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

@@ -2,9 +2,11 @@
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
# BuildKit-кеш npm — повторные сборки переиспользуют скачанные пакеты
# BuildKit-кеш npm — повторные сборки переиспользуют скачанные пакеты.
# npm install вместо npm ci: кросс-платформенный lockfile (Windows-host)
# не резолвит Linux-optional deps (@emnapi/core и др.), npm ci падает.
RUN --mount=type=cache,target=/root/.npm \
npm ci --prefer-offline --no-audit --no-fund
npm install --prefer-offline --no-audit --no-fund
# ── Dev stage: Vite HMR (используется compose.dev.yml) ───────────────────────
FROM deps AS dev

View File

@@ -9,7 +9,7 @@
"version": "0.0.0",
"dependencies": {
"@base-ui/react": "^1.3.0",
"@fontsource-variable/dm-sans": "^5.2.8",
"@fontsource-variable/inter": "^5.3.0",
"@fontsource-variable/jetbrains-mono": "^5.2.8",
"@novnc/novnc": "^1.6.0",
"@tailwindcss/vite": "^4.2.2",
@@ -692,20 +692,20 @@
}
},
"node_modules/@emnapi/core": {
"version": "1.9.2",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz",
"integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==",
"version": "1.11.3",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.3.tgz",
"integrity": "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg==",
"license": "MIT",
"optional": true,
"dependencies": {
"@emnapi/wasi-threads": "1.2.1",
"@emnapi/wasi-threads": "1.2.3",
"tslib": "^2.4.0"
}
},
"node_modules/@emnapi/runtime": {
"version": "1.9.2",
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz",
"integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==",
"version": "1.11.3",
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",
"integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -713,9 +713,9 @@
}
},
"node_modules/@emnapi/wasi-threads": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
"integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==",
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.3.tgz",
"integrity": "sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -917,10 +917,10 @@
"integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==",
"license": "MIT"
},
"node_modules/@fontsource-variable/dm-sans": {
"version": "5.2.8",
"resolved": "https://registry.npmjs.org/@fontsource-variable/dm-sans/-/dm-sans-5.2.8.tgz",
"integrity": "sha512-AxkvMTvNWgfrmlyjiV05vlHYJa+nRQCf1EfvIrQAPBpFJW0O9VTz7oAFr9S3lvbWdmnFoBk7yFqQL86u64nl2g==",
"node_modules/@fontsource-variable/inter": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.3.0.tgz",
"integrity": "sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"

View File

@@ -12,7 +12,7 @@
},
"dependencies": {
"@base-ui/react": "^1.3.0",
"@fontsource-variable/dm-sans": "^5.2.8",
"@fontsource-variable/inter": "^5.3.0",
"@fontsource-variable/jetbrains-mono": "^5.2.8",
"@novnc/novnc": "^1.6.0",
"@tailwindcss/vite": "^4.2.2",

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'