Skip to content

caps-log

Batch 8.

caps-log is a keyboard-driven terminal journal. The center of the screen is an annual calendar — twelve months laid out as a grid — and each day cell is highlighted according to whether a log entry exists for that date. Around the calendar sit four supporting panels: a sections menu (left), a tags menu (right), a log-entry preview (markdown-rendered), and a small events list box that counts down to upcoming annual events (birthdays, anniversaries). A scratchpad mode (s) drops you into a quick-note buffer. Pressing Enter on a day opens that day’s markdown file in $EDITOR; the calendar is the index, the editor is the content surface.

The thing worth stealing isn’t the journaling — it’s the layout discipline and the theming grammar. caps-log treats every visual element (each date type, each border, each menu entry state, each markdown header level) as an independently themeable component with its own foreground color, background color, and style-flag set. That’s a config schema KN-86 should copy almost wholesale.

  • Calendar as the primary index. The annual grid is the home surface; everything else is satellite. caps-log explicitly notes it “performs optimally when the entire calendar is visible” — i.e. the whole year fits on screen at once. For KN-86 a monthly grid is the right scope (128×75 has room for a generous month-at-a-glance with day cells ~14 cols wide), but the principle holds: the calendar is the navigation root, not a widget buried in a tab.
  • Four-state day cell. Each date renders in one of several mutually-exclusive states: log-date (has content), empty-date (no content), highlighted-date (cursor), weekend-date, event-date (annual event), todays-date. The cell’s appearance is a function of its state. This is a clean state-machine-per-cell model that maps directly onto how a KN-86 calendar cart would mark days.
  • Satellite panels are focus targets, not always-active. Tab / Shift+Tab cycles focus between the calendar and the menus; only the focused panel takes hjkl. Selected vs. unselected menu entries are visually distinct (see theming below).
  • Markdown preview pane renders the selected day’s entry inline with per-header-level styling — a lightweight read view that avoids opening the editor just to glance.
  • Border-style vocabulary. FTXUI gives caps-log six named border styles, all exposed in config: light, dashed, heavy, double, rounded, empty. Every panel (calendar-border, calendar-month-border, tags-menu.border, sections-menu.border, events-list.border, log-entry-preview.border) picks one. This is a pure box-drawing vocabulary — it survives the jump to monochrome perfectly, because border weight and style carry meaning without color. KN-86 already mandates CP437/box-drawing glyphs; a “heavy border = focused panel, light border = unfocused” convention is free differentiation on a single-color display.
  • Style-flag set per component: italic, bold, underlined, dim, inverted, strikethrough, blink. On amber-on-black, the survivors are bold (brightness), dim (reduced brightness), inverted (amber-on-black ↔ black-on-amber), and underlined. caps-log’s dim=true for unselected tag entries + bold=true for the selected entry is exactly the selected/unselected contrast pattern KN-86 needs, and it’s color-free.
  • Markdown header theming by level (header1…header6, list, quote, code-fg) — on a single color these collapse to brightness/weight tiers, but the idea of a typographic hierarchy expressed through style flags alone is the right monochrome instinct.
KeyAction
hjkl / arrowsMove within focused panel
Tab / Shift+TabCycle focus calendar ↔ menus
EnterOpen day’s entry in $EDITOR
dDelete log under cursor
sToggle scratchpad
+ / -Next / previous year

Clean, vim-rooted, fully keyboard. Note the absence of any mouse dependence — appropriate for KN-86’s Ferris Sweep input model.

  • FTXUI — C++ functional terminal UI library (components compose as a tree; declarative Renderer/Container model). Worth adding to the library shortlist as the C++-native counterpart to the Charm/Bubble Tea stack (cliamp.md, octoscope.md) and to opentui.md. KN-86’s nOSh runtime is C11/SDL3 and renders its own grid — we won’t adopt FTXUI — but its component-tree composition model and its per-component theme schema are reference architecture for how to structure the cart-facing UI primitives.
  • Boost.Program_options (CLI parsing), libgit2 (optional remote sync) — not relevant to KN-86.
  • Hierarchical view system: annual view, scratchpad view, menu components, markdown preview, optional git wrapper. Each view is a composed FTXUI component tree.
  • TOML config (~/.caps-log/config.ini) with a deeply nested theme tree: [view.annual-view.theme.log-date], [view.annual-view.theme.tags-menu.selected-entry], etc. Every leaf carries fgcolor / bgcolor / style flags. This nested-namespace theme schema is the single most portable idea here.
  • Data = plain markdown files, one per day, named d%y_%m_%d.md, with custom inline syntax (# Section, * Tag). The calendar is computed by scanning which day-files exist. Plain-file-per-unit + computed-index is a pattern a KN-86 calendar/journal cart could mirror on the cartridge SD filesystem.

caps-log is the strongest single-color win in this batch because its entire visual language is already color-optional:

  • Map the six FTXUI border styles onto KN-86’s box-drawing glyphs directly. Focused panel = heavy (┏━┓), unfocused = light (┌─┐), preview = rounded (╭─╮), disabled = dashed. Border weight becomes the panel-focus signal — no color needed. This is the cleanest answer to “how do you show which panel is active on a monochrome display.”
  • Day-cell states via glyph + inversion, not color. todays-date = inverted block; log-date (has entry) = bright/bold day number with a marker; empty-date = dim day number; highlighted-date (cursor) = inverted; event-date = day number with a corner glyph. Five-plus distinguishable states on one color, using position-stable markers inside each fixed-width cell.
  • Selected/unselected menu entries = bold (selected) vs dim (unselected) plus a leading caret on the selected row — caps-log’s exact pattern, color stripped.
  • Markdown preview hierarchy collapses to a brightness ladder: H1 = bold + ═══ underline rule, H2 = bold, H3 = bold-dim, body = normal, quote = dim + left rule, code = inverted span.
  • The per-component nested-namespace theme schema is a direct input to KN-86’s planned SYS-tab aesthetic-mode editor (cross-link 4trk.md, which argues for an editor not just a picker, and os-models.md for the color-picker UI). caps-log shows what the underlying config tree should look like: every visual element addressable by a dotted path, every leaf carrying weight/style/inversion.
  • FTXUI joins the TUI-framework reference set alongside the Charm stack and OpenTUI — the C++ entry in that comparison. Cross-link opentui.md, cliamp.md, octoscope.md.
  • Calendar-layout cross-link: see calcure.md (monthly grid + task panel) and chronos.md (time-grid week view) in this same batch — caps-log is the month/year index end of the calendar spectrum, chronos the intraday time-grid end.