feat(activity): the activity command type in .streamd.toml #287

Merged
kfickel merged 5 commits from 278_activity-command-config into main 2026-10-17 15:52:28 +02:00
Collaborator

Closes #278 (part of #277).

type = "activity" is now a command type of .streamd.toml. It is read, validated, completed, outlined and changed like the other types. Nothing is computed yet: streamd <key> says not implemented yet (exit 1), and its front-end tab is a placeholder view saying the same.

What changed

Core (streamd-core)

  • commands/activity/: ActivityCommand { description, intensity, mixed, exclude_mixed, start, series }, Series { name, color: Rgb, query: Vec<Condition> }, Intensity (count/fixed), MixedMode (split/first/most). There is also a fixed PALETTE: #D97A2B, #2F5BEA and four more. A series without color takes the palette colour of its position in the file.
  • CommandDefinition::Activity, as_activity, api::CommandKind::Activity.
  • File model: ActivityCommandFile and SeriesFile, which reject unknown fields. query takes one table or a list of them through one_or_many, like expect.
  • Validation (check_activity), each issue at its TOML path:
    • at least one series;
    • series names are not blank and are unique within the command;
    • color is #RRGGBB;
    • query is required and checked like expect (dimensions defined, values placed, aliases resolved);
    • wrong intensity / mixed values list their variants.
    • As decided in #277, there is no propagate = false rule.
  • schema.rs: ACTIVITY_COMMAND, SERIES and ConfigTable::{ActivityCommand, Series}.
  • complete.rs:
    • the fields of the command and of a series, and the header [[commands.<key>.series]];
    • the dimensions and values in query;
    • the variants of intensity and mixed, with what each does, and booleans for exclude_mixed.
  • index.rs reads query, so renaming a tag, a value or a dimension reaches into it.
  • outline.rs counts a dimension used in a query as named by the command, so the dimension can't be removed while the query uses it.
  • change.rs: put_activity writes only what differs and keeps comments. It rewrites series as an array of tables only when they changed.

CLI: commands/activity/ adds streamd <key> [-i], -i opens the front-end on a placeholder ActivityView, and frontend/views.rs gets its arms.

Bindings: Project.commands() and the config outline leave activity commands out (CommandSummary::of and CommandSettings::of return None) until #283 adds them. That way the Kotlin enums and the exhaustive whens of the app stay as they are.

Docs:

  • REQUIREMENTS: new R36 (configuration). R28 lists the type and validation rule 10; R25h covers completion and the index; R30 mentions the placeholder view.
  • README: an Activity section with the example.
  • AGENTS.md: commands/activity/.

