Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132<script lang="ts"> import { onMount } from 'svelte'; import { boards } from '../boards.svelte'; import { boardOf, type SettingsWindow, type WindowProps } from '../board.svelte'; import Settings from '../Settings.svelte'; import { hosts } from '../tiles/hosts'; import WindowFrame from './WindowFrame.svelte';
let { id, selected }: WindowProps<SettingsWindow> = $props(); // Captured on mount, so changing boards never hands ownership to the new board. const owner = boards.board!; let view = $state<Settings>(); let discarding = false;
onMount(() => owner.guardClose(id, () => discarding || (view?.canClose() ?? true))); $effect(() => { // Keep just this singleton editor mounted while its board is hidden: drafts // and in-flight saves are not serialized into the saved layout. if (boardOf(owner.id)?.windows[id]) hosts.hold(owner.id, id, 'settings'); else hosts.free(owner.id, id, 'settings'); });
function close() { discarding = true; owner.remove(id); }</script>
<WindowFrame {id} {selected} title="settings" canPopOut={false}> <Settings bind:this={view} onclose={close} /></WindowFrame>