feat(explorer): Virtual line spacer between Conflict, Staged and Unstaged groups#398
Open
kikefdezl wants to merge 3 commits into
Open
feat(explorer): Virtual line spacer between Conflict, Staged and Unstaged groups#398kikefdezl wants to merge 3 commits into
Conflict, Staged and Unstaged groups#398kikefdezl wants to merge 3 commits into
Conversation
|
What if only "Staged Changes" is present? |
Author
If the margin_top = (#tree_nodes > 0) and 1 or nil, |
Conflict, Staged and Unstaged groups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
When the explorer displays dozens of files, I often lose track of the Staged and Unstaged groups. I end up staging/unstaging files by accident because of this.
A single line spacer makes it much more clear where the unstaged files stop and the staged files start.
What was done
I introduced a
margin_topattribute to theNode. When rendering the explorer, ifmargin_top = n, we rendernvirtual lines above this group.For the Staged Group Node, I set
margin_topto be1if it's visible.I also added some type annotations for the Node tables.
Configuration & Opt-in vs Opt-out
This PR makes the change without exposing any configuration, since I believe it is a sensible default. If you would prefer to expose this via configuration and/or make it opt-in, I would be glad to update the PR with those changes.