feat(frontend): switch to Inter Variable, bump type scale, fix TS errors
Some checks failed
Deploy to Production / Trigger production update (push) Failing after 10s

- Replace DM Sans with Inter Variable (better screen rendering at small sizes)
- Bump text-xs 12→13px, text-sm 14→15px globally via theme tokens
- Fix hardcoded text-[13px] → text-sm in AppLayout, CommandPalette, DashboardPage
- Fix button sm variant text-[0.8rem] → text-xs for consistency
- Fix TS: ScriptExecuteDialog unused isRunning, setResult → setExecutionId(r.id)
- Fix TS: InstanceActionDialogs onValueChange null guards (string | null → string)
- Dockerfile: npm ci → npm install (cross-platform lockfile, Linux optional deps)
This commit is contained in:
2026-08-17 00:14:06 +05:00
parent ec076959db
commit 8fa1208cde
12 changed files with 40 additions and 34 deletions

View File

@@ -139,7 +139,7 @@ export default function CommandPalette() {
onMouseEnter={() => setActiveIndex(i)}
onClick={() => go(item.path)}
className={cn(
'flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-[13px] font-medium transition-colors',
'flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-sm font-medium transition-colors',
i === activeIndex
? 'bg-primary/10 text-primary'
: 'text-foreground hover:bg-accent'

View File

@@ -23,7 +23,7 @@ const buttonVariants = cva(
default:
"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
icon: "size-8",
"icon-xs":

View File

@@ -73,7 +73,7 @@ function CircularGauge({ label, value }: { label: string; value: number }) {
/>
</svg>
<div className="absolute inset-0 flex items-center justify-center">
<span className="font-mono text-[13px] font-bold tabular-nums">{Math.round(clamped)}</span>
<span className="font-mono text-sm font-bold tabular-nums">{Math.round(clamped)}</span>
</div>
</div>
<span className="text-2xs font-mono text-muted-foreground tracking-wide uppercase">{label}</span>

View File

@@ -1010,7 +1010,7 @@ function BackupDialog({ open, onClose, serverId, vmid, type, node, name }: Omit<
<div className="space-y-4">
<div className="space-y-2">
<Label>{t('backups.storage')}</Label>
<Select value={storage} onValueChange={setStorage}>
<Select value={storage} onValueChange={(v) => setStorage(v ?? '')}>
<SelectTrigger>
<SelectValue placeholder={t('backups.select_storage')} />
</SelectTrigger>
@@ -1031,7 +1031,7 @@ function BackupDialog({ open, onClose, serverId, vmid, type, node, name }: Omit<
<div className="grid grid-cols-2 gap-3">
<div className="space-y-2">
<Label>{t('backups.mode')}</Label>
<Select value={mode} onValueChange={setMode}>
<Select value={mode} onValueChange={(v) => setMode(v ?? '')}>
<SelectTrigger><SelectValue /></SelectTrigger>
<SelectContent>
<SelectItem value="snapshot">Snapshot</SelectItem>
@@ -1042,7 +1042,7 @@ function BackupDialog({ open, onClose, serverId, vmid, type, node, name }: Omit<
</div>
<div className="space-y-2">
<Label>{t('backups.compression')}</Label>
<Select value={compress} onValueChange={setCompress}>
<Select value={compress} onValueChange={(v) => setCompress(v ?? '')}>
<SelectTrigger><SelectValue /></SelectTrigger>
<SelectContent>
<SelectItem value="zstd">ZSTD</SelectItem>

View File

@@ -35,7 +35,6 @@ export default function ScriptExecuteDialog({ script, onOpenChange }: Props) {
// дальше поллим его до завершения (см. useScriptExecution).
const { data: liveExec } = useScriptExecution(executionId ?? 0);
const result: ScriptExecution | null = liveExec ?? null;
const isRunning = result?.status === 'running';
const serverIdNum = serverId ? Number(serverId) : 0;
const { data: nodesData } = useNodes(serverIdNum || 0);
@@ -87,7 +86,7 @@ export default function ScriptExecuteDialog({ script, onOpenChange }: Props) {
params: paramValues,
},
{
onSuccess: (r) => setResult(r),
onSuccess: (r) => setExecutionId(r.id),
onError: (e) => toast.error((e as Error).message),
},
);

View File

@@ -1,5 +1,5 @@
// @fontsource-variable/* packages ship CSS with no type declarations, so a
// bare side-effect import isn't matched by Vite's `*.css` module glob. Declare
// them as typeless modules to satisfy `tsc` (see main.tsx font imports).
declare module '@fontsource-variable/dm-sans';
declare module '@fontsource-variable/inter';
declare module '@fontsource-variable/jetbrains-mono';

View File

@@ -5,14 +5,19 @@
@custom-variant dark (&:is(.dark *));
@theme inline {
--font-sans: "DM Sans Variable", system-ui, sans-serif;
--font-sans: "Inter Variable", system-ui, sans-serif;
--font-mono: "JetBrains Mono Variable", ui-monospace, monospace;
--font-heading: var(--font-sans);
/* One named step below text-xs (12px) for micro labels / meta text, so the
type scale is 11·12·14·16·18·24·32 instead of ad-hoc text-[10px]/[11px]. */
/* Micro step for kbd hints, chart axis ticks, and compact badges.
Type scale: 11·12·13·14·16·18·24·32 */
--text-2xs: 0.6875rem; /* 11px */
--text-2xs--line-height: 1rem;
/* Bump xs/sm/base up by 1px for better readability at density. */
--text-xs: 0.8125rem; /* 13px, default 12px */
--text-xs--line-height: 1.125rem;
--text-sm: 0.9375rem; /* 15px, default 14px */
--text-sm--line-height: 1.375rem;
/* Semantic status tokens — use text-success / bg-warning / text-danger etc.
instead of hardcoded green-500 / amber-500 / red-500 so both themes and

View File

@@ -76,7 +76,7 @@ function SidebarContent() {
<Link
key={item.path}
to={item.path}
className={`flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[13px] font-medium transition-colors ${
className={`flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors ${
isActive
? 'bg-primary/10 text-primary'
: 'text-muted-foreground hover:bg-accent hover:text-accent-foreground'
@@ -118,7 +118,7 @@ function UserSection() {
{user?.username?.[0]?.toUpperCase() ?? '?'}
</div>
<div className="min-w-0 flex-1">
<p className="truncate text-[13px] font-medium">{user?.username ?? 'User'}</p>
<p className="truncate text-sm font-medium">{user?.username ?? 'User'}</p>
<p className="truncate text-2xs text-muted-foreground">
{user?.is_admin ? 'Admin' : 'User'}
</p>

View File

@@ -1,9 +1,9 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
// Self-hosted fonts (font-display: swap built in) — no render-blocking
// external Google Fonts request. Family names: "DM Sans Variable" /
// external Google Fonts request. Family names: "Inter Variable" /
// "JetBrains Mono Variable" (see --font-sans / --font-mono in index.css).
import '@fontsource-variable/dm-sans'
import '@fontsource-variable/inter'
import '@fontsource-variable/jetbrains-mono'
import './lib/i18n'
import './index.css'