summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/list_controller_trait.go
AgeCommit message (Collapse)Author
2024-01-23Set groundwork for better disabled reasons with range selectJesse Duffield
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-19Enforce single-item selection in various actionsJesse Duffield
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.