summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
AgeCommit message (Collapse)Author
2023-07-19Add integration test for accordion modeJesse Duffield
2023-07-19Properly fix accordion issueJesse Duffield
The true issue was that we were focusing the line in the view before it gets resized in the layout function. This meant if the view was squashed in accordion mode, the view wouldn't know how to set the cursor/origin to focus the line. Now we've got a queue of 'after layout' functions i.e. functions to call at the end of the layout function, right before views are drawn. The only caveat is that we can't have an infinite buffer so we're arbitrarily capping it at 1000 and dropping functions if we exceed that limit. But that really should never happen.
2023-07-10Fix flakey misc/initial_open testJesse Duffield
I've simplifiied the code because it was too complex for the current requirements, and this fixed the misc/initial_open test which was occasionally failing due to a race condition around busy tasks
2023-07-10Use an interface for tasks instead of a concrete structJesse Duffield
By using an interface for tasks we can use a fake implementation in tests with extra methods
2023-07-09Use first class task objects instead of global counterJesse Duffield
The global counter approach is easy to understand but it's brittle and depends on implicit behaviour that is not very discoverable. With a global counter, if any goroutine accidentally decrements the counter twice, we'll think lazygit is idle when it's actually busy. Likewise if a goroutine accidentally increments the counter twice we'll think lazygit is busy when it's actually idle. With the new approach we have a map of tasks where each task can either be busy or not. We create a new task and add it to the map when we spawn a worker goroutine (among other things) and we remove it once the task is done. The task can also be paused and continued for situations where we switch back and forth between running a program and asking for user input. In order for this to work with `git push` (and other commands that require credentials) we need to obtain the task from gocui when we create the worker goroutine, and then pass it along to the commands package to pause/continue the task as required. This is MUCH more discoverable than the old approach which just decremented and incremented the global counter from within the commands package, but it's at the cost of expanding some function signatures (arguably a good thing). Likewise, whenever you want to call WithWaitingStatus or WithLoaderPanel the callback will now have access to the task for pausing/ continuing. We only need to actually make use of this functionality in a couple of places so it's a high price to pay, but I don't know if I want to introduce a WithWaitingStatusTask and WithLoaderPanelTask function (open to suggestions).
2023-07-09Add mutex for refreshing branchesJesse Duffield
We had a race condition due to refreshing branches in two different places, one which refreshed reflog commits beforehand. The race condition meant that upon load we wouldn't see recency values (provided by the reflog commits) against the branches
2023-07-08Wait for intro before doing any of our refresh functionsJesse Duffield
We were doing this already for fetching but not for refreshing files so I'm making it consistent.
2023-07-08Handle pending actions properly in git commands that require credentialsJesse Duffield
I don't know if this is a hack or not: we run a git command and increment the pending action count to 1 but at some point the command requests a username or password, so we need to prompt the user to enter that. At that point we don't want to say that there is a pending action, so we decrement the action count before prompting the user and then re-increment it again afterward. Given that we panic when the counter goes below zero, it's important that it's not zero when we run the git command (should be impossible anyway). I toyed with a different approach using channels and a long-running goroutine that handles all commands that request credentials but it feels over-engineered compared to this commit's approach.
2023-07-08Add busy count for integration testsJesse Duffield
Integration tests need to be notified when Lazygit is idle so they can progress to the next assertion / user action.
2023-07-03Introduce filtered list view modelJesse Duffield
We're going to start supporting filtering of list views
2023-06-15Add nerdFontsVersion configStefan Haller
2023-05-16Rename CmdLog -> GuiLogJesse Duffield
We want to log both actions and commands for the sake of integration tests
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-30appease linterJesse Duffield
2023-04-30move quit actions to controllerJesse Duffield
2023-04-30move more actions into controllerJesse Duffield
2023-04-30move window arrangement helperJesse Duffield
2023-04-30lots of changesJesse Duffield
2023-04-30split context common from helper commonJesse Duffield
2023-04-30start moving getDisplayStrings funcs into contextsJesse Duffield
2023-04-30lots more refactoringJesse 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-04-13Show warning about deprecated edit configsStefan Haller
We print this to the terminal after lazygit quits rather than showing it in a panel at startup, so as to not annoy people too much. Hopefully it will still be prominent enough this way.
2023-03-24Merge pull request #2377 from shinhs0506/clear-staging-after-commitJesse Duffield
2023-03-24remove old integration test recording codeJesse Duffield
2023-03-20Push initial context instead of just putting it in the context arrayStefan Haller
This makes sure activateContext gets called on it.
2023-02-27feat(subcommits): load unlimited sub-commitsRyooooooga
2023-01-16replaced 'screenMode' to 'windowSize' in configPhanindra kumar Paladi
2023-01-11Added screenMode configuration to gui configurationPhanindra kumar Paladi
2022-12-30feat: add `GitVersion` structRyooooooga
2022-12-30chore(gui): remove unused `gitConfig`Ryooooooga
2022-12-30integrate snake game into lazygitJesse Duffield
2022-12-24move background code into its own fileJesse Duffield
2022-12-20apply user config changes in sandbox modeJesse Duffield
2022-10-02use thread safe mapJesse Duffield
2022-09-23fix: scan to buffer to empty character input in stdinkawaemon
2022-09-17remove deprecated callsjiepeng
2022-09-16various changes to improve integration testsJesse Duffield
2022-08-13move code from main into app package to allow test to be injectedJesse Duffield
2022-08-13move input and assert into integration tests packageJesse Duffield
2022-08-11add new integration test patternJesse Duffield
2022-08-07add deadlock mutex packageJesse Duffield
write to deadlock stderr after closing gocui more deadlock checking
2022-08-07move merge conflicts code into controllerJesse Duffield
2022-08-06rename merging context to mergeConflictsJesse Duffield
2022-08-06use ptmx map so that we can have multiple ptmx's stored for resizingJesse Duffield
2022-08-06refactor to only have one context per viewJesse Duffield
2022-08-01fix popup focus issueJesse Duffield
2022-07-31add optimistic rendering for staging and unstaging filesJesse Duffield
2022-06-11allow opening lazygit to a specific panelJesse Duffield