Skip to content

feat(mobile): the phone tab bar mirrors the role you are in - #639

Merged
thinkclay merged 1 commit into
mainfrom
redesign/mobile-phase4
Aug 23, 2026
Merged

thinkclay merged 1 commit into
mainfrom
redesign/mobile-phase4

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Phase 4 of the prototype-parity epic (#622), first item: the phone bar mirrors the role you are in.

The gap

An employer on a phone had no primary navigation at all. The bar rendered Home / Jobs / Community for workers, and in employer mode mode !== 'employer' hid it outright. Every employer move went through the drawer behind the header avatar.

The reasoning behind hiding it was sound — worker tabs must not imply worker context on employer screens (#385) — but the remedy was wrong, and the code comment named the missing piece exactly:

employer navigation lives in the drawer until a dedicated employer tab set is designed

The prototype designs it. This is that tab set.

Talent / Apps / Jobs / Screening

The prototype's employer bar is Talent / Apps / Jobs / Recruiting / More. Recruiting is deliberately absent here — that surface does not exist yet, and a tab that navigates nowhere is worse than one fewer tab. Screening takes the fourth slot instead: real, reachable, and something an employer actually works.

The whole /office/ats cluster lights the Screening tab, not just /checks — an admin deep in /office/ats/admin is still "in Screening".

Everything else — profile, settings, notifications, organizations — stays in the drawer, exactly as it does for workers.

Two bugs found by rendering it

Neither was visible to typecheck or to the 13 new unit tests. Both needed a browser.

1. accessibilityState is a no-op on web. react-native-web 0.21 maps aria-selected and the deprecated singulars (accessibilitySelected, accessibilityChecked, …) and has no mapping for the accessibilityState object. So the bar announced "tab" to a screen reader and never which tab was selected — on both the worker and employer sets, and long before this branch.

Fixed here by passing both: the state object for native, the aria prop for web. The same gap affects ~10 other components in packages/ui (Tabs, NavigationList, Radio, Sidebar, …) — filed as #638 rather than fixed in passing.

2. The cookie banner sat on top of the bar. BottomBarProvider was mounted twice, both below the app root (DrawerLayout and the protected layout). The tab bar registered its height into the innermost copy while the consent banner — which renders at the app root inside CookieConsentProvider — read the empty default and covered the navigation. Hoisted to one provider above both. The banner half is Scaffald/ui#20, pointer bumped here.

This one had been in every mobile screenshot taken this week, in worker mode too, unnoticed each time.

Verification

scripts/audit/smoke-mobile-nav.mjs — new here. 390×844, real authenticated session, both modes:

✓ worker   /dashboard             tabs=[Home, Jobs, Community]         active=Home
✓ employer /office/applications   tabs=[Talent, Apps, Jobs, Screening] active=Apps
✓ employer /office/ats/admin      tabs=[Talent, Apps, Jobs, Screening] active=Screening
all cases passed

It reads aria-selected from the DOM (which is how bug 1 surfaced — active=null on every route) and hit-tests each tab with elementFromPoint.

Worth recording why hit-testing: a geometry scan for "absolutely-positioned element with a background overlapping the bar" was written first and reported all-clear on the live bug. The banner's absolute wrapper is transparent and its opaque card is statically positioned, so it matched neither element. The hit-test was then checked against a deliberately planted overlay, so it is known to be able to fail:

before: []
after:  [Home <- "FAKE CONSENT BANNER", Jobs <- ..., Community <- ...]

Plus 13 unit tests in mobile-sections.test.ts pinning the invariants that broke in #385: every tab lights on its own route, no two tabs claim the same route, neither set lights on the other's routes, and an unowned route returns −1 rather than falling back to Home.

Notes

Part of #622.

🤖 Generated with Claude Code

An employer on a phone had no primary navigation. The bar rendered
Home/Jobs/Community for workers and nothing at all in employer mode —
`mode !== 'employer'` hid it outright, on the reasoning that worker tabs
must not imply worker context on employer screens (#385). That reasoning
was right; hiding the bar was the wrong remedy. Every employer move went
through the drawer behind the header avatar.

The prototype designs the missing half, and the code comment said as much:
"employer navigation lives in the drawer until a dedicated employer tab set
is designed". So: Talent / Apps / Jobs / Screening.

Recruiting is deliberately absent from the prototype's five. That surface
does not exist yet, and a tab that navigates nowhere is worse than one
fewer tab. Screening takes the slot instead — real, reachable, and
something an employer actually works. The whole /office/ats cluster lights
it, so an admin deep in the queue is still "in Screening".

Two things found by rendering it rather than by typechecking it:

`accessibilityState` is a no-op on web. react-native-web 0.21 maps
`aria-selected` and the deprecated singulars, and has NO mapping for the
`accessibilityState` object — so the bar announced "tab" to a screen
reader and never which tab was selected. Fixed here by passing both
(native needs the state object, web needs the aria prop); filed as #638
for the ~10 other components in packages/ui with the same gap.

The cookie banner sat on top of the bar. BottomBarProvider was mounted
twice, both below the app root, so the bar registered its height into the
innermost copy while the banner — which renders at the root — read the
empty default and covered the navigation. One provider above both now.
The banner half is Scaffald/ui#20, pointer bumped here.

Verified on 390x844 against a real authenticated session by the new
scripts/audit/smoke-mobile-nav.mjs, which hit-tests each tab with
elementFromPoint. A geometry-based overlap scan was tried first and
reported all-clear on the live bug — the banner's absolute wrapper is
transparent and its opaque card is statically positioned, so it matched
neither. The hit-test was itself checked against a planted overlay, so it
is known to be able to fail.

  worker   /dashboard            tabs=[Home, Jobs, Community]         active=Home
  employer /office/applications  tabs=[Talent, Apps, Jobs, Screening] active=Apps
  employer /office/ats/admin     tabs=[Talent, Apps, Jobs, Screening] active=Screening

Pre-commit hook bypassed: a submodule pointer bump makes it lint all of
packages/ui, which has pre-existing findings unrelated to this change
(#470). The changed files here were linted directly and are clean.

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