Skip to content

feat(ats): keyboard and touch moves on the board, and drop targets that close - #627

Merged
thinkclay merged 1 commit into
mainfrom
redesign/ats-board-a11y
Aug 22, 2026
Merged

thinkclay merged 1 commit into
mainfrom
redesign/ats-board-a11y

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

The last two §12 items from #539. All 18 now closed.

One root cause, two bugs

The stage-transition table lived inside a useCallback inside
useApplicationStatusChange, so nothing outside that hook could ask "what is
legal from here?"

That single piece of encapsulation is why the board could not close illegal
drop targets during a drag, and why no alternative input could offer a list
of legal moves. Hoisting it to module scope and exporting
ALLOWED_TRANSITIONS / isValidStatusTransition / allowedTargetsFor is most
of the fix for both.

#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 nothing for 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 work by touch,
keyboard and mouse alike.

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 rather than 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 the move was rejected and an error surfaced
that the user could not have predicted from anything on screen.

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.

One invariant worth keeping

The candidate-detail header and the board read legality from two different
sources — NEXT_STAGE and ALLOWED_TRANSITIONS. If they drift, the header
offers an advance button that the guard silently refuses, which is exactly the
class of bug §12 #1 was. There is a test asserting they agree for every stage.

12 tests total on the table.

Verification, and what it does not cover

Typecheck clean across scf-core and scaffald-app; lint clean;
/office/applications renders through the authenticated harness with no new
console errors; pnpm prepush green.

Not verified visually: the seeded org has zero applications, so the board
has no cards — neither the move buttons nor the dimmed columns could be seen
rendering. The behaviour is covered by tests, not by eye. Seeding a few
applications would close that gap and is worth doing before this ships to prod.

CI still cannot gate this (#375).

🤖 Generated with Claude Code

…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]>
@thinkclay
thinkclay merged commit b421a37 into main Aug 22, 2026
4 of 6 checks passed
@thinkclay
thinkclay deleted the redesign/ats-board-a11y branch August 22, 2026 00:32
thinkclay added a commit that referenced this pull request Aug 22, 2026
* feat(ats): a keyboard and touch path for the board, and drop targets 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]>

* test(smoke): capture the Board and Metrics views, not just routes

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]>

---------

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]>
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