Yuchen Yuan Claude Opus 4.7 commited on
Commit ·
74c84e9
1
Parent(s): fcc6a3d
Papers popover: restore mobile fixed-to-viewport anchoring
Browse filesOn narrow screens the Papers button sits mid-header, so pure
`absolute right-0` pushes the 22rem popover's left edge off-screen.
Re-enable `fixed right-3 top-14` for <sm; desktop keeps the
absolute-to-button anchoring.
The header's new `z-20` means a `fixed` child inside it stacks above
the canvas without the stacking-context trouble we saw earlier.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
frontend/src/components/TopBar.tsx
CHANGED
|
@@ -236,16 +236,18 @@ function PapersPopover() {
|
|
| 236 |
<span className="hidden sm:inline">Papers</span>
|
| 237 |
</button>
|
| 238 |
{open && (
|
| 239 |
-
//
|
| 240 |
-
//
|
| 241 |
-
//
|
| 242 |
-
//
|
| 243 |
-
//
|
| 244 |
-
//
|
| 245 |
-
//
|
|
|
|
|
|
|
| 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
|
|
|
|
| 236 |
<span className="hidden sm:inline">Papers</span>
|
| 237 |
</button>
|
| 238 |
{open && (
|
| 239 |
+
// Mobile (<sm): Papers button sits mid-header, so anchoring
|
| 240 |
+
// `absolute right-0` to the button pushes the 22rem popover
|
| 241 |
+
// off-screen on the left. Pin the popover to the viewport's
|
| 242 |
+
// right edge with `fixed right-3 top-14` so it always stays
|
| 243 |
+
// visible. The header itself is `z-20`, so a `fixed` child
|
| 244 |
+
// with z-index stacks above the canvas without trouble.
|
| 245 |
+
//
|
| 246 |
+
// Desktop (≥sm): back to anchor-to-button behaviour so the
|
| 247 |
+
// popover tracks with the Papers button in the header cluster.
|
| 248 |
<div
|
| 249 |
role="menu"
|
| 250 |
+
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-30 p-2 flex flex-col gap-0.5 w-[min(22rem,calc(100vw-1.5rem))]"
|
| 251 |
>
|
| 252 |
{papers.map((p) => (
|
| 253 |
<a
|