Skip to content

Bug: Token set folder drag-reorder scrambles order when folders are expanded #3815

@rbosker

Description

@rbosker

Description

When dragging token set folders in the sidebar to reorder them, the order gets scrambled if the folders are expanded (children visible). Drag-and-drop reordering only works correctly when folders are collapsed first.

Steps to Reproduce

  1. Open Tokens Studio for Figma plugin
  2. Have multiple token set folders in the sidebar
  3. Expand one or more folders so child sets are visible
  4. Drag a folder to reorder it
  5. Observe that the folder lands in an unexpected position and the overall order gets scrambled

Expected Behavior

Token set folders should reorder correctly regardless of whether they are expanded or collapsed.

Actual Behavior

The drag-and-drop index calculation appears to count expanded child items in the position, causing the folder to land at an unexpected index in the flat list.

Workaround

Collapse all folders before dragging them to reorder. This produces the correct result.

Environment

  • Plugin version: v2.11.2 (PRO)
  • OS: macOS 15.7.4

References

Metadata

Metadata

Labels

Type

No type

Projects

Status

📥 Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions