fix(panel): skip batch_selection notification when nothing changed#87
Merged
dlyongemallo merged 1 commit intomainfrom Apr 7, 2026
Merged
fix(panel): skip batch_selection notification when nothing changed#87dlyongemallo merged 1 commit intomainfrom
batch_selection notification when nothing changed#87dlyongemallo merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Diffview’s diff file panel selection batching so that batch_selection() only emits a selection-changed notification when the batch actually performed (or attempted) a notification-worthy mutation, avoiding no-op notifications.
Changes:
- Update
FilePanel:batch_selection()/_notify_selection_changed()to coalesce multiple selection mutations into a single notification and skip notifying on an empty batch. - Add functional tests verifying
batch_selection()notifies once for multiple mutations and not at all when nothing changes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lua/diffview/scene/views/diff/file_panel.lua | Adjusts batching/notification logic to avoid no-op batch_selection() notifications. |
| lua/diffview/tests/functional/selection_store_spec.lua | Adds functional coverage for the updated batch_selection() notification behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8227fc8 to
57f66b9
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.