Yuchen Yuan Claude Opus 4.7 commited on
Commit
5c7e83b
·
1 Parent(s): 2ed1d6e

Papers popover: match ThemeSwitcher structure (absolute + z-30)

Browse files

Drop the mobile-specific `fixed right-3 top-14` positioning. That
fixed+z-index combo created a separate stacking context that landed
behind the React Flow canvas in the backdrop-blur header's layer,
which is why the canvas nodes bled through. ThemeSwitcher never had
this problem because it uses plain `absolute z-30`.

Match it: `absolute right-0 top-full mt-1 z-30`, and rely on the
`w-[min(22rem,100vw-1.5rem)]` cap to keep the popover on-screen on
narrow viewports.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Files changed (1) hide show
  1. frontend/src/components/TopBar.tsx +8 -9
frontend/src/components/TopBar.tsx CHANGED
@@ -236,17 +236,16 @@ function PapersPopover() {
236
  <span className="hidden sm:inline">Papers</span>
237
  </button>
238
  {open && (
239
- // Mobile: the Papers button sits roughly mid-header, so anchoring
240
- // the popover to the button's right edge (absolute right-0) would
241
- // overflow the viewport on either side once the menu is 22rem
242
- // wide. Switch to `fixed` positioning flush with the viewport's
243
- // right edge and just below the 56px header, which guarantees it
244
- // stays on-screen regardless of where the button ends up.
245
- // Desktop (≥sm): back to absolute right-0 of the button so the
246
- // menu tracks with the header cluster.
247
  <div
248
  role="menu"
249
- className="fixed right-3 top-14 sm:absolute sm:right-0 sm:top-full sm:mt-1 rounded-lg border border-edge bg-surface shadow-xl z-50 p-2 flex flex-col gap-0.5 w-[min(22rem,calc(100vw-1.5rem))]"
250
  >
251
  {papers.map((p) => (
252
  <a
 
236
  <span className="hidden sm:inline">Papers</span>
237
  </button>
238
  {open && (
239
+ // Same positioning strategy as ThemeSwitcher: absolute right-0
240
+ // of the button so the menu tracks with the header cluster, and
241
+ // `w-[min(22rem,100vw-1.5rem)]` caps the width on narrow screens
242
+ // so it can't overflow the viewport's right edge. We do NOT use
243
+ // `position: fixed` here — fixed+z-index creates a new stacking
244
+ // context that can land behind the React Flow canvas in the
245
+ // backdrop-blur header's layer.
 
246
  <div
247
  role="menu"
248
+ className="absolute right-0 top-full mt-1 rounded-lg border border-edge bg-surface shadow-xl z-30 p-2 flex flex-col gap-0.5 w-[min(22rem,calc(100vw-1.5rem))]"
249
  >
250
  {papers.map((p) => (
251
  <a