Skip to content

feat(notes): show recently opened notes first in List Notes - #102

Merged
dionmunk merged 1 commit into
masterfrom
feat/recent-notes
Oct 7, 2026
Merged

dionmunk merged 1 commit into
masterfrom
feat/recent-notes

Conversation

@dionmunk

@dionmunk dionmunk commented Oct 7, 2026

Copy link
Copy Markdown
Owner

A note opened often, like todo.md, sat wherever its name put it in Notes: List Notes (Alt+L) (#18). Like VS Code's Quick Open, the notes you opened most recently now come first.

Changes

  • Recently opened first. With nothing typed, the list starts with the notes opened most recently, newest first, under a "recently opened" heading, then every other note in name order under "other notes". Without any history the list is unchanged.
  • Opened from anywhere. A note counts as opened when it becomes the active editor, whether that's from Notes, List Notes, the Explorer or Quick Open, including when it opens in a preview or a viewer.
  • Kept on this machine. The last 50 notes are stored in the extension's global state, not in settings or the notes folder, and are not synced. The history follows notes and folders that are moved, and deleted notes are left out.
  • Notes: Clear Recently Opened forgets the history.

While typing

VS Code ranks matches itself while you type (keeping our order would need sortByLabel, which is still a proposed API), so a better match comes before a recent one. With the headings in place, "recently opened" then labelled notes that weren't recent, so the headings are only shown for the full list. Once you type, it's VS Code's ranked matches, as in any quick pick.

Testing

  • npm test: 35 passing, 5 new tests for the history (newest first without duplicates, the limit, a moved note, a renamed folder versus a folder with a similar name, clearing). With the folder check loosened to a plain prefix, the renamed-folder test fails.

  • End to end in VS Code 1.140 on macOS:

    Scenario List Notes
    nothing opened yet project.md, alpha.md, b-todo.md, todo.md, zz.md (no headings)
    opened zz.md, then todo.md recently opened: todo.md, zz.md; other notes: the rest
    type to todo.md, b-todo.md, Create entries, no headings
    opened project.md from the Explorer project.md first under recently opened
    restarted VS Code with the same profile same order, the history was kept
    dragged todo.md into archive still in recently opened, at its new place
    Notes: Clear Recently Opened "Cleared the recently opened notes.", back to name order without headings
  • The List Notes scenarios from Combine search for notes and create new notes #34 (create from the list, typed extensions, both sections, Escape) gave the same results.

Closes #18.

A note opened often, like todo.md, sat wherever its name put it in List Notes
(#18). Like Quick Open, the notes opened most recently now come first under
"recently opened", newest first, then the others under "other notes".

- a note counts as opened when it becomes the active editor from anywhere:
  Notes, List Notes, the Explorer, Quick Open; previews and viewers count too
- the history is the last 50 notes, kept in the extension's state on this
  machine, never in settings or the notes folder; it follows moved notes and
  folders, and deleted notes are left out
- while typing, VS Code ranks the matches itself (sortByLabel is a proposed
  API), so the headings are only shown for the full list, where they're right
- Notes: Clear Recently Opened forgets the history
@dionmunk
dionmunk merged commit eb982ba into master Oct 7, 2026
1 check passed
@dionmunk
dionmunk deleted the feat/recent-notes branch October 7, 2026 15:44
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.

[Req] Option to sort "List Notes" by recently opened

1 participant