mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
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:
@@ -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)
|
||||
})
|
||||
})
|
||||
@@ -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))
|
||||
}
|
||||
Reference in New Issue
Block a user