fix(webui): toasts above sheets; drop unreachable alias helpers

Stack the toast viewport on perfect-design's --z-toast token so it sits
above Sheet overlays, and add a harness check that the toast is the
topmost element at its centre while a sheet is open.

Delete useAliasNames, lib/alias and its spec, which nothing imports
since the shadcn migration removed AliasBadge.
This commit is contained in:
2026-11-25 11:52:38 +00:00
parent ff58b03e21
commit 62817af834
5 changed files with 19 additions and 36 deletions
-18
View File
@@ -1,18 +0,0 @@
import { describe, expect, it } from 'vitest'
import { aliasNameSet } from './alias'
import type { AdminAliasView } from '@/types/api'
const view = (alias: string): AdminAliasView => ({ alias, target: 'openai/gpt-5', modelMeta: {} })
describe('aliasNameSet', () => {
it.each<{ name: string; input: AdminAliasView[] | undefined; has: string[]; hasNot: string[] }>([
{ name: 'undefined', input: undefined, has: [], hasNot: ['x'] },
{ name: 'empty', input: [], has: [], hasNot: ['x'] },
{ name: 'two aliases', input: [view('fast'), view('smart')], has: ['fast', 'smart'], hasNot: ['openai/gpt-5', 'Fast', ''] },
])('$name', ({ input, has, hasNot }) => {
const set = aliasNameSet(input)
for (const h of has) expect(set.has(h)).toBe(true)
for (const h of hasNot.filter((x) => !has.includes(x))) expect(set.has(h)).toBe(false)
})
})
-6
View File
@@ -1,6 +0,0 @@
import type { AdminAliasView } from '@/types/api'
/** aliasNameSet indexes configured alias names (exact match, as a client sends them) for O(1) lookups. */
export function aliasNameSet(aliases: readonly AdminAliasView[] | undefined): Set<string> {
return new Set((aliases ?? []).map((a) => a.alias))
}