Activity: the time range overlay of the TUI #282
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #277. Needs #281.
Goal
tin the activity view opens an overlay to choose the range, in the text syntax or from quick picks, like the app's time range sheet. The sheet is shown below for reference only: its tabs and calendar are not part of the terminal version.Behaviour
RangeSpec→ text, a round trip of #279) and is parsed as it is typed (api::activity_range+resolve). Below it are the resolved dates andN days, plus· to todaywhen the range ends today, or the parse error in the error colour. The grey line with the accepted forms stays and is labelled as examples. This answers open question 2 of the spec: typed input is parsed.commands/tui/widgets.rsstyle (centered), with its own small model that is tested purely.Tests
Model: typing, the round trip of the current range, an invalid entry blocking ⏎, quick picks filling the field, Esc keeping the old range. A
TestBackenddrawing.Docs
R36 (the keys of the view), README.
streamd <key> -i) #281streamd <key> -i) #281Implementation plan
Dependency #281 is merged. No earlier plan or follow-up comments were present when refining this ticket.
Behaviour and defaults
tfrom calendar, grid, day or all-shards mode. Seed the field from the currentModel.range.to_string(), preserving relative syntax such aslast 7 days.set_root(range)and emitsEffect::Recompute. This clears drill-down history and exits all-shards mode through the existing root transition; preserve the session's mixed-day setting. Applying the same range also starts a fresh root.Code changes
interactive/range.rs(registered ininteractive/mod.rs) with a small pure overlay model: text, insertion cursor, selected quick pick and a result such as Continue / Apply(RangeSpec) / Cancel. Supply today and tracking start explicitly fromSnapshot.today/Snapshot.start; no clock or file reads.RangeSpec::parse,RangeSpec::resolve(today, start),DayRange::lenandquick_picks(today), already re-exported by the CLI activity module. Do not implement a second parser or duplicate quick-pick dates. The CLI convention is to call the core modules directly. In particular, do not useapi::resolve_activity_rangefor this preview: it lacks the stream's tracking start and resolves “all” to today alone.Option<RangeOverlay>tointeractive/model.rs. Dispatch overlay keys before Pending prefixes, digit filters, help or normal dashboard keys; opening it clears pending prefixes. Replace thetplaceholder. Cancellation just drops the pending model; acceptance uses the root/recompute path above. Ignore key-release events as the existing model does.interactive/terminal.rs, makeActivityView::is_modal()true for help or the range overlay. The front-end already forwards modal keys, so no new global routing mechanism is needed.tui::centered, Clear, bordered Paragraph/List widgets and the shared title/dim/error styles. Include the field with a visible cursor, live preview or error, a labelled examples line, quick picks with selection, and “Enter apply · ↑/↓ quick pick · Esc cancel”. Keep the pending text/cursor visible horizontally; wrap preview/error/examples as needed and scroll the quick-pick viewport on short terminals. Clamp geometry and handle very small areas without panics. Keep parsing/resolution separate from drawing.Verification
Use fixed today/start fixtures, with no test reading the clock.
nix develop -c cargo test,nix develop -c cargo clippy --all-targets -- -D warnings, formatting checks, and finallynix flake checkas required by AGENTS.md. Manually try typing, picks, cancel/apply and drill-down → new root in the TUI.Documentation and completion
Update README.md's activity keys, REQUIREMENTS.md R36a's range-picker and modal behaviour, and AGENTS.md's activity architecture entry. Remove the placeholder wording from all three. This ticket changes the terminal overlay only; the Android range sheet remains #285.
Complete when arbitrary valid ranges and quick picks can be applied through t, errors remain editable, cancellation preserves the dashboard, and modal routing plus narrow-terminal rendering are verified.
Implementation status
Implemented locally on
282_activity-range-overlay, branched from the latestorigin/main.topens a modal editor with normal cursor editing, live core range previews and quick picks.Validation:
nix flake checkpassed on x86_64-linux, including 1,708 Rust tests and the Kotlin bindings check. All-target Clippy with-D warnings, rustfmt and repository commit hooks passed. Terminal smoke-tested drill-down, invalid typing/Enter, cancellation, quick-pick application and clearing the parent stack.Publishing is blocked: both GPG-signed commit attempts failed with
gpg: signing failed: Operation cancelledafter pinentry launched. No unsigned commit was created. The user has been asked to unlock the signing key; commits, push and PR remain pending.Elapsed wall time to this status: approximately 81 minutes (started 2026-10-20 13:22 UTC). Exact token usage is not exposed by this session, so no measured token count is available.
Implemented and published in PR #310: #310
The signing blocker is resolved. Both commits are GPG-signed (
c5cdf75feature,7deb023documentation), passed the applicable repository hooks, and are pushed. The working tree is clean.The implementation and validation findings are in the preceding status comment: live core range parsing, tracking-aware all-time preview, modal input, cancel/apply semantics, narrow layouts, tests and documentation.
nix flake checkpassed, including 1,708 Rust tests and Kotlin bindings; all-target Clippy and the terminal smoke test passed too.Total elapsed wall time from the initial start at 13:22 UTC to publication at approximately 14:54 UTC: about 92 minutes, including the signing interruption. Exact token usage is unavailable in this session; no measured count can be reported.