Untangle the day log: focused logging, period switch, plain headers, start-date fix - #190
Merged
Merged
Conversation
… 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
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 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
SwitchRowinside 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, thenupdateEpisode(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. APeriodRepositoryTestcase covers the sequence;LESSONS.mdrecords 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.
DayLogDatacarries 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,RefileSheetreplacesDaySwitchSheet,DaySectionremoved, stored-entries list for allow-multiple categoriesLogViewModel.kt:focusedCategoryId,loadedEpisodeStart,dayLogsstate;showFullDay(), start-movingstartPeriodToday()/undoStartPeriod(),minOfstart insave(), touched gate on the pinned fan-out,deleteDayLog()/editDayLog(), flow removal inremoveDay()DayLogSheet.kt,HomeViewModel.kt,HomeScreen.kt: per-row delete with confirmation, period grouping of system categories, group-aware coloursPeriodRepositoryTest.kt: regression test for the absorb-then-edit sequencechangelog/unreleased/logging-ui-confusions.json(minor),LESSONS.md, handover doc bulletsa11y_check.pypasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01ELZpYZSRB1DMaJiXvkcVSD