Files
windmill/frontend/src/lib/components/apps/appHeaderPin.svelte.ts
T
Guilhem LemouelandClaude Opus 5 63c1f7b6e8 feat: a deployed app gets the viewport, and the header waits in the corner
An app is the page, not a page inside Windmill's chrome, so the band leaves the flow
and floats above the viewport until the handle in the app's corner calls it down. The
handle is faded until the pointer nears it, hovering peeks the band over the app, and a
click pins it — one flag for every deployed app, in this browser, because someone who
wants the breadcrumb over a dashboard wants it over the next one too.

Peeking overlays rather than pushes: the app is an iframe, and taking 44px off its box
on every pass of the pointer would re-lay-out whatever it draws. Pinned, the band is in
flow like any other route's and the app starts under it.

The sidebar is untouched — docked stays docked, detached stays a peek — since the pin
is about the header alone. A page says it wants the viewport with one registry field,
so the layout keeps asking the registry rather than knowing about apps.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 14:33:19 +02:00

17 lines
650 B
TypeScript

import { useLocalStorageValue } from '$lib/svelte5Utils.svelte'
// A deployed app is the page, not a page inside Windmill's chrome, so it opens with the header out
// of the way. Pinning brings the header back for good — one flag for every app rather than one per
// app: someone who wants the breadcrumb over a dashboard wants it over the next one too.
const pref = useLocalStorageValue<boolean>('app_header_pinned', false, 'boolean')
/** Whether the page header stays in flow on a deployed app's page. */
export const appHeaderPinned = {
get val(): boolean {
return pref.val === true
},
set val(pinned: boolean) {
pref.val = pinned
}
}