oficina / calendar Public

Week all-day row, short chip titles, all-day edit dates (B8, B9) open

On branch fix/r1-allday-week-and-edit

B8 — week view (polish-audit/calendar.md, week.html:44-46)

  • The all-day strip lived inside each day's column, so that column's hour grid started ~42px lower and a 10:00 event drew beside the 11:00 label. The week grid is now row-by-row: headers, ONE all-day row (a cell per day, "All day" label; only drawn when the week has any all-day event), then the timed columns. Every column starts on the same line.
  • Short events: placed chips stack time over title; under an hour only one line fits and the title was the clipped line. PlacedChip.Short (< 1 hour of column) lays time and title on one line ([cal-placed~="short"]). Day view gets it too.

B9 — all-day edit (event_form.html:93-99)

  • Stored all-day values are bare dates; datetime-local refuses them, so Starts/Ends opened blank. All-day events now render field-date.
  • Scriptless floor: ticking/unticking All day cannot swap the input, so readEventForm (formTime) reads a datetime under All day as its date and a bare date without it as midnight. Before, ticking All day on a timed form always failed with "That is not a time we can read."

Tests — each FAILS on origin/main, passes here

  • internal/calendartest/allday_views_test.go (in make ci): 4 tests — all-day row precedes every timed column, 7 cells; 30-min chip marked short, 1h not (week + day); all-day edit form has type="date" with stored values; toggle round-trips.
  • TestWeekAndAllDayFormInARealBrowser + test/browser/week.mjs (make browser, Playwright): on main, column tops were 228/228/270/..., the 10:00 chip at 750 vs label line 708, the short chip's title painted 5px tall, and the edit form's input.value was "" with and without JS. Here all checks pass. Existing browser tests still pass.
  • make ci green.
LLM

Week all-day events no longer push that day's timed grid down an hour; short chips keep their title; editing an all-day event shows its dates.

Whole-branch review — fix/r1-allday-week-and-edit @ 55b6575 vs origin/main 5b9f0b6

Reviewed by Claude Fable 5.1 (claude-fable-5-1), session 21a32889, as the AGENTS.md whole-branch reviewer. One diff, scratch worktree, branch not edited.

VERDICT: APPROVE-WITH-NITS

What I checked and how

  • B8 fixed at the root. The week grid is now rows of one CSS grid (heads, one optional all-day row, then cal-hours + seven cal-column), so nothing above a column can offset it. cal-column-head left cal-hours, so the gutter no longer needs the head's height to line up. Day view keeps its own all-day strip ([cal-allday] unchanged) and only gains the short marker. Every chip still prints time and title, so the one-line layout does not lean on colour (AGENTS.md).
  • B9 fixed at the root. All-day events render field-date with the stored bare dates; timed events keep field-datetime. Scriptless floor holds: readEventForm → formTime accepts either shape.
  • Time-zone correctness of the parse change (handlers_event_form.go:119). No instant is ever formed: formTime only slices or appends a wall-clock STRING. Under All day, 2026-09-23T23:30 → 2026-09-23 is the date part of what was typed in the form's own zone (the person's, or the booked event's hidden tz), no UTC round trip, so it cannot land on the wrong day west of Greenwich; the validator then clears tz as the rule requires. Without All day, a bare date → T00:00 is midnight in that same tz, resolved by ToUTC like any typed midnight (the DST-gap rule in clock.go applies, as it would to a typed one). Timed events with a normal datetime pass through untouched (len == 16), and an all-day bare date passes through untouched — only the two mismatched shapes are rewritten; anything else still reaches the validator to be refused.
  • Tests exercise the fix — verified, not trusted. I copied allday_views_test.go onto clean origin/main: all four fail there (0 all-day cells; no short marker; type="datetime-local" on the all-day edit form; 422 on the toggle). I copied playwright_week_test.go + week.mjs onto clean main with node_modules symlinked from meet: it fails with exactly the audit's numbers (column tops 228/228/270…, 10:00 chip at 750 vs label line 708, 5px-tall title, input.value "" with and without JS). On the branch: make ci exit 0, no cached packages, the four new tests shown RUNning with -v; go test -tags browser -run InARealBrowser passes all three browser tests (booking, quick add, week) including the JS-off pass.
  • Regressions elsewhere. AnyAllDay is week-only; PlacedChip.Short is additive; formTime is used only by readEventForm, shared by create and update — both covered. No migrations.
  • Pre-existing flake TestTransientControlFailureAtBootRecovers reproduced on clean main (1 of 3 runs); unrelated to this branch.

Findings (none blocking)

  1. Medium nit — handlers_event_form.go:119, formTime under All day truncates the END down. The commonest toggle — open a 10:00–11:00 event, tick All day, save — submits …T10:00/…T11:00, both truncate to the same date, and the validator answers 422 "An all-day event ends on the following day." (I probed it: 422.) It was a 422 before too, so no regression, but the discussion says ticking All day "always failed" and now works — it works only for multi-day events. Worse, 7th 10:00 → 8th 17:00 becomes 7th → 8th exclusive, i.e. the event no longer covers the 8th (probed: stored end 2026-10-08). Suggested fix: for the END only, round UP to the next date when the time part is not 00:00 (ceil), so 10:00–11:00 becomes one day and 7th–8th 17:00 becomes two. AGENTS.md prefers refusing over silently correcting, so if you would rather not ceil, then the same-day case should at least be turned into a validation message that says what to do ("Set Ends to the following day").
  2. Nit — week.html. cal-column-head is position: sticky and now a direct grid child; the all-day row is not sticky, so on scroll it slides under the heads. Fine, and probably what you want, but the 48rem min-inline-size fallback should be looked at on a phone once, since the row now spans eight cells.
  3. Nit — viewdata.go:150. Short is a per-chip layout decision computed from HeightPct/100*(dayEnd-dayStart), which on a 23/25-hour DST day is right (it uses the real span, not 24h) — worth a two-word note in the comment so nobody "fixes" it to < 1h from the event's own duration.
  4. Housekeeping. node_modules (symlink) is untracked in my scratch tree; confirm it is not in the branch (it is not — git diff --name-only shows none) and that .gitignore covers it before anyone runs make browser in the shared checkout.