Merge branch 'main' into fix/handover-p1-batch

This commit is contained in:
Marc-André Bombeck authored and GitHub committed 2026-08-07 18:24:33 +02:00
commit 384992bb15
34 files changed
+1305 -383

No files matched your search

@@ -267,11 +267,15 @@ describe("<CoachInput>", () => {
expect(controls?.[0]).not.toMatch(/\bjustify-between\b/);
expect(controls?.[0]).toMatch(/\bshrink-0\b/);
// And the row itself is a row at every width, bottom-aligned so the send
// button stays beside the last line as the textarea grows.
// And the row itself is a row at every width. The textarea is centred in
// it — bottom-aligning a one-line textarea against a 44 px tap target left
// the placeholder sitting visibly low in the pill — while the controls
// keep their own bottom alignment, so the send button stays beside the
// LAST line as the textarea grows rather than drifting to the middle.
const shell = html.match(/<div[^>]*class="[^"]*\bflex-row\b[^"]*"[^>]*>/);
expect(shell?.[0]).toMatch(/\bitems-end\b/);
expect(shell?.[0]).toMatch(/\bitems-center\b/);
expect(shell?.[0]).not.toMatch(/\bflex-col\b/);
expect(controls?.[0]).toMatch(/\bself-end\b/);
});
it("sizes the hub actions trigger to the 44px tap-target floor on phones", () => {
@@ -427,9 +427,15 @@ export function CoachInput({
// hold: focus follows DOM order, and the DOM order (textarea,
// actions, Send) is identical in both layouts. Nothing jumps.
//
// `items-end` keeps the controls beside the LAST line as the textarea
// grows, so the send button stays where the thumb left it.
"flex flex-row items-end gap-1.5 p-1.5",
// `items-center` with the controls pinned `self-end` below. The row
// used to be `items-end` throughout, which bottom-aligned an empty
// one-line textarea against a 44 px touch target: the placeholder sat
// roughly 6 px low in the pill, reading as if the text had slipped.
// Centring the textarea fixes the empty and single-line cases, and
// `self-end` on the controls preserves the reason `items-end` was
// there — as the textarea grows, the send button stays beside the
// LAST line rather than drifting to the middle.
"flex flex-row items-center gap-1.5 p-1.5",
)}
>
<textarea
@@ -455,7 +461,7 @@ export function CoachInput({
/>
<div
data-slot="coach-input-controls"
className="order-2 flex shrink-0 items-center gap-1.5"
className="order-2 flex shrink-0 items-center gap-1.5 self-end"
>
<div
data-slot="coach-input-leading"
@@ -97,8 +97,16 @@ export function LabsChangesCard({
{labelKey ? ` · ${t(labelKey)}` : ""}
</p>
</div>
{/* The delta is CONTENT — the number the row exists to report —
so it takes the analyte's tier, not the meta tier of the
line under it (UI-STANDARDS §3). At `text-xs` muted it wore
the sub-line's typography and optically attached itself to
that lower line, which is what made a row centred to the
pixel read as bottom-aligned. `self-center` states the row's
alignment on the cell itself so it survives a future change
to the row's own `items-*`. */}
<p
className="text-muted-foreground shrink-0 text-xs tabular-nums"
className="text-foreground shrink-0 self-center text-sm tabular-nums"
data-slot="labs-change-delta"
>
{signedDelta}
+12 -19
View File
@@ -122,27 +122,20 @@ export function LayoutCoachFab() {
},
});
// v1.22 (M4) — surface a due/surfaced Coach reminder on the FAB. Additive:
// the dot also lights when the daily sweep has flipped a "remind me" reminder
// to due, independent of the nudge seen-stamp (resolving the reminder in the
// ledger clears it). Same cheap, gated, stale-while-revalidate read shape.
const { data: dueReminders } = useQuery({
queryKey: queryKeys.coachReminders("due,surfaced"),
queryFn: async () => {
const data = await apiGet<{ reminders?: unknown[] } | undefined>(
"/api/coach/reminders?status=due,surfaced",
);
return data?.reminders ?? [];
},
enabled: coachAvailable && !onCoachPage,
staleTime: 5 * 60 * 1000,
});
const hasDueReminders = (dueReminders?.length ?? 0) > 0;
const nudgedAt = status?.nudgedAt ?? null;
// ONE source for the dot: an assistant message the user has not opened yet.
//
// v1.22 added a second arm — a separate "any due reminder?" query — and that
// is the arm that produced a badge over an empty Coach. The sweep flipped a
// reminder to `due` without writing anything into a conversation, so the dot
// promised a message that did not exist; opening the Coach showed the empty
// state and did not clear the dot either, because only resolving the reminder
// in Settings could. The sweep now writes the reminder into the thread as a
// real assistant message (`coach-reminder-sweep.ts`), which the nudge status
// already reports — so the reminder still lights the dot, through the message
// it actually wrote, and opening the Coach clears it like any other.
const unread = isNudgeUnread(status, seenStamp);
// The visual dot lights for either an unread nudge OR a due reminder.
const showDot = unread || hasDueReminders;
const showDot = unread;
// The unread dot is visual-only (`aria-hidden`) and the swapped
// `aria-label` is not announced on mutation — a screen-reader user