summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context/sub_commits_context.go
AgeCommit message (Collapse)Author
2024-06-23Rerender fewer views when their width changesStefan Haller
In d5b4f7bb3e and 58a83b0862 we introduced a combined mechanism for rerendering views when either their width changes (needed for the branches view which truncates long branch names), or the screen mode (needed for those views that display more information in half or full screen mode, e.g. the commits view). This was a bad idea, because it unnecessarily rerenders too many views when just their width changes, which causes a noticable lag. This is a problem, for example, when selecting a file in the files panel that has only unstaged changes, and then going to one that has both staged and unstaged changes; this splits the main view, causing the side panels to become a bit narrower, and rerendering all those views took almost 500ms on my machine. Another similar example is entering or leaving staging mode. Fix this by being more specific about which views need rerendering under what conditions; this improves the time it takes to rerender in the above scenarios from 450-500s down to about 20ms. This reintroduces the code that was removed in 58a83b0862, but in a slightly different way.
2024-06-23Only render visible portion of the screen for commits viewStefan Haller
2024-06-23Use model searching in commits (and sub-commits) viewStefan Haller
2024-06-23Add type assertions for all searchable contextsStefan Haller
We want to add an additional method to ISearchableContext later in this branch, and this will make sure that we don't forget to implement it in any concrete context.
2024-06-23Cleanup: remove outdated commentStefan Haller
We do show the graph in the left/right view, as of b7673577a2.
2024-06-23Cleanup: reduce some code duplicationStefan Haller
ListContextTrait.OnSearchSelect was introduced in 138be04e65, but it was never called. I can only guess that a planned refactoring wasn't finished here.
2024-04-30Enable the commit graph in the divergence viewStefan Haller
2024-04-12rename sha to hash 3pikomonde
2024-04-12rename sha to hashpikomonde
2024-04-12renaming variable to CommitHashpikomonde
2024-03-02Rename showBranchMarkerForHeadCommit parameter to hasRebaseUpdateRefsConfigStefan Haller
Name it after what it is rather than what it is used for. In the next commit we will use it for another condition.
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-19Add SetSelection function for list contexts and use it in most placesJesse Duffield
The only time we should call SetSelectedLineIdx is when we are happy for a select range to be retained which means things like moving the selected line index to top top/bottom or up/down a page as the user navigates. But in every other case we should now call SetSelection because that will set the selected index and cancel the range which is almost always what we want.
2023-10-16Rerender certain views when their width changesStefan Haller
Situations where a view's width changes: - changing screen modes - enter staging or patch building - resizing the terminal window For the first of these we currently have special code to force a rerender, since some views render different content depending on whether they are in full-screen mode. We'll be able to remove that code now, since this new generic mechanism takes care of that too. But we will need this more general mechanism for cases where views truncate their content to the view width; we'll add one example for that later in this branch.
2023-08-29Add "Show divergence from upstream" entry to Upstream menu in branches panelStefan Haller
2023-08-29Remove sub_commits_context's Title methodStefan Haller
It implemented this because it wants to do custom truncation of the ref name; however, we can achieve the same thing by passing the truncated ref name to our DynamicTitleBuilder, which was previously unused.
2023-08-28Extract a ListRenderer structStefan Haller
I'm doing this not so much because it's a great abstraction, but just because it will make it much easier to write tests for it.
2023-08-28Change length parameter of getDisplayStrings to endIdxStefan Haller
It's more natural to work with this way, as we will see later in this branch.
2023-07-31Add a "Mark commit as base commit for rebase" commandStefan Haller
This allows to do the equivalent of "git rebase --onto <target> <base>", by first marking the <base> commit with the new command, and then selecting the target branch and invoking the usual rebase command there.
2023-07-31Don't show branch marker for head commit unless updateRefs config is onStefan Haller
2023-07-31Don't show branch heads in reflog subcommitsStefan Haller
It's tricky to get this right for reflog commits wrt what's the current branch for each one; so just disable it entirely here, it's probably not something anybody needs here.
2023-07-31Visualize local branch heads in commits panelStefan Haller
We want to mark all local branch heads with a "*" in the local commits panel, to make it easier to see how branches are stacked onto each other. In order to not confuse users with "*" markers that they don't understand, do this only for the case where users actually use stacked branches; those users are likely not going to be confused by the display. This means we want to filter out a few branch heads that shouldn't get the marker: the current branch, any main branch, and any old branch that has been merged to master already.
2023-07-03Introduce filtered list view modelJesse Duffield
We're going to start supporting filtering of list views
2023-06-01Refresh commits viewport on focus lostJesse Duffield
We don't want the highlighted selection sticking around after the context loses focus.
2023-05-26More compact and flexible date formatJesse Duffield
You can now configure both a time format and a short time format, where the short format kicks in when the time is within the last day
2023-05-25Use boolean field to control whether viewport is refreshed on line focusJesse Duffield
Go really doesn't like us doing anything inheritance-y: it does not support open recursion meaning it's really hard to re-use code. As such, here we're falling back to conditional logic. This fixes an issue where our ListContextTrait was calling FocusLine which was intended to be overridden by ViewportListContextTrait, but the subclassed function wasn't being called. I'm not actually sure how this went wrong given that it was working fine in the past, but at any rate, the new code is easy to follow.
2023-04-30split context common from helper commonJesse Duffield
2023-04-30move getDisplayStrings funcs into contextsJesse Duffield
2023-04-30move getModel functions into contextsJesse Duffield
2023-04-30move views into contextsJesse Duffield
2023-04-30remove context callback optsJesse 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-02-27feat(subcommits): load unlimited sub-commitsRyooooooga
2022-08-06refactor to only have one context per viewJesse Duffield
2022-05-05fix: fix a crash when pressing enter in empty commits, reflog, or stash panelRyooooooga
2022-04-02introduce Ref interfaceRyooooooga
2022-03-26show namesake for child viewsJesse Duffield
2022-03-26support viewing commits of reflog entry and show better view titleJesse Duffield
2022-03-26add basic commits controller for handling actions that apply to all commit ↵Jesse Duffield
contexts
2022-03-19update lintersJesse Duffield
2022-03-19use generics to DRY up context codeJesse Duffield
2022-03-17include stash in commitish controllerJesse Duffield
2022-03-17add common commit controllerJesse Duffield
2022-03-17refactor controllersJesse Duffield
2022-03-17refactor contextsJesse Duffield