Skip to content

fix(library): allow folder drops when non-priority sort is active#207

Merged
Crauzer merged 1 commit into
LeagueToolkit:mainfrom
helseaCat:fix/dnd-folder-drop-with-sort
Jun 15, 2026
Merged

fix(library): allow folder drops when non-priority sort is active#207
Crauzer merged 1 commit into
LeagueToolkit:mainfrom
helseaCat:fix/dnd-folder-drop-with-sort

Conversation

@helseaCat

@helseaCat helseaCat commented May 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #181

Problem

Selecting any sort other than "Priority" disabled all drag-and-drop, including dragging mods into folders. The single dndDisabled flag gated both reordering and folder drops.

Primary fix

Split dndDisabled into dndDisabled (search/patcher/filters/select mode) and reorderDisabled (non-priority sort). DnD stays active for folder drops; only reordering is suppressed. Folder grip handles hidden when reorder is disabled.

Related fixes found during testing

  • Grid reorder snap-backuseReorderMods was only sending root mod IDs to the backend, which expects the full set. Fixed by appending folder mods to the reorder call.
  • Collision detection — rewrote to use pointerWithin for folder targeting and closestCenter for mod reorder. Prevents false folder highlights and accidental folder drops during reorder.
  • Folder drilldown — threaded reorderDisabled through SortableModList so folder views also respect sort mode.
  • Folder-mod reorder — added reorderDisabled guard in useUnifiedDnd.handleDragEnd for same-folder reorder.

Happy to split the related fixes into a separate PR if preferred.

Verification

  • pnpm check passes (typecheck + lint + format + 268 tests)
  • Priority sort: full DnD works in grid and list
  • Non-priority sort: folder drops work, reorder blocked
  • Folder drilldown respects sort
  • Reorder persists when folders contain mods

@helseaCat helseaCat force-pushed the fix/dnd-folder-drop-with-sort branch 2 times, most recently from c6f7896 to a3b2839 Compare June 9, 2026 06:03
@helseaCat helseaCat force-pushed the fix/dnd-folder-drop-with-sort branch from a3b2839 to 32bef19 Compare June 10, 2026 04:58
@Crauzer Crauzer added area: frontend React/TypeScript UI type: ux User experience improvements priority: high Important, next up labels Jun 15, 2026
@Crauzer Crauzer moved this to In Progress in LTK Manager Jun 15, 2026
@Crauzer

Crauzer commented Jun 15, 2026

Copy link
Copy Markdown
Member

Thanks for the PR, looks good

@Crauzer Crauzer merged commit 9a6b2ac into LeagueToolkit:main Jun 15, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in LTK Manager Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: frontend React/TypeScript UI priority: high Important, next up type: ux User experience improvements

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Moving Mods into Folders with Sort By on Enabled First

2 participants