Jesse Duffield
a5f3515ad8
Set groundwork for better disabled reasons with range select
...
Something dumb that we're currently doing is expecting list items
to define an ID method which returns a string. We use that when copying
items to clipboard with ctrl+o and when getting a ref name for diffing.
This commit gets us a little deeper into that hole by explicitly requiring
list items to implement that method so that we can easily use the new
helper functions in list_controller_trait.go.
In future we need to just remove the whole ID thing entirely but I'm too
lazy to do that right now.
2024-01-23 13:03:37 +11:00
Jesse Duffield
51fb82d6bf
Enforce single-item selection in various actions
...
We want to show an error when the user tries to invoke an action that expects only
a single item to be selected.
We're using the GetDisabledReason field to enforce this (as well as DisabledReason
on menu items).
I've created a ListControllerTrait to store some shared convenience functions for this.
2024-01-19 10:50:49 +11:00
Jesse Duffield
06be88aef7
Use fields rather than methods on worktrees
...
I would prefer to use methods to keep things immutable but I'd rather be consistent with the other
models and update them all at once
2023-07-30 18:35:24 +10:00
Jesse Duffield
de57cfd6ff
Remove IO logic from presentation code for worktrees
...
We're doing all the IO in our workers loader method so that we don't need to do any
in our presentation code
2023-07-30 18:35:24 +10:00
Jesse Duffield
bc4ce26cef
Allow entering a worktree by pressing enter
2023-07-30 18:35:23 +10:00
Jesse Duffield
18a508b29c
Update cheatsheets
2023-07-30 18:35:23 +10:00
Jesse Duffield
3a7468ecac
Support opening worktree in editor
2023-07-30 18:35:23 +10:00
Jesse Duffield
87b2455dbb
Allow opening worktree in editor
...
This does the job but I think we need yet another editor command for opening a directory in a new window.
2023-07-30 18:35:22 +10:00
Jesse Duffield
18ea68c23a
Support creating worktrees from refs
2023-07-30 18:35:22 +10:00
Jesse Duffield
6b4a638415
Handle deleting branch attached to worktree
2023-07-30 18:35:22 +10:00
Jesse Duffield
ab3052f642
Land in the same panel when switching to a worktree
2023-07-30 18:35:22 +10:00
Jesse Duffield
077ae99438
Prompt to switch to worktree when branch is checked out by other worktree
2023-07-30 18:35:22 +10:00
Jesse Duffield
fe8adf9eb8
Use git lingo
2023-07-30 18:35:22 +10:00
Jesse Duffield
03f726038e
Alert when attempting to enter the current worktree
2023-07-30 18:35:21 +10:00
Jesse Duffield
796945aad0
Remove comment
2023-07-30 18:35:21 +10:00
Joel Baranick
db02c13bf6
Address PR comments
2023-07-30 18:35:21 +10:00
Joel Baranick
1ce9a87544
Basic support for adding a worktree
2023-07-30 18:35:21 +10:00
Joel Baranick
35e6e6347a
Put all worktree i18n strings together
...
Use tabwriter to align worktree panel contents
2023-07-30 18:35:21 +10:00
Joel Baranick
54708233ac
Improve worktree panel
2023-07-30 18:35:21 +10:00
Joel Baranick
c679fd1924
Style missing worktree as red and display better error when trying to switch to them
...
Use a broken link icon for missing worktrees
2023-07-30 18:35:21 +10:00
Joel Baranick
afc4aedd4f
Support for deleting a worktree
2023-07-30 18:35:21 +10:00
Joel Baranick
f8ba899b87
Initial addition of support for worktrees
2023-07-30 18:35:21 +10:00