Skip to content

fix(notes): update folder selection when moving notes between folders#678

Merged
gabrielste1n merged 2 commits intomainfrom
fix/notes-drag-drop-folder-state
Apr 27, 2026
Merged

fix(notes): update folder selection when moving notes between folders#678
gabrielste1n merged 2 commits intomainfrom
fix/notes-drag-drop-folder-state

Conversation

@gabrielste1n
Copy link
Copy Markdown
Collaborator

Summary

  • Fix bug where drag-and-dropping a note into a different folder didn't update the sidebar selection — previously required a page refresh.
  • If the moved note is the active note, activeFolderId now follows it (the folder-change effect in useFolderManagement re-loads notes and preserves activeNoteId, so the editor stays on the same note while the sidebar selection moves to the destination folder).
  • Otherwise, the note is removed from the current folder's list since it no longer belongs there.
  • Same logic applies uniformly to all three move paths: drag-drop, the editor metadata-row folder picker, and the list-item context menu.

Test plan

  • Drag a note (the currently active one) into a different folder → editor stays on the note, sidebar selection moves to the destination folder.
  • Drag a non-active note into a different folder → it disappears from the current folder's list; sidebar stays on current folder.
  • Move the active note via the metadata-row folder picker → editor stays on note, sidebar follows.
  • Move a note via the list-item context menu → behaves per the two cases above.
  • Folder counts in the sidebar refresh after each move.

When dragging a note into a different folder (or moving via the metadata-row
or list-item dropdown), the sidebar selection now follows the moved note if
it is the active note, and otherwise the note is removed from the current
folder's list. Previously the UI required a refresh to reflect the new state.
@gabrielste1n gabrielste1n merged commit 33b6c09 into main Apr 27, 2026
5 checks passed
@gabrielste1n gabrielste1n deleted the fix/notes-drag-drop-folder-state branch April 27, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant