Skip to content

feat: split the file list into Staged and Unstaged sections - #22

Merged
joaolfp merged 2 commits into
mainfrom
feat/split-staged-unstaged
Nov 16, 2026
Merged

joaolfp merged 2 commits into
mainfrom
feat/split-staged-unstaged

Conversation

@joaolfp

@joaolfp joaolfp commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

✨ Summary

  • split the Files panel into Staged (green) and Unstaged (red) groups, closes Split the file list into Staged and Unstaged sections #21
  • keep ± (staged + modified) files in the Staged group with their ± icon
  • hide the header of an empty group
  • skip group headers on j/k, Home/End and mouse clicks; the selection follows the file by path when it moves between groups
  • keep the group header visible when its first file is selected at the top of a scrolled list
  • add FileEntry::group, App::list_rows and App::row_of
  • add tests for grouping, empty groups, selection across groups, header clicks and rendering
  • update the README screenshot

🔧 Type of Change

  • ✨ Enhancement
  • 🐞 Bug fix
  • 🔐 Security fix
  • 💥 Breaking change
  • 🚀 New feature
  • 📦 New release
  • 📚 Documentation
  • ♻️ Refactor

🤖 Generated with Claude Code


Note

Low Risk
TUI-only list layout and selection mapping changes, covered by new integration tests; no git command or security behavior changes.

Overview
The Files panel now groups changes under Staged and Unstaged headers (with counts), instead of a single flat list. App::files is sorted with staged entries first; partially staged (±) files stay in Staged. Empty groups omit their header.

Selection and scrolling were updated so list_state tracks virtual rows (headers + files): list_rows, row_of, and click_file ignore header clicks. Rendering pins the group header above when the first file in that group is selected at the top of the viewport.

New FileGroup / FileEntry::group drive grouping; integration tests cover ordering, empty groups, selection when staging moves a file between groups, mouse clicks, and on-screen header layout.

Reviewed by Cursor Bugbot for commit 63fbb48. Bugbot is set up for automated code reviews on this repo. Configure here.

joaolfp and others added 2 commits November 16, 2026 10:13
Closes #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joaolfp
joaolfp merged commit 3f4f403 into main Nov 16, 2026
5 checks passed
@joaolfp
joaolfp deleted the feat/split-staged-unstaged branch November 16, 2026 13:23
@joaolfp joaolfp mentioned this pull request Nov 16, 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.

Split the file list into Staged and Unstaged sections

1 participant