Skip to content

Clear file tree selection on pane click#124

Open
jsgrrchg wants to merge 2 commits into
mainfrom
clear-file-tree-selection-on-pane-click
Open

Clear file tree selection on pane click#124
jsgrrchg wants to merge 2 commits into
mainfrom
clear-file-tree-selection-on-pane-click

Conversation

@jsgrrchg
Copy link
Copy Markdown
Owner

Summary

This PR clears explicit multi-selection in the file tree when the user clicks back into an editor/workspace pane.

Why

Multi-selected files and folders stayed visually selected after focus moved back to the editor, which made the tree feel like it had stale contextual state. The tree should keep multi-selection while the user is operating inside it, but clear that contextual selection when another main pane becomes active.

Changes

  • Adds a shared clearFileTreeSelection UI event in the navigation utilities.
  • Emits that event from workspace panes on pointer down, alongside the existing pane focus behavior.
  • Keeps the file tree selection state encapsulated inside FileTree by having it listen for the cleanup event.
  • Adds focused tests for both the workspace event emission and file tree cleanup behavior.

Validation

  • npm test -- --run src/features/vault/FileTree.test.tsx src/features/editor/MultiPaneWorkspace.test.tsx
  • npx tsc -b --pretty false

@jsgrrchg jsgrrchg marked this pull request as ready for review May 21, 2026 17:13
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.

1 participant