feat(file-panel): add multi-file selection for batch stage/unstage/restore#36
Merged
dlyongemallo merged 1 commit intomainfrom Mar 12, 2026
Merged
feat(file-panel): add multi-file selection for batch stage/unstage/restore#36dlyongemallo merged 1 commit intomainfrom
dlyongemallo merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds multi-file selection support to Diffview’s FilePanel, enabling batch stage/unstage and restore operations from the panel UI.
Changes:
- Introduces selection state and APIs on
FilePanel(toggle_selection,is_selected,get_selected_files,clear_selections) plus functional tests for this behavior. - Renders a visual marker for selected files in the file panel and adds a highlight group link for it.
- Adds a default keybinding (
w) to toggle selection and updates staging/restoring listeners to operate on selected files when present.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lua/diffview/tests/functional/panel_spec.lua | Adds functional coverage for FilePanel selection APIs. |
| lua/diffview/scene/views/diff/render.lua | Displays a marker for selected files during file panel rendering. |
| lua/diffview/scene/views/diff/listeners.lua | Implements multi-select toggle action and batch stage/restore behavior when selections exist. |
| lua/diffview/scene/views/diff/file_panel.lua | Adds selection state tracking and exposes selection-related methods. |
| lua/diffview/hl.lua | Adds highlight link for the “marked/selected” indicator. |
| lua/diffview/config.lua | Adds default keymap (w) for toggling selection in the file panel. |
| lua/diffview/actions.lua | Exposes toggle_select_entry as an action name. |
| doc/diffview_defaults.txt | Documents the new default keymap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
03e466d to
3c15343
Compare
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.
No description provided.