Skip to content

Persist note listing so short numeric IDs work across invocations#4

Merged
kristofer merged 2 commits intomainfrom
copilot/change-note-ids
Mar 17, 2026
Merged

Persist note listing so short numeric IDs work across invocations#4
kristofer merged 2 commits intomainfrom
copilot/change-note-ids

Conversation

Copy link

Copilot AI commented Mar 17, 2026

Note IDs (20260317-193750-042) are unwieldy to type. The listing already displayed numbers 1-N, but they were only usable within the same process — memo list then memo read 1 in a new shell would fail with "no current note listing".

Changes

  • internal/storage/storage.go: Added SaveLastListing([]string) and LoadLastListing() — persists ordered note IDs to ~/.memo-notes/.last-listing
  • cmd/list_command.go: Saves the listing to disk after each memo list run
  • cmd/command.go: ResolveNoteID() falls back to the on-disk listing when the in-memory listing is empty, making numbers valid across invocations until the next memo list
  • internal/ui/ui.go: Tip text updated to reflect persistence behavior

Usage

$ memo list
 1. Go Notes      | Created: 2026-03-17 10:00
 2. Python Basics | Created: 2026-03-17 10:01
 3. JavaScript    | Created: 2026-03-17 10:02

Tip: Numbers 1-3 stay valid until the next 'memo list' (e.g., 'memo read 3', 'memo delete 2').

$ memo read 2      # works in a new shell — no need to retype the full ID
$ memo delete 3
Original prompt

This section details on the original issue you should resolve

<issue_title>change up the note ids</issue_title>
<issue_description>need a way to make the typing of note_ids to be easier.
typing out the long note IDs is error-prone

need a way to simplify the list of the notes names and ids, maybe providing a temp id that can be typed the when note needs to be deleted, shown, edited....

</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: kristofer <17994+kristofer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add simplified typing for note IDs Persist note listing so short numeric IDs work across invocations Mar 17, 2026
Copilot AI requested a review from kristofer March 17, 2026 20:17
@kristofer kristofer marked this pull request as ready for review March 17, 2026 20:24
@kristofer kristofer merged commit 2117ff8 into main Mar 17, 2026
@kristofer kristofer deleted the copilot/change-note-ids branch March 17, 2026 20:24
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.

change up the note ids

2 participants