Skip to content

feat(notes): move notes with drag and drop, and use the file icon theme - #95

Merged
dionmunk merged 2 commits into
masterfrom
feat/move-notes
Oct 7, 2026
Merged

dionmunk merged 2 commits into
masterfrom
feat/move-notes

Conversation

@dionmunk

@dionmunk dionmunk commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Two features from the community fork in #82, rebuilt on top of the current code.

Moving notes and folders

Notes and folders could only be moved outside VS Code (#41).

  • Drag and drop: drag notes and folders onto a folder, onto empty space for the top level, or between Workspace Notes and Notes. Select several with Cmd/Ctrl to move them together.
  • Move To... in the right-click menu lists every folder of both sections, grouped under "Workspace Notes" and "Notes", leaving out folders an item can't go to.
  • Moves go through a WorkspaceEdit, so an open note stays open at its new location.
  • A folder can't be moved into itself, an existing item is never overwritten (each case shows a warning), and a note inside a folder that moves too goes along with it.
  • Dragging a note onto the editor area opens it (text/uri-list, as the VS Code API recommends).

The drag data is carried as JSON. VS Code only keeps the original objects for drops within the same view, and a drop on the other view delivers our type twice, the first time empty; I confirmed that by logging what handleDrop received, then took the non-empty entry.

File icon theme

Every note showed the same generic file icon. Tree items now carry a resourceUri with the File and Folder theme icons, so VS Code takes the icon from the current file icon theme (by extension for notes, by name for folders).

Testing

Closes #41.

Every note showed the same generic file icon. Tree items now carry their
resourceUri with the File and Folder theme icons, so VS Code takes the icon from
the current file icon theme: by extension for notes and by name for folders.

Based on the same change in the community fork from #82.
Notes and folders could only be moved outside VS Code (#41).

- drag notes and folders onto a folder, onto empty space for the top level, or
  between Workspace Notes and Notes; several selected items move together
- Move To... in the right-click menu lists every folder of both sections
- moves go through a WorkspaceEdit, so open editors follow the moved note
- a folder can't be moved into itself, an existing item is never overwritten,
  and a note inside a folder that moves too goes along with it
- drag a note onto the editor area to open it

Drag data is carried as JSON: VS Code only keeps the original objects for drops
within the same view, and a drop on the other view delivers the type twice, the
first time empty.

Move support was suggested by the community fork in #82.
@dionmunk
dionmunk merged commit 94728fc into master Oct 7, 2026
1 check passed
@dionmunk
dionmunk deleted the feat/move-notes branch October 7, 2026 05:32
This was referenced Oct 7, 2026
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.

Archiving

1 participant