Files
logseq/src
scheinriese aff36b571d refactor(icon): scope drag/upload state per picker instance
Five defonce atoms (*drag-active? *drag-depth *asset-picker-open?
*upload-status *uploading-files) were module-global. Two consequences:

1. Two pickers open simultaneously (sidebar + main view) cross-talked —
   drag highlights, upload progress, and the open flag were shared.
2. The OUTER icon-search root and the INNER asset-picker each have their
   own drop zone, but they collided on the SAME *drag-active? / *drag-depth
   even within a single picker session.

Move state into rum/local on each owning component:
- asset-picker (inner): 4 locals — drag-active?, drag-depth,
  asset-picker-open?, upload-status. Aliased in the main let-binding so
  existing *foo references resolve without code-site edits; lifecycle
  hooks (:did-mount, :will-unmount) thread state explicitly.
- icon-search (outer): 2 locals — drag-active?, drag-depth — independent
  from the inner picker's so nested drop zones no longer collide.

Also dropped *uploading-files entirely — it was declared but never read
or written anywhere in the file.

Compile clean. Page renders without runtime errors. Live drag-drop verify
deferred to manual testing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 14:08:20 +02:00
..
2026-05-04 12:31:54 +08:00