Repository navigation
π dashboard: profile menu does not open on mobile navbar - #12193
Conversation
Two independent defects made the account menu unreachable on phones: - The trigger was a bare <img data-action="toggleGHUserMenu"> handled by the delegated document click listener. WebKit/iOS Safari only synthesises a click from a tap on interactive elements, so the <img> got touch/pointer events but never a click and toggleGHUserMenu() never ran. The avatar now sits inside a real <button> with aria-haspopup / aria-expanded (kept in sync on every open/close path), which also makes the menu keyboard-reachable. - Under the <=768px and coarse-pointer landscape media blocks .oc-topbar-right is overflow:hidden so the chip strip scrolls; the absolutely-positioned .avatar-menu inside #oc-gh-avatar-wrap was clipped away even when it did toggle (Chromium). In those blocks #oc-gh-user-menu is now position:fixed under the navbar, viewport-clamped and scrollable. Desktop keeps the absolute dropdown. Verified with Playwright WebKit and Chromium at 390x844 with touch emulation before/after. Closes #12192 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
strings.Index found an earlier, unrelated @media (max-width: 768px) block and reported it as no longer clipping .oc-topbar-right. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at d0c01f0. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #12192
Problem
On the phone layout of the spoke dashboard (iPhone Safari, 9ab9808 on v5
:candidate) every navbar chip opens its popover except the user avatar β tapping it does nothing.Root cause
Two independent defects:
<img data-action="toggleGHUserMenu">relying on the delegateddocumentclick listener. WebKit/iOS Safari only synthesisesclickfrom a tap on interactive elements; the<img>receivedtouchstart/touchend/pointerupbut neverclick, sotoggleGHUserMenu()never ran. Reproduced in Playwright WebKit (390Γ844, touch): tapping a<button>fires click, tapping the avatar<img>does not.@media (max-width: 768px)and the coarse-pointer landscape block,.oc-topbar-right { overflow: hidden }makes the chip strip scroll, and theposition: absolute.avatar-menuinside#oc-gh-avatar-wrapwas clipped away entirely β even in Chromium where the toggle did fire, the menu was invisible.Fix
<button type="button" id="oc-gh-avatar-btn" data-action="toggleGHUserMenu" aria-haspopup="menu" aria-expanded aria-controls>; the<img>keeps itsnav-chipclasses/title/aria-label so the navbar chip tests still hold.aria-expandedis synced through a singlehiveSyncGHUserMenuTrigger()on every open/close path (toggle, outside click, Escape, backup, sign-out)..oc-topbar-right, pin#oc-gh-user-menuwithposition: fixedunder the navbar (safe-area aware, viewport-clamped width,max-height+overflow-y: autoso the long menu scrolls on a phone). Desktop is untouched (still the absolute dropdown).TestNavAvatarMenuOpensOnMobileguards the button wrapper, the absence ofdata-actionon the<img>, theposition: fixedrule in each clipping media block, and the aria-expanded sync.style=, no raw px/colour values (style ratchet unaffected).Verification
Playwright WebKit + Chromium at 390Γ844 with touch emulation against the served
static/dir: before β WebKithidden=trueafter tap, Chromium opened butelementFromPointon the first item did not hit the menu; after β both open withposition: fixed, first item hit-testable, menu within the viewport. Desktop 1280Γ800: open/toggle-close/outside-click/Escape all behave as before,aria-expandedtracks state.