Repository navigation
feat(notes): sort notes by name, date modified or date created - #103
Merged
Merged
Conversation
Notes were always sorted by name (#22, #63). A Sort By button after Search in each section offers name A to Z, name Z to A, and newest first by date modified or date created, saved in the new notes.sortOrder setting. Folders stay first, as in the Explorer, and List Notes uses the same order after the recently opened notes. Extensions can't show a check mark on a menu item (contributes.commands has no toggled), so the button opens a list that marks the current order instead. Where a file system doesn't record when a file was created, the date modified is used.
The title bar of each section keeps New Note, New Folder, Search and Sort By; Refresh and Settings join Reveal in File Explorer and the location commands in its ... menu.
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes and folders were always sorted by name (#22, #63).
Changes
notes.sortOrdersetting, so it persists and also shows in Settings, like the Explorer'sexplorer.sortOrder. It's written to the user settings, or to the workspace settings when they already set it.Alt+L) orders the notes after the recently opened ones (feat(notes): show recently opened notes first in List Notes #102) the same way....menu of each section, next to Reveal in File Explorer and the location commands, so the title bar shows New Note, New Folder, Search and Sort By.Extensions can't show a check mark on a menu item: the schema for
contributes.commandsin VS Code 1.140 has category, command, icon, enablement, shortTitle and title, and menu items have command, alt, group, submenu and when, but notoggled. That's why the button opens a list (like the Extensions view's filter) rather than a menu of checked items (like Outline's Sort By, which is built into VS Code).Testing
npm test: 41 passing, 6 new tests for the order (each order, folders first, the same date falling back to the name, an unknown setting).End to end in VS Code 1.140 on macOS. Notes and folders were created a second apart (archive, work, alpha, beta, gamma), then alpha was rewritten and a note was added to archive, so the two date orders differ:
Each choice was saved as
notes.sortOrderin the user settings, the list marked the current order with a check, and List Notes followed Date Modified (old.md, in archive, changed last, came first).Title bar and
...menu, with Notes only and with both sections:...: Reveal in File Explorer, Set Up Workspace Notes (when the workspace has no notes), Refresh Notes, Settings...: Reveal in File Explorer, Select Workspace Notes Location, Refresh NotesNot tested: Windows and Linux; on Linux, whether a file's creation date is available depends on the file system.
Closes #22, closes #63.