Skip to content

fix(files): prune stale selection after rename and explicit refresh #24

Open

Description

@nileshvasita

Problem

Renaming a selected file or directory can leave its old path in selectedPaths. renameItem calls refreshNode, which replaces children without pruning selection. The watcher does prune after a changed tree, but can return early on a structural no-op after the explicit refresh, so automatic repair is not guaranteed.

This existing state issue becomes visible with #23: dragging another selected row rejects the entire unresolved selection and asks the user to select items again. Bulk operations also consume selected paths.

Expected behavior

After a successful rename or explicit refresh, selection should contain only valid entries. Either deliberately remap renamed selections or prune stale keys and repair the selection anchor, preserving valid collapsed selections.

Validation

Add regression coverage for a selected renamed file, a renamed parent with selected descendants, and the watcher receiving an unchanged tree after explicit refresh. Verify valid remaining selections and shift-click anchors.

Discovered by source review, not a live UI reproduction. Reselecting the desired files is the current workaround.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions