Skip to content

fix(ui): show empty panes as a centered panel - #50

Open
noyobo wants to merge 4 commits into
cheat2001:mainfrom
noyobo:diff-empty-panel
Open

noyobo wants to merge 4 commits into
cheat2001:mainfrom
noyobo:diff-empty-panel

Conversation

@noyobo

@noyobo noyobo commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Empty panes were a single faint sentence, which read as a placeholder. This adds one centered panel (icon well, title, one line of why) and uses it wherever a whole pane was blank: a whitespace-only diff (including the staged case from #38), an empty file, a binary file, a missing image, no diff, a file with no history, an empty graph, a commit with no files, a welcome search with no matches, and an empty rebase plan. Filter misses and the command palette stay one line, because those are not a pane.

Screenshots

image image image image image

Checklist

  • pnpm typecheck && pnpm test pass
  • cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test pass (if Rust changed)
  • New engine functions have integration tests in tests/git_engine.rs
  • Mutating operations go through the undo tracked() wrapper where undoable
  • Colors use design tokens only (no hex in components)
  • CLAUDE.md updated if conventions/architecture changed
  • Commits carry no trailers from coding tools (Co-authored-by: <tool>, Generated with …)

Made with Cursor

A faint sentence read as a placeholder. Diff blanks, history, the graph, welcome search, rebase, and a commit with no files now share one icon, title, and line.
The working tree fixture gained three files, so the All files label is 12 changed.

@cheat2001 cheat2001 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. Ran it in demo mode and the panel reads as part of the app, same tile as the sidebar and settings empty states, and the staged whitespace copy closes the gap #38 left. Two small things before I merge.

The plate colour. Everywhere else that tint is written bg-primary/15 (EmptyCard, the sidebar tiles), so a named token for the same value gives us two ways to say one thing. Can you use bg-primary/15 on the icon well and drop the preset entry?

The whitespace condition in DiffPanel has a !diff && !isWorkingCopy branch. The engine never returns a null diff for a commit file, a whitespace only file comes back with zero hunks, which blankText already catches, and diff is only null after an error, which the branch above handles. So that part can't be reached. Drop it and whitespaceOnly is just ignoreWhitespace && !target.unchanged && blankText.

Commits get squashed on merge, no need to tidy the fix e2e ones.

This branch has not been deployed

No deployments
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