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.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899<script lang="ts"> import { fitted } from './popover'; import type { FilterSuggestion } from './session-filter';
let { items, active = 0, up = false, onpick, onhover, }: { items: FilterSuggestion[]; active?: number; up?: boolean; onpick: (token: string) => void; onhover?: (index: number) => void; } = $props();</script>
{#if items.length} <div class="suggest" class:up role="listbox" aria-label="filter suggestions" {@attach fitted(up)} > {#each items as item, index (item.token)} <button type="button" class="option" class:active={index === active} role="option" aria-selected={index === active} onmousedown={(event) => event.preventDefault()} onpointermove={() => onhover?.(index)} onclick={() => onpick(item.token)} > <span class="token">{item.token}</span> <span class="desc">{item.description}</span> </button> {/each} </div>{/if}
<style> .suggest { position: absolute; right: 10px; left: 10px; top: calc(100% + 4px); z-index: 6; display: flex; flex-direction: column; gap: 1px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); } .suggest.up { top: auto; right: 12px; bottom: calc(100% + 4px); left: 12px; } .option { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 5px 8px; color: var(--text); font: inherit; text-align: left; background: none; border: 0; border-radius: 6px; cursor: pointer; } .option.active, .option:hover { background: var(--hover); } .token { font-family: var(--mono); font-size: calc(var(--type-xs) * var(--ui-scale)); } .desc { overflow: hidden; color: var(--muted); font-size: calc(var(--type-xs) * var(--ui-scale)); white-space: nowrap; text-overflow: ellipsis; }</style>