Android: the form of an activity command #286

Closed
opened 2026-10-17 08:24:10 +02:00 by agentic-developer · 1 comment
Collaborator

Part of #277. Needs #283 (the outline records), and #284 for the entry from ⋮.

07-edit-command-activity.png, drawn in the app's Material 3 Expressive like the other forms.

Goal

The form of an activity command in the configuration (ConfigCommandForms.kt), opened from the Config screen and from ⋮ → Edit command of the activity screen.

Plan

  1. Description: DescriptionEntry, as every form.
  2. Series cards, numbered, in list order:
    • a colour swatch (a tap opens a picker of the default palette plus a #RRGGBB field), the name, and delete;
    • under them, query with the line "a shard matches if any line fits". Each table is a chip (sport = climbing; a table of several pairs reads sport = run, place = park), removable. Chips are joined by "or", with a "+ or" button that opens a PlacementEntry (dimension and value, as expect of the reminder form);
    • "+ Add" for a new series, which takes the next default colour. A note says that order matters for mixed days, and the cards can be moved up and down.
  3. Colouring:
    • Brightness: By count / Fixed (ConnectedChoice).
    • Mixed days: Split / First / Most, each with a one-line explanation.
    • A preview row of six example days (Run 1, Run 3, Climbing 2, Run 1 + Climbing 2, Run 2 + Climbing 1, none) in the current choices and series colours, drawn by the cell of #284. With fewer than two series, the mixed examples are left out.
  4. Statistics: "Exclude mixed days" (SwitchEntry, exclude_mixed), "Tracking starts" (DateEntry, start, clearable).
  5. Save through saveConfig (ConfigDraft.commandSteps), so that a renamed key goes first, comments are kept, and the save goes through the Changes flow like every other save. Field errors (an empty name, a bad colour, no series) are reported through LocalFieldErrors. Not on this screen (removed in the design): a TOML preview and "Pin to bottom bar".
  6. Config screen: the command is listed with the type badge activity and its one line (commandText: 2 series · count · split). "New command" offers the type, and newCommand starts with one empty series.

Tests

Pure (ConfigDraft): the steps of a new and of a changed activity command, the next default colour, reordering. Screenshot test of the form (@TallScreenshots) with two series and with one. Round trip on the emulator: edit, save, and see the commit in Changes.

Docs

R35 (the app), README, AGENTS.md (the form).

Part of #277. Needs #283 (the outline records), and #284 for the entry from ⋮. <img src="https://git.konstantinfickel.de/attachments/b933d832-645c-4a42-8b27-d97841df50a5" width="300"> `07-edit-command-activity.png`, drawn in the app's Material 3 Expressive like the other forms. ## Goal The form of an activity command in the configuration (`ConfigCommandForms.kt`), opened from the Config screen and from ⋮ → *Edit command* of the activity screen. ## Plan 1. **Description**: `DescriptionEntry`, as every form. 2. **Series cards**, numbered, in list order: - a colour swatch (a tap opens a picker of the default palette plus a `#RRGGBB` field), the name, and delete; - under them, `query` with the line "a shard matches if any line fits". Each table is a chip (`sport = climbing`; a table of several pairs reads `sport = run, place = park`), removable. Chips are joined by "or", with a "+ or" button that opens a `PlacementEntry` (dimension and value, as `expect` of the reminder form); - "+ Add" for a new series, which takes the next default colour. A note says that order matters for mixed days, and the cards can be moved up and down. 3. **Colouring**: - Brightness: *By count* / *Fixed* (`ConnectedChoice`). - Mixed days: *Split* / *First* / *Most*, each with a one-line explanation. - A **preview row** of six example days (Run 1, Run 3, Climbing 2, Run 1 + Climbing 2, Run 2 + Climbing 1, none) in the current choices and series colours, drawn by the cell of #284. With fewer than two series, the mixed examples are left out. 4. **Statistics**: "Exclude mixed days" (`SwitchEntry`, `exclude_mixed`), "Tracking starts" (`DateEntry`, `start`, clearable). 5. **Save** through `saveConfig` (`ConfigDraft.commandSteps`), so that a renamed key goes first, comments are kept, and the save goes through the Changes flow like every other save. Field errors (an empty name, a bad colour, no series) are reported through `LocalFieldErrors`. Not on this screen (removed in the design): a TOML preview and "Pin to bottom bar". 6. **Config screen**: the command is listed with the type badge `activity` and its one line (`commandText`: `2 series · count · split`). "New command" offers the type, and `newCommand` starts with one empty series. ## Tests Pure (`ConfigDraft`): the steps of a new and of a changed activity command, the next default colour, reordering. Screenshot test of the form (`@TallScreenshots`) with two series and with one. Round trip on the emulator: edit, save, and see the commit in Changes. ## Docs R35 (the app), README, AGENTS.md (the form).
Author
Collaborator

Implemented in #312.

Time: about 25 minutes (19:10–19:35), most of it waiting on builds (Android bindings, screenshot tests, nix flake check, nix build .#streamd-app).
Tokens: about 215k.

Findings

  • The preview row needs to know how a day is drawn, and that is core logic. So tracked_day in compute.rs now goes through drawing, the one place for classification, drawn and level. example_days uses it too. The facade (activity_examples, activity_palette, activity_color) and the bindings carry it. The app reaches these only through Configuring, so StreamSession stays the only caller of the bindings.
  • The palette and the check of a colour were not bound before. They are now, so the app does not keep a second copy of PALETTE or of Rgb::parse.
  • A series without a colour takes the colour of its place. Moving it, or removing one before it, would have changed its colour without warning. The form now writes the colour it showed in those cases (movedSeries, removedSeries). Add leaves the colour empty, so the new series takes the next colour of the palette.
  • The day cell of the activity screen was split into DayCell, which the form reuses. The existing activity screenshots stayed pixel-identical.
  • The Config → New command menu left out activity until this form existed. It is offered now.
  • The app's icons had no up arrow. The move buttons use the existing chevron, turned around, rather than a new icon file.
  • Not done: the round trip on the emulator (edit, save, see the commit in Changes). The save goes through the same saveConfig/commandSteps path as every other form.
Implemented in #312. **Time:** about 25 minutes (19:10–19:35), most of it waiting on builds (Android bindings, screenshot tests, `nix flake check`, `nix build .#streamd-app`). **Tokens:** about 215k. **Findings** - The preview row needs to know how a day is drawn, and that is core logic. So `tracked_day` in `compute.rs` now goes through `drawing`, the one place for classification, `drawn` and `level`. `example_days` uses it too. The facade (`activity_examples`, `activity_palette`, `activity_color`) and the bindings carry it. The app reaches these only through `Configuring`, so `StreamSession` stays the only caller of the bindings. - The palette and the check of a colour were not bound before. They are now, so the app does not keep a second copy of `PALETTE` or of `Rgb::parse`. - A series without a colour takes the colour of its place. Moving it, or removing one before it, would have changed its colour without warning. The form now writes the colour it showed in those cases (`movedSeries`, `removedSeries`). **Add** leaves the colour empty, so the new series takes the next colour of the palette. - The day cell of the activity screen was split into `DayCell`, which the form reuses. The existing activity screenshots stayed pixel-identical. - The *Config → New command* menu left out `activity` until this form existed. It is offered now. - The app's icons had no up arrow. The move buttons use the existing chevron, turned around, rather than a new icon file. - Not done: the round trip on the emulator (edit, save, see the commit in Changes). The save goes through the same `saveConfig`/`commandSteps` path as every other form.
Sign in to join this conversation.
No labels
android
cli
epic
planned
tui
No project
No assignees
1 participant
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#286
No description provided.