fix: lint

This commit is contained in:
imccyu
2026-07-28 00:56:37 +08:00
parent 2c5c1e72ba
commit 7e2f6f474d
2 changed files with 42 additions and 36 deletions

View File

@@ -186,7 +186,13 @@ export function ModelSelect({ locked, directory, load, select }: ModelSelectInje
aria-controls={open ? `${id}-menu` : undefined} aria-controls={open ? `${id}-menu` : undefined}
title={triggerLabel} title={triggerLabel}
disabled={locked} disabled={locked}
onClick={() => { open ? close() : show() }} onClick={() => {
if (open) {
close()
} else {
show()
}
}}
> >
<span className={css.triggerLabel}>{modelLabel}</span> <span className={css.triggerLabel}>{modelLabel}</span>
{effortLabel !== undefined && <span className={css.triggerEffort}>{effortLabel}</span>} {effortLabel !== undefined && <span className={css.triggerEffort}>{effortLabel}</span>}
@@ -203,13 +209,13 @@ export function ModelSelect({ locked, directory, load, select }: ModelSelectInje
> >
{pane === 'root' && ( {pane === 'root' && (
<> <>
<button ref={itemRef()} type="button" role="menuitem" className={css.cell} onClick={() => setPane('model')}> <button ref={itemRef()} type="button" role="menuitem" className={css.cell} onClick={() => { setPane('model') }}>
<span className={css.cellLabel}>Model</span> <span className={css.cellLabel}>Model</span>
<span className={css.cellValue}>{modelLabel}</span> <span className={css.cellValue}>{modelLabel}</span>
<IconChevronRightOutline14 className={css.cellChevron} /> <IconChevronRightOutline14 className={css.cellChevron} />
</button> </button>
{reasoning !== undefined && ( {reasoning !== undefined && (
<button ref={itemRef()} type="button" role="menuitem" className={css.cell} onClick={() => setPane('effort')}> <button ref={itemRef()} type="button" role="menuitem" className={css.cell} onClick={() => { setPane('effort') }}>
<span className={css.cellLabel}>Effort</span> <span className={css.cellLabel}>Effort</span>
<span className={css.cellValue}>{effortLabel}</span> <span className={css.cellValue}>{effortLabel}</span>
<IconChevronRightOutline14 className={css.cellChevron} /> <IconChevronRightOutline14 className={css.cellChevron} />

View File

@@ -13,11 +13,11 @@ export interface ModelSelectInjected {
/** The session's shared directory store (same instance the /model popup reads). */ /** The session's shared directory store (same instance the /model popup reads). */
directory: SnapshotStore<ModelDirectoryState> directory: SnapshotStore<ModelDirectoryState>
/** Refresh the advisory directory (fire-and-forget; errors land on the store). */ /** Refresh the advisory directory (fire-and-forget; errors land on the store). */
load(): void load: () => void
/** /**
* Select a complete provider/model/reasoning target through the shared route. * Select a complete provider/model/reasoning target through the shared route.
* @param target - model target and optional adapter-owned effort. * @param target - model target and optional adapter-owned effort.
* @returns whether the host accepted the selection. * @returns whether the host accepted the selection.
*/ */
select(target: ModelTarget): Promise<boolean> select: (target: ModelTarget) => Promise<boolean>
} }