Android: Activity screen (year grid, month calendar, day timeline, Days) #284
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Part of #277. Needs #283.
01-all-time-year-grid.png02-month-calendar.png03-day-timeline.png05-options-menu-exclude-mixed.pngThe screenshots come from a web prototype (Instrument Sans, its own colours). They give the content and behaviour. Draw them as the app draws everything else: Material 3 Expressive,
StreamdTheme,ScreenBar, the components ofComponents.kt. The bottom bar in them is a mock.Goal
The screen of an activity command (
ActivityScreen): a header with the range pill, the tiles, the chart chosen by the range, the legend, the latest shards, the Days table and the ⋮ menu. It opens from All and from a pinned tab, like a state or a timesheet command.Plan
Session
StreamSession.activity(key, range, excludeMixed, now, offset, limit)→ a plainActivity(core/Activity.kt: days, stats, series withColor, shards, range withprevious/next), the only call into the bindings. TheActivitiesinterface is implemented byStreamViewModel. TheOverviewof an activity command for All and the badge isN active days this month.Screen (
ui/Activity.kt, pure helpers inui/ActivityChart.kt)ScreenBarwith the command name and the monospaced subtitlestreamd <key> · <view>, back only when drilled in. At the top right is the range pill‹ label ›(the arrows loadprevious/nextand are disabled when closed; a tap on the label opens the sheet of #285, a no-op until then) and ⋮.StreamdTheme.mono.01): one horizontal strip, one column per week, Monday on top, 10 dp cells with a 3 dp gap, opened scrolled to the newest week. The weekday labels (Mo, We, Fr, Su) are fixed on the left, and the month labels are above (January and the first label carry the year). Cells: the series colour at the alpha of its level (32 %, 55 %, 78 %, 100 % over the surface, dark mode included), mixed days drawn bydrawn(two halves on a 135° hard stop, three or more as wedges), none days in a neutral surface variant, future days outlined only, and today with a ring. No hint texts.02): 7 columns, Monday first, 44 dp cells. Days outside the range are muted and cannot be tapped, and the 1st of a month reads1 Nov. Future days are dashed and today is outlined.03): one lane per series on a 0–24 h axis (labels 00, 06, 12, 18, 24, light gridlines), each shard a dot at its moment with its time as a label. Within a lane, the labels of dots less than 150 minutes apart alternate above and below. Shards are events, never bars. (Stacking dots minutes apart is a follow-up, not this ticket.)Mixed.rememberSaveableas range texts.Sat 17 Oct · 06:45in mono, the title (shardSummary), and the series as aTagChipin its colour. A tap opens the note (NoteRequest.route). With more than 5, in every view, there's aShow all N shardsbutton (the screen of #285, hidden until then).01,02,03;05exclusive): inclusive shows<Series>"incl. N mixed" ·Mixed"also counted above" ·None"no series matched"; exclusive shows<Series> only"no other series that day" ·Mixed"several series that day" ·None. Each row has its day count and a % of the tracked days, followed by the shards per series under "Shards". The link "… · change" opens the ⋮ menu. It is kept in the day view too, as in03. Wording is generic: the only domain words are the series names. Strings go instrings.xml.05): Exclude mixed days, a switch with its explanation, for the session (no new call: both tables are in the report); Edit command (the form of #286; until then the generic config form of the command, or hidden); Show shards in stream (#285; hidden until then).ic_calendar_view_monthor similar, a Material Symbol asIcons.ktsays), the one-line summary and the pin. A route per activity command in theNavHost, as for state and timesheet commands (BottomBar.kt,Pins.kt).Tests
JVM unit tests of the pure helpers: the alpha of a level, the drawn slices (1, 2, 3 series), the week columns of a range with the month labels, the label alternation of the timeline, and the generic wording in both modes. Screenshot tests (
ActivityScreenshots.kt, one scene per state,TODAYofFixtures.kt): the year grid, the month calendar, the day timeline, exclusive mode with the menu open, and a mixed day of three series. Split into aninternal ActivityContentdrawn by the tests, asTimesheetContentis. On the emulator: scroll to newest, drill down and back.Docs
R35 (the app), README, AGENTS.md (the screen,
core/Activity.kt).activitycommand type in .streamd.toml #278Implementation plan
Implement the behavior and chart dimensions in the issue description using the app's Material 3 Expressive theme and components. The prototype images specify content and interaction, not typography, colours, or navigation chrome. #283 is closed; the current bindings already expose activity reports, both Days tables, range stepping, summaries, and configuration records.
Scope and decisions
all. Use the report's shape and range metadata rather than duplicating the core's selection rules.These are implementation defaults following the ticket; clarification was requested about the temporary menu boundary, with no response received before recording this plan.
1. Session adapter and plain model
core/Activity.kt: plain activity/range/series/day/statistics/shard models, a success/failure result, and anActivitiesinterface. Preserve indices, drawn slices, intensity level, tracked counts, both Days tables, paging total, summaries, and previous/next texts. Convert configured colours once to Compose Color, matching the proposed app model.StreamSession.activity(key, range, excludeMixed, now, offset, limit), running bindings on the session dispatcher. StreamSession remains the app's only binding caller; StreamViewModel implements Activities and supplies the call's current instant.2. Pure chart and presentation helpers
Add
ui/ActivityChart.ktand JVM tests before each behavior:3. Screen state and navigation
ActivityScreenandinternal ActivityContent, following TimesheetScreen/TimesheetContent. Keep loading/effects in the screen; content accepts fully loaded state, today, menu state, and callbacks.4. Charts and surrounding content
streamd <key> · <view>, drill-back control, range pill, overflow menu.5. App integration
6. Validation and documentation
nix build .#streamd-app(not included in flake check). Use the documented bindings setup if running Gradle directly.nix flake check. No new dependency is expected; if Gradle dependencies change, regenerate android/deps.json using the documented script.Implemented in PR #309: #309
Three signed commits add the activity model/chart helpers, the session adapter and screen integration, and screenshot coverage/documentation. Activity commands now have All entries, pins/badges, the newest-first year grid, month calendar, complete day timeline, saveable drill history, latest note links, and both Days tables. Mixed-mode switching uses the existing report without reloading.
Validation passed: 405 JVM tests with no skips, 128 screenshot scenes, the full
nix build .#streamd-app(including exact screenshot validation), and the finalnix flake check. Twenty new Activity light/dark references and the updated All references were visually reviewed. Emulator interaction checks remain unverified: there is no /dev/kvm and ADB reported no connected device.Findings: timelines need all events independently of the five-shard preview; per-series mixed-day counts are inclusive minus exclusive days; the expanded layoutlib suite needs a 2 GiB screenshot-test heap. Platform popup contents rendered blank at frame zero, so the menu uses a Material Surface overlay with outside-tap and Back dismissal. No Maven dependency changed. The range picker/full-shard actions remain in #285; Edit command opens the generic form.
Elapsed time: approximately 1 hour 43 minutes from branch creation (13:10 UTC) to PR creation (14:53 UTC), including the interruption and signing-key wait. Active execution time was not separately measured.
Token usage: this runtime does not expose reliable session token totals, so an exact count is unavailable rather than estimated.