summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation
AgeCommit message (Collapse)Author
2024-06-23Fix truncation of long branch names containing non-ASCII charactersStefan Haller
2024-06-23Add test demonstrating wrong truncation of branch names containing non-ASCII ↵Stefan Haller
characters
2024-06-15Add user config gui.commitAuthorFormatanikiforov
2024-06-03Show divergence from base branch in branches listStefan Haller
2024-06-03Remove ColoredBranchStatus and branchStatusColorStefan Haller
Previously the entire status was colored in a single color, so the API made sense. This is going to change in the next commit, so now we must include the color in the string returned from BranchStatus(), which means that callers who need to do hit detection or measure the length need to decolorize it. While we're at it, switch the order of ↑3↓7 to ↓7↑3. For some reason that I can't really explain I find it more logical this way. The software out there is pretty undecided about it, it seems: VS Code puts ↓7 first, and so does the shell prompt that comes with git; git status and git branch -v put "ahead" first though. Shrug.
2024-06-03More explicit test of status panel contentStefan Haller
Use Equals instead of Contains for asserting the status view content. This solves the problem that we might assert Contains("↓2 repo"), but what it really shows is "↑1↓2 repo", and the test still succeeds. At best this is confusing. Also, this way we don't have to use the awkward DoesNotContain to check that it really doesn't show a checkmark. To do this, we need to fix two whitespace problems: - there was always a space at the end for no reason. Simply remove it. It was added in efb51eee96, but from looking at that diff it seems it was added accidentally. - there was a space at the beginning if the branch status was empty. This is actually a cosmetic problem, for branches without a status the text was indented by once space. Change this so that the space is added conditionally. It's a bit awkward that we have to use Decolorise here, but this will go away again later in this branch.
2024-05-19Rename Pushables/Pullables to AheadForPull/BehindForPullStefan Haller
In preparation for adding AheadForPush/BehindForPush in the next commit.
2024-05-19Remove redundant variable dedeclarationsJesse Duffield
In go 1.22, loop variables are redeclared with each iteration of the loop, rather than simple updated on each iteration. This means that we no longer need to manually redeclare variables when they're closed over by a function.
2024-04-30Enable the commit graph in the divergence viewStefan Haller
2024-04-27Refactor `pkg/gui/presentation/commits.go` slightly to be consistentStefan Haller
Change `func displayCommit()` so all the individual strings are built first, then the whole thing `cols` is put together. Before, most strings were built prior to constructing `cols`, but a few were built inside the `cols` construction.
2024-04-27Add config option for length of commit hash displayed in commits viewOlivia Bahr
- Add config option `commitHashLength` to to pkg/config/user_config.go - Changed the hash display in pkg/gui/presentation/commits.go
2024-04-22Switch git-todo-parser from fsmiamoto original repo to stefanhaller's forkStefan Haller
Sometimes it takes a while to get PRs accepted upstream, and this blocks our progress. Since I'm pretty much the only one making changes there anyway, it makes sense to point to my fork directly.
2024-04-12rename sha to hash 10, last remaining sha (hopefully)pikomonde
2024-04-12rename sha to hash 9, case: Shapikomonde
2024-04-12rename sha to hash 6, update short hashpikomonde
2024-04-12rename sha to hash 5pikomonde
2024-04-12rename sha to hash 4pikomonde
2024-04-12rename sha to hash 2pikomonde
2024-04-12rename sha to hashpikomonde
2024-04-12renaming variable to CommitHashpikomonde
2024-04-12standardize 'Commit Sha' to 'Commit Hash'pikomonde
2024-04-07Replace min/max helpers with built-in min/maxEng Zer Jun
We upgraded our minimum Go version to 1.21 in commit 57ac9c2189458a7f0e63c2e9cac8334694a3d545. We can now replace our `utils.Min` and `utils.Max` functions with the built-in `min` and `max`. Reference: https://go.dev/ref/spec#Min_and_max Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-04-06Add `SpinnerConfig`Artem Belyakov
This new config section allows to customize frames and rate of thespinner
2024-03-29Cleanup: don't mess with globals in tests without resetting themStefan Haller
Changing globals in the init() function of a test file is a bad idea, as it affects all other tests that run after it. Do it explicitly in each test function that needs it, and take care of restoring the previous value afterwards.
2024-03-17Show inline waiting status when checking out a local branchStefan Haller
2024-03-16Store full ref in Name field of update-ref commitsStefan Haller
Strip the prefix at presentation time instead. This makes it easier to find update-ref todos in order to move them up/down, or delete them.
2024-03-07Show all submodules recursivelyStefan Haller
2024-03-02Don't show branch head on rebase todos if the rebase.updateRefs config is onStefan Haller
The additional branch head icon is more confusing than useful in this situation. The update-ref entries show very clearly where the branch heads will go when continuing the rebase; the information where the branch heads used to be before the rebase is not really needed here, and just makes the display more confusing. I'm not adding more tests here because the changes to the existing tests demonstrate the change clearly enough.
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-03-02Fix linter warningsStefan Haller
These started to pop up in my editor after I installed an update of gopls, I think. It's unfortunate that we don't see them on CI.
2024-01-26Use inline status for fetching remotesStefan Haller
2024-01-22Add config setting to suppress showing file iconsStefan Haller
2024-01-22Show file names in default colour (#3081)Jesse Duffield
Fixes https://github.com/jesseduffield/lazygit/issues/3077 Show unstaged file names in default colour Previously, we had the following rules: * file names were in red when unstaged or partially staged * directory names were in red if unstaged, yellow if partially staged, and green if fully staged Red text on a black background can be hard to read, so instead I'm changing it so that unstaged files have their names in the default text colour. I'm also making it so that partially staged files are in yellow, just like how partially staged directories are yellow (same deal with the commit files view when adding to a custom patch). So the new rules are: * unstaged files/directories use the default colour * partially staged files/directories are in yellow * fully staged files/directories are in green I've also done a refactor on the code clean up some dead code from when the file tree outline was drawn with box characters, and I've made it so that the indentation in each line is handled inside the function that draws the line rather than in the recursive parent function. This makes it easier to experiment with things like showing the file status characters on the left edge of the view (admittedly after experimenting with it, I decided I didn't like it). Apologies for having a refactor and a functional change in the one commit but by the time I was done, I couldn't be bothered going back and retroactively splitting it into two halves.
2024-01-22Show unstaged file names in default colourJesse Duffield
Previously, we had the following rules: * file names were in red when unstaged or partially staged * directory names were in red if unstaged, yellow if partially staged, and green if fully staged Red text on a black background can be hard to read, so instead I'm changing it so that unstaged files have their names in the default text colour. I'm also making it so that partially staged files are in yellow, just like how partially staged directories are yellow (same deal with the commit files view when adding to a custom patch). So the new rules are: * unstaged files/directories use the default colour * partially staged files/directories are in yellow * fully staged files/directories are in green I've also done a refactor on the code clean up some dead code from when the file tree outline was drawn with box characters, and I've made it so that the indentation in each line is handled inside the function that draws the line rather than in the recursive parent function. This makes it easier to experiment with things like showing the file status characters on the left edge of the view (admittedly after experimenting with it, I decided I didn't like it). Apologies for having a refactor and a functional change in the one commit but by the time I was done, I couldn't be bothered going back and retroactively splitting it into two halves.
2024-01-15Don't try to shorten branch names that are already 3 characters or lessStefan Haller
This fixes a potential crash when the available width is very small and the branch name is one to three characters long.
2023-12-27feat: add age on stash linesAzraelSec
2023-12-10Fall back to WithWaitingStatus if view showing the item is not visibleStefan Haller
2023-10-18create iconProperties struct and convert iconMaps to use iconPropertiesaashish2057
2023-10-16Truncate long branch names to make branch status visibleStefan Haller
2023-10-16Make it possible to set the nerd fonts version to "off"Stefan Haller
We don't need this for production code, but it will be needed for tests in the next commit.
2023-10-16Pass "now" into utils.LoaderStefan Haller
This makes it possible to write deterministic tests for views that use it.
2023-10-08Add inline status for pushing tags and deleting remote tagsStefan Haller
2023-10-08Add inline status for pushing/pulling/fast-forwarding branchesStefan Haller
When pulling/pushing/fast-forwarding a branch, show this state in the branches list for that branch for as long as the operation takes, to make it easier to see when it's done (without having to stare at the status bar in the lower left). This will hopefully help with making these operations feel more predictable, now that we no longer show a loader panel for them.
2023-08-29Add "Show divergence from upstream" entry to Upstream menu in branches panelStefan Haller
2023-08-29Remove the magenta color on menu items that open a menuStefan Haller
It's distracting. But keep the ellipsis.
2023-08-28Make RenderDisplayStrings return the column positionsStefan Haller
Not used by anything yet, but we'll need it later in this branch.
2023-08-28Change RenderDisplayStrings to return a slice of stringsStefan Haller
We'll join them with newlines afterwards. This will make it easier to insert other (non-model) items.
2023-08-28Call getDisplayStrings with a valid range of model indicesStefan Haller
It's nicer if clients can rely on the indices being valid, and don't have to clamp themselves.
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-08-28Add icons for files with .mdx and .svelte file extensions (#2889)Jesse Duffield