Activity: streamd <key> [RANGE] prints the chart and the Days table #280
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 #279.
Goal
streamd <key> [RANGE]of an activity command prints a chart chosen by the length of the range, then the totals and the Days table.streamd <key> shards [RANGE]lists the matching shards.Command line (
commands/activity/cli.rs)RANGEis the syntax of #279 (num_args(1..), joined by spaces), defaulting tothis month. A wrong range is a usage error naming the forms.--exclude-mixed/--include-mixedoverrideexclude_mixed(they conflict with each other).shardsand the range positional do not clash (args_conflicts_with_subcommands, as the state commands do).-icombines with the range and the mixed flags and opens the view on them.Output (
commands/activity/print.rs)The glyph is the level (
░▒▓█= 1, 2, 3, 4+; always█withintensity = "fixed"), coloured in the series colour (truecolor through crossterm, ascommands/state/style.rsprints). A mixed day drawn split is◩with the first series as foreground and the second as background (with three or more series it's the same with the first two). Withfirst/mostit's the winner's glyph.·is a day without a match,┄(dim) a future day, and a blank is an untracked day. Today is bold/underlined. Without colour (NO_COLOR, not a terminal) the glyphs stay, and mixed days are◩.Calendar (2–42 days; the weeks of the range, Monday first, days outside the range dim):
Grid (more than 42 days, and
all): one 53-column strip per calendar year, newest year first, one column per week, the rows Monday to Sunday (labelsMo,We,Fr,Su), the months above (Jancarrying no year: the year heads the strip). Weeks outside the range are blank.Day (one day): the shards of the day instead of a chart.
Exclusive (
--exclude-mixed, orexclude_mixed = true): the Days table readsRun only"no other series that day",Climbing only,Mixed"several series that day",None"no series matched". Wording is generic: the only domain words are the series names.shards [RANGE]: one line per shard, newest first:2026-10-16 Fri 18:30 Fingerboard session · 120 min @Climbing journal/…:1(paths as in R21 Paths). A shard matching two series prints a warning after the output, naming it byfile:line, asstreamd <key>does too.Tests
The clap adapter (default range, joined words, conflicts,
shards), the printing of each shape on the sample of #279 without colour (golden strings), an integration test incrates/streamd-cli/tests/cli.rs.Docs
R36 (the command line, the output), README (usage with the example), AGENTS.md.
streamd <key> -i) #281activitycommand type in .streamd.toml #278Implemented in PR #306 (branch
280_print-activity-chart, 6 commits).Time: about 1 hour (13:08–14:07 on 2026-10-20), including
nix flake check.Tokens: about 62k of the session budget. This is approximate: it comes from the session's remaining-token counter, not an exact per-request count.
Findings during the implementation
/implementwould have refused it. It was implemented from the description at the user's request.this month. The default isRangeSpec::Monthof today's month, built inrun.rs.args_conflicts_with_subcommandsmakes clap readstreamd sport -i shardsas a range word. Without special handling the error would be "shardsis no range". That case now gets its own message:`shards` takes no options; write `streamd <key> shards [RANGE]`.Statsdid not have. I addedStats.series_only_shardsto the core. The bindings don't carryStatsyet (#283), so they are unaffected.3..17 Oct.Climbing 2 from 10:00 to 19:00, and a day without shards saysNo shards(· the day is to come/· the day is not tracked).styled_output(terminal and noNO_COLOR) moved from the state command'srun.rstocommands/state/style.rsso the activity output can share it.streamd <key> -i) #281