Skip to content

[Bug] Range selection behaves incorrectly after renaming a file #1617

@iamkartiknayak

Description

@iamkartiknayak

Issue/Description:
After renaming a file, shift-based range selection behaves inconsistently. The selection range appears to be calculated using the file’s previous position rather than its updated sorted position.

This results in unexpected files being selected.

Steps to Reproduce:

  1. Create 5 files named: 1, 2, 3, 4, 5
  2. Select file 2
  3. Rename 210
  4. Hold Shift and click file 1
  5. Observe the resulting selection

Expected Behavior:
Range selection should respect the current sorted order after renaming.
The selection should include files between 1 and 10 based on their updated positions in the list.

Actual Behavior:
The selection range behaves as if the file still occupies its old position prior to renaming, leading to incorrect files being highlighted.

Other Notes:

  • Likely related to selection anchor not updating after rename
  • May require recalculating selection index after model reorder
Image

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