Skip to content

πŸ› dashboard: profile menu does not open on mobile navbar - #12193

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
fix/12192-mobile-avatar-menu
Oct 15, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
fix/12192-mobile-avatar-menu

Conversation

@clubanderson

Copy link
Copy Markdown
Member

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:

  1. No click on tap. The trigger was a bare <img data-action="toggleGHUserMenu"> relying on the delegated document click listener. WebKit/iOS Safari only synthesises click from a tap on interactive elements; the <img> received touchstart/touchend/pointerup but never click, so toggleGHUserMenu() never ran. Reproduced in Playwright WebKit (390Γ—844, touch): tapping a <button> fires click, tapping the avatar <img> does not.
  2. Clipped dropdown. Under @media (max-width: 768px) and the coarse-pointer landscape block, .oc-topbar-right { overflow: hidden } makes the chip strip scroll, and the position: absolute .avatar-menu inside #oc-gh-avatar-wrap was clipped away entirely β€” even in Chromium where the toggle did fire, the menu was invisible.

Fix

  • Wrap the avatar in a real <button type="button" id="oc-gh-avatar-btn" data-action="toggleGHUserMenu" aria-haspopup="menu" aria-expanded aria-controls>; the <img> keeps its nav-chip classes/title/aria-label so the navbar chip tests still hold. aria-expanded is synced through a single hiveSyncGHUserMenuTrigger() on every open/close path (toggle, outside click, Escape, backup, sign-out).
  • In both mobile media blocks that clip .oc-topbar-right, pin #oc-gh-user-menu with position: fixed under the navbar (safe-area aware, viewport-clamped width, max-height + overflow-y: auto so the long menu scrolls on a phone). Desktop is untouched (still the absolute dropdown).
  • New TestNavAvatarMenuOpensOnMobile guards the button wrapper, the absence of data-action on the <img>, the position: fixed rule in each clipping media block, and the aria-expanded sync.
  • No new inline 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 β€” WebKit hidden=true after tap, Chromium opened but elementFromPoint on the first item did not hit the menu; after β€” both open with position: fixed, first item hit-testable, menu within the viewport. Desktop 1280Γ—800: open/toggle-close/outside-click/Escape all behave as before, aria-expanded tracks state.

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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 15, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#12205 πŸ› dashboard: GitHub API budget tile too narrow for caller table same files src/pkg/dashboard/static/index.html
#12158 ✨ review: add review.shadow to record would_have_held for the review gate same files src/pkg/dashboard/static/index.html
#12170 πŸ› Settings modal: sticky-section gap, height, and section navigation same files src/pkg/dashboard/static/index.html
#12182 ✨ intent: add intent.shadow to record would_have_blocked same files src/pkg/dashboard/static/index.html
#12187 ✨ dashboard settings: agent_sandbox scalar settings same files src/pkg/dashboard/static/index.html
#12186 ✨ Hive-curated good first issues to attract contributors with their own coding agents same files src/pkg/dashboard/static/index.html

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>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at d0c01f0.

@kubestellar-prow
kubestellar-prow Bot deleted the fix/12192-mobile-avatar-menu branch October 15, 2026 20:57
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dashboard: profile avatar menu does not open on mobile navbar (iPhone Safari)

1 participant