Repository navigation
Logs: each action of the person logged by name, in one place - #1901
Open
vmillet-dev wants to merge 1 commit into
Open
vmillet-dev wants to merge 1 commit into
vmillet-dev wants to merge 1 commit into
Conversation
AppState::act numbers each action of the session, logs it at info under ui::action (#412 Notes::Editor::Close), then applies it: the frame's loop, the tray and a second launch call it; apply, which one action may call again, logs nothing. The name is the variants alone, read by strum::IntoStaticStr, a carrier variant adding its part's own; never the payload, nor an id. What is sent at each key typed, or by the screen as it shows a card, is at trace by one list beside the name. The number is the backend's, for the calls to the core to read. The crate's tests share one logger (testing::listen); every action a state test applies through Held must have a name. Closes #1843 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BbVs5tCyTr9AasGra3Zzg3
This was referenced Dec 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1843
One place logs each action.
AppState::acttakes a number from the backend (Backend::next_action, from 1 in the session), logs the action, then applies it. The frame's loop, the tray and a second launch callact;applylogs nothing, because one action may apply another (Menu::QuitappliesGlobal::Quit). Each line looks like this:The name comes from the variants alone.
Action::namereads them throughstrum::IntoStaticStr: the area, the variant, and for a variant that carries what is asked of a part of the area, that part's variant too. Examples:Notes::Editor::Close,Notes::Editor::Fields::Keep,Http::Runner::Start,Menu::Preferences::Apply,App::Window::…. The line never holds a payload or an id (the owner chose the name alone). A new variant is logged without anyone writing a line for it.Typing goes to
trace. Actions sent at each key typed, or by the screen itself as it shows a card, are logged attracethrough the one listFREQUENT, kept besidename: a search, the palette's text, a request's draft, a variable row, the current passphrase typed, the fields' preview, a drawing's picture, a sheet evaluated, a JSON explored. Theinfolines then read as what the person did. Three journeys run with their logs kept (03, 05, 09) show that no action floods atinfo. The most frequent areNotes::Editor::Save(28, one per blur or closing),Http::Send(27) andNotes::Canvas::StepBack(13).Dependency.
strum0.27.2 is declared once in[workspace.dependencies]withderive(D33). It was already compiled withderivethroughcroner, soCargo.lockgains no crate and no version. Its licence is MIT.cargo-denyis not installed here, sosecurity-cargo.ymlwill be the check on this pull request.Tests
each_action_is_logged_once_by_name_numbered_in_order(real core, temporary library): one action of each area, plus a carrier, is found underui::action, in order, numbered without a gap.Palette::Typeis attrace.what_an_action_carries_is_never_logged: actions carrying a title (a duplicate), a checklist item, a body (a save), a field value (Fields::Keep) and a URL (Http::Edit), each a sentinel. None of the sentinels is in any line logged during the test, at any level, on any thread.Held::applymust have a name made only of::-separated alphanumeric parts. The 1,578 ui tests ran with that check.testing::listen. The preferences test that set its own logger uses it, since a test binary can hold only one logger.Docs. The wiki's logs page gets a new section, « What the person did »: where an action is logged, what its name holds, the
tracelist, and how to read a session's numbers.interface.md's « Drawing, state and actions » points toact.Checks run (Linux)
cargo test -p ui --lib: 1,578 pass, 4 ignored.cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo fmt --all --check,node --test "scripts/*.test.mjs"(77 pass).Generated by Claude Code