Files
windmill/frontend/src/lib/components/ContextBridge.svelte
T
Guilhem LemouelandClaude Opus 5 7625427009 feat: detail pages fill the page header, which now spans above the sidebar
A script or flow detail page no longer draws a bar of its own: its path becomes
the header's breadcrumb, its summary keeps the rename-and-labels popover next to
it, and its badges, menu and buttons ride along as the header's actions. The
band runs the full width with the sidebar hanging below it.

A snippet rendered in the header initialises its components under the header,
not under the page that wrote it, so anything the page's tree provides is lost —
the detail page's buttons read TriggerContext and threw. ContextBridge carries
the entries a registration names back around the render.

The floating handle is gone with it: the header's own toggle is the one control,
hovering it peeks the sidebar in and clicking pins it. The workspace picker in
the header is a denser variant of the sidebar's, and the card's outside-click
catcher starts at the card rather than the viewport top, so it no longer
swallows clicks meant for the toggle.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 12:03:47 +02:00

19 lines
721 B
Svelte

<!--
@component
Re-exposes contexts from one component tree inside another.
A snippet handed to the page header renders under the header, not under the page that wrote it, so
any component it creates looks its contexts up in the header's tree and finds nothing. The page
passes the entries its buttons need and this sets them again around the render.
-->
<script lang="ts">
import { setContext, type Snippet } from 'svelte'
let { contexts, children }: { contexts?: Map<any, any>; children: Snippet } = $props()
// setContext only takes effect during init, so this instance is keyed on `contexts` by callers.
if (contexts) for (const [key, value] of contexts) setContext(key, value)
</script>
{@render children()}