Tests

  • Parsing: a full example, the defaults, a single-table vs a list query, unknown fields of the command and of a series, and wrong variants.
  • Every validation rule with its path, alias resolution, and the default colours by position.
  • Completion at query = { , inside a list query, and for the fields, variants and header.
  • The outline/change round trip on the R36 example: putting it back changes nothing, adding writes the example, and changed series are rewritten while comments stay.
  • Renaming a tag and a dimension used in a query, and locate of the issues of a series.
  • CLI integration: the help text, not implemented yet, -i needs a terminal, and an invalid query reported with its path.
  • Bindings: activity commands are left out.

nix flake check passes.

Closes #278 (part of #277). `type = "activity"` is now a command type of `.streamd.toml`. It is read, validated, completed, outlined and changed like the other types. Nothing is computed yet: `streamd <key>` says `not implemented yet` (exit 1), and its front-end tab is a placeholder view saying the same. ## What changed **Core** (`streamd-core`) - `commands/activity/`: `ActivityCommand { description, intensity, mixed, exclude_mixed, start, series }`, `Series { name, color: Rgb, query: Vec<Condition> }`, `Intensity` (`count`/`fixed`), `MixedMode` (`split`/`first`/`most`). There is also a fixed `PALETTE`: `#D97A2B`, `#2F5BEA` and four more. A series without `color` takes the palette colour of its position in the file. - `CommandDefinition::Activity`, `as_activity`, `api::CommandKind::Activity`. - File model: `ActivityCommandFile` and `SeriesFile`, which reject unknown fields. `query` takes one table or a list of them through `one_or_many`, like `expect`. - Validation (`check_activity`), each issue at its TOML path: - at least one series; - series names are not blank and are unique within the command; - `color` is `#RRGGBB`; - `query` is required and checked like `expect` (dimensions defined, values placed, aliases resolved); - wrong `intensity` / `mixed` values list their variants. - As decided in #277, there is no `propagate = false` rule. - `schema.rs`: `ACTIVITY_COMMAND`, `SERIES` and `ConfigTable::{ActivityCommand, Series}`. - `complete.rs`: - the fields of the command and of a series, and the header `[[commands.<key>.series]]`; - the dimensions and values in `query`; - the variants of `intensity` and `mixed`, with what each does, and booleans for `exclude_mixed`. - `index.rs` reads `query`, so renaming a tag, a value or a dimension reaches into it. - `outline.rs` counts a dimension used in a query as named by the command, so the dimension can't be removed while the query uses it. - `change.rs`: `put_activity` writes only what differs and keeps comments. It rewrites `series` as an array of tables only when they changed. **CLI**: `commands/activity/` adds `streamd <key> [-i]`, `-i` opens the front-end on a placeholder `ActivityView`, and `frontend/views.rs` gets its arms. **Bindings**: `Project.commands()` and the config outline leave activity commands out (`CommandSummary::of` and `CommandSettings::of` return `None`) until #283 adds them. That way the Kotlin enums and the exhaustive `when`s of the app stay as they are. **Docs**: - REQUIREMENTS: new R36 (configuration). R28 lists the type and validation rule 10; R25h covers completion and the index; R30 mentions the placeholder view. - README: an Activity section with the example. - AGENTS.md: `commands/activity/`. ## Tests - Parsing: a full example, the defaults, a single-table vs a list `query`, unknown fields of the command and of a series, and wrong variants. - Every validation rule with its path, alias resolution, and the default colours by position. - Completion at `query = { `, inside a list `query`, and for the fields, variants and header. - The outline/change round trip on the R36 example: putting it back changes nothing, adding writes the example, and changed series are rewritten while comments stay. - Renaming a tag and a dimension used in a `query`, and `locate` of the issues of a series. - CLI integration: the help text, `not implemented yet`, `-i` needs a terminal, and an invalid query reported with its path. - Bindings: activity commands are left out. `nix flake check` passes.
Read, validated, completed, outlined and changed like the other types.
streamd <key> says it is not implemented yet, and its view is a
placeholder; the bindings leave activity commands out until #283.

Refs #278
Refs #278
Refs #278
docs: the activity command type (R36)
Some checks failed
Continuous Integration / Conventional Commits (push) Successful in 16s
Continuous Integration / Lint, Check & Test (push) Successful in 7m7s
Continuous Integration / Build Package (push) Has been cancelled
95f0bd99da
Refs #278
kfickel force-pushed 278_activity-command-config from 95f0bd99da
Some checks failed
Continuous Integration / Conventional Commits (push) Successful in 16s
Continuous Integration / Lint, Check & Test (push) Successful in 7m7s
Continuous Integration / Build Package (push) Has been cancelled
to 981e76541c
Some checks failed
Continuous Integration / Conventional Commits (push) Successful in 5s
Continuous Integration / Build Package (push) Has been cancelled
Continuous Integration / Lint, Check & Test (push) Has been cancelled
2026-10-17 08:53:55 +02:00
Compare
docs: a rename no longer reaches into trigger.if, which is gone
All checks were successful
Continuous Integration / Conventional Commits (push) Successful in 17s
Continuous Integration / Lint, Check & Test (push) Successful in 6m37s
Continuous Integration / Build Package (push) Successful in 14m37s
8ebca54d86
kfickel force-pushed 278_activity-command-config from 8ebca54d86
All checks were successful
Continuous Integration / Conventional Commits (push) Successful in 17s
Continuous Integration / Lint, Check & Test (push) Successful in 6m37s
Continuous Integration / Build Package (push) Successful in 14m37s
to 9c52c3f15c
All checks were successful
Continuous Integration / Conventional Commits (push) Successful in 19s
Continuous Integration / Build Package (push) Successful in 39s
Continuous Integration / Lint, Check & Test (push) Successful in 1m36s
2026-10-17 15:20:14 +02:00
Compare
kfickel deleted branch 278_activity-command-config 2026-10-17 15:52:29 +02:00
Sign in to join this conversation.
No reviewers
No labels
android
cli
epic
planned
tui
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
kfickel/streamd!287
No description provided.