Skip to content

fix(desktop): stop a read-only choice card promising a pick - #1623

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Nov 15, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

What this does

A reply can hold more than one futureos-choice fence, and only the last card stays interactive; the earlier ones are read-only. Those read-only cards still printed the answering subtitle ("Pick one and it lands in the input") over rows that answer nothing, and only a screen-reader-only span hinted that they were stale. This branch makes a read-only card say so, removes the now-unused choice.stale string, and corrects the design doc, which claimed a sent card keeps its chosen row highlighted (it does not — the answer is the tag on the user message).

  • Desktop: a card without an answer surface prints choice.hint.readonly instead of the answering hint (the model's own hint is replaced too, since it also describes picking); the card carries aria-disabled and aria-describedby; a read-only row drops tabindex instead of holding -1.
  • Mobile: the same read-only subtitle switch.
  • Docs: section 2 no longer promises a post-send highlight, section 3 gains the read-only subtitle rule, and choice.stale is removed from the copy table.

Commits

  • fix(desktop): stop a read-only choice card promising a pick

Verification

  • desktop: npx tsc --noEmit clean; npx eslint on the three changed TS/TSX files clean; npx vitest run on ChoiceCard.test.tsx and MarkdownContent.test.tsx 26 passed, and on i18n.test.ts / localeKeys.test.ts 9 passed.
  • mobile: npx tsc --noEmit clean; npx eslint on the changed files clean; full npx jest 171 suites / 3239 tests passed.
  • make check-docs: 421 docs checked OK, 0 pairs pending, provider matrix 13 rows.
  • No remaining reference to choice.stale in desktop, mobile or packages.
  • Run under Node 22.22.3 with ulimit -n 8192. The shared node_modules was repaired from the committed lock with npm ci before testing (it was broken independently of this branch); package-lock.json is unchanged.

User-visible changes

  • A read-only choice card (an earlier question in a reply that holds two or more cards) now says "An earlier question — this card can no longer be picked" instead of the answering hint, on both desktop and mobile, in both locales; its rows are aria-disabled and out of the tab order. Before: the inert card advertised a pick. Revert efd0ce564.
  • The screen-reader-only "This card is no longer active" span is gone; the visible subtitle replaces it.
  • No setting, default value, migration or wire change.

A reply may hold two `futureos-choice` fences, and only the last one is
interactive — but the earlier card still printed "Pick one and it lands in the
input" over rows that answered nothing, and only a `sr-only` span hinting it
was stale told a screen-reader user apart. A button that looks pressable and
isn't is the defect; the criterion that produced it is deterministic (the
parsed card count), so it is fixed in the render layer rather than by asking
the model to behave.

- a card without an answer surface prints `choice.hint.readonly` instead of the
  answering hint, and so replaces the model's own `hint` (it describes picking
  too); the same sentence is what `aria-describedby` reads
- the group says `aria-disabled`, and a read-only row drops `tabindex` rather
  than holding `-1`, which is out of the tab order but still takes focus from
  script
- remove `choice.stale`: its only use was the sr-only span this replaces

Docs: §2 said a sent card keeps a highlighted row. It does not — the answer is
the tag on the user message, and backfilling the card would mean reading the
message after it, a cross-entry timing dependency for a decorative effect. §2
now describes the behaviour, says why it is not built, and §3 gained the
read-only subtitle rule next to the tolerance table.

Tests assert text, `aria-disabled` and focus — never colour: a two-card body
must leave the first card unbrowsable and unfocusable, and reverting either the
criterion or the mobile subtitle turns them red.
@huichen
huichen enabled auto-merge (squash) November 15, 2026 18:18
@huichen
huichen merged commit dae8f35 into main Nov 15, 2026
12 checks passed
@huichen
huichen deleted the pr/huichen branch November 15, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant