Skip to content

Fix call node context menu being hidden behind source view bottom box#6045

Merged
canova merged 1 commit into
firefox-devtools:mainfrom
canova:contextmenu-z-index
May 27, 2026
Merged

Fix call node context menu being hidden behind source view bottom box#6045
canova merged 1 commit into
firefox-devtools:mainfrom
canova:contextmenu-z-index

Conversation

@canova

@canova canova commented May 22, 2026

Copy link
Copy Markdown
Member

The CallNodeContextMenu and MaybeMarkerContextMenu were rendered inside .Details, which sits inside .DetailsContainer. DetailsContainer sets position: relative; z-index: 0, which creates a stacking context that capped the context menu's z-index at 0 relative to its siblings. Since the BottomBox is a sibling of DetailsContainer declared later in the DOM, it always painted on top of the context menus, and it makes them unreadable when the source view was open.

Moved both context menus from Details.tsx into ProfileViewer.tsx, and placed after BottomBox, so they share a stacking context with both DetailsContainer and BottomBox. Their --z-context-menu: 5 now paints above the BottomBox as intended. Context menus are wired to triggers by id rather than DOM proximity, so the move does not affect the behavior.

Technically MaybeMarkerContextMenu can't be visible while we still have the source view visible, but I think it makes sense to keep them together.

Before:
Screenshot 2026-05-22 at 11 08 21

After:
Screenshot 2026-05-22 at 11 08 36

Example profile:
Before / after

@canova canova requested a review from fatadel May 22, 2026 09:11
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.77%. Comparing base (3182970) to head (7ad991d).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6045      +/-   ##
==========================================
- Coverage   83.78%   83.77%   -0.01%     
==========================================
  Files         329      329              
  Lines       34528    34547      +19     
  Branches     9659     9574      -85     
==========================================
+ Hits        28930    28943      +13     
- Misses       5169     5175       +6     
  Partials      429      429              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fatadel fatadel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @canova, thanks for the PR! I've tested it locally and it seems to work fine.

However, I've found an alternate fix worth considering: just drop position: relative; z-index: 0 from .DetailsContainer. Tested locally, fixes the same bug. It seems like nothing inside Details depends on that stacking context.

@canova

canova commented May 27, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review @fatadel!

I was thinking that position: relative; z-index: 0 was needed for something else that's why I didn't want to touch it initially. But now that I'm looking, I couldn't a good place that it's actually useful.

I saw one behavior difference, previously the screenshots would render on top of the context menu:
Screenshot 2026-05-27 at 11 25 31

But with these position and z-index rules removed, it renders below it:
Screenshot 2026-05-27 at 11 25 41

But I think this is actually a better behavior. Beause the context menu is an explicit gesture, as oppose to just hovering. So I think context menu should render on top of the screenshots.

It looks like we added these rules in #4606, but I can't see anything that breaks in the splitter when I remove them. So I think they are safe to remove. I'll update the patch

@canova canova force-pushed the contextmenu-z-index branch from adac6b0 to 0086188 Compare May 27, 2026 09:50
DetailsContainer set `position: relative; z-index: 0`, creating a
stacking context that trapped the context menus (rendered inside
DetailsContainer) at z-index 0. The BottomBox is a sibling of
DetailsContainer that comes later in the DOM, so it painted on top of
the menus whenever the source view was open.

Removing the stacking context from DetailsContainer lets the context
menu's --z-context-menu compete at .profileViewer level and paint above
the BottomBox. The parent .profileViewer still provides a stacking
context for the KeyboardShortcut overlay.
@canova canova force-pushed the contextmenu-z-index branch from 0086188 to 7ad991d Compare May 27, 2026 09:50
@fatadel

fatadel commented May 27, 2026

Copy link
Copy Markdown
Contributor

LGTM!

@canova canova merged commit 4a79539 into firefox-devtools:main May 27, 2026
23 checks passed
@canova canova mentioned this pull request Jun 16, 2026
canova added a commit that referenced this pull request Jun 16, 2026
Changes:

[Nazım Can Altınova] Fix call node context menu being hidden behind
source view bottom box (#6045)
[Nazım Can Altınova] Pass `--use-env-proxy` only when the node version
is >= 24 (#6064)
[fatadel] Upgrade @firefox-devtools/react-contextmenu to 5.2.4 (#6066)
[Markus Stange] Switch profiler-edit from minimist to commander (#6065)
[Markus Stange] Support reading profiles from JsonSlabs files (#6037)
[Florian Quèze] Don't fail profile processing when a marker's stack
field is not a backtrace (#6069)
[fatadel] Replace the footer-links overlay with a settings menu (#6042)
[fatadel] Upgrade @types/node to match Node 24 (#6070)
[fatadel] Remove unused undici-types package (#6074)
[cathaysia] Update isLocalURL to include LAN addresses, .local domains,
and hostn… (#5973)
[Markus Stange] Fix from-url with binary profiles (#6072)
[fatadel] Upgrade to React 19 (#6067)
[Markus Stange] Add an insertStackLabels helper. (#6076)
[fatadel] Drive counter tooltips from a tooltipRows schema (#6023)
[fatadel] Add TrackPower--tooltip-average-power-microwatt (#6080)
[Markus Stange] Downgrade to React 19.1 to fix unusable dev build
performance. (#6082)
[Nazım Can Altınova] Add source map symbolication and source view
support (#6018)
[spokodev] fix(FilterNavigatorBar): clip overflow so many breadcrumbs do
not expand the parent (#6085)
[Markus Stange] Move paddings inside the tree header cells. (#6002)
[Markus Stange] Add an --insert-label-frames argument to the
profiler-edit tool (#5966)
[Markus Stange] Stop printing "error: too many arguments" during tests.
(#6088)
[Markus Stange] More additions to profiler-edit, for sp3 profiles
(#6009)
[Nazım Can Altınova] Do not rely on localized texts in the settings menu
tests (#6101)

And special thanks to our localizers:

be: Andrei Mukamolau
de: Ger
de: Michael Köhler
de: Ralf Duehnfahr
el: Jim Spentzos
en-CA: chutten
en-GB: Ian Neal
es-CL: ravmn
fr: Théo Chevalier
fr: wy
fur: Fabio Tomat
fy-NL: Fjoerfoks
ia: Melo46
it: Francesco Lodolo [:flod]
nl: Mark Heijl
ru: Valery Ledovskoy
sr: Марко Костић (Marko Kostić)
sv-SE: Andreas Pettersson
tr: Grk
tr: Selim Şumlu
zh-CN: Olvcpr423
zh-TW: Pin-guang Chen
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.

2 participants