feat(android): the form of an activity command #312

Merged
kfickel merged 6 commits from 286_activity-command-form into main 2026-10-20 20:11:56 +02:00
Collaborator

Closes #286.

What it does

The configuration of the app now has a full form for an activity command, in place of the description-only placeholder. It opens from the Config screen and from ⋮ → Edit command of the activity screen.

  • Description, as in every form.
  • Series cards, numbered:
    • each card has a colour swatch (tap: the palette of the core, or type #RRGGBB; Of its place clears it), the name, move up/down and delete;
    • under them, the query as removable chips joined by "or" (sport = run, sport = jog, place = park). Or opens a dialog with a PlacementEntry.
    • Add appends a series in the next default colour.
    • A series keeps its colour when it is moved, or when one before it is removed: a colour it had only from its place is written then.
  • Colouring: By count / Fixed and Split / First / Most (ConnectedChoice), each with a line explaining it. Below is a row of example days in the series colours: Run 1, Run 3, Climbing 2, Run 1 + Climbing 2, Run 2 + Climbing 1, none. The mixed examples are left out with fewer than two series. A default is only written where the file already had a value.
  • Statistics: Exclude mixed days and Tracking starts, which can be left empty.
  • Save goes through commandSteps, so a renamed key goes first. The form can't be saved with no series, a series without a name or a query, or an invalid colour (LocalFieldErrors).
  • The Config list shows an activity command as 2 series · count · split. New command now offers activity, and newCommand starts with one empty series.

Core and bindings

The rule is that logic stays in the core, so the drawing of a day was pulled out of tracked_day into drawing (one place for classification, drawn and level).

  • example_days uses it for the preview row.
  • The facade has activity_examples, activity_palette and activity_color.
  • The bindings carry these as activityExamples, activityPalette and activityColor (record ExampleDay).
  • In the app they are reached only through Configuring (palette, color, examples), which StreamSession.kt answers.
  • The day cell of the activity screen was split into DayCell, which the preview reuses. The existing activity screenshots are pixel-identical.

Tests

  • Rust: example days for split/first/most, count/fixed, and one, three and no series; the facade; the binding conversions.
  • Kotlin unit tests (ActivityDraftTest): colour by place, the next colour, moving and removing keep colours, the query of a series, completeness, example labels, chosen, the steps of a new and a renamed command. ConfigListTest is updated for the new one-line summary and the first series.
  • Screenshots (ConfigEditScreenshots): two series (tall), one series fixed/most (tall), and a new command.
  • nix flake check and nix build .#streamd-app pass.

Not done: the round trip on the emulator (edit, save, see the commit in Changes) was not tried.

Closes #286. ## What it does The configuration of the app now has a full form for an activity command, in place of the description-only placeholder. It opens from the Config screen and from ⋮ → *Edit command* of the activity screen. - **Description**, as in every form. - **Series cards**, numbered: - each card has a colour swatch (tap: the palette of the core, or type `#RRGGBB`; *Of its place* clears it), the name, move up/down and delete; - under them, the query as removable chips joined by "or" (`sport = run`, `sport = jog, place = park`). **Or** opens a dialog with a `PlacementEntry`. - **Add** appends a series in the next default colour. - A series keeps its colour when it is moved, or when one before it is removed: a colour it had only from its place is written then. - **Colouring**: *By count* / *Fixed* and *Split* / *First* / *Most* (`ConnectedChoice`), each with a line explaining it. Below is a row of example days in the series colours: Run 1, Run 3, Climbing 2, Run 1 + Climbing 2, Run 2 + Climbing 1, none. The mixed examples are left out with fewer than two series. A default is only written where the file already had a value. - **Statistics**: *Exclude mixed days* and *Tracking starts*, which can be left empty. - **Save** goes through `commandSteps`, so a renamed key goes first. The form can't be saved with no series, a series without a name or a query, or an invalid colour (`LocalFieldErrors`). - The **Config list** shows an activity command as `2 series · count · split`. **New command** now offers `activity`, and `newCommand` starts with one empty series. ## Core and bindings The rule is that logic stays in the core, so the drawing of a day was pulled out of `tracked_day` into `drawing` (one place for classification, `drawn` and `level`). - `example_days` uses it for the preview row. - The facade has `activity_examples`, `activity_palette` and `activity_color`. - The bindings carry these as `activityExamples`, `activityPalette` and `activityColor` (record `ExampleDay`). - In the app they are reached only through `Configuring` (`palette`, `color`, `examples`), which `StreamSession.kt` answers. - The day cell of the activity screen was split into `DayCell`, which the preview reuses. The existing activity screenshots are pixel-identical. ## Tests - Rust: example days for split/first/most, count/fixed, and one, three and no series; the facade; the binding conversions. - Kotlin unit tests (`ActivityDraftTest`): colour by place, the next colour, moving and removing keep colours, the query of a series, completeness, example labels, `chosen`, the steps of a new and a renamed command. `ConfigListTest` is updated for the new one-line summary and the first series. - Screenshots (`ConfigEditScreenshots`): two series (tall), one series fixed/most (tall), and a new command. - `nix flake check` and `nix build .#streamd-app` pass. Not done: the round trip on the emulator (edit, save, see the commit in Changes) was not tried.
kfickel force-pushed 286_activity-command-form from 43c71c281a
All checks were successful
Continuous Integration / Conventional Commits (push) Successful in 14s
Continuous Integration / Lint, Check & Test (push) Successful in 7m59s
Continuous Integration / Build Package (push) Successful in 17m13s
to f9f1b1206a
All checks were successful
Continuous Integration / Conventional Commits (push) Successful in 14s
Continuous Integration / Build Package (push) Successful in 37s
Continuous Integration / Lint, Check & Test (push) Successful in 1m24s
2026-10-20 19:56:51 +02:00
Compare
kfickel scheduled this pull request to auto merge when all checks succeed 2026-10-20 19:58:52 +02:00
kfickel deleted branch 286_activity-command-form 2026-10-20 20:11:56 +02:00
Sign in to join this conversation.
No reviewers
No labels
android
cli
epic
planned
tui
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!312
No description provided.