Skip to content

Period detail screen: view one period day by day - #186

Merged
mapgie merged 1 commit into
mainfrom
claude/period-detail-view
Aug 26, 2026
Merged

Period detail screen: view one period day by day#186
mapgie merged 1 commit into
mainfrom
claude/period-detail-view

Conversation

@mapgie

@mapgie mapgie commented Aug 26, 2026

Copy link
Copy Markdown
Owner

What this adds

A read-only period detail screen (period_detail/{periodId}, ui/screens/history/PeriodDetailScreen.kt + PeriodDetailViewModel.kt), answering "how do I view a period, each day individually logged?" in the redesign's component language.

What the screen shows

  • A ToneHero (tinted with the Flow category's role colour) wording the episode naturally: "Mar 3 to Mar 8" or "Started Mar 3, ongoing", with a caption for length ("6 days" / "4 days so far") and cycle context ("28-day cycle") when the gap to the next episode is plausible (15 to 60 days, same bounds History uses).
  • One ListCard with a row per logged day, derived from the episode's period_days rows (getDaysForEpisode, which also handles the ongoing/open-ended cap; defensive fallback to the start day if no rows exist). Each row: "Day N" with its date, the day's flow as a word ("Medium") in the Flow category's role colour (numeric_slider steps map back through the shared PeriodDaySync label mapping; legacy chip-mode labels pass through as-is; the word carries the meaning, never colour alone), a muted second line with the day's symptoms ("Cramps, Fatigue") and a distinct-category count of anything else logged ("2 more logged").
  • The episode's notes in a card (body font), when non-blank.
  • Tapping a day row opens that day's unified log (Screen.LogDay.forDate(date)); every row carries Role.Button semantics and a 56dp minimum height.

Loading: the episode row is observed reactively (getPeriodById); the day range's logs load in a fixed number of queries (one range query for logs, one batched query for their values, grouped by date in memory). A missing/deleted episode pops the screen. Day-level data refreshes when the screen re-enters composition after a day or the episode was edited beneath it.

Routing change in History

Tapping a period card in History now opens the detail view instead of the period editor directly. Editing is preserved: the detail screen's top-bar Edit action opens the same Screen.LogPeriod.withId(id) editor, one tap away. All other History paths (swipe-to-delete with undo, the merge menu) are untouched, and the LogPeriod route itself is unchanged.

Other changes

  • Screen.PeriodDetail route + registration in MainActivity.kt.
  • Changelog fragment changelog/unreleased/period-detail-view.json (minor: new screen).
  • One-line drift note in docs/design/logging-redesign/subsystem-maps/01-logging-screens.md (the new screen sits between History and the destinations that map describes).

No DB changes; LogScreen, LogPeriodScreen, and ManageCategoriesScreen are untouched.

Checks run

  • python3 a11y_check.py clean (119 files)
  • python3 wcag_check.py clean (405 pairs, 27 themes; no colour literals added, roles only)
  • Semantics-import sweep over all app/src/main/**/*.kt clean
  • No en/em dashes in user-facing text

🤖 Generated with Claude Code

https://claude.ai/code/session_01PZJLynVBkgLtehJFXffnfg


Generated by Claude Code

Tapping a period card in History now opens a read-only detail view built
from the logging-redesign component library: a ToneHero words the range
("Mar 3 to Mar 8", or "Started Mar 3, ongoing") with length and cycle
context, and a single ListCard lists each logged day (from period_days)
as "Day N" with its date, the day's flow as a word in the Flow
category's role colour, the day's symptoms, and a count of other logged
categories. Tapping a day opens the unified day screen for that date;
the top bar's Edit action opens the existing period editor, so the
previous History tap behaviour stays one tap away.

The ViewModel observes the episode row reactively, loads the day range's
tracking logs in a fixed number of queries (one for logs, one for their
values), and pops back when the episode no longer exists. Day-level data
refreshes when the screen returns to composition after an edit.

Claude-Session: https://claude.ai/code/session_01PZJLynVBkgLtehJFXffnfg
Co-authored-by: Claude <noreply@anthropic.com>
@mapgie
mapgie marked this pull request as ready for review August 26, 2026 23:14
@mapgie
mapgie merged commit f761bdd into main Aug 26, 2026
4 checks passed
@mapgie
mapgie deleted the claude/period-detail-view branch August 26, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants