UX gap sweep: dead buttons, wrong action inputs, non-live views #107

Closed
opened 2026-10-14 03:33:15 +00:00 by kayg · 2 comments
Owner

kayg wants a sweep for UX gaps like the sign-out bug (#20, PR #104): the Devices "Sign out" button sent {id} while the action expects {installation}, so it never worked, and no test caught it.

Scope:

  1. Contract check (systematic): every action the web app calls (name + input shape) must match the server's registered action and its input schema. Make it a test that fails CI on any mismatch. Generated types or a schema dump checked in CI both work.
  2. Walk every flow by hand in a real browser against a real server with a migrated Home (693-note shape), on desktop 1440 and phone 390, Chromium and WebKit: sign-in → today → journal → open/edit/rename note → links/backlinks → make note/move → history/restore → palette → settings (each control) → devices → sign out. For each control check:
    • it does what it says;
    • it shows progress, errors and empty states in plain words;
    • it updates live on a second device (ADR 0012);
    • keyboard and focus work;
    • nothing is a dead end.
  3. Post a catalogue on this issue: gap → where → severity → fix. Fix small ones in one PR with tests. File big ones as their own issues.
kayg wants a sweep for UX gaps like the sign-out bug (#20, PR #104): the Devices "Sign out" button sent `{id}` while the action expects `{installation}`, so it never worked, and no test caught it. Scope: 1. **Contract check (systematic):** every action the web app calls (name + input shape) must match the server's registered action and its input schema. Make it a test that fails CI on any mismatch. Generated types or a schema dump checked in CI both work. 2. **Walk every flow by hand** in a real browser against a real server with a migrated Home (693-note shape), on desktop 1440 and phone 390, Chromium and WebKit: sign-in → today → journal → open/edit/rename note → links/backlinks → make note/move → history/restore → palette → settings (each control) → devices → sign out. For each control check: - it does what it says; - it shows progress, errors and empty states in plain words; - it updates live on a second device (ADR 0012); - keyboard and focus work; - nothing is a dead end. 3. Post a catalogue on this issue: gap → where → severity → fix. Fix small ones in one PR with tests. File big ones as their own issues.
Author
Owner

UX gap sweep: catalogue

How it was found: a v0-shaped Home (665 days + 28 notes from the 10k fixture, named the way v0 named them) moved in with calternal migrate-v0 (693 notes), a real server with no dev user, signed in with Playwright virtual passkeys in Chromium (each device its own Installation), WebKit borrowing a session cookie. Two devices at once (1440 desktop + 390 phone) for every flow, with every API failure, page error and console error logged. Plus a read of every control in apps/web/src.

1. Contract check (the #20 class of bug)

Every action's input type on the server now produces a JSON Schema (schemars), collected in contracts/actions.json. A Rust test fails CI when the file drifts from the server. The web app turns the file into types (apps/web/scripts/action-types.mjs → src/lib/actions.gen.ts, re-checked in bun run check), so action(name, input) refuses an unknown action, a missing or misspelled field, or a wrong type at typecheck time. src/lib/api.typetest.ts proves it bites, with the #20 bug itself (account.revoke with {id}) as the first case.

Run against today's dev (with Trash, passkeys and prefs-offline merged): no mismatches left (#20's was fixed in #104). Two side effects:

  • action() adds an idempotency key whenever the contract says an action changes things, so a forgotten {mutates: true} can't break a call any more.
  • The notes.* inputs now refuse unknown fields (most others already did), so a misspelled optional field fails loudly from the CLI and agents too.

2. Gaps

Severity order: broken / data-risky → dead end → not live → polish. "Fixed" = in the PR for this issue.

# Gap Where Severity Fix
1 A device signed out from Devices kept its live socket: it stayed on the note and kept saving edits into notes it had open; nothing told it it was signed out. crates/server/src/live.rs, web session broken, data/security Fixed. The socket ends with unauthorized when its Installation is revoked or signs out; the app (on that, or on any 401 from an action) shows sign-in with "This device was signed out. Sign in to keep going." Rust test + e2e.
2 Every note switch threw state_unsafe_mutation (the bar's "editing" flag changed during the editor's teardown), which could leave the bar thinking you're still editing. lib/ui.svelte.ts broken Fixed (deferred to a microtask).
3 No contract between the web's action calls and the server's inputs. everywhere broken (class) Fixed, see 1 above.
4 A session that runs out (not revoked) still keeps its open socket. live socket broken, small Filed #138.
5 Versions can't be opened or restored; no server action for it. The flow stops at a list. Info → Versions dead end Filed #137 (server + mockup).
6 Settings → Writing → Show markdown switch did nothing (local state only). Settings.svelte dead end Fixed: a real preference (ui.source), every device; the bar/palette still flip one note. e2e in flow.spec.
7 Settings → Appearance → Photos from Unsplash switch does nothing. Settings.svelte dead end → #102 (backgrounds). Not touched.
8 Style sheet: Shuffle / Unsplash / Upload are "Coming soon". Inspector.svelte dead end (labelled) → #102.
9 Devices → "This device" was an empty section in a plain browser tab. AppCard.svelte dead end Fixed: "Up to date in this browser."
10 Insert → "Link to note" is a disabled tile that says "Type [[ or @"; it could just open the picker. InsertSheet.svelte polish Not fixed.
11 Devices list failing to load said "Only this browser." (untrue). Settings → Devices errors Fixed: "Couldn't load your devices. Try again".
12 Devices → Sign out had no progress and swallowed errors (unhandled rejection). Settings → Devices errors Fixed: "Signing out…", and a toast with Try again.
13 Pin / Unpin that failed flipped back silently. notes.svelte.ts errors Fixed: "Couldn't pin the note." with Try again.
14 Versions failing to load said "Not saved yet" / "No changes saved yet". Info sheet errors Fixed: "Couldn't load the versions. Try again".
15 Mentions failing to load just hide the section; palette search failing is silent. Info sheet, palette errors, polish Not fixed (quiet by design; worth a word later).
16 A new sign-in didn't show in a Devices list open elsewhere (only sign-outs were journaled). auth not live Fixed: account.installation-added on sign-in. Rust test + e2e.
17 Checked live across two devices: typing, H1 rename (file follows), pin from the other device, make note, move to note, sign-out, revoke, prefs. live All live after 16.
18 Palette named search hits by file name ("2026-09-03") while the list says "Thursday, 3 September"; it never told search what was opened (search.visit unused). Palette.svelte polish Fixed both.
19 Versions said "kayg (a device)". versions.ts polish Fixed: "(this device)" / "(another device)".
20 Devices: this browser was somewhere in the middle. Settings → Devices polish Fixed: this browser first, then most recent.
21 Devices: every row is "Chrome on Linux" with a phone icon; no way to tell two apart (no sign-in date, no kind icon). Every row's button is just "Sign out" for screen readers. Settings → Devices polish Not fixed.
22 The Today chip broke over two lines ("Toda / y") at 390. editor.css polish Fixed (white-space: nowrap).
23 Jobs (make note, move, rename) stamp last edited: in UTC (+00:00) while typing uses the device offset. notes jobs polish Not fixed (jobs get no tz; small server change).
24 Every cold start logs a 401 console error from the sign-in probe (GET /api/v1/actions). After signing out from Settings the open Devices view asks once more and gets a 401. auth.svelte.ts, Settings polish (noise) Not fixed.
25 migrate-v0: a file named 2026-10-13.md (not v0's 20261013-dailynote.md) becomes a titled note "2026 10 13", not a day. crates/migrate-v0 polish (v0 never named days so) Not fixed.
26 WebKit (Playwright, Linux, software GL): the Info sheet on a phone renders see-through and unreadable; Chromium is fine. Info sheet, 390 needs checking on a real iPhone → design / #105 owner.

Routed to the owners (not touched here)

  • #102 backgrounds: 7, 8.
  • #90 Trash, #99 passkeys, #100 prefs offline, #101 tag rename: merged while this ran; their calls pass the contract check. #6 uses #100's prefs code (ui.source is one more key in PREF_KEYS).
  • #105 / design: 26.

Not checked deeply

Keyboard: only the palette (⌘K, typing, Escape) was driven by keys here; the shortcut table is covered by #39's tests. No full keyboard-only or screen-reader pass was done; that's worth its own sweep.

Screenshots (this branch, real server, the 693-note Home)

Devices: this browser first, "Up to date in this browser" instead of an empty section. 390 / 900 / 1440, light and dark.

Chromium: 42-devices-chromium-390-light.png 42-devices-chromium-900-light.png 42-devices-chromium-1440-light.png 42-devices-chromium-390-dark.png 42-devices-chromium-900-dark.png 42-devices-chromium-1440-dark.png

WebKit: 42-devices-webkit-390-light.png 42-devices-webkit-900-light.png 42-devices-webkit-1440-light.png 42-devices-webkit-390-dark.png 42-devices-webkit-900-dark.png 42-devices-webkit-1440-dark.png

Gap 1, fixed: device A signs device B out from Devices (left); B, mid-note on a phone, stops at once and says why (right). Before, B stayed on the note and its typing kept reaching the file (typed after being signed out was in 2026-10-14.md).

34-revoked-1440.png 36-b-types-after-revoke.png

Versions name the device; Today chip on one line (390): Chromium 41-info-chromium-390-light.png WebKit 41-info-webkit-390-light.png (gap 26: WebKit draws the sheet see-through here)

40-today-webkit-390-light.png 40-today-chromium-390-dark.png

Palette: search hits named like the list ("Sunday, 24 May", not 2026-05-24). 44-palette-chromium-1440-light.png

## UX gap sweep: catalogue How it was found: a v0-shaped Home (665 days + 28 notes from the 10k fixture, named the way v0 named them) moved in with `calternal migrate-v0` (693 notes), a real server with no dev user, signed in with Playwright virtual passkeys in Chromium (each device its own Installation), WebKit borrowing a session cookie. Two devices at once (1440 desktop + 390 phone) for every flow, with every API failure, page error and console error logged. Plus a read of every control in `apps/web/src`. ### 1. Contract check (the #20 class of bug) Every action's input type on the server now produces a JSON Schema (`schemars`), collected in **`contracts/actions.json`**. A Rust test fails CI when the file drifts from the server. The web app turns the file into types (`apps/web/scripts/action-types.mjs` → `src/lib/actions.gen.ts`, re-checked in `bun run check`), so `action(name, input)` refuses an unknown action, a missing or misspelled field, or a wrong type at typecheck time. `src/lib/api.typetest.ts` proves it bites, with the #20 bug itself (`account.revoke` with `{id}`) as the first case. Run against today's dev (with Trash, passkeys and prefs-offline merged): **no mismatches left** (#20's was fixed in #104). Two side effects: - `action()` adds an idempotency key whenever the contract says an action changes things, so a forgotten `{mutates: true}` can't break a call any more. - The `notes.*` inputs now refuse unknown fields (most others already did), so a misspelled optional field fails loudly from the CLI and agents too. ### 2. Gaps Severity order: **broken / data-risky → dead end → not live → polish.** "Fixed" = in the PR for this issue. | # | Gap | Where | Severity | Fix | |---|---|---|---|---| | 1 | A device signed out from Devices kept its live socket: it stayed on the note and **kept saving edits** into notes it had open; nothing told it it was signed out. | `crates/server/src/live.rs`, web session | broken, data/security | **Fixed.** The socket ends with `unauthorized` when its Installation is revoked or signs out; the app (on that, or on any 401 from an action) shows sign-in with "This device was signed out. Sign in to keep going." Rust test + e2e. | | 2 | Every note switch threw `state_unsafe_mutation` (the bar's "editing" flag changed during the editor's teardown), which could leave the bar thinking you're still editing. | `lib/ui.svelte.ts` | broken | **Fixed** (deferred to a microtask). | | 3 | No contract between the web's action calls and the server's inputs. | everywhere | broken (class) | **Fixed**, see 1 above. | | 4 | A session that runs out (not revoked) still keeps its open socket. | live socket | broken, small | Filed **#138**. | | 5 | Versions can't be opened or restored; no server action for it. The flow stops at a list. | Info → Versions | dead end | Filed **#137** (server + mockup). | | 6 | Settings → Writing → **Show markdown** switch did nothing (local state only). | `Settings.svelte` | dead end | **Fixed:** a real preference (`ui.source`), every device; the bar/palette still flip one note. e2e in flow.spec. | | 7 | Settings → Appearance → **Photos from Unsplash** switch does nothing. | `Settings.svelte` | dead end | → **#102** (backgrounds). Not touched. | | 8 | Style sheet: Shuffle / Unsplash / Upload are "Coming soon". | `Inspector.svelte` | dead end (labelled) | → **#102**. | | 9 | Devices → "This device" was an **empty section** in a plain browser tab. | `AppCard.svelte` | dead end | **Fixed:** "Up to date in this browser." | | 10 | Insert → "Link to note" is a disabled tile that says "Type [[ or @"; it could just open the picker. | `InsertSheet.svelte` | polish | Not fixed. | | 11 | Devices list failing to load said **"Only this browser."** (untrue). | Settings → Devices | errors | **Fixed:** "Couldn't load your devices. Try again". | | 12 | Devices → Sign out had no progress and swallowed errors (unhandled rejection). | Settings → Devices | errors | **Fixed:** "Signing out…", and a toast with Try again. | | 13 | Pin / Unpin that failed flipped back silently. | `notes.svelte.ts` | errors | **Fixed:** "Couldn't pin the note." with Try again. | | 14 | Versions failing to load said "Not saved yet" / "No changes saved yet". | Info sheet | errors | **Fixed:** "Couldn't load the versions. Try again". | | 15 | Mentions failing to load just hide the section; palette search failing is silent. | Info sheet, palette | errors, polish | Not fixed (quiet by design; worth a word later). | | 16 | A **new sign-in** didn't show in a Devices list open elsewhere (only sign-outs were journaled). | auth | not live | **Fixed:** `account.installation-added` on sign-in. Rust test + e2e. | | 17 | Checked live across two devices: typing, H1 rename (file follows), pin from the other device, make note, move to note, sign-out, revoke, prefs. | | live | All live after 16. | | 18 | Palette named search hits by file name ("2026-09-03") while the list says "Thursday, 3 September"; it never told search what was opened (`search.visit` unused). | `Palette.svelte` | polish | **Fixed** both. | | 19 | Versions said "kayg (a device)". | `versions.ts` | polish | **Fixed:** "(this device)" / "(another device)". | | 20 | Devices: this browser was somewhere in the middle. | Settings → Devices | polish | **Fixed:** this browser first, then most recent. | | 21 | Devices: every row is "Chrome on Linux" with a phone icon; no way to tell two apart (no sign-in date, no kind icon). Every row's button is just "Sign out" for screen readers. | Settings → Devices | polish | Not fixed. | | 22 | The **Today** chip broke over two lines ("Toda / y") at 390. | `editor.css` | polish | **Fixed** (`white-space: nowrap`). | | 23 | Jobs (make note, move, rename) stamp `last edited:` in UTC (`+00:00`) while typing uses the device offset. | notes jobs | polish | Not fixed (jobs get no `tz`; small server change). | | 24 | Every cold start logs a 401 console error from the sign-in probe (`GET /api/v1/actions`). After signing out from Settings the open Devices view asks once more and gets a 401. | `auth.svelte.ts`, Settings | polish (noise) | Not fixed. | | 25 | `migrate-v0`: a file named `2026-10-13.md` (not v0's `20261013-dailynote.md`) becomes a titled note "2026 10 13", not a day. | `crates/migrate-v0` | polish (v0 never named days so) | Not fixed. | | 26 | WebKit (Playwright, Linux, software GL): the Info sheet on a phone renders see-through and unreadable; Chromium is fine. | Info sheet, 390 | needs checking on a real iPhone | → design / #105 owner. | ### Routed to the owners (not touched here) - **#102 backgrounds:** 7, 8. - **#90 Trash, #99 passkeys, #100 prefs offline, #101 tag rename:** merged while this ran; their calls pass the contract check. #6 uses #100's prefs code (`ui.source` is one more key in `PREF_KEYS`). - **#105 / design:** 26. ### Not checked deeply Keyboard: only the palette (⌘K, typing, Escape) was driven by keys here; the shortcut table is covered by #39's tests. No full keyboard-only or screen-reader pass was done; that's worth its own sweep. ### Screenshots (this branch, real server, the 693-note Home) **Devices**: this browser first, "Up to date in this browser" instead of an empty section. 390 / 900 / 1440, light and dark. Chromium: ![42-devices-chromium-390-light.png](https://git.kayg.org/attachments/a7a4df26-6a34-4856-85f0-f8d84c8f7607) ![42-devices-chromium-900-light.png](https://git.kayg.org/attachments/ff1580bd-92ea-4f06-bc14-3c4409ac4014) ![42-devices-chromium-1440-light.png](https://git.kayg.org/attachments/fabcf739-9114-4bc4-830f-e93d48720c74) ![42-devices-chromium-390-dark.png](https://git.kayg.org/attachments/50b23a98-1634-4e0c-ae62-25b777c2eab1) ![42-devices-chromium-900-dark.png](https://git.kayg.org/attachments/777d50e6-fd60-456f-9cab-e0003c8f87a5) ![42-devices-chromium-1440-dark.png](https://git.kayg.org/attachments/f806978e-cd27-4968-ab70-d7dc2bc8fdb3) WebKit: ![42-devices-webkit-390-light.png](https://git.kayg.org/attachments/72471f14-393e-4e15-acf9-212b54027215) ![42-devices-webkit-900-light.png](https://git.kayg.org/attachments/0b5d8707-1cdf-472f-960d-adfe9a09e480) ![42-devices-webkit-1440-light.png](https://git.kayg.org/attachments/81d9a174-4cdb-48bf-9eae-7dd5c68a7c03) ![42-devices-webkit-390-dark.png](https://git.kayg.org/attachments/424d26a0-c5c5-416e-baf0-707ed3ecb087) ![42-devices-webkit-900-dark.png](https://git.kayg.org/attachments/980d1733-8ee5-46ae-bbba-ac08516ea4d5) ![42-devices-webkit-1440-dark.png](https://git.kayg.org/attachments/51266f30-93cd-4005-8d72-2a509ff65870) **Gap 1, fixed:** device A signs device B out from Devices (left); B, mid-note on a phone, stops at once and says why (right). Before, B stayed on the note and its typing kept reaching the file (`typed after being signed out` was in `2026-10-14.md`). ![34-revoked-1440.png](https://git.kayg.org/attachments/7977d868-67aa-477a-8677-d6681117b9bb) ![36-b-types-after-revoke.png](https://git.kayg.org/attachments/49d1640c-8677-4286-b6fd-5481b651c312) **Versions name the device; Today chip on one line (390):** Chromium ![41-info-chromium-390-light.png](https://git.kayg.org/attachments/621435c9-f9b6-459e-943f-1d10890e7e62) WebKit ![41-info-webkit-390-light.png](https://git.kayg.org/attachments/8be8c5c7-4b0f-4e8c-9811-96b708cd96a4) (gap 26: WebKit draws the sheet see-through here) ![40-today-webkit-390-light.png](https://git.kayg.org/attachments/779ce506-0091-4c11-8ed4-2145556f3872) ![40-today-chromium-390-dark.png](https://git.kayg.org/attachments/99ceeb0d-b33c-4f37-833a-18e2834f37ac) **Palette:** search hits named like the list ("Sunday, 24 May", not `2026-05-24`). ![44-palette-chromium-1440-light.png](https://git.kayg.org/attachments/74b306b5-f551-4c98-a7f5-6defca390da6)
Author
Owner

Perf and verification for PR #157

What changed on hot paths

  • Live socket: one string compare per journal entry (account.installation-revoked for this Installation?). Nothing else per entry.
  • Sign-in: account.installation-added is written in a background task, so the sign-in answer doesn't wait on it. (PR #152's CI showed that writing it inline was enough to expire an 80 ms test session.)
  • action(): one Set lookup (MUTATES) per call.
  • Web bundle: 783,266 → 785,351 bytes of JS (+2.1 KB: the MUTATES list, the error/retry states, the sign-out handling). Types cost nothing at runtime.

Keystroke to paint (editor.spec.ts @perf, chromium-1440, 200-paragraph note; dev and this branch run alternately on the same server binary, 3 rounds each; each value is one finished test, default or source mode):

p50 ms p95 ms
dev 1971, 1795, 1152, 4445 3672, 3443, 2992, 7605
branch 1604, 622, 586, 1046, 501 4129, 2684, 1840, 2993, 2651

The shared machine's load average was 70 to 95 the whole time, so these are 10 to 100 times over the 50 ms budget for both sides and only show that the branch isn't worse. Nothing here touches the typing path. This needs a rerun on the quiet perf VM before it counts as a gate result.

Sign-in to today ready, 693-note Home (walk-through, same load): 2.5 to 8.6 s, all from load. Same code path as dev, apart from the background journal write.

Verified

  • cargo clippy --workspace --all-targets, cargo test --workspace (all green locally; CI rust green on #157).
  • bun run check, including the contract typetest.
  • Browser tests: flow.spec (new parts: revoke-to-sign-in, live sign-in, Show markdown) passes locally and in CI. The other failures in CI for #157 (WebKit editor/links/trash, layout shift at cpu×6) are the same ones failing on the other open PRs right now (#153, #154 and others) and pass locally when rerun with 1 to 2 workers. #147 is working on that.
## Perf and verification for PR #157 **What changed on hot paths** - Live socket: one string compare per journal entry (`account.installation-revoked` for this Installation?). Nothing else per entry. - Sign-in: `account.installation-added` is written in a background task, so the sign-in answer doesn't wait on it. (PR #152's CI showed that writing it inline was enough to expire an 80 ms test session.) - `action()`: one `Set` lookup (`MUTATES`) per call. - Web bundle: 783,266 → 785,351 bytes of JS (+2.1 KB: the `MUTATES` list, the error/retry states, the sign-out handling). Types cost nothing at runtime. **Keystroke to paint** (`editor.spec.ts @perf`, chromium-1440, 200-paragraph note; dev and this branch run alternately on the same server binary, 3 rounds each; each value is one finished test, default or source mode): | | p50 ms | p95 ms | |---|---|---| | dev | 1971, 1795, 1152, 4445 | 3672, 3443, 2992, 7605 | | branch | 1604, 622, 586, 1046, 501 | 4129, 2684, 1840, 2993, 2651 | The shared machine's load average was 70 to 95 the whole time, so these are 10 to 100 times over the 50 ms budget for **both** sides and only show that the branch isn't worse. Nothing here touches the typing path. This needs a rerun on the quiet perf VM before it counts as a gate result. **Sign-in to today ready, 693-note Home** (walk-through, same load): 2.5 to 8.6 s, all from load. Same code path as dev, apart from the background journal write. **Verified** - `cargo clippy --workspace --all-targets`, `cargo test --workspace` (all green locally; CI rust green on #157). - `bun run check`, including the contract typetest. - Browser tests: flow.spec (new parts: revoke-to-sign-in, live sign-in, Show markdown) passes locally and in CI. The other failures in CI for #157 (WebKit editor/links/trash, layout shift at cpu×6) are the same ones failing on the other open PRs right now (#153, #154 and others) and pass locally when rerun with 1 to 2 workers. #147 is working on that.
kayg closed this issue 2026-10-14 08:13:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#107
No description provided.