feat(webui): make the dashboard responsive and add loading and empty states

Every tab row scrolls sideways instead of being clipped by its card.
On phones this hid tabs, such as the Config change helper's last forms
at 360-390px. The login button has a larger touch target, and long
names are truncated with a tooltip.

Loading and empty states:
- Skeletons show only while a selection has no data yet, never over
  data already on screen during a refresh.
- Empty states name the next step to take.
- Error states offer a Retry button that shows progress, and each card
  keeps its own error.
- Toasts confirm copies and key generation, and report background
  failures once per streak through polite and assertive live regions.

Other changes:
- The access matrix switches between Models, MCP servers and Agents,
  and says "none configured" only once its data has loaded.
- Home ranks the top 5 users by cost, requests or tokens. It requests
  only the needed metrics and warns before a range exceeds the
  server's key cap.
- MCP and agent deep links accept a bare target name.

admin_assets_gen.go is regenerated.

Claude-Session: https://claude.ai/code/session_01V5jYJNxpDFdJkyyExpADrv
This commit is contained in:
2026-09-23 23:02:22 +01:00
parent 95a3a0e235
commit cf308624af
57 changed files with 3621 additions and 446 deletions
+10 -3
View File
@@ -5,6 +5,7 @@ import { computed, onUnmounted, ref, useTemplateRef } from 'vue'
import { Badge } from '@/components/ui/badge'
import { copyText } from '@/lib/clipboard'
import { formatContextWindow, formatModelCostHover } from '@/lib/format'
import { useToastsStore } from '@/stores/toasts'
/**
* ModelChip is one clickable, copyable model-id chip, used anywhere a
@@ -51,6 +52,7 @@ const props = defineProps<{
const labelRef = useTemplateRef<HTMLElement>('label')
const state = ref<'idle' | 'copied' | 'selected' | 'failed'>('idle')
let resetTimer: ReturnType<typeof setTimeout> | undefined
const toasts = useToastsStore()
function scheduleReset(): void {
clearTimeout(resetTimer)
@@ -64,8 +66,13 @@ async function onClick(): Promise<void> {
// 'failed' (neither the Clipboard API nor the selection fallback
// worked) gets its own visible state rather than a silent no-op — a
// click that visibly does nothing reads as a broken button, not as
// "nothing to report".
// "nothing to report". Only a FAILURE also gets a toast (states-plan.md
// item 3) — 'copied'/'selected' already have clear, accessible inline
// feedback right at the click target (the icon swap plus this same
// title/aria-label text), so a success toast on top would double-notify
// for something the reader is already looking straight at.
state.value = result
if (result === 'failed') toasts.push({ kind: 'error', message: `Could not copy ${props.id}.` })
scheduleReset()
}
@@ -123,13 +130,13 @@ onUnmounted(() => {
as="button"
type="button"
variant="secondary"
class="cursor-pointer gap-1 font-mono text-xs font-normal transition-colors hover:bg-accent hover:text-accent-foreground"
class="max-w-full cursor-pointer gap-1 truncate font-mono text-xs font-normal transition-colors hover:bg-accent hover:text-accent-foreground"
:class="state === 'failed' ? 'text-destructive' : ''"
:title="title"
:aria-label="title"
@click="onClick"
>
<span ref="label" class="select-text">{{ id }}</span>
<span ref="label" class="min-w-0 truncate select-text">{{ id }}</span>
<FontAwesomeIcon :icon="icon[state]" class="size-2.5 shrink-0" aria-hidden="true" />
</Badge>
</template>