Skip to content

Commit 5794d14

Browse files
committed
fix(tater): actually put sprite behind the plan
The previous commit diagnosed this wrong. The real regression came from PR #509 (Zed-style overlay scrollbars), which wraps <main> in overlayscrollbars. The library's CSS applies `position: relative; z-index: 0` to its `[data-overlayscrollbars-padding]` and `[data-overlayscrollbars-viewport]` wrappers (see overlayscrollbars.css:206/214), which creates a stacking context INSIDE <main>. That traps the plan's `z-10`/`z-50` inside it: from the outer content wrapper's perspective, the entire plan subtree paints at effective `z=0`, so the tater at `z-5` ends up on top of it. Bumping planAreaRef doesn't help — it's already trapped inside the library's z-0 stacking context, so its value only changes layering WITHIN that bubble. What has to change is the layer the whole bubble paints at in the outer context, i.e. the <main> host itself. Give the OverlayScrollArea <main> `relative z-20`, which makes it a stacking context at z=20 in the outer wrapper. Keep the sprite at z-15 so it still paints above the z-10 sidebar rail / resize handles but below <main>. Revert planAreaRef back to `relative z-10` — its bump was a no-op given the trap. https://claude.ai/code/session_019Q3pp1qUN52e76PqpHY6mg
1 parent 9e5cb46 commit 5794d14

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/editor/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ const App: React.FC = () => {
15251525
{/* Document Area */}
15261526
<OverlayScrollArea
15271527
element="main"
1528-
className={`flex-1 min-w-0 bg-grid ${!sidebar.isOpen ? 'lg:pl-[30px]' : ''}`}
1528+
className={`flex-1 min-w-0 bg-grid relative z-20 ${!sidebar.isOpen ? 'lg:pl-[30px]' : ''}`}
15291529
data-print-region="document"
15301530
onViewportReady={handleViewportReady}
15311531
>
@@ -1539,7 +1539,7 @@ const App: React.FC = () => {
15391539
cancelText="Dismiss"
15401540
showCancel
15411541
/>
1542-
<div ref={planAreaRef} className="min-h-full flex flex-col items-center px-2 py-3 md:px-10 md:py-8 xl:px-16 relative z-20">
1542+
<div ref={planAreaRef} className="min-h-full flex flex-col items-center px-2 py-3 md:px-10 md:py-8 xl:px-16 relative z-10">
15431543
{/* Sticky header lane — ghost bar that pins the toolstrip +
15441544
badges at top: 12px once the user scrolls. Invisible at top
15451545
of doc; original toolstrip/badges remain the source of

packages/ui/components/TaterSpriteRunning.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const TaterSpriteRunning: React.FC = () => {
2525
right: -DISPLAY_WIDTH, // Start off-screen right
2626
width: DISPLAY_WIDTH,
2727
height: DISPLAY_HEIGHT,
28-
zIndex: 15, // Above sidebar tabs / resize handles (z-10) but below the plan area stack (z-20)
28+
zIndex: 15, // Above sidebar tabs / resize handles (z-10), below the <main> plan host (z-20). Plan's own z-10/z-50 are trapped inside overlayscrollbars' z-0 wrapper, so main's z-index — not planAreaRef's — is what actually beats the sprite.
2929
backgroundImage: `url(${spriteSheet})`,
3030
backgroundSize: `${TOTAL_SPRITE_WIDTH}px ${DISPLAY_HEIGHT}px`,
3131
backgroundPosition: 'left center',

0 commit comments

Comments
 (0)