Skip to content

feat(explorer): Virtual line spacer between Conflict, Staged and Unstaged groups#398

Open
kikefdezl wants to merge 3 commits into
esmuellert:mainfrom
kikefdezl:main
Open

feat(explorer): Virtual line spacer between Conflict, Staged and Unstaged groups#398
kikefdezl wants to merge 3 commits into
esmuellert:mainfrom
kikefdezl:main

Conversation

@kikefdezl

@kikefdezl kikefdezl commented May 23, 2026

Copy link
Copy Markdown
image

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_top attribute to the Node. When rendering the explorer, if margin_top = n, we render n virtual lines above this group.

For the Staged Group Node, I set margin_top to be 1 if 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.

@h0adp0re

Copy link
Copy Markdown

What if only "Staged Changes" is present?

@kikefdezl

kikefdezl commented May 29, 2026

Copy link
Copy Markdown
Author

What if only "Staged Changes" is present?

If the Unstaged group visibility is toggled off, the Staged group will stick to the top because we only add the margin to a group if there are any nodes above.

margin_top = (#tree_nodes > 0) and 1 or nil,

@kikefdezl kikefdezl changed the title feat(explorer): Virtual line spacer between Staged and Unstaged groups feat(explorer): Virtual line spacer between Conflict, Staged and Unstaged groups May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants