Repository navigation
test(smoke): capture the Board and Metrics views, not just routes - #628
Merged
Merged
Conversation
…that close Phase 3, final §12 items (#622). Closes #12 and #13 from #539 — all 18 done. ROOT CAUSE, SHARED BY BOTH. The stage-transition table lived inside a useCallback inside useApplicationStatusChange, so nothing outside that hook could ask "what is legal from here?". The board could not close illegal drop targets during a drag, and no alternative input could offer a list of legal moves. Hoisting it to module scope and exporting ALLOWED_TRANSITIONS, isValidStatusTransition and allowedTargetsFor is most of the fix. #12 THE BOARD WAS POINTER-ONLY. Keyboard: PointerSensor was the only sensor registered. dnd-kit ships a KeyboardSensor that gives Space to lift, arrows to move between droppables and Space to drop — so the fix is registering it, not building a parallel interaction. Mobile: a keyboard sensor does not help a phone. One stage renders at a time behind a Tabs control, so there is no second column on screen to drag a card to — cross-stage moves were impossible, not merely awkward. Each card now carries explicit move buttons for its legal targets, which works by touch, by keyboard and by mouse. They route through the same `changeStatus` the drag path uses, so the confirm modal for critical moves and the transition guard apply identically: a second INPUT, not a second code path. Targets are computed from the CARD's status, not the column's — `withdrawn` cards live in the rejected column and must not inherit its moves. #13 ILLEGAL DROPS FAILED SILENTLY AFTER THE DROP. A column accepted any card, then rejected the move and surfaced an error the user could not have predicted. Columns that cannot legally receive the dragged card now register as `disabled` droppables — the card will not land there — and dim to 0.35 with aria-disabled, so the constraint is visible during the drag rather than explained afterwards. Nothing dims at rest; a column is only closed while something is actually in the air. 12 tests on the table, including one invariant worth keeping: the candidate header's advance button and the board read from two different sources (NEXT_STAGE and ALLOWED_TRANSITIONS), and if they drift the header offers a button the guard silently refuses — which is exactly the class of bug §12 #1 was. The test asserts they agree for every stage. Verified: typecheck clean on scf-core and scaffald-app; lint clean; 12 new tests; /office/applications renders through the authenticated harness with no new console errors. NOT verified visually: the seeded org has zero applications, so the board has no cards and neither the move buttons nor the dimmed columns could be seen rendering. The behaviour is covered by tests, not by eye. Co-Authored-By: Claude Opus 5 <[email protected]>
The pipeline's Board and Metrics views are client state behind a segmented control, not routes, so a route-only sweep never saw either. The board in particular carries the keyboard/touch move controls and the closed drop targets added in #627 — the exact code that had no other way of being looked at, and which shipped verified by tests alone. The harness now clicks through to both and screenshots them. WHAT THIS IMMEDIATELY SETTLED. #627 shipped with "not verified visually: the seeded org has zero applications". That turned out to be wrong about the cause, in a way worth recording: - the database has 16 applications across all 8 statuses; Unicorn owns 12 - [email protected] holds an org-scoped `admin` assignment on Unicorn, and the access lookup resolves it correctly even under RLS - the endpoint still returned `{"data":[],"total":0}` for him while returning 12 for the org OWNER That is precisely the bug the comment in employer-applications.ts says was fixed — org admin sees 0, owner sees 12. It was not a live bug. The local edge runtime was serving the MAIN checkout, whose working tree is behind origin/main and predates that fix. Restarting `supa functions serve` from a current tree returned all 12 immediately. Worth knowing, because a stale edge runtime reproduces a fixed authz bug faithfully enough to be filed again. `grep` the served checkout before believing an API result that looks like a known issue. With real data the pipeline verifies end to end: days-in-stage leads every row (14d, 12d, 9d…), overdue reasons are per-stage ("no first response yet", "screening decision", "awaiting inquiry reply"), and every card offers exactly its legal targets — New → Screening/Closed, Screening → Inquired/Interview/ Closed, Inquired → Interview/Offer/Closed. Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay
added a commit
that referenced
this pull request
Aug 22, 2026
Follows #627/#628. Swaps the board's per-card move controls from one button per legal target to a single compact menu, matching the prototype. WHY. Three buttons under every card put thirty-six controls on a twelve-card board. Visible buttons are more discoverable and cost fewer interactions — that is a real trade, not a regression — but the board is the screen where density matters most, and the comp uses a menu for exactly that reason. WHAT HAD TO SURVIVE. §12 #12 was "the board is pointer-only". A menu that cannot be operated by keyboard would move that barrier rather than remove it, so the swap is only correct if the menu is genuinely operable. `@scaffald/ui`'s Dropdown was the obvious component and is deliberately NOT used: it has no key handling of any kind — no Escape, no arrow keys, no roles — so adopting it would have put the board back behind a nicer-looking trigger. MoveMenu is built on Popover instead, which already closes on Escape, with every item a real Pressable carrying `role="menuitem"` so it lands in the tab order and Enter/Space activates it. Worth fixing Dropdown eventually; not worth blocking this on. VERIFIED, NOT ASSUMED. The smoke harness now opens the first menu and counts what it finds, so this cannot quietly rot: 9 triggers, 2 menuitem(s) after opening ← New's legal targets exactly 0 menuitem(s) after Escape ← the keyboard contract holds A menu that rendered but did not open, or opened but would not close, now fails visibly in the harness output rather than in production. Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #627.
The pipeline's Board and Metrics views are client state behind a segmented control, not routes — so a route-only sweep never saw either. The board carries the keyboard/touch move controls and the closed drop targets from #627, i.e. the exact code that had no other way of being looked at and shipped verified by tests alone.
The harness now clicks through to both and screenshots them.
What this immediately settled
#627 shipped saying "not verified visually: the seeded org has zero applications". That was wrong about the cause, in a way worth recording:
[email protected]holds an org-scopedadminassignment on Unicorn, and the access lookup resolves it correctly even under RLS (verified directly){"data":[],"total":0}for him, while returning 12 for the org ownerThat is precisely the bug the comment in
employer-applications.tssays was fixed — "an org admin saw 0, the owner saw 12". I was one step from filing it again as a live authz regression.It was not live. The local edge runtime was serving the main checkout, whose working tree is behind
origin/mainand predates that fix. Restartingsupa functions servefrom a current tree returned all 12 immediately.Worth knowing generally: a stale edge runtime reproduces a fixed authz bug faithfully enough to be filed again. Grep the served checkout before believing an API result that matches a known issue.
The pipeline now verifies end to end
With real data:
One design divergence I want a second opinion on
The move controls render as one button per legal target — three buttons under most cards. That is more discoverable and fewer interactions than a menu, and it is why the keyboard path needs no menu semantics at all.
But the prototype uses a compact
Move ▾dropdown per row, and at 12 cards the button-per-target version is visibly busier than the comp. I have left it as buttons rather than silently diverging or silently degrading accessibility to match a picture — flagging it instead.🤖 Generated with Claude Code