feat(ffi): bindings of activity commands for Kotlin #307

Merged
kfickel merged 7 commits from 283_activity-bindings into main 2026-10-20 14:46:52 +02:00
Collaborator

Closes #283 (part of #277).

Activity commands now cross into Kotlin: the report, the range syntax and the configuration.

Core (facade)

  • New api::ActivityRange: the days, the label, the range as written again (spec) and the ranges a step back/forward give (previous / next, none where no step is possible). ActivityReport.range is now this record (it replaces label, can_step_back, can_step_forward), so the app does no date arithmetic for the arrows.
  • api::resolve_activity_range(text, today) and api::activity_quick_picks(today).
  • config::project re-exports ActivityCommandFile and SeriesFile.

Bindings (streamd-ffi)

  • CommandKind.Activity: activity commands are no longer filtered out of Project.commands().
  • project.activity(store, stream, key, range: String, excludeMixed: Boolean?, now, offset, limit) -> ActivityReport, with ActivityRange (RangeUnit, text, previous/next as text), ActivityShape, ActivitySeries (#RRGGBB), ActivityDay (DayKind None/Single/Mixed/Future/Untracked, counts, shards, drawn indices, level), ActivityStats (both ways to count a mixed day, with their percentages), ActivityShardPage, shared.
  • activityRange(text, today) (throws InvalidRange with the core's wording) and activityQuickPicks(today) -> List<QuickPick>.
  • Outline: CommandSettings.Activity with ActivitySettings, IntensitySetting, MixedSetting, SeriesSettings, both ways; ConfigTable.ActivityCommand and Series.
  • InvalidRange already crossed, so error.rs needed no change.

App

The new variants reach the app's exhaustive whens, so it gets the minimum: an activity command is listed in the configuration (its series as its line), its form shows only the description (the rest is given back unchanged), and it is left out of the "new command" menu. The screen and the full form are #284–#286.

Tests

  • Rust: the range and its steps, days (kind, counts, drawn, level, untracked/future), stats in both ways, paging, shared shards, errors, activityRange/quick picks; the outline round trip with an activity command added to the starter configuration, and a form put that writes nothing new.
  • Kotlin (ffi-kotlin): the sample month of #279 through the map store, the quick picks, InvalidRange, and the outline round trip.
  • App: ConfigListTest for the activity arms; nix build .#streamd-app (unit + screenshot tests) passes.
  • nix flake check passes.

Docs: R35/R36 of REQUIREMENTS.md, AGENTS.md (facade, project.rs, records.rs, outline.rs, activity module), README.

Also fixes a doc comment of FileTarget in records.rs that had a line of code pasted into it.

Closes #283 (part of #277). Activity commands now cross into Kotlin: the report, the range syntax and the configuration. ## Core (facade) - New `api::ActivityRange`: the days, the label, the range as written again (`spec`) and the ranges a step back/forward give (`previous` / `next`, none where no step is possible). `ActivityReport.range` is now this record (it replaces `label`, `can_step_back`, `can_step_forward`), so the app does no date arithmetic for the arrows. - `api::resolve_activity_range(text, today)` and `api::activity_quick_picks(today)`. - `config::project` re-exports `ActivityCommandFile` and `SeriesFile`. ## Bindings (`streamd-ffi`) - `CommandKind.Activity`: activity commands are no longer filtered out of `Project.commands()`. - `project.activity(store, stream, key, range: String, excludeMixed: Boolean?, now, offset, limit) -> ActivityReport`, with `ActivityRange` (`RangeUnit`, `text`, `previous`/`next` as text), `ActivityShape`, `ActivitySeries` (`#RRGGBB`), `ActivityDay` (`DayKind` None/Single/Mixed/Future/Untracked, `counts`, `shards`, `drawn` indices, `level`), `ActivityStats` (both ways to count a mixed day, with their percentages), `ActivityShardPage`, `shared`. - `activityRange(text, today)` (throws `InvalidRange` with the core's wording) and `activityQuickPicks(today) -> List<QuickPick>`. - Outline: `CommandSettings.Activity` with `ActivitySettings`, `IntensitySetting`, `MixedSetting`, `SeriesSettings`, both ways; `ConfigTable.ActivityCommand` and `Series`. - `InvalidRange` already crossed, so `error.rs` needed no change. ## App The new variants reach the app's exhaustive `when`s, so it gets the minimum: an activity command is listed in the configuration (its series as its line), its form shows only the description (the rest is given back unchanged), and it is left out of the "new command" menu. The screen and the full form are #284–#286. ## Tests - Rust: the range and its steps, days (kind, counts, drawn, level, untracked/future), stats in both ways, paging, shared shards, errors, `activityRange`/quick picks; the outline round trip with an activity command added to the starter configuration, and a form put that writes nothing new. - Kotlin (`ffi-kotlin`): the sample month of #279 through the map store, the quick picks, `InvalidRange`, and the outline round trip. - App: `ConfigListTest` for the activity arms; `nix build .#streamd-app` (unit + screenshot tests) passes. - `nix flake check` passes. Docs: R35/R36 of REQUIREMENTS.md, AGENTS.md (facade, `project.rs`, `records.rs`, `outline.rs`, activity module), README. Also fixes a doc comment of `FileTarget` in `records.rs` that had a line of code pasted into it.
kfickel force-pushed 283_activity-bindings from e086f55c9d
All checks were successful
Continuous Integration / Conventional Commits (push) Successful in 29s
Continuous Integration / Lint, Check & Test (push) Successful in 10m54s
Continuous Integration / Build Package (push) Successful in 25m45s
to 4fe8736746
All checks were successful
Continuous Integration / Lint, Check & Test (push) Successful in 6m19s
Continuous Integration / Build Package (push) Successful in 13m18s
Continuous Integration / Conventional Commits (push) Successful in 4s
2026-10-20 14:46:13 +02:00
Compare
kfickel deleted branch 283_activity-bindings 2026-10-20 14:46:52 +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!307
No description provided.