Odin and Me ยท Appendix C

Appendix C: Beyond the book

Muninn is deliberately small. Here's where a real console-application toolkit goes further than I chose to here, each with a short pointer rather than code: go build these if you want them.

A proper terminal-UI library

Everything Chapter 7 built, clearing, cursor positioning, colour, box-drawing, is raw ANSI escapes, hand-written, no library. That was the point: seeing what a terminal UI actually is before reaching for something that hides it. A real terminal-UI toolkit goes much further: scrolling regions, resizable panes, mouse input, alternate screen buffers that restore your shell's previous contents on exit. None of that ships with Odin, so any such library is necessarily third-party and was out of scope for what I wanted to cover. If you want it, that's the door to walk through next.

Multiple save files or profiles

Muninn has exactly one save file, next to the binary, holding one person's notes. A multi-profile version would let you switch between separate note collections: work notes, personal notes, a project-specific set, each in its own file, with a small picker screen before the main menu. SAVE_FILE in persist.odin is currently a constant; making it a runtime value, chosen at startup or via a command-line argument, is most of the work.

Categories and tags

A second field on Note, a category string, or a small set of tags, plus a way to filter list_notes/search_notes by it. The store and persistence format both need a new field (encode_note/decode_note grow by one delimiter-separated piece each), and the menu needs a filter prompt. Nothing here requires new concepts beyond what Chapter 9 through 11 already gave you: it's a genuinely reasonable next project once you've finished the book.

Exporting notes

A menu item that writes every note out as one plain-text or Markdown file, formatted for reading outside Muninn entirely: one heading per note, the body underneath. core:strings.Builder and os.write_entire_file, the same tools Chapter 8 and Chapter 10 already used, are all it needs.

A proper per-OS data directory

Chapter 12's honestly-named shortcut: SAVE_FILE is a bare filename next to the binary, not the %APPDATA%/~/Library/Application Support//$XDG_DATA_HOME location a shipped tool should use. Finding the right path per platform and building persist.odin's full path from it is a small, genuinely useful exercise once everything else here feels comfortable.

Undo

Delete is currently Muninn's only destructive action, and its only safety net is the confirmation prompt from ยง10.5. A proper undo would need to remember at least the last deleted note (or a short history of them) somewhere the menu could offer to restore from: a small stack of Note values, pushed on delete, popped on undo, is the shape of it.