Replace the status-bar model chip's modal with a Cursor-style dropdown: - providers grouped by name in a stable order (no recency reshuffle on select) - per-model hover-Edit submenu for reasoning effort + fast, gated by per-model capabilities now surfaced in the model.options payload - unified Fast toggle: flips the speed=fast param where supported, else swaps to the model's `-fast` variant (base and variant collapse into one row) - localStorage-backed "Edit Models" dialog to choose which models appear Adds reusable dropdown primitives (DropdownMenuSearch, shared row/label tokens, portaled + collision-aware submenus) and reads session state from nanostores rather than prop-drilling, so editing options doesn't rebuild and close the menu.
31 lines
929 B
TypeScript
31 lines
929 B
TypeScript
import { useStore } from '@nanostores/react'
|
|
|
|
import { ModelVisibilityDialog } from '@/components/model-visibility-dialog'
|
|
import type { HermesGateway } from '@/hermes'
|
|
import { $modelVisibilityOpen, setModelVisibilityOpen } from '@/store/model-visibility'
|
|
import { $activeSessionId, $gatewayState } from '@/store/session'
|
|
|
|
interface ModelVisibilityOverlayProps {
|
|
gateway?: HermesGateway
|
|
onOpenProviders: () => void
|
|
}
|
|
|
|
export function ModelVisibilityOverlay({ gateway, onOpenProviders }: ModelVisibilityOverlayProps) {
|
|
const activeSessionId = useStore($activeSessionId)
|
|
const gatewayOpen = useStore($gatewayState) === 'open'
|
|
const open = useStore($modelVisibilityOpen)
|
|
|
|
if (!gatewayOpen) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<ModelVisibilityDialog
|
|
gw={gateway}
|
|
onOpenChange={setModelVisibilityOpen}
|
|
onOpenProviders={onOpenProviders}
|
|
open={open}
|
|
sessionId={activeSessionId}
|
|
/>
|
|
)
|
|
}
|