Skip to content

Notifications: a history behind the bar's alerts (space n) - #34

Closed
jack-work wants to merge 1 commit into
mainfrom
feat/notifications
Closed

jack-work wants to merge 1 commit into
mainfrom
feat/notifications

Conversation

@jack-work

Copy link
Copy Markdown
Owner

Phase 1 of plans/notifications.md: everything the pager says is kept, and space n shows it.

What changes on screen

  • The alert: the bar's first slot, unchanged. It retires after notice_ttl.
  • The mark: 𝄞 N stays on the bar while warnings or errors are unread, red or yellow by the worst of them. This is what remains after the alert retires.
  • The pit: space n or :notifications shows the history, newest first, with the same picker, wash and ♩ marker as the other pits.
    • A row is time, level (✗ ! ·), source (cli, or the aria it concerns), text, and ×N when it repeated. Repeats coalesce into one row that moves to the top.
    • Enter expands a row. a attends its aria, y yanks it, f cycles all → warnings and up → errors, and / searches.
    • Opening the pit counts as reading it. :notifications clear empties it.

space is a leader, since n stays search-repeat. space n is <leader>n, where Gluck's Neovim opens its notification history.

What gets posted

  • Every verb result and refusal, about 60 call sites, at the level each already had.
  • Every turn report for the aria on screen, with that aria as the source.
  • The pager process's own slog warnings and errors: freeze dumps, template failures, messages dropped on exit.

The history lives in the pager's memory, on the transcript, so it survives hopping between arias.

Found and fixed: [cli] notice_ttl was documented but never applied. Now it is, and it survives a hop.

Not here: phase 2, which covers the daemon's own trouble and turns finishing on other arias this session has shown. It is designed in the plan.

Tests

  • notifications_test.go: the store, coalescing, unread count, bound, clear; the view, filter, expand and attend; the bar mark; the history and TTL surviving a hop; space n; the slog capture.
  • The keymap oracles record, with a date, that space no longer dismisses a panel.
  • Full suite green.
  • scripts/notifications-pty.sh: 14/14 on the flake build of this commit, 5/14 on 0.37.11 (those five check for absences).
  • Verified in an isolated .#sandbox devshell with real credentials: a real failed turn, a bogus-model 404, landed in the pit with its aria as the source, and a attended that aria back after a hop.

…g it

Everything the pager said went through one slot, the first cell of the
status bar, which retires after notice_ttl. After that it existed nowhere
but one lastError string and the log file. A `𝄞` glyph for a notifications
pit had been reserved since August, and nothing opened it.

Now every alert is POSTED to a history first, and the bar and a pit are two
views of it:

  the ALERT  the newest one, in the bar's first slot, retiring as before
  the MARK   𝄞 N while warnings or errors are unread, red or yellow by the
             worst of them; it is what stays when the alert retires
  the PIT    `space n` or `:notifications`: the history, newest first, as
             the same picker every pit is

A row is time, level (✗ ! ·), source (cli or the aria it concerns) and text,
with ×N when it repeated: the same source, level and text, digits folded,
coalesce into one row that moves to the top and is unread again, as Gluck's
Neovim msg_router coalesces. Enter expands a row with what it could not hold;
`a` attends the row's aria; `y` yanks it; `f` cycles all, warnings and up,
errors; `/` searches. Opening it reads it. `:notifications clear` empties the
pager's copy, as Vim's `:messages clear` does.

Space is a leader: `space n` is `<leader>n`, which is where Gluck's Neovim
opens its notification history. n stays search-repeat. A leader arms and
waits, so space no longer falls through to a panel's any-key dismissal: the
keymap oracles record that, dated.

What is posted: every verb result and refusal (setCommandNoteAt, about 60
sites, levels as they were), every turn report for the aria on screen
(reportAt, with the aria as the source), and the pager process's own slog
WARN and ERROR (a freeze dump written, templates that failed to load,
messages dropped on exit), minus reportAt's echo of every alert. It lives on
the TRANSCRIPT, in the pager's memory: a hop mints a new session status, and
setStatus binds the same history to each.

Found on the way: `[cli] notice_ttl` was documented and never applied (nothing
called setNoticeTTL). It is now, through setStatus, so a hop keeps it.

Phase 2, the daemon's own trouble and turns finishing on arias this session
has shown, is designed in plans/notifications.md and not built here.

scripts/notifications-pty.sh drives the real binary in tmux, hermetically:
14/14 on this build, 5/14 on 0.37.11 (the five are absences).
@jack-work

Copy link
Copy Markdown
Owner Author

Superseded by #35, which merges this with its sibling into one branch to validate. Nothing is lost: this branch's commit is in #35's history.

@jack-work jack-work closed this Sep 30, 2026
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.

1 participant