feat(activity): the activity command type in .streamd.toml #287
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "278_activity-command-config"
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?
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>saysnot 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 fixedPALETTE:#D97A2B,#2F5BEAand four more. A series withoutcolortakes the palette colour of its position in the file.CommandDefinition::Activity,as_activity,api::CommandKind::Activity.ActivityCommandFileandSeriesFile, which reject unknown fields.querytakes one table or a list of them throughone_or_many, likeexpect.check_activity), each issue at its TOML path:coloris#RRGGBB;queryis required and checked likeexpect(dimensions defined, values placed, aliases resolved);intensity/mixedvalues list their variants.propagate = falserule.schema.rs:ACTIVITY_COMMAND,SERIESandConfigTable::{ActivityCommand, Series}.complete.rs:[[commands.<key>.series]];query;intensityandmixed, with what each does, and booleans forexclude_mixed.index.rsreadsquery, so renaming a tag, a value or a dimension reaches into it.outline.rscounts 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_activitywrites only what differs and keeps comments. It rewritesseriesas an array of tables only when they changed.CLI:
commands/activity/addsstreamd <key> [-i],-iopens the front-end on a placeholderActivityView, andfrontend/views.rsgets its arms.Bindings:
Project.commands()and the config outline leave activity commands out (CommandSummary::ofandCommandSettings::ofreturnNone) until #283 adds them. That way the Kotlin enums and the exhaustivewhens of the app stay as they are.Docs:
commands/activity/.Tests
query, unknown fields of the command and of a series, and wrong variants.query = {, inside a listquery, and for the fields, variants and header.query, andlocateof the issues of a series.not implemented yet,-ineeds a terminal, and an invalid query reported with its path.nix flake checkpasses.activitycommand type in .streamd.toml #27895f0bd99da981e76541c8ebca54d869c52c3f15c