Skip to content

Commit 949fdc7

Browse files
authored
fix(fairies): move FairyHUD to InFrontOfTheCanvas layer (tldraw#7221)
Moves the FairyHUD and FairyHUDTeaser components to render in the `InFrontOfTheCanvas` layer instead of `Overlays`. This positions the fairy HUD above the canvas content but below other UI elements like toolbars. ### Change type - [x] `improvement` ### Test plan 1. Open a file in the editor 2. Verify the fairy HUD teaser appears above canvas shapes but below UI elements - [ ] Unit tests - [ ] End to end tests ### Release notes - Moved fairy HUD to render in front of canvas layer for better z-index positioning. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Render FairyHUD in the in-front-of-canvas layer and tweak z-index/animation so the HUD and cookie banner stack correctly. > > - **Editor (`TlaEditor.tsx`)** > - Move `FairyHUD` rendering from `Overlays` to `InFrontOfTheCanvas` with fallback to `FairyHUDTeaser`. > - Keep `Overlays` for `FairyVision`, `RemoteFairies`, and `Fairies` only when `canShowFairies`. > - Add default `components.InFrontOfTheCanvas` to always show `FairyHUDTeaser` (outside instance-specific config). > - **Styling** > - Set `--tl-layer-canvas-in-front: 499` on `.tla .tl-container` to control stacking. > - Update cookie consent panel: adjust translate to `62%`, shorten animation to `3s`, change timing to `ease-out`, and align `@keyframes` start. > - Raise `.cookieConsentWrapper` to `z-index: var(--tl-layer-canvas-in-front)`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d733d35. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 37f961f commit 949fdc7

3 files changed

Lines changed: 23 additions & 11 deletions

File tree

apps/dotcom/client/src/tla/components/TlaEditor/TlaEditor.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ export const components: TLComponents = {
8888
SharePanel: TlaEditorSharePanel,
8989
Dialogs: null,
9090
Toasts: null,
91+
92+
InFrontOfTheCanvas: () => (
93+
<Suspense fallback={<div />}>
94+
<FairyHUDTeaser />
95+
</Suspense>
96+
),
9197
}
9298

9399
interface TlaEditorProps {
@@ -305,13 +311,15 @@ function TlaEditorInner({ fileSlug, deepLinks }: TlaEditorProps) {
305311
{/* <InCanvasTaskList agents={agents} /> */}
306312
<RemoteFairies />
307313
<Fairies agents={agents} />
308-
<FairyHUD agents={agents} />
309-
</Suspense>
310-
) : (
311-
<Suspense fallback={<div />}>
312-
<FairyHUDTeaser />
313314
</Suspense>
314-
)}
315+
) : null}
316+
</>
317+
),
318+
InFrontOfTheCanvas: () => (
319+
<>
320+
<Suspense fallback={<div />}>
321+
{canShowFairies ? <FairyHUD agents={agents} /> : <FairyHUDTeaser />}
322+
</Suspense>
315323
</>
316324
),
317325
DebugMenu: () => <CustomDebugMenu />,

apps/dotcom/client/src/tla/components/dialogs/dialogs.module.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@
4545
box-shadow: var(--tla-shadow-3);
4646
margin-bottom: 4px;
4747
margin-right: 4px;
48-
transform: translate(0px, 100%);
49-
animation: slideUp 5s ease-in forwards;
50-
animation-delay: 2s;
48+
transform: translate(0px, 62%);
49+
animation: slideUp 3s ease-out forwards;
5150
}
5251

5352
@keyframes slideUp {
5453
0% {
55-
transform: translate(0px, 100%);
54+
transform: translate(0px, 62%);
5655
}
5756
100% {
5857
transform: translate(0px, 0%);
@@ -149,7 +148,7 @@
149148
position: fixed;
150149
bottom: 0;
151150
right: 0;
152-
z-index: var(--tl-layer-menus);
151+
z-index: var(--tl-layer-canvas-in-front);
153152
width: fit-content;
154153
}
155154

apps/dotcom/client/src/tla/styles/tla.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,3 +338,8 @@
338338
.tla .tl-watermark_SEE-LICENSE {
339339
display: none;
340340
}
341+
342+
/* Crazy sneaky */
343+
.tla .tl-container {
344+
--tl-layer-canvas-in-front: 499;
345+
}

0 commit comments

Comments
 (0)