Skip to content

Phase 8: unified day log becomes the only logging surface, superseded screens removed - #187

Merged
mapgie merged 5 commits into
mainfrom
claude/logging-redesign-phase-8
Aug 28, 2026
Merged

Phase 8: unified day log becomes the only logging surface, superseded screens removed#187
mapgie merged 5 commits into
mainfrom
claude/logging-redesign-phase-8

Conversation

@mapgie

@mapgie mapgie commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Phase 8: cleanup and removal (final phase of the logging redesign)

Gated on the owner's parity sign-off (recorded 2026-08-28 in PLAN.md section 7). Every removal below is matched to a proven replacement; PLAN.md section 3 is the contract and is walked in full at the end.

Prerequisites #185 and #186 were already merged to main (v0.57.0-beta.1), so this branch is cut straight from main and the diff contains only Phase 8 work.

What changed

1. Entry points flipped to log_day

  • Calendar day tap (quick log): period quick log opens the day screen (it resolves start/continue/edit itself); a category quick log opens the day screen with that category focused via the new categoryId argument; instant Plus One increments are unchanged.
  • Speed dial: "Log Period" and every category item open the day screen for the targeted date (categories focused).
  • Day sheet: the former "Try the new day log (preview)" row is now the standard "Open day log" action; "Period" edit opens the day screen for that day; a tracked entry's edit opens the day screen targeting that exact log; "Log more for this day…" still opens the full menu.
  • Quick Log widget deep link: opens today's day screen with the tapped category focused. Widget rendering untouched; the PIN-lock neutral-placeholder invariant holds unchanged (GoFloWidget.kt not in this diff).
  • Period detail (Period detail screen: view one period day by day #186): the top-bar pencil now opens the day screen on the episode's first day ("Open first day"), replacing its Screen.LogPeriod.withId reference.

2. Parity gap closed before deletion (Phase 5 deviation)

Editing one specific same-day log of an allowMultiple category previously still routed to LogCategory. log_day now accepts logId: LogViewModel loads that one log as its category's entry with existingLog set, so Save goes through updateLogInPlace and "Delete entry" removes exactly that log. The day sheet's per-entry edit uses it. The deep links are one-shot (consumed on first load); switching day reloads normally.

3. Removed (each verified reference-free by grep before and after)

  • LogPeriodScreen.kt + LogPeriodViewModel.kt (incl. PinnedCategoryInput, SectionLabel, its private DatePickerDialogWrapper)
  • LogCategoryScreen.kt + LogCategoryViewModel.kt (incl. DateSelectorCard, its private DatePickerDialogWrapper)
  • LogEntryTopBar.kt (orphaned once both callers were gone)
  • Routes Screen.LogPeriod, Screen.LogCategory and their MainActivity registrations and imports
  • AddCategoryDialog, EditAppearanceDialog, RenameCategoryDialog (superseded since Phase 7, annotated @Suppress("unused")) and their orphaned helpers CategoryColorPicker, CategoryIconGrid, NumericSettingsSection
  • Dead ViewModel methods: ManageCategoriesViewModel.addCategory/.updateCategoryAppearance; ManageCategoryValuesViewModel.renameCategory/.updateAppearance/.updateNumericSettings/.updateUnit/.setShowInLogPeriod/.setAllowMultiple/.setTrackAgainstTime

4. Relocated / consolidated (not removed)

  • metricConfigFor + TimedIncrementTimeline moved to ui/screens/log/MetricSupport.kt (LogScreen consumes them)
  • DatePickerDialogWrapper consolidated into one shared ui/components/DatePickerDialogWrapper.kt
  • FullColorPickerDialog + SaturationValuePanel/HueSlider + isFixedColorToken/isCustomColorToken moved to ui/screens/categories/CategoryColorPickerDialog.kt (still used by CategoryEditScreen's custom colour slot and the adopt-colour rules)
  • ManageCategoryValuesScreen: per-type settings sections that duplicated the edit flow (slider range/step labels/decimals/unit, free-numeric unit, and the log-with-period / allow-multiple / track-against-time switches) are consolidated into the Edit action, which provably covers each (CategoryEditScreen step 2 + unit field + Options card, incl. system Flow in slider mode). The screen keeps what only it does: value catalog CRUD, the built-in Flow chips/slider switch, the alarms section, archive/delete, and now points at Edit for the rest.

5. Kept deliberately

PeriodDaySync (flow mapping + the save fan-out syncFlowToTrackingLog/syncSymptomsToTrackingLog/computePinnedValues; also used by PeriodDetailViewModel), AddSymptomDialog, widget + reminder refresh on save, SelectableChip, all repository methods (a few setters, e.g. updateNumericSettings, now have no UI caller but stay as data-layer API per the phase guide's do-not-remove rule), CustomAlarm system, tracking modes, quick-log, export, Stats/History.

PLAN.md section 3 preservation walk (verified by inspection on the finished tree)

Logging

  • Generic category value, all input types: LogScreen renders every category through MetricInput (CategoryMetricSection/MetricSectionBody); chips (default), stepped scale/slider (numeric_slider), free numeric with unit (numeric_free), count stepper (increment), timed increment with per-tap timestamp + timeline (TimedIncrementTimeline in MetricSupport.kt, per-tap saves in LogViewModel.addTimedIncrement).
  • "Previously recorded (removed from options)" chips: LogScreen.MetricSectionBody (default type).
  • Notes per log (500-char cap): per-entry "Add note" field in MetricSectionBody. Edit an existing log: non-allowMultiple entries load automatically; a specific allowMultiple log via the logId deep link. Delete a log: "Delete entry" with confirmation. Date selection: title sheet "Change day" + Day card (replaces canEditDate; a logId targeting is dropped on day switch, matching the old screen's fixed-date rule for by-id edits).
  • Period day: start/end dates (PeriodDatesSection), ongoing null end ("Still ongoing", "Clear end date"), flow slider or chips with the 1→Spotting/2→Light/4→Heavy/else Medium mapping (FlowSection + PeriodDaySync), symptoms chips + inline Add via AddSymptomDialog writing to the value catalog (SymptomsSection, addNewSymptomToLibrary), pinned showInLogPeriod categories in the flow context, episode notes.
  • Episode/continuation logic: gap tolerance from prefs (LogViewModel.init), episode day number (top bar + Day section), range vs open-ended (logPeriodRange vs logPeriodDay in save()), "Remove this day", "Delete Entire Period", "Disable period logging" (overflow menu).
  • Unsaved-changes guard: BackHandler + save/discard dialog on LogScreen (now also guards day switches).
  • Period save fan-out: PeriodDaySync.syncFlowToTrackingLog / .syncSymptomsToTrackingLog / .computePinnedValues in LogViewModel.save() (unchanged since Phase 5).
  • Side effects on save: GoFloWidget.updateAllWidgets + ReminderScheduler.refreshPredictionReminders on period saves, day removal, and episode deletion.

Categories & management

  • Create / rename / archive / unarchive / delete (system protected) / reorder: CategoryEditScreen (create + rename + delete-with-history), ManageCategoriesScreen swipes + reorder mode, ManageCategoryValuesScreen menu.
  • Per-category icon, colour token (roles + fixed hex + custom picker), input type ("fixed once logged"), numeric range/unit/decimals, scale labels, allow-multiple, show-in-log-period, track-against-time, mode key: all on CategoryEditScreen (mode key carried through CategoryEditViewModel.save).
  • Value catalog CRUD incl. rename-with-history and seeded-value protection: ManageCategoryValuesScreen (kept).
  • System categories (Flow, Symptoms, Ovulation Test preset): untouched (seeding, protection, flow chips/slider switch kept on the values screen).
  • Tracking modes: ModesScreen untouched.
  • Quick-log config + Quick Log widget: ManageQuickLogScreen untouched; widget increment broadcast unchanged; non-increment taps open the day screen focused.
  • ManageCategoryValues screen: kept (value editing); per-type settings consolidated into Edit per section 4 above.

Theme & colour

  • No theme, palette, or colour-machinery file changed in this diff (wcag_check.py green).

Other surfaces

  • Stats, History, Home, DayLogSheet, Dashboard, export, custom alarms: data model untouched (DB stays v24, no migration); only navigation targets changed.

Needs device pass (new or rerouted behaviour that inspection cannot fully confirm):

  • The logId deep link end to end: day sheet edit of one allowMultiple entry, in-place save, targeted delete.
  • The categoryId focus behaviour from the widget deep link and speed dial (expanded input inside grouped cards).
  • Timed-increment per-entry "edit" rows in the day sheet now land on the day screen's timeline (equivalent capability, different surface).
  • General smoke pass over every flipped entry point.

Evidence and checks

  • Dead-reference grep over the whole main source set for every deleted symbol and route string (LogPeriodScreen, LogPeriodViewModel, LogCategoryScreen, LogCategoryViewModel, PinnedCategoryInput, LogEntryTopBar, DateSelectorCard, Screen.LogPeriod, Screen.LogCategory, log_period, log_category, AddCategoryDialog, EditAppearanceDialog, RenameCategoryDialog, CategoryIconGrid, NumericSettingsSection, the removed VM methods, newEntryForDate, .editEntry(, withId(): zero hits (the only log_category match is the unrelated DataStore key quick_log_category_id).
  • Navigation graph read end to end; MainActivity registers no dead route.
  • python3 a11y_check.py: clean. python3 wcag_check.py: clean. Semantics-import sweep over all main-set Kotlin files: clean. Changelog fragment validated by check_changelog_fragment.py against origin/main.
  • Docs updated: PLAN.md status + section 7 Phase 8 row (Done, DB 24, parity sign-off date, deviations), subsystem maps 01/02 drift notes marking the removals, LESSONS.md (two transferable lessons), changelog fragment logging-redesign-cleanup.json (minor bump).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PZJLynVBkgLtehJFXffnfg


Generated by Claude Code

claude added 5 commits August 28, 2026 01:12
…metric helpers

- Screen.LogDay gains optional categoryId (focus a category's input) and
  logId (load one specific log for in-place editing) arguments; builders
  forCategory and forLog added. This closes the Phase 5 deviation: editing
  one particular same-day log of an allow-multiple category is now possible
  on the unified day screen, so the old per-category screen has no unique
  capability left.
- LogViewModel consumes the two deep links one-shot on first load:
  focus expands the category, and an edit target pins that exact log into
  its category's entry (existingLog set), so Save updates it in place and
  Delete entry removes exactly it.
- Screen.LogPeriod and Screen.LogCategory route definitions removed
  (registrations and entry points follow in the next commits).
- DatePickerDialogWrapper consolidated into one shared component in
  ui/components (was private per screen); LogScreen now uses it.
- metricConfigFor and TimedIncrementTimeline moved out of
  LogCategoryScreen.kt into ui/screens/log/MetricSupport.kt so the unified
  screen keeps them after the old screen is deleted.

Claude-Session: https://claude.ai/code/session_01PZJLynVBkgLtehJFXffnfg
Co-authored-by: Claude <noreply@anthropic.com>
- Home calendar quick log: a period tap and a category tap both open
  log_day (category taps focus that category); instant Plus One increments
  are unchanged.
- Home speed dial: Log Period and every category item open the day screen
  for the targeted date, categories focused.
- Day sheet: the day-log row is now the standard action ("Open day log",
  no longer a preview); Period edit opens the day screen for that day, and
  a tracked entry's edit opens the day screen targeting that exact log.
- Quick Log widget deep link opens today's day screen with the tapped
  category focused (the PIN-lock neutral-placeholder widget behaviour is
  untouched).
- Period detail: the top-bar action now opens the unified day screen on
  the episode's first day ("Open first day").
- log_day registration gains the categoryId/logId deep-link arguments.

Claude-Session: https://claude.ai/code/session_01PZJLynVBkgLtehJFXffnfg
Co-authored-by: Claude <noreply@anthropic.com>
Deleted, each matched to its proven replacement on the unified day screen:
- LogPeriodScreen.kt + LogPeriodViewModel.kt (day editing, episode dates,
  flow, symptoms, pinned categories, notes, remove-day, delete-period,
  disable-period-tracking, unsaved-changes guard all live on LogScreen;
  the save fan-out and widget/reminder refreshes go through the shared
  PeriodDaySync/PeriodRepository paths LogViewModel already uses).
- LogCategoryScreen.kt + LogCategoryViewModel.kt (per-type inputs render
  through MetricInput on LogScreen; per-entry notes, delete, previously
  recorded chips, track-against-time, timed-increment timeline all exist
  there; editing one specific log now goes through the logId deep link).
- PinnedCategoryInput and the two private DatePickerDialogWrapper copies
  died with those files (the wrapper lives on as the shared component).
- LogEntryTopBar.kt: both of its callers are gone.
- MainActivity: log_period and log_category registrations and imports
  removed; PeriodDaySync and ReminderPreferences comments updated.

PeriodDaySync, AddSymptomDialog, and every repository method the new
surfaces use are kept.

Claude-Session: https://claude.ai/code/session_01PZJLynVBkgLtehJFXffnfg
Co-authored-by: Claude <noreply@anthropic.com>
…o the edit flow

- AddCategoryDialog, EditAppearanceDialog, and RenameCategoryDialog
  (superseded by CategoryEditScreen since Phase 7, kept unreferenced under
  @Suppress("unused")) are deleted, along with the helpers only they used:
  CategoryColorPicker, CategoryIconGrid, and NumericSettingsSection.
- FullColorPickerDialog (+ its SaturationValuePanel/HueSlider internals)
  and the isFixedColorToken/isCustomColorToken helpers, still live for
  CategoryEditScreen's custom colour slot and the adopt-colour rules, move
  to their own CategoryColorPickerDialog.kt.
- ManageCategoryValuesScreen: the per-type settings sections that
  duplicated the edit flow (slider range/step labels/decimals/unit, free
  numeric unit, and the log-with-period / allow-multiple /
  track-against-time switches) are consolidated into the Edit action,
  which provably covers each of them. The screen keeps what only it does:
  the value catalog CRUD (add/rename/fix-history/delete with seeded-value
  protection), the built-in Flow chips/slider switch, the alarms section,
  and archive/delete. Info sections point at the Edit action.
- Dead ViewModel methods removed: ManageCategoriesViewModel.addCategory
  and .updateCategoryAppearance; ManageCategoryValuesViewModel
  .renameCategory, .updateAppearance, .updateNumericSettings, .updateUnit,
  .setShowInLogPeriod, .setAllowMultiple, .setTrackAgainstTime.
  Repository methods stay untouched.

Claude-Session: https://claude.ai/code/session_01PZJLynVBkgLtehJFXffnfg
Co-authored-by: Claude <noreply@anthropic.com>
- PLAN.md: status line updated, section 7 Phase 8 row recorded as Done
  (branch, DB 24 unchanged, owner parity sign-off 2026-08-28, full
  removal/relocation list, deviations).
- Subsystem maps 01/02: Phase 8 drift notes marking the removed files and
  the new log_day deep links; map 01's per-screen sections kept as the
  historical record.
- LESSONS.md: two transferable lessons (delegate-operator imports vs
  text-based import scrubbing; the supersede-and-annotate deletion
  staging pattern).
- Changelog fragment (minor bump).

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 28, 2026 02:17
@mapgie
mapgie merged commit 19648fa into main Aug 28, 2026
4 checks passed
@mapgie
mapgie deleted the claude/logging-redesign-phase-8 branch August 28, 2026 02:17
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