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.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126<script lang="ts"> import type { Snippet } from 'svelte'; import Menu from './Menu.svelte';
// A title-bar icon that lists things: the session's background jobs, the // artifacts it made, the agents it started. The list closes on a pick, a click elsewhere or Escape; // `up` opens it above the icon, for the phone's composer; `inline` renders the list // straight into the body of an undocked chip window. let { label, count = 0, live = false, up = false, inline = false, open = $bindable(false), icon, children, }: { label: string; count?: number; live?: boolean; up?: boolean; inline?: boolean; open?: boolean; icon: Snippet; children: Snippet; } = $props(); let element = $state<HTMLElement>();</script>
{#if inline} <ul class="list inline menu-rows nowheel holds-wheel"> {@render children()} </ul>{:else} <span class="menu nodrag" class:open bind:this={element}> <button class="icon" class:flat={up} class:live aria-haspopup="true" aria-expanded={open} aria-label={label} title={label} onclick={() => (open = !open)} > {@render icon()} {#if count}<span class="count">{count}</span>{/if} </button> <Menu bind:open host={element} {label} as="ul" role="list" {up} start={up}> {@render children()} </Menu> </span>{/if}
<style> .menu { position: relative; display: inline-flex; } .menu.open { z-index: 30; } .icon { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 7px; color: var(--muted); font: inherit; font-size: calc(var(--type-sm) * var(--ui-scale)); background: var(--well); border: 0; border-radius: 8px; cursor: pointer; transition: background-color 120ms ease, color 120ms ease; } .icon:hover, .icon[aria-expanded='true'] { color: var(--text); background: var(--field); } /* flat in a composer, like the composer's own buttons */ .icon.flat { height: 28px; background: none; } .icon.flat:hover, .icon.flat[aria-expanded='true'] { background: var(--hover); } .icon.live { color: var(--accent); } .count { font-variant-numeric: tabular-nums; } /* Alone on a canvas the list is as tall as itself, up to a cap; in a tile or a group it fills its place. */ :global(.window-slot[data-place='canvas']) .list.inline { max-height: 280px; } .list.inline { flex: 1 1 auto; min-height: 0; margin: 0; padding: 4px 6px 8px; overflow-y: auto; overscroll-behavior: contain; list-style: none; } :is(.menu, .list) :global(li > button) { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; } :is(.menu, .list) :global(.when) { color: var(--muted); font-size: calc(var(--type-sm) * var(--ui-scale)); font-variant-numeric: tabular-nums; white-space: nowrap; }</style>