Period detail screen: view one period day by day - #186
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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).ListCardwith a row per logged day, derived from the episode'speriod_daysrows (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 sharedPeriodDaySynclabel 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").Screen.LogDay.forDate(date)); every row carriesRole.Buttonsemantics 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 theLogPeriodroute itself is unchanged.Other changes
Screen.PeriodDetailroute + registration inMainActivity.kt.changelog/unreleased/period-detail-view.json(minor: new screen).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, andManageCategoriesScreenare untouched.Checks run
python3 a11y_check.pyclean (119 files)python3 wcag_check.pyclean (405 pairs, 27 themes; no colour literals added, roles only)app/src/main/**/*.ktclean🤖 Generated with Claude Code
https://claude.ai/code/session_01PZJLynVBkgLtehJFXffnfg
Generated by Claude Code