summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context.go
AgeCommit message (Collapse)Author
2023-07-30Standardise on using lo for slice functionsJesse Duffield
We've been sometimes using lo and sometimes using my slices package, and we need to pick one for consistency. Lo is more extensive and better maintained so we're going with that. My slices package was a superset of go's own slices package so in some places I've just used the official one (the methods were just wrappers anyway). I've also moved the remaining methods into the utils package.
2023-07-30Land in the same panel when switching to a worktreeJesse Duffield
2023-07-03Add integration tests for searching/filteringJesse Duffield
2023-07-03Show filter status similar to what we show with searchJesse Duffield
2023-07-03Only cancel search if main or temporary context loses focusJesse Duffield
This is a pickle: initially I wanted it so that a filter would cancel automatically if the current context lost focus. But there are situations where you want to retain the focus, e.g. when a popup appears, or when you view the commits of a branch. The issue is that when you view the commits of a branch, the branches context is removed from the context stack. Even if this were not the case, you could imagine going branches -> sub-commits -> files -> sub-commits, where in that case branches would definitely be off the stack upon navigating to the files context. So because I'm too lazy to find a proper solution to this problem, I'm just making it so that filters in side contexts are retained unless explicitly cancelled. There's another edge case this commit handles which is that if I'm in the sub-commits context via the branches context and start a search, then navigate to the reflog context and hit enter to get to the sub-commits context again, I need to cancel the search before I switch. Likewise with the commit files context.
2023-07-03Move more logic into search helperJesse Duffield
2023-07-03Cancel filter/search when hitting escapeJesse Duffield
2023-07-03Introduce filtered list view modelJesse Duffield
We're going to start supporting filtering of list views
2023-05-16Don't deactivate context that you're about to activateJesse Duffield
2023-05-16Compare contexts with keysJesse Duffield
We don't want to compare contexts directly given they are interfaces and not pointers to structs
2023-05-02merge master into refactor-better-encapsulationJesse Duffield
2023-04-30Split commit message panel into commit summary and commit description panelSean
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting. By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel, and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel and then 'enter' to submit the message. We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept, so we just push both contexts one after the other, and likewise remove both contexts when we escape.
2023-04-30ensure initial context is set when entering submoduleJesse Duffield
2023-04-30move more actions into controllerJesse Duffield
2023-04-30lots of changesJesse Duffield
2023-04-30Begin refactoring guiJesse Duffield
This begins a big refactor of moving more code out of the Gui struct into contexts, controllers, and helpers. We also move some code into structs in the gui package purely for the sake of better encapsulation
2023-03-24Merge pull request #2377 from shinhs0506/clear-staging-after-commitJesse Duffield
2023-03-20Avoid deactivating and activating when pushing the current context againStefan Haller
When calling PushContext, do nothing if the context to be pushed is already on top of the stack. Avoids flicker in certain situations.
2023-03-04Keep side context in context stack when pushing a main contextStefan Haller
This fixes accordion mode for the commit files panel. When entering a file, the commit files panel should stay expanded.
2022-08-06refactor to only have one context per viewJesse Duffield
2022-08-02make exception for searching from menuJesse Duffield
2022-08-01fix issue caused by opening a menu over a promptJesse Duffield
2022-07-30Fix github linter errorsLuka Markušić
2022-05-07more documentationJesse Duffield
2022-04-16do not highlight line if there are no items to displayJesse Duffield
2022-03-26remove dead codeJesse Duffield
2022-03-26don't hide transient views upon losing focusJesse Duffield
2022-03-26show namesake for child viewsJesse Duffield
2022-03-26support viewing commits of reflog entry and show better view titleJesse Duffield
2022-03-24no more filterThenMapJesse Duffield
2022-03-24renameJesse Duffield
2022-03-24would you believe that I'm adding even more genericsJesse Duffield
2022-03-24many more genericsJesse Duffield
2022-03-24more genericsJesse Duffield
2022-03-17remove dead codeJesse Duffield
2022-03-17more consistent namingJesse Duffield
2022-03-17fix CIJesse Duffield
2022-03-17defend against view not yet having a context defined against itJesse Duffield
2022-03-17appease linterJesse Duffield
2022-03-17refactor contextsJesse Duffield
2022-03-17working againJesse Duffield
2022-03-17more refactoringJesse Duffield
2022-03-17some more refactoringJesse Duffield
2022-03-17move context keys into context packageJesse Duffield
2022-03-17start moving commit panel handlers into controllerJesse Duffield
more and more move rebase commit refreshing into existing abstraction and more and more WIP and more handling clicks properly fix merge conflicts update cheatsheet lots more preparation to start moving things into controllers WIP better typing expand on remotes controller moving more code into controllers
2022-01-15stop refreshing the screen so muchJesse Duffield
2021-12-06more efficient context diff size changingJesse Duffield
2021-12-06Fix: Don't access a view if it's `nil`DerTeta
The way the `if` expression in `deactivateContext` was composed, it was possible to have it to evaluate to `true` even though the `view` variable was `nil`. As far as I can tell, this seems to be only possible during tests. Nonetheless, I think the expression looks more "correct" this way.
2021-11-05support scrolling left and rightJesse Duffield
2021-11-01some refactoring in anticipation of the graph featureJesse Duffield