From 20eefdf13070d9f641e1c9a5963d431980e211ec Mon Sep 17 00:00:00 2001
From: Claude
Date: Sun, 11 Oct 2026 14:10:12 +0000
Subject: [PATCH 1/2] fix(ui): calendar, header and phone accessibility fixes
- Quiet calendar days (a filter is on, nothing of that kind) kept their
buttons but faded to about 2:1; they now use the soft ink at full
opacity.
- "Planning to cancel" was only a strikethrough; the day's label and the
list view say it in words (ADR-042).
- The sticky day panel slid under the sticky header; it now sticks below
it (--header-h) and scrolls inside itself.
- At 360px the three sums overlapped and the balance label ran off the
screen; sums stack as rows and the label flips past the middle.
- A "Skip to content" link is the first Tab stop.
- Links without a class take the surrounding text colour instead of the
browser's default blue.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_01BPCHu3hWdkxC3xHAxPegqx
---
docs/HANDOFF.md | 46 +++++++++++++++
src/app/(app)/layout.tsx | 11 +++-
src/app/globals.css | 65 ++++++++++++++++++---
src/features/cashflow/ui/agenda.tsx | 3 +
src/features/cashflow/ui/balance-line.tsx | 4 +-
src/features/cashflow/ui/month-grid.test.ts | 62 ++++++++++++++++++++
src/features/cashflow/ui/month-grid.tsx | 15 +++--
tests/e2e/calendar.spec.ts | 48 +++++++++++++++
tests/e2e/skip-link.spec.ts | 23 ++++++++
9 files changed, 262 insertions(+), 15 deletions(-)
create mode 100644 src/features/cashflow/ui/month-grid.test.ts
create mode 100644 tests/e2e/skip-link.spec.ts
diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md
index 96e889e..1d6bdc0 100644
--- a/docs/HANDOFF.md
+++ b/docs/HANDOFF.md
@@ -4381,3 +4381,49 @@ rows", transactions 2 "show more" in steps of 20, plus a view-only list.
### Open problems
- iOS Safari ignores `background-attachment: fixed`, so there the grid
scrolls with the page and may not line up exactly with the header.
+
+## HO-121: Accessibility fixes from the UI audit: calendar, header, phones
+
+- **Date:** 2026-10-11 (UTC)
+- **Author:** Muhammad Tahub Khatri with Claude Code
+- **Branch / PR:** `fix/ui-a11y` / PR linked from the branch
+
+### What changed
+- **Quiet days:** with a filter on, days with nothing of that kind faded
+ to opacity 0.35, which dropped their numbers to about 2:1 on buttons
+ that still work. They now keep full opacity with `--ink-soft` and a
+ lighter weight (7:1 or better).
+- **Planning to cancel:** a subscription the person plans to cancel was
+ only a strikethrough. The day cell's label (`describeDay`, now exported
+ from `month-grid.tsx`) and the list view both say "planning to cancel"
+ (ADR-042: every visual state has words).
+- **Day panel:** it stuck at `top: 1rem`, under the sticky header. New
+ `--header-h` token (7rem): the panel sticks below the header, is never
+ taller than the window and scrolls inside itself. `scroll-padding-top`
+ uses the same token.
+- **Phones:** the three sums sat in three 100px columns and a five-digit
+ balance overlapped the next one at 360px; at 40rem and below each sum is
+ a row. The balance line's label opens to the left past the middle (was
+ 70%), so it no longer runs off a narrow screen.
+- **Skip link:** "Skip to content" is the first Tab stop on every
+ signed-in page and jumps past the header's dozen controls.
+- **Links:** links without a class took the browser's default blue (fails
+ contrast on the dark ground). They now take the text colour around them.
+- Tests: `month-grid.test.ts` (Vitest) for `describeDay`;
+ `calendar.spec.ts` checks quiet days, the cancel label, 360px and the
+ panel under the header; `skip-link.spec.ts` for the skip link.
+
+### Verified
+- `pnpm lint`, `typecheck`, `format:check`, `docs:check` and `build`
+ pass. `pnpm test:unit`: everything passes except the Neon storage tests,
+ which need `storage-tests` credentials this container does not have
+ (TEST-05).
+- Playwright was not run (Muhammad runs it).
+
+### What's next
+- The day panel's × still removes an entry at once; confirmations are in
+ `fix/ui-confirmations`.
+
+### Open problems
+- `--header-h` is an estimate of the header's height, not measured. If the
+ header grows (a third row), raise it.
diff --git a/src/app/(app)/layout.tsx b/src/app/(app)/layout.tsx
index 1975666..7381e69 100644
--- a/src/app/(app)/layout.tsx
+++ b/src/app/(app)/layout.tsx
@@ -48,6 +48,9 @@ async function SignedIn({ children }: { children: ReactNode }) {
export default function AppLayout({ children }: { children: ReactNode }) {
return (
<>
+
+ Skip to content
+
{/* Two rows on the landing page's night band: the wordmark, Capital
One sync and the account above; the page tabs below. */}
@@ -74,9 +77,11 @@ export default function AppLayout({ children }: { children: ReactNode }) {
- Loading…
}>
- {children}
-
+
+ Loading…}>
+ {children}
+
+
>
);
}
diff --git a/src/app/globals.css b/src/app/globals.css
index 1f2eb44..3446908 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -38,6 +38,10 @@
/* Figures that should line up like a statement. */
--font-num: var(--font-mono), ui-monospace, Menlo, monospace;
+ /* About the height of the sticky signed-in header (src/app/(app)/
+ layout.tsx), so nothing sticky or scrolled-to hides under it. */
+ --header-h: 7rem;
+
/* "Sample" label (ADR-024) and Insights' slight comparison tints
(ADR-056). Tints sit behind ink text: the words carry the meaning. */
--sample-bg: #fbefd9;
@@ -132,12 +136,38 @@ html {
font-size: clamp(16px, 11px + 0.42vw, 20px);
/* Room for the sticky header (src/app/(app)/layout.tsx), so a focused or
linked-to element is never hidden underneath it. */
- scroll-padding-top: 8rem;
+ scroll-padding-top: calc(var(--header-h) + 1rem);
}
/* The grid is fixed to the window, like the sticky header's and the
dashboard hero's, so its lines run on unbroken from the header into the
page while it scrolls. */
+/* Links without a class of their own take the colour of the text around
+ them, never the browser's default blue (which fails contrast on the dark
+ ground). */
+a {
+ color: inherit;
+ text-underline-offset: 0.15em;
+}
+
+/* "Skip to content": the first stop for the keyboard, shown only when
+ focused (src/app/(app)/layout.tsx). */
+.skip-link {
+ position: absolute;
+ top: -10rem;
+ left: 1rem;
+ z-index: 20;
+ padding: 0.5rem 1rem;
+ border-radius: 8px;
+ background: var(--head-ink);
+ color: var(--head-bg);
+ font-weight: 600;
+}
+
+.skip-link:focus {
+ top: 1rem;
+}
+
body {
background-color: var(--bg);
background-image:
@@ -684,9 +714,11 @@ button.cell:hover,
}
}
-/* A day with nothing of the chosen kind steps back */
-.cell[data-quiet] > * {
- opacity: 0.35;
+/* A day with nothing of the chosen kind steps back: softer, lighter
+ number, still readable (fading it with opacity fell to about 2:1). */
+.cell[data-quiet]:not([data-today]) .cell-day {
+ color: var(--ink-soft);
+ font-weight: 400;
}
.cell {
@@ -741,7 +773,11 @@ button.cell:hover,
.panel {
position: sticky;
- top: 1rem;
+ /* Below the sticky header, and never taller than the window. */
+ top: calc(var(--header-h) + 1rem);
+ max-height: calc(100dvh - var(--header-h) - 2rem);
+ overflow-y: auto;
+ overscroll-behavior: contain;
padding: 1.25rem;
border: 1px solid var(--line);
border-radius: 10px;
@@ -1186,16 +1222,31 @@ footer {
.panel {
position: static;
+ max-height: none;
+ overflow: visible;
}
}
/* Phones: cells show marks and bars; names live in the day panel */
@media (max-width: 40rem) {
+ /* One sum per row, label left and figure right: three columns were
+ too narrow for a five-digit balance at 360px. */
.sums {
display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 0.75rem;
+ grid-template-columns: minmax(0, 1fr);
+ gap: 0.5rem;
+ }
+
+ .sums > div:not(.sums-op) {
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: 1rem;
+ }
+
+ .sums dt {
+ max-width: none;
}
.sums-op {
diff --git a/src/features/cashflow/ui/agenda.tsx b/src/features/cashflow/ui/agenda.tsx
index 9c073b9..e84d37c 100644
--- a/src/features/cashflow/ui/agenda.tsx
+++ b/src/features/cashflow/ui/agenda.tsx
@@ -64,6 +64,9 @@ export function Agenda({
{item.unconfirmed && (
· not confirmed
)}
+ {item.recurringId && cancelPlans.has(item.recurringId) && (
+ · planning to cancel
+ )}
70
+ // Past the middle, the label opens to the left so it never
+ // runs off a narrow screen.
+ x(selectedIndex) > 50
? "line-label line-label-left"
: "line-label"
}
diff --git a/src/features/cashflow/ui/month-grid.test.ts b/src/features/cashflow/ui/month-grid.test.ts
new file mode 100644
index 0000000..8089411
--- /dev/null
+++ b/src/features/cashflow/ui/month-grid.test.ts
@@ -0,0 +1,62 @@
+import { describe, expect, it } from "vitest";
+import { cents } from "@/lib/money";
+import type { DayView, Item } from "../domain/cashflow";
+import { describeDay } from "./month-grid";
+
+function item(overrides: Partial = {}): Item {
+ return {
+ id: "item-1",
+ date: "2026-02-10",
+ name: "StreamFlix",
+ amount: cents(-1599),
+ kind: "subscription",
+ category: "Subscriptions",
+ planned: false,
+ recurringId: "rec-1",
+ ...overrides,
+ };
+}
+
+function day(items: Item[]): DayView {
+ return {
+ date: "2026-02-10",
+ day: 10,
+ isToday: false,
+ isFuture: false,
+ items,
+ moneyIn: cents(0),
+ moneyOut: cents(1599),
+ everydaySpent: cents(0),
+ endBalance: cents(120000),
+ noSpend: false,
+ };
+}
+
+describe("describeDay", () => {
+ it("says in words that a subscription is planned to be cancelled", () => {
+ const label = describeDay(day([item()]), new Set(["rec-1"]));
+
+ expect(label).toContain("StreamFlix");
+ expect(label).toContain("planning to cancel");
+ });
+
+ it("says nothing about cancelling when no plan matches the item", () => {
+ expect(describeDay(day([item()]), new Set(["rec-2"]))).not.toContain(
+ "cancel",
+ );
+ expect(
+ describeDay(day([item({ recurringId: undefined })]), new Set(["rec-1"])),
+ ).not.toContain("cancel");
+ });
+
+ it("keeps the other states and the balance", () => {
+ const label = describeDay(
+ day([item({ onCard: true, unconfirmed: true })]),
+ new Set(),
+ );
+
+ expect(label).toContain("on card");
+ expect(label).toContain("planned, not confirmed");
+ expect(label).toMatch(/balance \$1,200\.00$/);
+ });
+});
diff --git a/src/features/cashflow/ui/month-grid.tsx b/src/features/cashflow/ui/month-grid.tsx
index 3f1b2fa..ca57e98 100644
--- a/src/features/cashflow/ui/month-grid.tsx
+++ b/src/features/cashflow/ui/month-grid.tsx
@@ -42,13 +42,20 @@ const KEY_STEPS: Record = {
ArrowDown: 7,
};
-function describe(day: DayView) {
+/**
+ * What a day cell says to a screen reader. Every visual state has words
+ * here (ADR-042): on card, planned and not confirmed, planning to cancel
+ * (the cell shows that one only as a strikethrough).
+ */
+export function describeDay(day: DayView, cancelPlans: ReadonlySet) {
const parts = [formatLong(day.date)];
if (day.isToday) parts.push("today");
- for (const item of day.items)
+ for (const item of day.items) {
+ const cancelling = !!item.recurringId && cancelPlans.has(item.recurringId);
parts.push(
- `${item.name} ${formatSigned(item.amount)}${item.onCard ? " on card" : ""}${item.unconfirmed ? " planned, not confirmed" : ""}`,
+ `${item.name} ${formatSigned(item.amount)}${item.onCard ? " on card" : ""}${item.unconfirmed ? " planned, not confirmed" : ""}${cancelling ? " planning to cancel" : ""}`,
);
+ }
if (day.noSpend) parts.push("no-spend day");
parts.push(
`${day.isFuture ? "expected balance" : "balance"} ${formatCents(day.endBalance)}`,
@@ -85,7 +92,7 @@ function Cell({