Session 41: Clearer state #221
Labels
No labels
accessibility
area:accounts
area:ai-evals
area:look
area:maps
area:platform
area:rides-progress
area:riding
area:today-plan-coach
area:ui-shell
bot:blocked
bot:failed
bot:pr
bot:waiting
bot:working
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
later
now
owner-check
parked
question
ready
session
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ckreidl/trainer#221
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
41 · Today and Plan say what state they're in
Phase: UI polish (owner request 2026-11-06) · Branch:
session/41-clearer-state· Depends on: 40The second half of the 2026-11-06 UI review, after session 40's readability fixes. Three places tell the rider something that's out of step with what has happened: the week summary mixes reference frames, pre-ride advice outlives the ride, and plan generation can't be left. Change copy and state only. The look stays as it is.
Read first
src/components/today/week-panel.tsx,src/components/plan/week-totals.ts(weekTotals), and whereverweekToDateandweekDayslivesrc/components/today/coach-card.tsx,src/components/today/rest-day.tsx,src/components/today/unplanned-ride.tsx,src/routes/_app/today.tsxsrc/server/on-session-logged.tsand how Today learns that a re-plan or ride feedback is pendingsrc/routes/_app/plan.tsx(theGenerationstate andgenerate()),src/server/plan.ts(generatePlanStream) and the Anthropic call under itclaude-apiskill before touchingsrc/ai/Goal
week-panel.tsxreads "105 of 0 planned so far · 0 of 3 sessions · 1:30 of 4:00". Split it so each figure has its own reference frame. Logged TSS is one figure. Planned TSS due through today is another, or "nothing scheduled through today" when it's zero. Planned sessions done is "N of M", and unplanned rides are named as such ("+ 1 unplanned ride"). Time is labelled week to date or whole week, but don't mix the two. The arithmetic belongs in a pure function with tests, besideweekTotalsorweekToDate. Keep it short enough for a phone, with two short lines rather than one long one. The section'sasidetotal may stay if it still agrees.coach-card.tsxlabels advice "If you ride anyway" or "How to ride it" from the planned/rest state alone, so after a ride is logged today it still reads as pre-ride advice. Gate that block on there being no ride logged today. Once a ride is logged, either show the advice the coach gave after it, or show a plain "Updating your advice" state while a re-plan or feedback for that ride is pending. Use only state Today already has (or can cheaply load). Don't add polling beyond what exists.generatePlanStreambehaves when the client stops reading. Then add a visible control whose label is honest about what it does. If abandoning the stream stops the server work (anAbortSignalthat reaches the Anthropic call), call it "Stop". If the server carries on and saves anyway, call it "Hide" and say so in one line ("The plan keeps generating and will appear here when it's done"). Prefer making "Stop" true if that is a small change. Either way, the current plan stays in force until a new one is saved, as now. Record which one it is indocs/decisions.md.Rules
authed, its validator and the ownership checks. A stopped run still writes itsAiCallrow (cost counts).AI_REPLAY=1.Tests
Out of scope
Session 40's items, dark tokens, and wider rewrites of Today's sections (the review noted rest-day choices recur in several places; note it under Follow-ups rather than restructure). Note anything else you find under Follow-ups.
Done when
All three items work on a production build (replay), and unit, typecheck, lint, format, audit and e2e pass. Replay has no recorded re-plan for the rest-day path, so add an owner check under Follow-ups → Now: after a real ride on a rest day, does Today read right once the re-plan lands? Finish with the end-of-session ritual in
CLAUDE.md.Moved from
prompts/41-clearer-state.mdon 2026-11-08.