Skip to content

Untangle the day log: focused logging, period switch, plain headers, start-date fix - #190

Merged
mapgie merged 3 commits into
mainfrom
claude/logging-ui-confusions-p5oa10
Sep 9, 2026
Merged

Untangle the day log: focused logging, period switch, plain headers, start-date fix#190
mapgie merged 3 commits into
mainfrom
claude/logging-ui-confusions-p5oa10

Conversation

@mapgie

@mapgie mapgie commented Sep 9, 2026

Copy link
Copy Markdown
Owner

What this fixes

Five confusions on the unified day screen, one of which turned out to be a data bug, plus the ways logs could not be deleted and the day sheet's display faults.

1. Speed dial / widget opened the whole day. Opening the screen for one category (speed dial, quick-log widget, or an entry from the day sheet) now shows only that category as the hero, with a "Log more for this day" button that expands to the full day. The focus follows a re-file and survives a day switch. Untouched categories are never saved, so the focused save writes only what was entered.

2. "Period started today" looked like a menu row but was a toggle. It is now a SwitchRow inside the card. It stays in place while the start is pending (switching it off is the undo), and its subtitle says what saving will do: start a new period, continue one, or move a period's start back to this day. Once the day is a stored period day the filled status row with End/Undo is unchanged.

3. The Day section duplicated the title. Removed. Tapping the screen title opens the date picker directly. The title's "Switch day or category" sheet is gone; its category "jump" only expanded a grouped row and had no other effect.

4. Metric headers looked collapsible but opened the re-file sheet. They are plain SectionHeaders now, consistent with Symptoms and the group cards. Re-filing lives in a "Move to another category" text button next to "Add note", shown once a value has been entered.

5. Logging a period day just before a period's start silently did nothing. The save called logPeriodDay(day), which moves the start back, then updateEpisode(start = loadedStart), which trimmed the day again. The save now passes the earlier of the loaded start and the day, and the switch moves the displayed start so the screen shows what the save will produce. A PeriodRepositoryTest case covers the sequence; LESSONS.md records the pattern.

6. Deleted entries came back. On a period day, every save fanned out to each "Log with period" category whether or not it was touched, writing a slider's minimum or a count of 0. Pinned categories now follow the same touched-only rule as every other entry.

7. Allow-multiple entries had no delete on the day screen. The day screen now lists the day's stored entries under the input, each with Edit (loads it into the input in place) and Delete. The header reads "N logged" when the input is empty but entries exist.

8. Flow could never be deleted. "Remove this day from period" now removes the day's flow entry with the day. Symptoms and tracked categories are kept, and the dialog copy says so.

9. The calendar day sheet could not delete anything, and its display was broken.

  • Every row now has a "delete" action with a confirmation dialog. A row with several entries of one category deletes them all; timed entries have a per-entry "delete". This is the one place every stored log is listed, so it covers Flow and Symptoms on any day, including a Flow log stranded on a day that is no longer a period day.
  • Flow and Symptoms sit inside the period box on a period day (flow first) instead of under "Tracked".
  • Rows used the category's raw colour token, so a category inheriting its group's colour rendered a neutral bubble with near-invisible value text ("No", "Yes"). The sheet now resolves the effective token through the groups (DayLogData carries them), and a category with no colour at all shows its value in the normal text colour.

Changes

  • LogScreen.kt: focus-mode branch, footer switch, plain headers, re-file button, RefileSheet replaces DaySwitchSheet, DaySection removed, stored-entries list for allow-multiple categories
  • LogViewModel.kt: focusedCategoryId, loadedEpisodeStart, dayLogs state; showFullDay(), start-moving startPeriodToday()/undoStartPeriod(), minOf start in save(), touched gate on the pinned fan-out, deleteDayLog()/editDayLog(), flow removal in removeDay()
  • DayLogSheet.kt, HomeViewModel.kt, HomeScreen.kt: per-row delete with confirmation, period grouping of system categories, group-aware colours
  • PeriodRepositoryTest.kt: regression test for the absorb-then-edit sequence
  • changelog/unreleased/logging-ui-confusions.json (minor), LESSONS.md, handover doc bullets

a11y_check.py passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ELZpYZSRB1DMaJiXvkcVSD

… plain headers

Five confusions on the unified day screen, plus the bug behind one of them:

- Opening the screen for one category (speed dial, widget, or a day-sheet
  entry) now shows only that category's input as the hero, with a
  "Log more for this day" button that expands to the whole day. The
  focus follows a re-file and survives a day switch.
- The "Period started today" footer was a chevron row that acted as a
  toggle. It is now a SwitchRow inside the card, staying in place while
  the start is pending so toggling it off is the undo. Its subtitle
  says what saving will do (start, continue, or move the start back).
- The Day section duplicated the title's date. It is removed; tapping
  the title opens the date picker directly, and the title sheet's
  category "jump" (which only expanded a grouped row) goes with it.
- Metric headers looked like collapsible headers but opened the re-file
  sheet. They are plain SectionHeaders now; re-filing lives in a
  "Move to another category" text button that appears once a value has
  been entered, since only unsaved values can be re-filed.
- Saving a period day just before an episode's start silently dropped
  it: logPeriodDay moved the start back, then updateEpisode was handed
  the start loaded before that and trimmed the new day away. The save
  now passes min(loaded start, day), and tapping the switch moves the
  displayed start (and day number) so the screen shows the boundary the
  save will produce. Regression test covers the sequence.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ELZpYZSRB1DMaJiXvkcVSD
On a period day, every save fanned out to each "Log with period"
category whether or not the user touched it, writing a slider's minimum
or a count of 0. That fabricated logs the user never entered, and made
"Delete entry" useless: the next "Save day" (or reopening the day and
saving) recreated the log with its default.

Pinned categories now follow the same rule as every other entry and save
only when touched. The pinned value rules (slider min fallback, count
including 0) still apply to a touched entry.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ELZpYZSRB1DMaJiXvkcVSD
Two more ways a log could not be deleted:

- Allow-multiple categories start a fresh entry on the day screen, so a
  saved entry had no delete button unless reached through the day
  sheet's "edit" deep link. The day screen now lists the day's stored
  entries under the input, each with Edit (loads it into the input in
  place) and Delete. Deleting a listed row leaves the input alone;
  deleting the row loaded in the input resets it. The header reads
  "N logged" when the input is empty but entries exist.
- "Remove this day from period" kept the day's flow log, which then had
  no surface left to edit or delete it from. It now removes the flow
  entry with the day; symptoms and tracked categories are still kept.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ELZpYZSRB1DMaJiXvkcVSD
@mapgie
mapgie marked this pull request as ready for review September 9, 2026 19:03
@mapgie
mapgie merged commit a411fba into main Sep 9, 2026
4 checks passed
@mapgie
mapgie deleted the claude/logging-ui-confusions-p5oa10 branch September 9, 2026 19:03
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