Skip to content

fix(portal): NIETE WhatsApp number, mobile nav tray, dropdown overflow (bd-2465/2466/2467) - #87

Merged
hatafatif merged 1 commit into
mainfrom
bd-2465-portal-ui-fixes
Aug 1, 2026
Merged

fix(portal): NIETE WhatsApp number, mobile nav tray, dropdown overflow (bd-2465/2466/2467)#87
hatafatif merged 1 commit into
mainfrom
bd-2465-portal-ui-fixes

Conversation

@hatafatif

Copy link
Copy Markdown
Collaborator

Three of the six reported portal issues. #4 (portal reimplements the bot's level logic) and #6 (Beacon House capstone) are deliberately not here — both deferred to a keyboard session.


bd-2465 — every WhatsApp CTA opened Rumi, not NIETE

https://wa.me/message/WCYNS4DTDB2MD1 was hardcoded in 11 places across 9 files.

A wa.me/message/… short-link resolves to whoever owns the code, so the URL contains no phone number to read — which is exactly why the wrong bot survived at all eleven call sites. Nothing in the source looked wrong.

Now one constant, portal/src/lib/whatsapp.ts, holding NIETE's 923206281951 in the direct wa.me/<number> form that states plainly which bot it opens.

bd-2466 — the mobile bottom bar cropped

It rendered every nav item plus Logout in one flex row — seven cells for teachers, roughly 52px each on a 360px screen.

The four you named (Dashboard, Curriculum, Training, Coaching) stay in the bar; My Plans, Analytics and Logout move into a bottom Sheet behind More.

Two details worth knowing:

  • The More cell shows active styling when the current route lives inside the tray, so it never hides where you are.
  • Leader nav has no matching titles, so rather than emptying the bar it falls through to first-four-plus-tray. There's a test pinning that, because a rename of any nav title would otherwise blank the mobile bar.

bd-2467 — dropdowns cropped on mobile

Two faults in one file, and they explain both symptoms you described separately.

Text spilling out of the control (your #5) — SelectTrigger had [&>span]:line-clamp-1, but the span is a flex child, and flex children default to min-width: auto. It refused to shrink below its content width, so the clamp never engaged. Added min-w-0 (plus flex-1, and shrink-0 on the chevron so it isn't squashed once the value can shrink).

Options cropped at the screen edge (your #3) — SelectContent set a min-width from the trigger but no max-width, so a single long option widened the panel past the viewport. Capped to calc(100vw-2rem), and option rows now wrap rather than forcing the panel wider — a clipped chapter title is usually unreadable, a two-line row is not.

Both fixes live in the shared primitive, so this is platform-wide. A test asserts no page hand-rolls its own SelectPrimitive.Trigger and escapes it.


Verification, and its limits

tests/portal/portal-ui-contracts.test.js — 14 tests. Full suite 144 failed / 1989 passed vs a fresh main baseline of 144 failed / 1975 passed; zero new failures.

Read this before trusting the green tick. These tests assert on file contents, not rendering — there is no TSX transform in this runner and no browser in my environment. They pin the exact tokens a future edit would silently drop, which is genuinely useful for regression. They cannot tell you it looks right on a phone.

So the three things needing your eye:

  1. The More tray — does the bottom sheet feel right, and are those the four you want?
  2. Wrapped dropdown rows — long chapter titles now go to two lines. Check that reads better than truncation to you.
  3. Trigger truncation — the selected value now ellipsises instead of spilling.

I also couldn't typecheck (no TypeScript installed here), so a build error would surface at deploy rather than in CI.

Closes: bd-2465, bd-2466, bd-2467

🤖 Generated with Claude Code

Three reported portal issues. #4 (portal reimplements the bot's level
logic) and #6 (Beacon House capstone) are deliberately NOT here — both
deferred to a keyboard session.

bd-2465 — every WhatsApp CTA opened Rumi, not NIETE.
`https://wa.me/message/WCYNS4DTDB2MD1` was hardcoded in 11 places across
9 files. A wa.me short-link resolves to whoever owns the code, so the
URL contains no number to read — which is exactly why the wrong bot went
unnoticed at every one of those call sites. Now one constant in
lib/whatsapp.ts holding NIETE's 923206281951, in the direct
`wa.me/<number>` form that says plainly which bot it opens.

bd-2466 — the mobile bottom bar cropped.
It rendered every nav item plus Logout in one flex row: seven cells for
teachers, ~52px each on a 360px screen. Now the four the operator named
(Dashboard, Curriculum, Training, Coaching) stay in the bar and the rest
— My Plans, Analytics, Logout — move into a bottom Sheet behind "More".
The More cell shows active styling when the current route lives inside
it, so the tray never hides where you are. Leader nav has no matching
titles, so it falls through to first-four-plus-tray rather than emptying
the bar; there's a test for that.

bd-2467 — dropdowns cropped on mobile. Two faults, one file, and they
explain both reported symptoms:
  * Text spilling OUT of the control: SelectTrigger had
    `[&>span]:line-clamp-1`, but the span is a flex child and flex
    children default to min-width:auto — so it refused to shrink below
    its content and the clamp never engaged. Added min-w-0 (plus flex-1
    and shrink-0 on the chevron).
  * Options cropped at the screen edge: SelectContent set a min-width
    from the trigger but no max-width, so one long option widened the
    panel past the viewport. Capped to calc(100vw-2rem), and option rows
    now wrap instead of forcing the panel wider — a clipped chapter
    title is usually unreadable, a two-line row is not.
Both live in the shared primitive, so the fix is platform-wide; a test
asserts no page hand-rolls its own SelectPrimitive trigger and escapes
it.

Tests: tests/portal/portal-ui-contracts.test.js (14). These assert on
file contents, not rendering — there is no TSX transform in this runner
and no browser here. They pin the exact tokens a future edit would
silently drop. They CANNOT tell you it looks right on a phone: the tray
layout and the wrapped dropdown rows need a human eye.

Full suite matches the main baseline: 144 failed both sides, +14 passed,
no new failing suites.

Closes: bd-2465
Closes: bd-2466
Closes: bd-2467
@hatafatif
hatafatif merged commit 1d3a56b into main Aug 1, 2026
1 check passed
@hatafatif
hatafatif deleted the bd-2465-portal-ui-fixes branch August 1, 2026 17:12
hatafatif added a commit that referenced this pull request Aug 1, 2026
build(portal): rebuild SPA dist — #87 merged but never shipped (the manual dist process is broken)
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