Skip to content

fix(panel): skip batch_selection notification when nothing changed#87

Merged
dlyongemallo merged 1 commit intomainfrom
persist_file_marking
Apr 7, 2026
Merged

fix(panel): skip batch_selection notification when nothing changed#87
dlyongemallo merged 1 commit intomainfrom
persist_file_marking

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 7, 2026 02:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread lua/diffview/scene/views/diff/file_panel.lua
@dlyongemallo dlyongemallo force-pushed the persist_file_marking branch from 8227fc8 to 57f66b9 Compare April 7, 2026 02:17
@dlyongemallo dlyongemallo merged commit 03e7f50 into main Apr 7, 2026
2 checks passed
@dlyongemallo dlyongemallo deleted the persist_file_marking branch April 7, 2026 02:21
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