Front/back toggle renders the selected side as disabled #100
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM
The bugs
The active toggle renders as disabled.
ReviewWorkspacePage.tsx:453-468marks the currentside both
btn-primaryanddisabled, andstyles.css:224-227renders disabled at 45% opacitywith a not-allowed cursor. So the selected option looks broken. Disabled and selected are
different states and must not share a presentation.
A dead button when there is no back scan. When
has_backis false, a lone permanentlydisabled "Front" button remains as pure noise.
Scope
aria-pressedand rendered solid, notdisabled.
label.
For contrast, the decision buttons get this right — the green/red/ghost split correctly satisfies
docs/circa-ui-spec.md§7.2 ("approving should not feel identical to skipping"). This toggle isthe one place the state model went wrong.
Done when
aria-pressedReferences
frontend/src/pages/ReviewWorkspacePage.tsx:453-468frontend/src/styles.css:224-227Done in
97d5cdc, with #98 and #99. CI run #60 green.Done when:
aria-pressedThe issue's diagnosis was exactly right and needed no correction: the current side was marked both
btn-primaryanddisabled, and disabled renders at 45% opacity withnot-allowed, so the selected option looked broken. Selected and disabled are different states and no longer share a presentation — the active segment is solid andaria-pressed="true", and never disabled.A photograph with no back scan now shows a muted "Front only" label instead of one permanently dead button.
Keyboard operability came free: #102 had already made these real
<button>elements as part of its sweep, so there was nothing to fix here.One existing test had to change, and it is worth naming because it was asserting the bug.
the front and back toggle > starts on the frontdidexpect(getByRole("button", {name: "Front"})).toBeDisabled()— the old behaviour, written down and pinned. It now assertsaria-pressed="true"instead. A second test was renamed from "offers no Back button" to "offers no toggle at all", because it was understating what it now holds: neither button is present, and the "Front only" label is.The e2e reviewer journey needed a comment corrected for the same reason — it explained that the toggle was "inert because there is nowhere to go", which is no longer true, since there is now no toggle at all. No assertion changed.