mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-15 08:02:53 +00:00
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>
17 lines
650 B
TypeScript
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
|
|
}
|
|
}
|