Skip to content

fix(CookieConsent): the banner sat on top of the phone tab bar - #20

Merged
thinkclay merged 1 commit into
mainfrom
fix/cookie-banner-clears-mobile-nav
Aug 23, 2026
Merged

thinkclay merged 1 commit into
mainfrom
fix/cookie-banner-clears-mobile-nav

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

The consent banner is position: absolute, bottom: spacing[16], zIndex: 1000. The mobile tab bar is absolutely positioned at the bottom too and sits lower in the stack — so on a phone the banner landed squarely on the app's primary navigation. Home / Jobs / Community were behind it and untappable until somebody dismissed the banner.

BottomBarProvider already publishes the bar's height for exactly this purpose (page-level BottomBars offset above the pill with it). The banner just never read it. Now it does.

navBarHeight is 0 on desktop, and 0 when no provider is mounted, so this is a no-op everywhere the bar is absent.

The reported height moves to an effect

reportBannerHeight feeds callers' bottom offsets (welcome-screen uses it to keep the banner off the primary CTA), so it has to describe the space the card occupies measured from the bottom of the screen — which now includes the bar beneath it.

Left inside onLayout it would only recompute when the card itself re-laid-out, going stale the moment a nav bar appeared or changed height. It reads from state in an effect keyed on both inputs instead. reportBannerHeight is a useCallback([], []) with an equality guard, so this cannot loop.

Verification

This one needs a companion change in the app repo to take effect, and that is the interesting part.

BottomBarProvider was mounted twice, both below the root: in DrawerLayout and in the protected layout. The tab bar registered its height into the innermost copy, while the banner — which renders at the app root inside CookieConsentProvider — read the empty default and got 0. So this fix alone is inert. Scaffald/SaaS hoists the provider to the app root and drops both nested copies.

With both in place, verified on a 390×844 viewport against a real authenticated session by scripts/audit/smoke-mobile-nav.mjs, which hit-tests every tab with elementFromPoint:

✓ 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

The detector was itself checked against a deliberately-placed banner-shaped overlay, so it is known to be able to fail:

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

Worth noting why hit-testing: a geometry scan for "absolutely-positioned element with a background overlapping the bar" was tried first and reported all-clear. The banner's absolute wrapper is transparent and its opaque card is statically positioned, so that check matched neither element. It would have passed over the live bug.

How it surfaced

Found while adding the employer tab set — the bar renders in employer mode now, so the collision showed up on the ATS screens. It was never employer-specific: worker mode had it too, in every screenshot taken this week, unnoticed each time.

🤖 Generated with Claude Code

The banner is position:absolute, bottom: spacing[16], zIndex 1000. The
mobile tab bar is absolutely positioned at the bottom too and sits lower
in the stack, so on a phone the consent card covered the app's primary
navigation until somebody dismissed it — Home/Jobs/Community were behind
it, unreachable.

BottomBarProvider already publishes the bar's height for exactly this
(page-level BottomBars offset above the pill with it); the banner simply
never read it. It does now. navBarHeight is 0 on desktop and 0 when no
provider is mounted, so this is a no-op everywhere the bar is absent.

The reported banner height moves to an effect at the same time. It feeds
callers' bottom offsets (welcome-screen), so it has to describe the space
the card occupies measured from the bottom of the screen — which now
includes the bar beneath it. Left in onLayout it would only recompute when
the card itself re-laid-out, going stale the moment a nav bar appeared or
changed height.

Found while adding the employer tab set: the bar renders in employer mode
now, so the collision showed up on the ATS screens. It was never specific
to employer mode — worker mode had it too, in every screenshot, unnoticed.

Co-Authored-By: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay merged commit b7cf07a into main Aug 23, 2026
@thinkclay
thinkclay deleted the fix/cookie-banner-clears-mobile-nav branch August 23, 2026 10:29
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Aug 23, 2026
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