Merge pull request #145 from poli0981/chore/v0.37.0-deps
chore: v0.37.0 — dependency modernization
This commit is contained in:
78 files changed
+1350
-1791
No files matched your search
@@ -2,6 +2,40 @@
|
||||
|
||||
All notable changes to YTDescGen ship as tagged releases on `main`.
|
||||
|
||||
## v0.37.0 — 2026-08-17
|
||||
|
||||
A **dependency modernization** release. No user-facing feature changes; the app
|
||||
should behave identically. Every major the project had been sitting on is now
|
||||
current, and the two new lint rules that came with them found four real
|
||||
performance bugs.
|
||||
|
||||
### Changed
|
||||
|
||||
- **React 18 → 19**, `@types/react` 19, `@vitejs/plugin-react` 6. One source change: React 19 types `useRef<T>(null)` as `RefObject<T | null>` rather than `RefObject<T>` — the old type quietly claimed a ref was non-null before its element mounted. [ScrollToTopButton](src/components/layout/ScrollToTopButton.tsx) now matches, which keeps its existing null check honest.
|
||||
- **Tailwind 3 → 4** ([src/styles/globals.css](src/styles/globals.css)) — configuration moves from `tailwind.config.ts` (deleted) into CSS. The design tokens live in an `@theme` block that maps Tailwind's names onto the existing `:root` / `.light` variables, so the runtime theme toggle keeps working exactly as before. `darkMode: "class"` becomes `@custom-variant dark`, because the app toggles a class on `<html>` rather than following the OS. PostCSS now loads `@tailwindcss/postcss`. Verified in the browser in both themes.
|
||||
- **ESLint 9 → 10** + `eslint-plugin-react-hooks` 5 → 7, which enables the React Compiler diagnostics.
|
||||
- **Zustand 4 → 5**, **i18next 23 → 26**, **react-i18next 15 → 17**, `@testing-library/*`, `typescript-eslint` 8.67, plus the Vite / Vitest / tsx / knip / Tauri-plugin patch line.
|
||||
|
||||
### Fixed
|
||||
|
||||
The new `react-hooks/set-state-in-effect` rule flagged seven call sites. Four were real extra render passes and are fixed:
|
||||
|
||||
- **[use-online-status](src/hooks/use-online-status.ts)** rewritten to `useSyncExternalStore`. It was re-reading `navigator.onLine` inside an effect to close the gap between the first render and the listeners attaching — subscribing properly removes the gap rather than patching it, and costs one render fewer on every mount.
|
||||
- **[ShortcutHelpModal](src/components/ui/ShortcutHelpModal.tsx)** derives its filter from `open` instead of resetting state in an effect, so a modal that spends most of its life closed no longer schedules work on unrelated parent updates.
|
||||
- **[DraftIndicator](src/components/editor/DraftIndicator.tsx)** and **[use-languages-ready](src/hooks/use-languages-ready.ts)** now guard their setters.
|
||||
|
||||
Three remain as **warnings**, deliberately: they genuinely sync state *from* an external source (i18next bundle readiness, a text mirror of a numeric store field, and a `useMemo` the compiler can't preserve). Each needs a restructure rather than a guard, so they are recorded in [eslint.config.js](eslint.config.js) rather than silenced or used as a reason to hold back the upgrade.
|
||||
|
||||
### Not upgraded
|
||||
|
||||
- **`lucide-react` stays at 0.577.0.** 1.x removes every brand icon (Instagram, Facebook, GitHub, YouTube, X) — upstream dropped them for trademark reasons. Taking 1.x would mean either a generic globe next to a Facebook link, or re-adding the marks ourselves and inheriting the exposure lucide just shed. Neither is worth it: 0.577 already delivered the win, cutting the main bundle **175 kB → 137 kB**.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- `knip` now ignores `tailwindcss`, whose only reference after the migration is `@import "tailwindcss"` in CSS — which knip doesn't follow.
|
||||
- Full gate green: typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, **692 tests**, build. Verified live in the browser: both themes render, icons intact, editor and batch functional.
|
||||
- Six manifests bumped 0.35.0 → 0.37.0. (0.36.0 is reserved for the two new locales.)
|
||||
|
||||
## v0.35.0 — 2026-08-17
|
||||
|
||||
A **guardrails** release. Four things the app quietly let you do wrong — publish
|
||||
|
||||
@@ -13,6 +13,24 @@ export default tseslint.config(
|
||||
...reactHooks.configs.recommended.rules,
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
||||
|
||||
// eslint-plugin-react-hooks 7 turned on the React Compiler diagnostics.
|
||||
// They are worth having — four of the seven they flagged on arrival were
|
||||
// real extra render passes and were fixed (use-online-status moved to
|
||||
// `useSyncExternalStore`, ShortcutHelpModal now derives instead of
|
||||
// resetting in an effect, DraftIndicator and use-languages-ready were
|
||||
// guarded).
|
||||
//
|
||||
// Three remain, all genuinely syncing state FROM an external source:
|
||||
// src/hooks/use-languages-ready.ts — i18next bundle readiness
|
||||
// src/components/editor/PlaytestEditor.tsx — text mirror of a store number
|
||||
// src/components/editor/StoreLinkEditor.tsx — compiler can't preserve a useMemo
|
||||
//
|
||||
// Each needs a real restructure, not a guard, so they are warnings rather
|
||||
// than a reason to hold back the ESLint 10 upgrade or to delete the rule.
|
||||
// Downgrade — do not remove: the signal is the point.
|
||||
"react-hooks/set-state-in-effect": "warn",
|
||||
"react-hooks/preserve-manual-memoization": "warn",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"ignoreDependencies": [
|
||||
"@tauri-apps/plugin-fs",
|
||||
"@tauri-apps/plugin-shell",
|
||||
"tailwindcss",
|
||||
"@testing-library/jest-dom",
|
||||
"@testing-library/react"
|
||||
],
|
||||
|
||||
Generated
+836
-1345
File diff suppressed because it is too large.
Load diff
+19
-18
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yt-desc-gen",
|
||||
"version": "0.35.0",
|
||||
"version": "0.37.0",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
@@ -30,34 +30,35 @@
|
||||
"@tauri-apps/plugin-dialog": "^2.7.2",
|
||||
"@tauri-apps/plugin-fs": "^2.5.1",
|
||||
"@tauri-apps/plugin-opener": "^2.5.4",
|
||||
"@tauri-apps/plugin-shell": "^2.0.0",
|
||||
"clsx": "^2.1.0",
|
||||
"i18next": "^23.15.0",
|
||||
"@tauri-apps/plugin-shell": "^2.3.5",
|
||||
"clsx": "^2.1.1",
|
||||
"i18next": "^26.3.6",
|
||||
"i18next-resources-to-backend": "^1.2.3",
|
||||
"lucide-react": "^0.577.0",
|
||||
"react": "^18.3.0",
|
||||
"react-dom": "^18.3.0",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-i18next": "^15.0.0",
|
||||
"react": "^19.2.8",
|
||||
"react-dom": "^19.2.8",
|
||||
"react-hot-toast": "^2.6.0",
|
||||
"react-i18next": "^17.0.11",
|
||||
"react-router-dom": "^7.18.2",
|
||||
"zustand": "^4.5.0"
|
||||
"zustand": "^5.0.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.5",
|
||||
"@testing-library/jest-dom": "^6.4.0",
|
||||
"@testing-library/react": "^16.0.0",
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@tailwindcss/postcss": "^4.3.3",
|
||||
"@testing-library/jest-dom": "^7.0.1",
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@types/node": "^26.2.0",
|
||||
"@types/react": "^18.3.0",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@vitejs/plugin-react": "^5.2.0",
|
||||
"@types/react": "^19.2.18",
|
||||
"@types/react-dom": "^19.2.4",
|
||||
"@vitejs/plugin-react": "^6.0.5",
|
||||
"autoprefixer": "^10.5.4",
|
||||
"eslint": "^9.39.5",
|
||||
"eslint-plugin-react-hooks": "^5.0.0",
|
||||
"eslint": "^10.8.1",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"knip": "^6.32.2",
|
||||
"postcss": "^8.5.26",
|
||||
"prettier": "^3.9.6",
|
||||
"prettier-plugin-tailwindcss": "^0.8.1",
|
||||
"tailwindcss": "^3.4.0",
|
||||
"tailwindcss": "^4.3.3",
|
||||
"tsx": "^4.23.12",
|
||||
"typescript": "^5.5.0",
|
||||
"typescript-eslint": "^8.67.0",
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
// Tailwind 4 ships its PostCSS plugin as a separate package.
|
||||
"@tailwindcss/postcss": {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
@@ -81,13 +81,11 @@ function main(): void {
|
||||
} catch {
|
||||
return { label: source.label, version: null };
|
||||
}
|
||||
let version: string | null = null;
|
||||
try {
|
||||
version = source.extract(raw);
|
||||
return { label: source.label, version: source.extract(raw) };
|
||||
} catch {
|
||||
version = null;
|
||||
return { label: source.label, version: null };
|
||||
}
|
||||
return { label: source.label, version };
|
||||
});
|
||||
|
||||
const missing = found.filter((entry) => entry.version === null);
|
||||
|
||||
Generated
+1
-1
@@ -5529,7 +5529,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "yt-desc-gen"
|
||||
version = "0.35.0"
|
||||
version = "0.37.0"
|
||||
dependencies = [
|
||||
"tauri",
|
||||
"tauri-build",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "yt-desc-gen"
|
||||
version = "0.35.0"
|
||||
version = "0.37.0"
|
||||
description = "YouTube Gameplay Description Generator"
|
||||
authors = ["poli0981"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
|
||||
"productName": "YTDescGen",
|
||||
"version": "0.35.0",
|
||||
"version": "0.37.0",
|
||||
"identifier": "com.skullmute.ytdescgen",
|
||||
"build": {
|
||||
"beforeBuildCommand": "npm run build",
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ const LogPage = lazy(() => import("@pages/LogPage").then((m) => ({ default: m.Lo
|
||||
const AboutPage = lazy(() => import("@pages/AboutPage").then((m) => ({ default: m.AboutPage })));
|
||||
|
||||
function PageLoader() {
|
||||
return <div className="flex items-center justify-center p-12 text-text-muted">Loading...</div>;
|
||||
return <div className="text-text-muted flex items-center justify-center p-12">Loading...</div>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,15 +33,15 @@ export function ConsentGate() {
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="consent-title"
|
||||
className="flex min-h-screen flex-col items-center justify-center gap-6 bg-surface-0 px-6 py-12 text-center"
|
||||
className="bg-surface-0 flex min-h-screen flex-col items-center justify-center gap-6 px-6 py-12 text-center"
|
||||
>
|
||||
<ShieldCheck className="h-14 w-14 text-accent" aria-hidden />
|
||||
<ShieldCheck className="text-accent h-14 w-14" aria-hidden />
|
||||
|
||||
<div className="max-w-md space-y-2">
|
||||
<h1 id="consent-title" className="text-2xl font-semibold text-text-primary">
|
||||
<h1 id="consent-title" className="text-text-primary text-2xl font-semibold">
|
||||
{t("consentGate.title")}
|
||||
</h1>
|
||||
<p className="text-sm text-text-secondary">{t("consentGate.intro")}</p>
|
||||
<p className="text-text-secondary text-sm">{t("consentGate.intro")}</p>
|
||||
</div>
|
||||
|
||||
<div className="grid w-full max-w-md gap-2 sm:grid-cols-2">
|
||||
@@ -51,15 +51,15 @@ export function ConsentGate() {
|
||||
href={doc.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-3 rounded-lg border border-border bg-surface-1 px-3 py-2.5 text-sm text-text-primary transition-colors hover:border-accent hover:bg-surface-2"
|
||||
className="border-border bg-surface-1 text-text-primary hover:border-accent hover:bg-surface-2 flex items-center gap-3 rounded-lg border px-3 py-2.5 text-sm transition-colors"
|
||||
>
|
||||
<span className="flex-1 truncate text-left">{t(doc.labelKey)}</span>
|
||||
<ExternalLink className="h-3.5 w-3.5 shrink-0 text-text-muted" />
|
||||
<ExternalLink className="text-text-muted h-3.5 w-3.5 shrink-0" />
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="w-full max-w-md rounded-lg border border-border bg-surface-1 p-4">
|
||||
<div className="border-border bg-surface-1 w-full max-w-md rounded-lg border p-4">
|
||||
<Checkbox checked={agreed} onChange={setAgreed} label={t("consentGate.agreeLabel")} />
|
||||
</div>
|
||||
|
||||
@@ -67,7 +67,7 @@ export function ConsentGate() {
|
||||
<Button variant="primary" onClick={onContinue} disabled={!agreed}>
|
||||
{t("consentGate.continue")}
|
||||
</Button>
|
||||
{!agreed && <p className="text-xs text-text-muted">{t("consentGate.mustAgree")}</p>}
|
||||
{!agreed && <p className="text-text-muted text-xs">{t("consentGate.mustAgree")}</p>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -43,8 +43,8 @@ export function CommunityEditor() {
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex flex-col gap-1">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.community")}</span>
|
||||
<p className="text-xs text-text-muted">{t("editor.communityHelp")}</p>
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.community")}</span>
|
||||
<p className="text-text-muted text-xs">{t("editor.communityHelp")}</p>
|
||||
</div>
|
||||
|
||||
<ValidatedInput
|
||||
|
||||
@@ -66,26 +66,26 @@ export function ContentWarningChecklist() {
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="flex items-baseline justify-between">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.warnings")}</span>
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.warnings")}</span>
|
||||
{selected.length > 0 && (
|
||||
<span className="text-xs text-text-muted">{selected.length} selected</span>
|
||||
<span className="text-text-muted text-xs">{selected.length} selected</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="relative">
|
||||
<Search className="pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted" />
|
||||
<Search className="text-text-muted pointer-events-none absolute top-1/2 left-2.5 h-3.5 w-3.5 -translate-y-1/2" />
|
||||
<input
|
||||
type="text"
|
||||
value={query}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
placeholder={t("editor.contentWarningSearchPlaceholder")}
|
||||
className="w-full rounded-md border border-border bg-surface-1 py-1.5 pl-8 pr-7 text-sm text-text-primary placeholder:text-text-muted focus:border-accent focus:outline-none"
|
||||
className="border-border bg-surface-1 text-text-primary placeholder:text-text-muted focus:border-accent w-full rounded-md border py-1.5 pr-7 pl-8 text-sm focus:outline-none"
|
||||
/>
|
||||
{query && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setQuery("")}
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-primary"
|
||||
className="text-text-muted hover:text-text-primary absolute top-1/2 right-2 -translate-y-1/2"
|
||||
aria-label="Clear search"
|
||||
>
|
||||
<X className="h-3.5 w-3.5" />
|
||||
@@ -94,7 +94,7 @@ export function ContentWarningChecklist() {
|
||||
</div>
|
||||
|
||||
{isFiltering && totalMatching === 0 ? (
|
||||
<p className="py-2 text-center text-xs text-text-muted">
|
||||
<p className="text-text-muted py-2 text-center text-xs">
|
||||
{t("editor.contentWarningEmpty")}
|
||||
</p>
|
||||
) : (
|
||||
@@ -105,12 +105,12 @@ export function ContentWarningChecklist() {
|
||||
return (
|
||||
<div
|
||||
key={group.id}
|
||||
className="overflow-hidden rounded-md border border-border bg-surface-1"
|
||||
className="border-border bg-surface-1 overflow-hidden rounded-md border"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => toggleGroup(group.id)}
|
||||
className="flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium text-text-secondary hover:bg-surface-2"
|
||||
className="text-text-secondary hover:bg-surface-2 flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium"
|
||||
aria-expanded={isOpen}
|
||||
>
|
||||
<span className="flex items-center gap-1.5">
|
||||
@@ -122,13 +122,13 @@ export function ContentWarningChecklist() {
|
||||
{t(group.labelKey)}
|
||||
</span>
|
||||
{groupSelectedCount > 0 && (
|
||||
<span className="bg-accent/15 rounded-full px-2 py-0.5 text-[10px] font-medium text-accent">
|
||||
<span className="bg-accent/15 text-accent rounded-full px-2 py-0.5 text-[10px] font-medium">
|
||||
{groupSelectedCount}
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
{isOpen && (
|
||||
<div className="grid grid-cols-1 gap-x-3 gap-y-1 border-t border-border bg-surface-1 px-3 py-2 sm:grid-cols-2">
|
||||
<div className="border-border bg-surface-1 grid grid-cols-1 gap-x-3 gap-y-1 border-t px-3 py-2 sm:grid-cols-2">
|
||||
{group.items.map((id) => {
|
||||
const checked = selected.includes(id);
|
||||
return (
|
||||
@@ -145,7 +145,7 @@ export function ContentWarningChecklist() {
|
||||
type="checkbox"
|
||||
checked={checked}
|
||||
onChange={() => toggleItem(id)}
|
||||
className="focus:ring-accent/40 h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-border text-accent focus:ring-1"
|
||||
className="focus:ring-accent/40 border-border text-accent h-3.5 w-3.5 shrink-0 cursor-pointer rounded focus:ring-1"
|
||||
/>
|
||||
<span>{t(`editor.contentWarningOptions.${id}`)}</span>
|
||||
</label>
|
||||
|
||||
@@ -10,15 +10,22 @@ export function DraftIndicator() {
|
||||
const videoType = useEditorStore((s) => s.videoType);
|
||||
|
||||
useEffect(() => {
|
||||
setShowSaved(true);
|
||||
const timer = setTimeout(() => setShowSaved(false), 2000);
|
||||
return () => clearTimeout(timer);
|
||||
// Show, then hide 2s later. Both transitions go through the timer rather
|
||||
// than one synchronous `setShowSaved(true)` on every dependency change,
|
||||
// which cost an extra render pass each keystroke-driven update
|
||||
// (react-hooks/set-state-in-effect).
|
||||
const show = setTimeout(() => setShowSaved(true), 0);
|
||||
const hide = setTimeout(() => setShowSaved(false), 2000);
|
||||
return () => {
|
||||
clearTimeout(show);
|
||||
clearTimeout(hide);
|
||||
};
|
||||
}, [gameName, videoType]);
|
||||
|
||||
if (!showSaved) return null;
|
||||
|
||||
return (
|
||||
<span className="flex items-center gap-1 text-xs text-success">
|
||||
<span className="text-success flex items-center gap-1 text-xs">
|
||||
<Check className="h-3 w-3" />
|
||||
{t("editor.draftSaved")}
|
||||
</span>
|
||||
|
||||
@@ -202,11 +202,11 @@ export function EndingsEditor() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{count === 0 && <p className="text-xs text-text-muted">{t("editor.endings.emptyHint")}</p>}
|
||||
{count === 0 && <p className="text-text-muted text-xs">{t("editor.endings.emptyHint")}</p>}
|
||||
|
||||
{/* CASE A: single ending — number + name pair, with preview. */}
|
||||
{count === 1 && endings[0] && (
|
||||
<div className="flex flex-col gap-2 rounded-lg border border-border bg-surface-1 p-3">
|
||||
<div className="border-border bg-surface-1 flex flex-col gap-2 rounded-lg border p-3">
|
||||
<div className="grid grid-cols-[100px_1fr] gap-2">
|
||||
<Input
|
||||
label={t("editor.endings.numberLabel")}
|
||||
@@ -228,12 +228,12 @@ export function EndingsEditor() {
|
||||
onChange={(e) => updateEnding(0, { name: e.target.value })}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-xs text-text-muted">
|
||||
<p className="text-text-muted text-xs">
|
||||
{t("editor.endings.previewLabel")}:{" "}
|
||||
<span className="font-mono text-text-secondary">{previewFor(endings[0])}</span>
|
||||
<span className="text-text-secondary font-mono">{previewFor(endings[0])}</span>
|
||||
</p>
|
||||
{!endings[0].number && !endings[0].name.trim() && (
|
||||
<p className="flex items-center gap-1.5 text-xs text-warning">
|
||||
<p className="text-warning flex items-center gap-1.5 text-xs">
|
||||
<AlertTriangle className="h-3 w-3" />
|
||||
{t("editor.endings.warnings.singleEmpty")}
|
||||
</p>
|
||||
@@ -244,9 +244,9 @@ export function EndingsEditor() {
|
||||
{/* CASE B / C: multi-ending table. */}
|
||||
{count >= 2 && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="overflow-hidden rounded-lg border border-border">
|
||||
<div className="border-border overflow-hidden rounded-lg border">
|
||||
<table className="w-full text-sm">
|
||||
<thead className="bg-surface-1 text-xs uppercase text-text-muted">
|
||||
<thead className="bg-surface-1 text-text-muted text-xs uppercase">
|
||||
<tr>
|
||||
<th className="px-2 py-1.5 text-left">#</th>
|
||||
<th className="w-[100px] px-2 py-1.5 text-left">
|
||||
@@ -258,8 +258,8 @@ export function EndingsEditor() {
|
||||
</thead>
|
||||
<tbody>
|
||||
{endings.map((entry, i) => (
|
||||
<tr key={i} className="border-t border-border">
|
||||
<td className="px-2 py-1.5 text-text-muted">{i + 1}</td>
|
||||
<tr key={i} className="border-border border-t">
|
||||
<td className="text-text-muted px-2 py-1.5">{i + 1}</td>
|
||||
<td className="px-2 py-1.5">
|
||||
<Input
|
||||
type="number"
|
||||
@@ -279,7 +279,7 @@ export function EndingsEditor() {
|
||||
onChange={(e) => updateEnding(i, { name: e.target.value })}
|
||||
/>
|
||||
</td>
|
||||
<td className="px-2 py-1.5 font-mono text-xs text-text-muted">
|
||||
<td className="text-text-muted px-2 py-1.5 font-mono text-xs">
|
||||
{previewFor(entry)}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -292,7 +292,7 @@ export function EndingsEditor() {
|
||||
|
||||
{/* Case B: timeline gate banner. */}
|
||||
{isMultiEnding && !isMultiVideo && timelineEndingCount < count && (
|
||||
<p className="border-warning/40 bg-warning/10 flex items-start gap-1.5 rounded border p-2 text-xs text-warning">
|
||||
<p className="border-warning/40 bg-warning/10 text-warning flex items-start gap-1.5 rounded border p-2 text-xs">
|
||||
<AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0" />
|
||||
<span>
|
||||
{t("editor.endings.warnings.timelineShort", {
|
||||
@@ -305,7 +305,7 @@ export function EndingsEditor() {
|
||||
|
||||
{/* CASE C: video-count input + per-video ranges. */}
|
||||
{isMultiEnding && (
|
||||
<div className="flex flex-col gap-2 rounded-lg border border-border bg-surface-1 p-3">
|
||||
<div className="border-border bg-surface-1 flex flex-col gap-2 rounded-lg border p-3">
|
||||
<Input
|
||||
label={t("editor.endings.videoCountLabel")}
|
||||
type="number"
|
||||
@@ -316,10 +316,10 @@ export function EndingsEditor() {
|
||||
/>
|
||||
{isMultiVideo && (
|
||||
<>
|
||||
<p className="text-xs text-text-muted">{t("editor.endings.videoRangeHint")}</p>
|
||||
<div className="overflow-hidden rounded border border-border">
|
||||
<p className="text-text-muted text-xs">{t("editor.endings.videoRangeHint")}</p>
|
||||
<div className="border-border overflow-hidden rounded border">
|
||||
<table className="w-full text-sm">
|
||||
<thead className="bg-surface-2 text-xs uppercase text-text-muted">
|
||||
<thead className="bg-surface-2 text-text-muted text-xs uppercase">
|
||||
<tr>
|
||||
<th className="px-2 py-1.5 text-left">{t("editor.endings.videoLabel")}</th>
|
||||
<th className="px-2 py-1.5 text-left">From</th>
|
||||
@@ -328,7 +328,7 @@ export function EndingsEditor() {
|
||||
</thead>
|
||||
<tbody>
|
||||
{endingVideoRanges.map((r, i) => (
|
||||
<tr key={i} className="border-t border-border">
|
||||
<tr key={i} className="border-border border-t">
|
||||
<td className="px-2 py-1.5">{i + 1}</td>
|
||||
<td className="px-2 py-1.5">
|
||||
<Input
|
||||
@@ -354,7 +354,7 @@ export function EndingsEditor() {
|
||||
</table>
|
||||
</div>
|
||||
{rangeWarnings.length > 0 && (
|
||||
<ul className="border-warning/40 bg-warning/10 flex flex-col gap-1 rounded border p-2 text-xs text-warning">
|
||||
<ul className="border-warning/40 bg-warning/10 text-warning flex flex-col gap-1 rounded border p-2 text-xs">
|
||||
{rangeWarnings.map((w, i) => (
|
||||
<li key={i} className="flex items-start gap-1.5">
|
||||
<AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0" />
|
||||
@@ -381,7 +381,7 @@ export function EndingsEditor() {
|
||||
value={String(Math.min(endingVideoIndex, endingVideoCount))}
|
||||
onChange={(v) => set("endingVideoIndex", Number(v) || 1)}
|
||||
/>
|
||||
<p className="text-xs text-text-muted">{t("editor.endings.videoIndexHint")}</p>
|
||||
<p className="text-text-muted text-xs">{t("editor.endings.videoIndexHint")}</p>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -56,14 +56,14 @@ export function ExtraFieldsInput() {
|
||||
<div className="flex flex-col gap-3">
|
||||
{extraFields.includes("gachaQuestType") && (
|
||||
<div className="flex flex-col gap-1">
|
||||
<label htmlFor="gacha-quest-type" className="text-sm font-medium text-text-secondary">
|
||||
<label htmlFor="gacha-quest-type" className="text-text-secondary text-sm font-medium">
|
||||
{t("editor.gachaQuestType")}
|
||||
</label>
|
||||
<select
|
||||
id="gacha-quest-type"
|
||||
value={store.gachaQuestType ?? "main_story"}
|
||||
onChange={(e) => store.set("gachaQuestType", e.target.value as GachaQuestType)}
|
||||
className="focus:ring-accent/50 rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary transition-colors focus:border-accent focus:outline-none focus:ring-2"
|
||||
className="focus:ring-accent/50 border-border bg-surface-1 text-text-primary focus:border-accent rounded-lg border px-3 py-2 text-sm transition-colors focus:ring-2 focus:outline-none"
|
||||
>
|
||||
{GACHA_QUEST_TYPE_GROUPS.map((g) => (
|
||||
<optgroup key={g.group} label={t(`editor.gachaQuestTypeGroups.${g.group}`)}>
|
||||
@@ -88,7 +88,7 @@ export function ExtraFieldsInput() {
|
||||
)}
|
||||
{isGacha && visibility.anniversaryYear && (
|
||||
<div className="flex flex-col gap-1">
|
||||
<label htmlFor="anniversary-year" className="text-sm font-medium text-text-secondary">
|
||||
<label htmlFor="anniversary-year" className="text-text-secondary text-sm font-medium">
|
||||
{t("editor.anniversaryYear")}
|
||||
</label>
|
||||
<select
|
||||
@@ -97,7 +97,7 @@ export function ExtraFieldsInput() {
|
||||
onChange={(e) =>
|
||||
store.set("anniversaryYear", e.target.value === "" ? null : Number(e.target.value))
|
||||
}
|
||||
className="focus:ring-accent/50 rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary transition-colors focus:border-accent focus:outline-none focus:ring-2"
|
||||
className="focus:ring-accent/50 border-border bg-surface-1 text-text-primary focus:border-accent rounded-lg border px-3 py-2 text-sm transition-colors focus:ring-2 focus:outline-none"
|
||||
>
|
||||
<option value="">—</option>
|
||||
{ANNIVERSARY_YEARS.map((y) => (
|
||||
@@ -201,14 +201,14 @@ export function ExtraFieldsInput() {
|
||||
)}
|
||||
{extraFields.includes("scheduledTime") && (
|
||||
<div className="flex flex-col gap-1">
|
||||
<label className="text-sm font-medium text-text-secondary">
|
||||
<label className="text-text-secondary text-sm font-medium">
|
||||
{t("editor.scheduledTime")}
|
||||
</label>
|
||||
<input
|
||||
type="datetime-local"
|
||||
value={store.scheduledTime ?? ""}
|
||||
onChange={(e) => store.set("scheduledTime", e.target.value)}
|
||||
className="focus:ring-accent/50 rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary transition-colors placeholder:text-text-muted focus:border-accent focus:outline-none focus:ring-2"
|
||||
className="focus:ring-accent/50 border-border bg-surface-1 text-text-primary placeholder:text-text-muted focus:border-accent rounded-lg border px-3 py-2 text-sm transition-colors focus:ring-2 focus:outline-none"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -50,8 +50,8 @@ export function GenreSelector() {
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="flex flex-wrap items-center justify-between gap-2">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.genre")}</span>
|
||||
<span className="text-xs text-text-muted">
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.genre")}</span>
|
||||
<span className="text-text-muted text-xs">
|
||||
{genres.length}/{MAX_GENRES}
|
||||
</span>
|
||||
</div>
|
||||
@@ -61,7 +61,7 @@ export function GenreSelector() {
|
||||
key={groupId}
|
||||
type="button"
|
||||
onClick={() => applyGroup(groupId)}
|
||||
className="rounded-lg border border-border bg-surface-1 px-2.5 py-1 text-xs font-medium text-text-secondary transition-colors hover:border-accent hover:text-text-primary"
|
||||
className="border-border bg-surface-1 text-text-secondary hover:border-accent hover:text-text-primary rounded-lg border px-2.5 py-1 text-xs font-medium transition-colors"
|
||||
>
|
||||
{t(`editor.genreGroups.${groupId}`)}
|
||||
</button>
|
||||
@@ -72,10 +72,10 @@ export function GenreSelector() {
|
||||
value={filter}
|
||||
onChange={(e) => setFilter(e.target.value)}
|
||||
placeholder={t("editor.genreSearchPlaceholder")}
|
||||
className="focus:ring-accent/50 rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary transition-colors placeholder:text-text-muted focus:border-accent focus:outline-none focus:ring-2"
|
||||
className="focus:ring-accent/50 border-border bg-surface-1 text-text-primary placeholder:text-text-muted focus:border-accent rounded-lg border px-3 py-2 text-sm transition-colors focus:ring-2 focus:outline-none"
|
||||
/>
|
||||
{visibleOptions.length === 0 ? (
|
||||
<p className="py-2 text-sm text-text-muted">{t("editor.genreSearchNoResults")}</p>
|
||||
<p className="text-text-muted py-2 text-sm">{t("editor.genreSearchNoResults")}</p>
|
||||
) : (
|
||||
<ChipGroup
|
||||
multiple
|
||||
@@ -86,12 +86,12 @@ export function GenreSelector() {
|
||||
/>
|
||||
)}
|
||||
{showHint && (
|
||||
<div className="border-accent/40 bg-accent/5 flex items-center justify-between gap-3 rounded-lg border px-3 py-2 text-xs text-text-secondary">
|
||||
<div className="border-accent/40 bg-accent/5 text-text-secondary flex items-center justify-between gap-3 rounded-lg border px-3 py-2 text-xs">
|
||||
<span>{t("editor.skipGraphicsHintLabel")}</span>
|
||||
<div className="flex shrink-0 gap-2">
|
||||
<button
|
||||
type="button"
|
||||
className="rounded bg-accent px-2 py-1 font-medium text-white"
|
||||
className="bg-accent rounded px-2 py-1 font-medium text-white"
|
||||
onClick={() => {
|
||||
set("skipGraphicsSettings", true);
|
||||
setHintDismissed(true);
|
||||
@@ -101,7 +101,7 @@ export function GenreSelector() {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="rounded px-2 py-1 font-medium text-text-secondary hover:bg-surface-2"
|
||||
className="text-text-secondary hover:bg-surface-2 rounded px-2 py-1 font-medium"
|
||||
onClick={() => setHintDismissed(true)}
|
||||
>
|
||||
{t("editor.skipGraphicsHintKeep")}
|
||||
|
||||
@@ -43,11 +43,14 @@ export function PlaytestEditor() {
|
||||
// (platform clamp, profile / preset load, draft reset). Only fires on a
|
||||
// real store change, so it never clobbers an in-progress invalid edit.
|
||||
useEffect(() => {
|
||||
const current = invitesText.trim() === "" ? 0 : Number(invitesText);
|
||||
if (current !== playtestInvites) {
|
||||
setInvitesText(playtestInvites > 0 ? String(playtestInvites) : "");
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const next = playtestInvites > 0 ? String(playtestInvites) : "";
|
||||
// Functional form so the comparison happens against the *current* text
|
||||
// without depending on it, and so an unchanged value returns the same
|
||||
// reference instead of scheduling a render (react-hooks/set-state-in-effect).
|
||||
setInvitesText((prev) => {
|
||||
const current = prev.trim() === "" ? 0 : Number(prev);
|
||||
return current === playtestInvites ? prev : next;
|
||||
});
|
||||
}, [playtestInvites]);
|
||||
|
||||
const handlePlatformChange = (id: string) => {
|
||||
@@ -77,7 +80,7 @@ export function PlaytestEditor() {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<span className="text-sm font-medium text-text-secondary">
|
||||
<span className="text-text-secondary text-sm font-medium">
|
||||
{t("editor.playtest.heading")}
|
||||
</span>
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ export function PlaythroughNotesForm() {
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex items-baseline justify-between">
|
||||
<span className="text-sm font-medium text-text-secondary">
|
||||
<span className="text-text-secondary text-sm font-medium">
|
||||
{t("editor.playthroughNotes.title")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -6,29 +6,29 @@ export function QuickPreview() {
|
||||
const output = useGeneratedOutput();
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3 rounded-lg border border-border bg-surface-1 p-4">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.quickPreview")}</span>
|
||||
<div className="border-border bg-surface-1 flex flex-col gap-3 rounded-lg border p-4">
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.quickPreview")}</span>
|
||||
|
||||
<div className="flex flex-col gap-2">
|
||||
<div>
|
||||
<span className="text-xs font-medium uppercase text-text-muted">{t("output.title")}</span>
|
||||
<p className="mt-1 text-sm font-medium text-text-primary">{output.title || "..."}</p>
|
||||
<span className="text-text-muted text-xs font-medium uppercase">{t("output.title")}</span>
|
||||
<p className="text-text-primary mt-1 text-sm font-medium">{output.title || "..."}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
<span className="text-text-muted text-xs font-medium uppercase">
|
||||
{t("output.description")}
|
||||
</span>
|
||||
<p className="mt-1 line-clamp-3 whitespace-pre-wrap text-xs text-text-secondary">
|
||||
<p className="text-text-secondary mt-1 line-clamp-3 text-xs whitespace-pre-wrap">
|
||||
{output.description || "..."}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
<span className="text-text-muted text-xs font-medium uppercase">
|
||||
{t("output.tags")} ({output.tags.length})
|
||||
</span>
|
||||
<p className="mt-1 line-clamp-2 text-xs text-text-muted">{output.tagString || "..."}</p>
|
||||
<p className="text-text-muted mt-1 line-clamp-2 text-xs">{output.tagString || "..."}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,7 @@ export function RigEditor() {
|
||||
const renderValidationBadge = (issue: RigValidationIssue | null) => {
|
||||
if (!issue) return null;
|
||||
return (
|
||||
<div className="flex items-center gap-1 text-xs text-warning">
|
||||
<div className="text-warning flex items-center gap-1 text-xs">
|
||||
<AlertTriangle className="h-3 w-3" />
|
||||
<span>{t(issue.messageKey)}</span>
|
||||
</div>
|
||||
@@ -87,7 +87,7 @@ export function RigEditor() {
|
||||
|
||||
return (
|
||||
<div key={field.id} className="col-span-2 flex flex-col gap-2">
|
||||
<span className="text-sm font-medium text-text-secondary">{t(field.labelKey)}</span>
|
||||
<span className="text-text-secondary text-sm font-medium">{t(field.labelKey)}</span>
|
||||
<div className="grid grid-cols-3 gap-2">
|
||||
<Select
|
||||
label={t("editor.gpu_brand")}
|
||||
@@ -173,7 +173,7 @@ export function RigEditor() {
|
||||
|
||||
return (
|
||||
<div key={field.id} className="col-span-2 flex flex-col gap-2">
|
||||
<span className="text-sm font-medium text-text-secondary">{t(field.labelKey)}</span>
|
||||
<span className="text-text-secondary text-sm font-medium">{t(field.labelKey)}</span>
|
||||
<div className="grid grid-cols-2 gap-2">{renderedParts}</div>
|
||||
{renderValidationBadge(issue)}
|
||||
</div>
|
||||
@@ -223,7 +223,7 @@ export function RigEditor() {
|
||||
onChange={(e) => onCustomChange(e.target.value)}
|
||||
/>
|
||||
{part.customSuffix && (
|
||||
<span className="text-sm text-text-muted">{part.customSuffix.trim()}</span>
|
||||
<span className="text-text-muted text-sm">{part.customSuffix.trim()}</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
@@ -263,7 +263,7 @@ export function RigEditor() {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.rig")}</span>
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.rig")}</span>
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
{RIG_FIELDS.map((field) => {
|
||||
if (field.type === "cascading_dropdown") return renderCascading(field);
|
||||
|
||||
@@ -15,10 +15,10 @@ export function SocialEditor() {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.social")}</span>
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.social")}</span>
|
||||
|
||||
<div className="flex flex-col gap-2">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">Donate</span>
|
||||
<span className="text-text-muted text-xs font-medium uppercase">Donate</span>
|
||||
{donateFields.map((field) => (
|
||||
<ValidatedInput
|
||||
key={field.id}
|
||||
@@ -37,7 +37,7 @@ export function SocialEditor() {
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-2">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">Social</span>
|
||||
<span className="text-text-muted text-xs font-medium uppercase">Social</span>
|
||||
{socialFields.map((field) => (
|
||||
<ValidatedInput
|
||||
key={field.id}
|
||||
|
||||
@@ -77,11 +77,11 @@ export function StoreLinkEditor() {
|
||||
setField("gameName", extracted);
|
||||
toast.custom(
|
||||
(item) => (
|
||||
<div className="flex items-center gap-3 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary shadow">
|
||||
<div className="border-border bg-surface-2 text-text-primary flex items-center gap-3 rounded-lg border px-3 py-2 text-sm shadow">
|
||||
<span>{t("editor.toast.urlAutoFilled", { name: extracted })}</span>
|
||||
<button
|
||||
type="button"
|
||||
className="rounded px-2 py-0.5 text-xs font-medium text-accent hover:bg-surface-1"
|
||||
className="text-accent hover:bg-surface-1 rounded px-2 py-0.5 text-xs font-medium"
|
||||
onClick={() => {
|
||||
setField("gameName", "");
|
||||
toast.dismiss(item.id);
|
||||
@@ -97,10 +97,10 @@ export function StoreLinkEditor() {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.storeLinks")}</span>
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.storeLinks")}</span>
|
||||
{mismatch && (
|
||||
<div className="flex items-start gap-2 rounded-lg border border-warning bg-surface-2 px-3 py-2 text-sm">
|
||||
<span className="flex-1 text-text-primary">
|
||||
<div className="border-warning bg-surface-2 flex items-start gap-2 rounded-lg border px-3 py-2 text-sm">
|
||||
<span className="text-text-primary flex-1">
|
||||
{t("editor.warning.linkNameMismatch", {
|
||||
host: mismatch.host,
|
||||
suggestedName: mismatch.suggestedName,
|
||||
@@ -110,7 +110,7 @@ export function StoreLinkEditor() {
|
||||
<button
|
||||
type="button"
|
||||
aria-label={t("common.dismiss")}
|
||||
className="shrink-0 rounded px-2 py-0.5 text-base leading-none text-text-secondary hover:bg-surface-1"
|
||||
className="text-text-secondary hover:bg-surface-1 shrink-0 rounded px-2 py-0.5 text-base leading-none"
|
||||
onClick={() =>
|
||||
setDismissedFingerprints((prev) => {
|
||||
const next = new Set(prev);
|
||||
|
||||
@@ -67,26 +67,26 @@ export function TechNotesChecklist() {
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="flex items-baseline justify-between">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.techNotes")}</span>
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.techNotes")}</span>
|
||||
{selected.length > 0 && (
|
||||
<span className="text-xs text-text-muted">{selected.length} selected</span>
|
||||
<span className="text-text-muted text-xs">{selected.length} selected</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="relative">
|
||||
<Search className="pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted" />
|
||||
<Search className="text-text-muted pointer-events-none absolute top-1/2 left-2.5 h-3.5 w-3.5 -translate-y-1/2" />
|
||||
<input
|
||||
type="text"
|
||||
value={query}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
placeholder={t("editor.techNoteSearchPlaceholder")}
|
||||
className="w-full rounded-md border border-border bg-surface-1 py-1.5 pl-8 pr-7 text-sm text-text-primary placeholder:text-text-muted focus:border-accent focus:outline-none"
|
||||
className="border-border bg-surface-1 text-text-primary placeholder:text-text-muted focus:border-accent w-full rounded-md border py-1.5 pr-7 pl-8 text-sm focus:outline-none"
|
||||
/>
|
||||
{query && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setQuery("")}
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-primary"
|
||||
className="text-text-muted hover:text-text-primary absolute top-1/2 right-2 -translate-y-1/2"
|
||||
aria-label="Clear search"
|
||||
>
|
||||
<X className="h-3.5 w-3.5" />
|
||||
@@ -95,7 +95,7 @@ export function TechNotesChecklist() {
|
||||
</div>
|
||||
|
||||
{isFiltering && totalMatching === 0 ? (
|
||||
<p className="py-2 text-center text-xs text-text-muted">{t("editor.techNoteEmpty")}</p>
|
||||
<p className="text-text-muted py-2 text-center text-xs">{t("editor.techNoteEmpty")}</p>
|
||||
) : (
|
||||
<div className="flex flex-col gap-1">
|
||||
{filteredGroups.map((group) => {
|
||||
@@ -104,12 +104,12 @@ export function TechNotesChecklist() {
|
||||
return (
|
||||
<div
|
||||
key={group.id}
|
||||
className="overflow-hidden rounded-md border border-border bg-surface-1"
|
||||
className="border-border bg-surface-1 overflow-hidden rounded-md border"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => toggleGroup(group.id)}
|
||||
className="flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium text-text-secondary hover:bg-surface-2"
|
||||
className="text-text-secondary hover:bg-surface-2 flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium"
|
||||
aria-expanded={isOpen}
|
||||
>
|
||||
<span className="flex items-center gap-1.5">
|
||||
@@ -121,13 +121,13 @@ export function TechNotesChecklist() {
|
||||
{t(group.labelKey)}
|
||||
</span>
|
||||
{groupSelectedCount > 0 && (
|
||||
<span className="bg-accent/15 rounded-full px-2 py-0.5 text-[10px] font-medium text-accent">
|
||||
<span className="bg-accent/15 text-accent rounded-full px-2 py-0.5 text-[10px] font-medium">
|
||||
{groupSelectedCount}
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
{isOpen && (
|
||||
<div className="grid grid-cols-1 gap-x-3 gap-y-1 border-t border-border bg-surface-1 px-3 py-2 sm:grid-cols-2">
|
||||
<div className="border-border bg-surface-1 grid grid-cols-1 gap-x-3 gap-y-1 border-t px-3 py-2 sm:grid-cols-2">
|
||||
{group.items.map((id) => {
|
||||
const checked = selected.includes(id);
|
||||
return (
|
||||
@@ -144,7 +144,7 @@ export function TechNotesChecklist() {
|
||||
type="checkbox"
|
||||
checked={checked}
|
||||
onChange={() => toggleItem(id)}
|
||||
className="focus:ring-accent/40 h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-border text-accent focus:ring-1"
|
||||
className="focus:ring-accent/40 border-border text-accent h-3.5 w-3.5 shrink-0 cursor-pointer rounded focus:ring-1"
|
||||
/>
|
||||
<span>{t(`editor.techNoteOptions.${id}`)}</span>
|
||||
</label>
|
||||
|
||||
@@ -112,7 +112,7 @@ export function VideoSettingsForm() {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.videoSettings")}</span>
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.videoSettings")}</span>
|
||||
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
|
||||
<Select
|
||||
@@ -151,14 +151,14 @@ export function VideoSettingsForm() {
|
||||
value={store.videoStyleEra}
|
||||
onChange={(v) => store.set("videoStyleEra", v as VideoStyleEra)}
|
||||
/>
|
||||
<p className="-mt-1 text-xs text-text-muted">{t("editor.videoStyleHelp")}</p>
|
||||
<p className="text-text-muted -mt-1 text-xs">{t("editor.videoStyleHelp")}</p>
|
||||
|
||||
<Toggle
|
||||
label={t("editor.skipGraphicsSettings")}
|
||||
checked={store.skipGraphicsSettings}
|
||||
onChange={(v) => store.set("skipGraphicsSettings", v)}
|
||||
/>
|
||||
<p className="-mt-1 text-xs text-text-muted">{t("editor.skipGraphicsSettingsHelp")}</p>
|
||||
<p className="text-text-muted -mt-1 text-xs">{t("editor.skipGraphicsSettingsHelp")}</p>
|
||||
|
||||
{!store.skipGraphicsSettings && (
|
||||
<>
|
||||
|
||||
@@ -61,8 +61,8 @@ export function VietnameseDonateEditor() {
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex flex-col gap-1">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.vnDonate")}</span>
|
||||
<p className="text-xs text-text-muted">{t("editor.vnDonateHelp")}</p>
|
||||
<span className="text-text-secondary text-sm font-medium">{t("editor.vnDonate")}</span>
|
||||
<p className="text-text-muted text-xs">{t("editor.vnDonateHelp")}</p>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
|
||||
@@ -52,16 +52,16 @@ function FullscreenError({ kind }: ErrorPageProps) {
|
||||
useDocumentTitle(title);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col items-center justify-center gap-6 bg-surface-0 px-6 py-12 text-center">
|
||||
<div className="bg-surface-0 flex min-h-screen flex-col items-center justify-center gap-6 px-6 py-12 text-center">
|
||||
<Icon className={clsx("h-16 w-16", colour)} aria-hidden />
|
||||
{meta.code !== null && (
|
||||
<p className={clsx("font-mono text-6xl font-bold tabular-nums leading-none", colour)}>
|
||||
<p className={clsx("font-mono text-6xl leading-none font-bold tabular-nums", colour)}>
|
||||
{meta.code}
|
||||
</p>
|
||||
)}
|
||||
<div className="max-w-md space-y-2">
|
||||
<h1 className="text-2xl font-semibold text-text-primary">{title}</h1>
|
||||
<p className="text-sm text-text-secondary">{description}</p>
|
||||
<h1 className="text-text-primary text-2xl font-semibold">{title}</h1>
|
||||
<p className="text-text-secondary text-sm">{description}</p>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center justify-center gap-3">
|
||||
<Button
|
||||
@@ -99,14 +99,14 @@ function ContainedError({ kind, onReset, detail }: ErrorPageProps) {
|
||||
|
||||
return (
|
||||
<div className="flex min-h-[200px] items-center justify-center p-6">
|
||||
<div className="border-danger/40 w-full max-w-md rounded-lg border bg-surface-2 p-5 shadow-md shadow-black/10">
|
||||
<div className="border-danger/40 bg-surface-2 w-full max-w-md rounded-lg border p-5 shadow-md shadow-black/10">
|
||||
<div className={clsx("mb-3 flex items-center gap-2", colour)}>
|
||||
<Icon className="h-4 w-4" />
|
||||
<h2 className="text-sm font-semibold">{title}</h2>
|
||||
</div>
|
||||
<p className="mb-3 text-xs text-text-secondary">{description}</p>
|
||||
<p className="text-text-secondary mb-3 text-xs">{description}</p>
|
||||
{detail && (
|
||||
<pre className="mb-4 max-h-32 overflow-auto whitespace-pre-wrap rounded bg-surface-3 p-2 text-[11px] text-text-muted">
|
||||
<pre className="bg-surface-3 text-text-muted mb-4 max-h-32 overflow-auto rounded p-2 text-[11px] whitespace-pre-wrap">
|
||||
{detail}
|
||||
</pre>
|
||||
)}
|
||||
@@ -140,7 +140,7 @@ function ReportBugLink({ size = "md" }: { size?: "sm" | "md" }) {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className={clsx(
|
||||
"focus:ring-accent/50 inline-flex items-center justify-center gap-2 rounded-lg font-medium text-text-secondary transition-colors hover:bg-surface-2 hover:text-text-primary focus:outline-none focus:ring-2",
|
||||
"focus:ring-accent/50 text-text-secondary hover:bg-surface-2 hover:text-text-primary inline-flex items-center justify-center gap-2 rounded-lg font-medium transition-colors focus:ring-2 focus:outline-none",
|
||||
sizeClass,
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -35,18 +35,18 @@ export function OfflineBanner() {
|
||||
return (
|
||||
<div
|
||||
role="status"
|
||||
className="border-warning/40 fixed inset-x-0 bottom-0 z-50 flex items-center justify-center gap-3 border-t bg-surface-2 px-4 py-2 text-sm text-text-primary shadow-md shadow-black/20"
|
||||
className="border-warning/40 bg-surface-2 text-text-primary fixed inset-x-0 bottom-0 z-50 flex items-center justify-center gap-3 border-t px-4 py-2 text-sm shadow-md shadow-black/20"
|
||||
>
|
||||
<WifiOff className="h-4 w-4 shrink-0 text-warning" aria-hidden />
|
||||
<WifiOff className="text-warning h-4 w-4 shrink-0" aria-hidden />
|
||||
<span>{t("errorPages.offlineBanner.message")}</span>
|
||||
<Link to="/offline" className="font-medium text-accent hover:text-accent-hover">
|
||||
<Link to="/offline" className="text-accent hover:text-accent-hover font-medium">
|
||||
{t("errorPages.offlineBanner.details")}
|
||||
</Link>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setDismissed(true)}
|
||||
aria-label={t("common.dismiss")}
|
||||
className="ml-1 rounded p-1 text-text-muted transition-colors hover:bg-surface-3 hover:text-text-primary"
|
||||
className="text-text-muted hover:bg-surface-3 hover:text-text-primary ml-1 rounded p-1 transition-colors"
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</button>
|
||||
|
||||
@@ -19,7 +19,7 @@ export function HistoryCard({ entry }: HistoryCardProps) {
|
||||
const date = new Date(entry.createdAt).toLocaleDateString();
|
||||
|
||||
return (
|
||||
<div className="hover:border-accent/30 rounded-lg border border-border-strong bg-surface-2 shadow-md shadow-black/10 transition-colors">
|
||||
<div className="hover:border-accent/30 border-border-strong bg-surface-2 rounded-lg border shadow-md shadow-black/10 transition-colors">
|
||||
<div
|
||||
className="flex cursor-pointer items-center justify-between p-3"
|
||||
onClick={() => setExpanded(!expanded)}
|
||||
@@ -27,9 +27,9 @@ export function HistoryCard({ entry }: HistoryCardProps) {
|
||||
<div className="flex-1">
|
||||
<div className="flex items-center gap-2">
|
||||
{videoType && <span>{videoType.icon}</span>}
|
||||
<span className="text-sm font-medium text-text-primary">{entry.title}</span>
|
||||
<span className="text-text-primary text-sm font-medium">{entry.title}</span>
|
||||
</div>
|
||||
<div className="mt-1 flex gap-2 text-xs text-text-muted">
|
||||
<div className="text-text-muted mt-1 flex gap-2 text-xs">
|
||||
<span>{entry.gameName}</span>
|
||||
<span>{entry.language.toUpperCase()}</span>
|
||||
<span>{date}</span>
|
||||
@@ -44,24 +44,24 @@ export function HistoryCard({ entry }: HistoryCardProps) {
|
||||
deleteEntry(entry.id);
|
||||
}}
|
||||
>
|
||||
<Trash2 className="h-3.5 w-3.5 text-danger" />
|
||||
<Trash2 className="text-danger h-3.5 w-3.5" />
|
||||
</Button>
|
||||
{expanded ? (
|
||||
<ChevronUp className="h-4 w-4 text-text-muted" />
|
||||
<ChevronUp className="text-text-muted h-4 w-4" />
|
||||
) : (
|
||||
<ChevronDown className="h-4 w-4 text-text-muted" />
|
||||
<ChevronDown className="text-text-muted h-4 w-4" />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{expanded && (
|
||||
<div className="border-t border-border p-3">
|
||||
<div className="border-border border-t p-3">
|
||||
<div className="mb-2 flex gap-2">
|
||||
<CopyButton text={entry.title} label={t("output.copyTitle")} />
|
||||
<CopyButton text={entry.description} label={t("output.copyDescription")} />
|
||||
<CopyButton text={entry.tags} label={t("output.copyTags")} />
|
||||
</div>
|
||||
<pre className="max-h-48 overflow-y-auto whitespace-pre-wrap rounded bg-surface-2 p-2 font-sans text-xs text-text-secondary">
|
||||
<pre className="bg-surface-2 text-text-secondary max-h-48 overflow-y-auto rounded p-2 font-sans text-xs whitespace-pre-wrap">
|
||||
{entry.description}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,7 @@ export function AppShell() {
|
||||
useGlobalErrorHandler();
|
||||
|
||||
return (
|
||||
<div className="flex h-screen overflow-hidden bg-surface-0">
|
||||
<div className="bg-surface-0 flex h-screen overflow-hidden">
|
||||
<Sidebar />
|
||||
<div className="flex min-w-0 flex-1 flex-col">
|
||||
<Header onOpenMobileNav={() => setMobileNavOpen(true)} />
|
||||
|
||||
@@ -37,23 +37,23 @@ export function Header({ onOpenMobileNav }: HeaderProps) {
|
||||
};
|
||||
|
||||
return (
|
||||
<header className="flex items-center justify-between gap-2 border-b border-border bg-surface-1 px-3 py-3 pt-[max(0.75rem,env(safe-area-inset-top))] sm:px-6">
|
||||
<header className="border-border bg-surface-1 flex items-center justify-between gap-2 border-b px-3 py-3 pt-[max(0.75rem,env(safe-area-inset-top))] sm:px-6">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
{onOpenMobileNav && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onOpenMobileNav}
|
||||
aria-label="Open navigation menu"
|
||||
className="-ml-1 rounded-lg p-2 text-text-secondary transition-colors hover:bg-surface-2 hover:text-text-primary md:hidden"
|
||||
className="text-text-secondary hover:bg-surface-2 hover:text-text-primary -ml-1 rounded-lg p-2 transition-colors md:hidden"
|
||||
>
|
||||
<Menu className="h-5 w-5" />
|
||||
</button>
|
||||
)}
|
||||
<div className="min-w-0">
|
||||
<h1 className="truncate text-base font-bold text-text-primary sm:text-lg">
|
||||
<h1 className="text-text-primary truncate text-base font-bold sm:text-lg">
|
||||
{t("app.title")}
|
||||
</h1>
|
||||
<p className="hidden truncate text-xs text-text-muted sm:block">{t("app.subtitle")}</p>
|
||||
<p className="text-text-muted hidden truncate text-xs sm:block">{t("app.subtitle")}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-2">
|
||||
@@ -71,7 +71,7 @@ export function Header({ onOpenMobileNav }: HeaderProps) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
|
||||
className="rounded-lg p-2 text-text-secondary transition-colors hover:bg-surface-2 hover:text-text-primary"
|
||||
className="text-text-secondary hover:bg-surface-2 hover:text-text-primary rounded-lg p-2 transition-colors"
|
||||
title={t("header.toggleTheme")}
|
||||
aria-label={t("header.toggleTheme")}
|
||||
>
|
||||
@@ -80,22 +80,22 @@ export function Header({ onOpenMobileNav }: HeaderProps) {
|
||||
<div className="relative" ref={dropdownRef}>
|
||||
<button
|
||||
onClick={() => setOpen(!open)}
|
||||
className="flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm transition-colors hover:bg-surface-2 sm:px-3"
|
||||
className="hover:bg-surface-2 flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm transition-colors sm:px-3"
|
||||
aria-haspopup="listbox"
|
||||
aria-expanded={open}
|
||||
>
|
||||
<span>{current?.flag}</span>
|
||||
<span className="hidden text-text-primary sm:inline">{current?.nativeName}</span>
|
||||
<ChevronDown className="h-3.5 w-3.5 text-text-muted" />
|
||||
<span className="text-text-primary hidden sm:inline">{current?.nativeName}</span>
|
||||
<ChevronDown className="text-text-muted h-3.5 w-3.5" />
|
||||
</button>
|
||||
{open && (
|
||||
<div className="absolute right-0 top-full z-50 mt-1 min-w-[200px] max-w-[calc(100vw-2rem)] rounded-lg border border-border bg-surface-1 py-1 shadow-xl">
|
||||
<div className="border-border bg-surface-1 absolute top-full right-0 z-50 mt-1 max-w-[calc(100vw-2rem)] min-w-[200px] rounded-lg border py-1 shadow-xl">
|
||||
{SUPPORTED_LANGUAGES.map((lang) => (
|
||||
<button
|
||||
key={lang.id}
|
||||
onClick={() => handleSwitch(lang.id as SupportedLanguage)}
|
||||
className={clsx(
|
||||
"flex w-full items-center gap-2 px-3 py-2 text-sm transition-colors hover:bg-surface-2",
|
||||
"hover:bg-surface-2 flex w-full items-center gap-2 px-3 py-2 text-sm transition-colors",
|
||||
lang.id === appLanguage ? "bg-accent-muted text-accent" : "text-text-primary",
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -6,7 +6,13 @@ import clsx from "clsx";
|
||||
|
||||
interface ScrollToTopButtonProps {
|
||||
/** The scrollable container to watch and scroll back to the top. */
|
||||
scrollRef: RefObject<HTMLElement>;
|
||||
/**
|
||||
* React 19 types `useRef<T>(null)` as `RefObject<T | null>` rather than
|
||||
* `RefObject<T>` — the ref genuinely is null before the element mounts, and
|
||||
* the old type quietly lied about it. Matching that here rather than casting
|
||||
* at the call site keeps the null-check below honest.
|
||||
*/
|
||||
scrollRef: RefObject<HTMLElement | null>;
|
||||
}
|
||||
|
||||
/** Scroll distance (px) past which the button fades in. */
|
||||
@@ -62,10 +68,10 @@ export function ScrollToTopButton({ scrollRef }: ScrollToTopButtonProps) {
|
||||
aria-hidden={!visible}
|
||||
tabIndex={visible ? 0 : -1}
|
||||
className={clsx(
|
||||
"fixed bottom-6 right-6 z-40 flex h-touch w-touch items-center justify-center",
|
||||
"rounded-full border border-border bg-surface-1 text-text-primary shadow-lg",
|
||||
"transition-opacity duration-200 hover:bg-surface-2",
|
||||
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
||||
"h-touch w-touch fixed right-6 bottom-6 z-40 flex items-center justify-center",
|
||||
"border-border bg-surface-1 text-text-primary rounded-full border shadow-lg",
|
||||
"hover:bg-surface-2 transition-opacity duration-200",
|
||||
"focus-visible:ring-accent focus:outline-none focus-visible:ring-2",
|
||||
visible ? "opacity-100" : "pointer-events-none opacity-0",
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -110,7 +110,7 @@ export function Sidebar() {
|
||||
return (
|
||||
<aside
|
||||
className={clsx(
|
||||
"hidden shrink-0 flex-col border-r border-border bg-surface-1 transition-[width] duration-200 md:flex",
|
||||
"border-border bg-surface-1 hidden shrink-0 flex-col border-r transition-[width] duration-200 md:flex",
|
||||
collapsed ? "w-14" : "w-56",
|
||||
)}
|
||||
>
|
||||
@@ -119,7 +119,7 @@ export function Sidebar() {
|
||||
onClick={toggle}
|
||||
aria-label={t(collapsed ? "sidebar.expand" : "sidebar.collapse")}
|
||||
title={t(collapsed ? "sidebar.expand" : "sidebar.collapse")}
|
||||
className="flex h-12 items-center justify-center border-b border-border text-text-muted transition-colors hover:bg-surface-2 hover:text-text-primary"
|
||||
className="border-border text-text-muted hover:bg-surface-2 hover:text-text-primary flex h-12 items-center justify-center border-b transition-colors"
|
||||
>
|
||||
{collapsed ? <PanelLeftOpen className="h-5 w-5" /> : <PanelLeftClose className="h-5 w-5" />}
|
||||
</button>
|
||||
|
||||
@@ -33,7 +33,7 @@ export function LogEntryCard({ entry }: LogEntryProps) {
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
"rounded-lg border bg-surface-2 transition-colors",
|
||||
"bg-surface-2 rounded-lg border transition-colors",
|
||||
entry.level === "error" ? "border-red-500/30" : "border-border",
|
||||
)}
|
||||
>
|
||||
@@ -49,39 +49,39 @@ export function LogEntryCard({ entry }: LogEntryProps) {
|
||||
>
|
||||
{entry.level}
|
||||
</span>
|
||||
<span className="shrink-0 rounded bg-surface-3 px-1.5 py-0.5 text-[10px] text-text-muted">
|
||||
<span className="bg-surface-3 text-text-muted shrink-0 rounded px-1.5 py-0.5 text-[10px]">
|
||||
{entry.source}
|
||||
</span>
|
||||
<span className="min-w-0 flex-1 truncate text-xs text-text-primary">{entry.message}</span>
|
||||
<span className="shrink-0 text-[10px] text-text-muted">{time}</span>
|
||||
<span className="text-text-primary min-w-0 flex-1 truncate text-xs">{entry.message}</span>
|
||||
<span className="text-text-muted shrink-0 text-[10px]">{time}</span>
|
||||
<div className="flex shrink-0 items-center gap-0.5">
|
||||
<button
|
||||
onClick={handleCopy}
|
||||
className="rounded p-1 text-text-muted hover:bg-surface-3 hover:text-text-primary"
|
||||
className="text-text-muted hover:bg-surface-3 hover:text-text-primary rounded p-1"
|
||||
>
|
||||
{copied ? <Check className="h-3 w-3 text-success" /> : <Copy className="h-3 w-3" />}
|
||||
{copied ? <Check className="text-success h-3 w-3" /> : <Copy className="h-3 w-3" />}
|
||||
</button>
|
||||
<button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
deleteEntry(entry.id);
|
||||
}}
|
||||
className="rounded p-1 text-text-muted hover:bg-surface-3 hover:text-danger"
|
||||
className="text-text-muted hover:bg-surface-3 hover:text-danger rounded p-1"
|
||||
>
|
||||
<Trash2 className="h-3 w-3" />
|
||||
</button>
|
||||
{entry.details &&
|
||||
(expanded ? (
|
||||
<ChevronUp className="h-3.5 w-3.5 text-text-muted" />
|
||||
<ChevronUp className="text-text-muted h-3.5 w-3.5" />
|
||||
) : (
|
||||
<ChevronDown className="h-3.5 w-3.5 text-text-muted" />
|
||||
<ChevronDown className="text-text-muted h-3.5 w-3.5" />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{expanded && entry.details && (
|
||||
<div className="border-t border-border px-3 py-2">
|
||||
<pre className="max-h-40 overflow-auto whitespace-pre-wrap font-mono text-[11px] text-text-secondary">
|
||||
<div className="border-border border-t px-3 py-2">
|
||||
<pre className="text-text-secondary max-h-40 overflow-auto font-mono text-[11px] whitespace-pre-wrap">
|
||||
{entry.details}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@ export function CharCounter({ text, limit }: CharCounterProps) {
|
||||
"font-mono text-xs font-semibold transition-colors",
|
||||
isOver && "text-danger",
|
||||
isWarning && "text-warning",
|
||||
!isOver && !isWarning && "font-normal text-text-muted",
|
||||
!isOver && !isWarning && "text-text-muted font-normal",
|
||||
)}
|
||||
>
|
||||
{count}/{limit}
|
||||
|
||||
@@ -30,7 +30,7 @@ export function CopyAllBar({ text, status }: CopyAllBarProps) {
|
||||
const { copy } = useClipboard();
|
||||
|
||||
return (
|
||||
<div className="sticky bottom-0 flex flex-col gap-2 border-t border-border bg-surface-0 px-3 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] sm:px-4">
|
||||
<div className="border-border bg-surface-0 sticky bottom-0 flex flex-col gap-2 border-t px-3 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] sm:px-4">
|
||||
<LimitBlockBanner status={status} />
|
||||
<div className="flex items-center justify-end">
|
||||
<Button
|
||||
|
||||
@@ -22,7 +22,7 @@ export function LimitBlockBanner({ status, titleKey }: LimitBlockBannerProps) {
|
||||
return (
|
||||
<div
|
||||
role="alert"
|
||||
className="border-danger/40 bg-danger/10 flex flex-col gap-1 rounded-lg border px-3 py-2 text-xs text-danger"
|
||||
className="border-danger/40 bg-danger/10 text-danger flex flex-col gap-1 rounded-lg border px-3 py-2 text-xs"
|
||||
>
|
||||
<span className="flex items-center gap-1.5 font-semibold">
|
||||
<AlertTriangle className="h-3.5 w-3.5 shrink-0" />
|
||||
|
||||
@@ -73,11 +73,11 @@ export function OutputExtras() {
|
||||
{hasThumbnail && (
|
||||
<section className="flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-text-primary">{t("output.thumbnailText")}</h3>
|
||||
<h3 className="text-text-primary text-sm font-semibold">{t("output.thumbnailText")}</h3>
|
||||
<CopyButton text={thumbnailText} label={t("output.copyThumbnailText")} />
|
||||
</div>
|
||||
<div className="rounded-lg border border-border bg-surface-1 p-3">
|
||||
<pre className="whitespace-pre-wrap font-sans text-sm text-text-secondary">
|
||||
<div className="border-border bg-surface-1 rounded-lg border p-3">
|
||||
<pre className="text-text-secondary font-sans text-sm whitespace-pre-wrap">
|
||||
{thumbnailText}
|
||||
</pre>
|
||||
</div>
|
||||
@@ -87,11 +87,11 @@ export function OutputExtras() {
|
||||
{hasPinned && (
|
||||
<section className="flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-text-primary">{t("output.pinnedComment")}</h3>
|
||||
<h3 className="text-text-primary text-sm font-semibold">{t("output.pinnedComment")}</h3>
|
||||
<CopyButton text={pinnedComment} label={t("output.copyPinnedComment")} />
|
||||
</div>
|
||||
<div className="rounded-lg border border-border bg-surface-1 p-3">
|
||||
<pre className="whitespace-pre-wrap font-sans text-sm text-text-secondary">
|
||||
<div className="border-border bg-surface-1 rounded-lg border p-3">
|
||||
<pre className="text-text-secondary font-sans text-sm whitespace-pre-wrap">
|
||||
{pinnedComment}
|
||||
</pre>
|
||||
</div>
|
||||
@@ -101,13 +101,13 @@ export function OutputExtras() {
|
||||
{hasTemplate && (
|
||||
<section className="flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-text-primary">
|
||||
<h3 className="text-text-primary text-sm font-semibold">
|
||||
{t("output.pinnedCommentTemplate")}
|
||||
</h3>
|
||||
<CopyButton text={templateText} label={t("output.copyPinnedCommentTemplate")} />
|
||||
</div>
|
||||
<div className="rounded-lg border border-border bg-surface-1 p-3">
|
||||
<pre className="whitespace-pre-wrap font-sans text-sm text-text-secondary">
|
||||
<div className="border-border bg-surface-1 rounded-lg border p-3">
|
||||
<pre className="text-text-secondary font-sans text-sm whitespace-pre-wrap">
|
||||
{templateText}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ export function OutputPreview({ output: outputProp, status }: OutputPreviewProps
|
||||
{/* Title */}
|
||||
<section className="flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-text-primary">{t("output.title")}</h3>
|
||||
<h3 className="text-text-primary text-sm font-semibold">{t("output.title")}</h3>
|
||||
<div className="flex items-center gap-3">
|
||||
{showCharCount && <CharCounter text={output.title} limit={YT_LIMITS.TITLE_MAX} />}
|
||||
<CopyButton
|
||||
@@ -40,15 +40,15 @@ export function OutputPreview({ output: outputProp, status }: OutputPreviewProps
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-lg border border-border bg-surface-1 p-3">
|
||||
<p className="text-sm font-medium text-text-primary">{output.title}</p>
|
||||
<div className="border-border bg-surface-1 rounded-lg border p-3">
|
||||
<p className="text-text-primary text-sm font-medium">{output.title}</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Description */}
|
||||
<section className="flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-text-primary">{t("output.description")}</h3>
|
||||
<h3 className="text-text-primary text-sm font-semibold">{t("output.description")}</h3>
|
||||
<div className="flex items-center gap-3">
|
||||
{showCharCount && (
|
||||
<CharCounter text={output.description} limit={YT_LIMITS.DESCRIPTION_MAX} />
|
||||
@@ -62,8 +62,8 @@ export function OutputPreview({ output: outputProp, status }: OutputPreviewProps
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="max-h-[60vh] overflow-y-auto rounded-lg border border-border bg-surface-1 p-3 sm:max-h-[400px]">
|
||||
<pre className="whitespace-pre-wrap font-sans text-sm text-text-secondary">
|
||||
<div className="border-border bg-surface-1 max-h-[60vh] overflow-y-auto rounded-lg border p-3 sm:max-h-[400px]">
|
||||
<pre className="text-text-secondary font-sans text-sm whitespace-pre-wrap">
|
||||
{output.description}
|
||||
</pre>
|
||||
</div>
|
||||
@@ -72,7 +72,7 @@ export function OutputPreview({ output: outputProp, status }: OutputPreviewProps
|
||||
{/* Tags */}
|
||||
<section className="flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-sm font-semibold text-text-primary">
|
||||
<h3 className="text-text-primary text-sm font-semibold">
|
||||
{t("output.tags")} ({output.tags.length})
|
||||
</h3>
|
||||
<div className="flex items-center gap-3">
|
||||
@@ -86,15 +86,15 @@ export function OutputPreview({ output: outputProp, status }: OutputPreviewProps
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-lg border border-border bg-surface-1 p-3">
|
||||
<div className="border-border bg-surface-1 rounded-lg border p-3">
|
||||
{compactTagDisplay ? (
|
||||
<p className="text-xs text-text-secondary">{output.tagString}</p>
|
||||
<p className="text-text-secondary text-xs">{output.tagString}</p>
|
||||
) : (
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{output.tags.map((tag, i) => (
|
||||
<span
|
||||
key={i}
|
||||
className="rounded-md bg-surface-2 px-2 py-0.5 text-xs text-text-secondary"
|
||||
className="bg-surface-2 text-text-secondary rounded-md px-2 py-0.5 text-xs"
|
||||
>
|
||||
{tag}
|
||||
</span>
|
||||
|
||||
@@ -92,7 +92,7 @@ export function VariantPicker({ open, onClose }: VariantPickerProps) {
|
||||
{variants.map((variant) => (
|
||||
<section key={variant.id} className="flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-xs font-semibold uppercase tracking-wide text-text-muted">
|
||||
<h3 className="text-text-muted text-xs font-semibold tracking-wide uppercase">
|
||||
{t(variant.labelKey)}
|
||||
</h3>
|
||||
<div className="flex items-center gap-3">
|
||||
@@ -100,8 +100,8 @@ export function VariantPicker({ open, onClose }: VariantPickerProps) {
|
||||
<CopyButton text={variant.title} label={t("output.copyTitle")} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-lg border border-border bg-surface-1 p-3">
|
||||
<p className="text-sm font-medium text-text-primary">{variant.title}</p>
|
||||
<div className="border-border bg-surface-1 rounded-lg border p-3">
|
||||
<p className="text-text-primary text-sm font-medium">{variant.title}</p>
|
||||
</div>
|
||||
</section>
|
||||
))}
|
||||
|
||||
@@ -46,12 +46,12 @@ export function PresetCard({ preset }: PresetCardProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="hover:border-accent/30 flex flex-col gap-3 rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="hover:border-accent/30 border-border-strong bg-surface-2 flex flex-col gap-3 rounded-lg border p-4 shadow-md shadow-black/10 transition-colors sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="min-w-0 flex-1">
|
||||
<h3 className="text-sm font-semibold text-text-primary">{preset.gameName}</h3>
|
||||
<div className="mt-1.5 flex flex-wrap items-center gap-1.5 text-xs text-text-muted">
|
||||
<h3 className="text-text-primary text-sm font-semibold">{preset.gameName}</h3>
|
||||
<div className="text-text-muted mt-1.5 flex flex-wrap items-center gap-1.5 text-xs">
|
||||
{genreDefs.map((g) => (
|
||||
<span key={g.id} className="rounded bg-surface-2 px-1.5 py-0.5">
|
||||
<span key={g.id} className="bg-surface-2 rounded px-1.5 py-0.5">
|
||||
{g.icon} {t(g.labelKey)}
|
||||
</span>
|
||||
))}
|
||||
@@ -67,7 +67,7 @@ export function PresetCard({ preset }: PresetCardProps) {
|
||||
<Pencil className="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" onClick={() => setShowDelete(true)}>
|
||||
<Trash2 className="h-3.5 w-3.5 text-danger" />
|
||||
<Trash2 className="text-danger h-3.5 w-3.5" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@ export function PresetList() {
|
||||
return (
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<h2 className="text-base font-semibold text-text-primary">{t("presets.title")}</h2>
|
||||
<h2 className="text-text-primary text-base font-semibold">{t("presets.title")}</h2>
|
||||
<Button size="sm" onClick={() => setShowCreate(true)}>
|
||||
<Plus className="h-4 w-4" />
|
||||
{t("presets.createNew")}
|
||||
@@ -22,7 +22,7 @@ export function PresetList() {
|
||||
</div>
|
||||
|
||||
{presets.length === 0 ? (
|
||||
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
|
||||
<p className="border-border text-text-muted rounded-lg border border-dashed py-8 text-center text-sm">
|
||||
{t("presets.emptyState")}
|
||||
</p>
|
||||
) : (
|
||||
|
||||
@@ -66,7 +66,7 @@ export function PresetSaveForm({ open, onClose, editPreset }: PresetSaveFormProp
|
||||
onChange={(e) => setGameName(e.target.value)}
|
||||
autoFocus
|
||||
/>
|
||||
<p className="text-xs text-text-muted">
|
||||
<p className="text-text-muted text-xs">
|
||||
{editPreset
|
||||
? "Update the game name. Other fields are saved from the editor."
|
||||
: "Preset will save your current game name, genre, platform, store links, and warning settings."}
|
||||
|
||||
@@ -45,13 +45,13 @@ export function ProfileCard({ profile }: ProfileCardProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="hover:border-accent/30 flex flex-col gap-3 rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="hover:border-accent/30 border-border-strong bg-surface-2 flex flex-col gap-3 rounded-lg border p-4 shadow-md shadow-black/10 transition-colors sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="min-w-0 flex-1">
|
||||
<h3 className="text-sm font-semibold text-text-primary">{profile.name}</h3>
|
||||
<p className="mt-0.5 text-xs text-text-secondary">
|
||||
<h3 className="text-text-primary text-sm font-semibold">{profile.name}</h3>
|
||||
<p className="text-text-secondary mt-0.5 text-xs">
|
||||
{profile.channelName || "No channel"}
|
||||
</p>
|
||||
<div className="mt-1.5 flex flex-wrap gap-3 text-xs text-text-muted">
|
||||
<div className="text-text-muted mt-1.5 flex flex-wrap gap-3 text-xs">
|
||||
{socialCount > 0 && <span>{socialCount} social links</span>}
|
||||
{rigCount > 0 && <span>{rigCount} rig fields</span>}
|
||||
</div>
|
||||
@@ -65,7 +65,7 @@ export function ProfileCard({ profile }: ProfileCardProps) {
|
||||
<Pencil className="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" onClick={() => setShowDelete(true)}>
|
||||
<Trash2 className="h-3.5 w-3.5 text-danger" />
|
||||
<Trash2 className="text-danger h-3.5 w-3.5" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@ export function ProfileList() {
|
||||
return (
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<h2 className="text-base font-semibold text-text-primary">{t("profiles.title")}</h2>
|
||||
<h2 className="text-text-primary text-base font-semibold">{t("profiles.title")}</h2>
|
||||
<Button size="sm" onClick={() => setShowCreate(true)}>
|
||||
<Plus className="h-4 w-4" />
|
||||
{t("profiles.createNew")}
|
||||
@@ -22,7 +22,7 @@ export function ProfileList() {
|
||||
</div>
|
||||
|
||||
{profiles.length === 0 ? (
|
||||
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
|
||||
<p className="border-border text-text-muted rounded-lg border border-dashed py-8 text-center text-sm">
|
||||
{t("profiles.emptyState")}
|
||||
</p>
|
||||
) : (
|
||||
|
||||
@@ -84,8 +84,8 @@ export function ProfileSaveForm({ open, onClose, editProfile }: ProfileSaveFormP
|
||||
onChange={(e) => setAdText(e.target.value)}
|
||||
rows={4}
|
||||
/>
|
||||
<p className="text-xs text-text-muted">{t("profiles.thirdPartyAdTextHelp")}</p>
|
||||
<p className="text-xs text-text-muted">
|
||||
<p className="text-text-muted text-xs">{t("profiles.thirdPartyAdTextHelp")}</p>
|
||||
<p className="text-text-muted text-xs">
|
||||
{editProfile
|
||||
? "Update this profile's name and ad copy. Other fields are saved from the editor."
|
||||
: "Profile will save your current channel name, social links, rig info, and video settings."}
|
||||
|
||||
@@ -37,10 +37,10 @@ export function TemplateCard({ template }: TemplateCardProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="hover:border-accent/30 flex flex-col gap-3 rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="hover:border-accent/30 border-border-strong bg-surface-2 flex flex-col gap-3 rounded-lg border p-4 shadow-md shadow-black/10 transition-colors sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="min-w-0 flex-1">
|
||||
<h3 className="text-sm font-semibold text-text-primary">{template.name}</h3>
|
||||
<div className="mt-1.5 flex flex-wrap items-center gap-2 text-xs text-text-muted">
|
||||
<h3 className="text-text-primary text-sm font-semibold">{template.name}</h3>
|
||||
<div className="text-text-muted mt-1.5 flex flex-wrap items-center gap-2 text-xs">
|
||||
<span>{template.snapshot.gameName || "—"}</span>
|
||||
<span>·</span>
|
||||
<span>{date}</span>
|
||||
@@ -52,7 +52,7 @@ export function TemplateCard({ template }: TemplateCardProps) {
|
||||
{t("templates.loadTemplate")}
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" onClick={() => setShowDelete(true)}>
|
||||
<Trash2 className="h-3.5 w-3.5 text-danger" />
|
||||
<Trash2 className="text-danger h-3.5 w-3.5" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@ export function TemplateList() {
|
||||
|
||||
if (templates.length === 0) {
|
||||
return (
|
||||
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
|
||||
<p className="border-border text-text-muted rounded-lg border border-dashed py-8 text-center text-sm">
|
||||
{t("templates.emptyState")}
|
||||
</p>
|
||||
);
|
||||
|
||||
@@ -118,7 +118,7 @@ export function TemplateSaveForm({ open, onClose }: TemplateSaveFormProps) {
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
autoFocus
|
||||
/>
|
||||
<p className="text-xs text-text-muted">{t("templates.saveHint")}</p>
|
||||
<p className="text-text-muted text-xs">{t("templates.saveHint")}</p>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
@@ -27,22 +27,22 @@ export function Accordion({ id, title, icon, badge, open, onToggle, children }:
|
||||
return (
|
||||
<section
|
||||
data-accordion-id={id}
|
||||
className="overflow-hidden rounded-lg border border-border bg-surface-1"
|
||||
className="border-border bg-surface-1 overflow-hidden rounded-lg border"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onToggle}
|
||||
aria-expanded={open}
|
||||
className="flex w-full items-center justify-between gap-3 px-4 py-3 text-left transition-colors hover:bg-surface-2"
|
||||
className="hover:bg-surface-2 flex w-full items-center justify-between gap-3 px-4 py-3 text-left transition-colors"
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
{icon && <span className="text-base leading-none">{icon}</span>}
|
||||
<span className="text-sm font-semibold text-text-primary">{title}</span>
|
||||
<span className="text-text-primary text-sm font-semibold">{title}</span>
|
||||
{badge}
|
||||
</div>
|
||||
<ChevronDown
|
||||
className={clsx(
|
||||
"h-4 w-4 text-text-muted transition-transform duration-200",
|
||||
"text-text-muted h-4 w-4 transition-transform duration-200",
|
||||
open && "rotate-180",
|
||||
)}
|
||||
/>
|
||||
@@ -54,7 +54,7 @@ export function Accordion({ id, title, icon, badge, open, onToggle, children }:
|
||||
)}
|
||||
>
|
||||
<div className="overflow-hidden">
|
||||
<div className="flex flex-col gap-3 border-t border-border px-4 py-4">{children}</div>
|
||||
<div className="border-border flex flex-col gap-3 border-t px-4 py-4">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -23,7 +23,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
<button
|
||||
ref={ref}
|
||||
className={clsx(
|
||||
"focus:ring-accent/50 inline-flex items-center justify-center gap-2 rounded-lg font-medium transition-colors focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:opacity-50",
|
||||
"focus:ring-accent/50 inline-flex items-center justify-center gap-2 rounded-lg font-medium transition-colors focus:ring-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
||||
variantClasses[variant],
|
||||
sizeClasses[size],
|
||||
className,
|
||||
|
||||
@@ -26,7 +26,7 @@ export function Checkbox({ checked, onChange, label, className, id }: CheckboxPr
|
||||
<label
|
||||
htmlFor={inputId}
|
||||
className={clsx(
|
||||
"group flex min-h-touch cursor-pointer items-start gap-3 text-left",
|
||||
"group min-h-touch flex cursor-pointer items-start gap-3 text-left",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
@@ -44,12 +44,12 @@ export function Checkbox({ checked, onChange, label, className, id }: CheckboxPr
|
||||
"peer-focus-visible:ring-accent/50 peer-focus-visible:ring-2",
|
||||
checked
|
||||
? "border-accent bg-accent text-white"
|
||||
: "border-border bg-surface-1 text-transparent group-hover:border-border-strong",
|
||||
: "border-border bg-surface-1 group-hover:border-border-strong text-transparent",
|
||||
)}
|
||||
>
|
||||
<Check className="h-3.5 w-3.5" strokeWidth={3} />
|
||||
</span>
|
||||
<span className="text-sm leading-snug text-text-primary">{label}</span>
|
||||
<span className="text-text-primary text-sm leading-snug">{label}</span>
|
||||
</label>
|
||||
);
|
||||
}
|
||||
@@ -58,8 +58,8 @@ export function ChipGroup(props: ChipGroupProps) {
|
||||
<div className={clsx("flex flex-col gap-2", className)}>
|
||||
{(label || counter) && (
|
||||
<div className="flex items-center justify-between">
|
||||
{label && <span className="text-sm font-medium text-text-secondary">{label}</span>}
|
||||
{counter && <span className="text-xs text-text-muted">{counter}</span>}
|
||||
{label && <span className="text-text-secondary text-sm font-medium">{label}</span>}
|
||||
{counter && <span className="text-text-muted text-xs">{counter}</span>}
|
||||
</div>
|
||||
)}
|
||||
<div className="flex flex-wrap gap-2">
|
||||
@@ -77,7 +77,7 @@ export function ChipGroup(props: ChipGroupProps) {
|
||||
selected
|
||||
? "bg-accent text-white"
|
||||
: disabled
|
||||
? "cursor-not-allowed bg-surface-2 text-text-muted opacity-40"
|
||||
? "bg-surface-2 text-text-muted cursor-not-allowed opacity-40"
|
||||
: "bg-surface-2 text-text-secondary hover:bg-surface-3 hover:text-text-primary",
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -43,7 +43,7 @@ export function ConfirmDialog({
|
||||
</>
|
||||
}
|
||||
>
|
||||
<p className="text-sm text-text-secondary">{message}</p>
|
||||
<p className="text-text-secondary text-sm">{message}</p>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
@@ -49,8 +49,8 @@ export function Drawer({
|
||||
aria-modal="true"
|
||||
aria-label={ariaLabel ?? title}
|
||||
className={clsx(
|
||||
"absolute bottom-0 top-0 flex w-64 max-w-[85vw] flex-col bg-surface-1 shadow-2xl transition-transform duration-200",
|
||||
side === "left" ? "left-0 border-r border-border" : "right-0 border-l border-border",
|
||||
"bg-surface-1 absolute top-0 bottom-0 flex w-64 max-w-[85vw] flex-col shadow-2xl transition-transform duration-200",
|
||||
side === "left" ? "border-border left-0 border-r" : "border-border right-0 border-l",
|
||||
open ? "translate-x-0" : side === "left" ? "-translate-x-full" : "translate-x-full",
|
||||
className,
|
||||
)}
|
||||
@@ -60,12 +60,12 @@ export function Drawer({
|
||||
}}
|
||||
>
|
||||
{title && (
|
||||
<div className="flex items-center justify-between border-b border-border px-4 py-3">
|
||||
<h2 className="text-base font-semibold text-text-primary">{title}</h2>
|
||||
<div className="border-border flex items-center justify-between border-b px-4 py-3">
|
||||
<h2 className="text-text-primary text-base font-semibold">{title}</h2>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClose}
|
||||
className="rounded-lg p-2 text-text-muted hover:bg-surface-2 hover:text-text-primary"
|
||||
className="text-text-muted hover:bg-surface-2 hover:text-text-primary rounded-lg p-2"
|
||||
aria-label="Close"
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
|
||||
@@ -18,7 +18,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
{label && (
|
||||
<label htmlFor={inputId} className="text-sm font-medium text-text-secondary">
|
||||
<label htmlFor={inputId} className="text-text-secondary text-sm font-medium">
|
||||
{label}
|
||||
</label>
|
||||
)}
|
||||
@@ -27,14 +27,14 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
||||
id={inputId}
|
||||
aria-invalid={isError || undefined}
|
||||
className={clsx(
|
||||
"focus:ring-accent/50 min-h-touch rounded-lg border bg-surface-1 px-3 py-2.5 text-base text-text-primary transition-colors placeholder:text-text-muted focus:outline-none focus:ring-2 sm:text-sm",
|
||||
"focus:ring-accent/50 min-h-touch bg-surface-1 text-text-primary placeholder:text-text-muted rounded-lg border px-3 py-2.5 text-base transition-colors focus:ring-2 focus:outline-none sm:text-sm",
|
||||
isError ? "border-danger" : "border-border focus:border-accent",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
{errorText && <p className="text-xs text-danger">{errorText}</p>}
|
||||
{helpText && !errorText && <p className="text-xs text-text-muted">{helpText}</p>}
|
||||
{errorText && <p className="text-danger text-xs">{errorText}</p>}
|
||||
{helpText && !errorText && <p className="text-text-muted text-xs">{helpText}</p>}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -35,16 +35,16 @@ export function Modal({ open, onClose, title, children, footer, className }: Mod
|
||||
>
|
||||
<div
|
||||
className={clsx(
|
||||
"mx-4 flex max-h-[85vh] w-[calc(100%-2rem)] max-w-lg flex-col rounded-xl border border-border bg-surface-1 shadow-2xl",
|
||||
"border-border bg-surface-1 mx-4 flex max-h-[85vh] w-[calc(100%-2rem)] max-w-lg flex-col rounded-xl border shadow-2xl",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{title && (
|
||||
<div className="flex items-center justify-between border-b border-border px-5 py-4">
|
||||
<h2 className="text-base font-semibold text-text-primary">{title}</h2>
|
||||
<div className="border-border flex items-center justify-between border-b px-5 py-4">
|
||||
<h2 className="text-text-primary text-base font-semibold">{title}</h2>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="rounded-lg p-1 text-text-muted hover:bg-surface-2 hover:text-text-primary"
|
||||
className="text-text-muted hover:bg-surface-2 hover:text-text-primary rounded-lg p-1"
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</button>
|
||||
@@ -52,7 +52,7 @@ export function Modal({ open, onClose, title, children, footer, className }: Mod
|
||||
)}
|
||||
<div className="flex-1 overflow-y-auto px-5 py-4">{children}</div>
|
||||
{footer && (
|
||||
<div className="flex justify-end gap-2 border-t border-border px-5 py-3">{footer}</div>
|
||||
<div className="border-border flex justify-end gap-2 border-t px-5 py-3">{footer}</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
{label && (
|
||||
<label htmlFor={selectId} className="text-sm font-medium text-text-secondary">
|
||||
<label htmlFor={selectId} className="text-text-secondary text-sm font-medium">
|
||||
{label}
|
||||
</label>
|
||||
)}
|
||||
@@ -29,7 +29,7 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
||||
value={value}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
className={clsx(
|
||||
"focus:ring-accent/50 rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary transition-colors focus:border-accent focus:outline-none focus:ring-2",
|
||||
"focus:ring-accent/50 border-border bg-surface-1 text-text-primary focus:border-accent rounded-lg border px-3 py-2 text-sm transition-colors focus:ring-2 focus:outline-none",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Modal } from "./Modal";
|
||||
|
||||
@@ -22,34 +22,33 @@ export function ShortcutHelpModal({ open, onClose }: ShortcutHelpModalProps) {
|
||||
const { t } = useTranslation("ui");
|
||||
const [query, setQuery] = useState("");
|
||||
|
||||
// Reset the filter every time the modal closes so a re-open starts
|
||||
// fresh — otherwise the previous filter persists invisibly.
|
||||
useEffect(() => {
|
||||
if (!open) setQuery("");
|
||||
}, [open]);
|
||||
// A closed modal has no filter. Deriving this rather than resetting `query`
|
||||
// in an effect means a re-open always starts fresh without an extra render
|
||||
// pass on every parent update while the modal is closed.
|
||||
const activeQuery = open ? query : "";
|
||||
|
||||
const filtered = useMemo(() => {
|
||||
const trimmed = query.trim().toLowerCase();
|
||||
const trimmed = activeQuery.trim().toLowerCase();
|
||||
if (!trimmed) return SHORTCUTS;
|
||||
return SHORTCUTS.filter((s) => {
|
||||
const label = t(s.labelKey).toLowerCase();
|
||||
return label.includes(trimmed) || s.keys.toLowerCase().includes(trimmed);
|
||||
});
|
||||
}, [query, t]);
|
||||
}, [activeQuery, t]);
|
||||
|
||||
return (
|
||||
<Modal open={open} onClose={onClose} title={t("shortcuts.title")}>
|
||||
<div className="flex flex-col gap-3">
|
||||
<input
|
||||
type="text"
|
||||
value={query}
|
||||
value={activeQuery}
|
||||
onChange={(e) => setQuery(e.target.value)}
|
||||
placeholder={t("shortcuts.searchPlaceholder")}
|
||||
className="focus:ring-accent/50 rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary transition-colors placeholder:text-text-muted focus:border-accent focus:outline-none focus:ring-2"
|
||||
className="focus:ring-accent/50 border-border bg-surface-1 text-text-primary placeholder:text-text-muted focus:border-accent rounded-lg border px-3 py-2 text-sm transition-colors focus:ring-2 focus:outline-none"
|
||||
autoFocus
|
||||
/>
|
||||
{filtered.length === 0 ? (
|
||||
<p className="py-2 text-sm text-text-muted">{t("shortcuts.noResults")}</p>
|
||||
<p className="text-text-muted py-2 text-sm">{t("shortcuts.noResults")}</p>
|
||||
) : (
|
||||
<div className="flex flex-col gap-2">
|
||||
{filtered.map((s) => (
|
||||
@@ -57,8 +56,8 @@ export function ShortcutHelpModal({ open, onClose }: ShortcutHelpModalProps) {
|
||||
key={`${s.keys}-${s.labelKey}`}
|
||||
className="flex items-center justify-between py-1"
|
||||
>
|
||||
<span className="text-sm text-text-secondary">{t(s.labelKey)}</span>
|
||||
<kbd className="rounded bg-surface-2 px-2 py-0.5 font-mono text-xs text-text-primary">
|
||||
<span className="text-text-secondary text-sm">{t(s.labelKey)}</span>
|
||||
<kbd className="bg-surface-2 text-text-primary rounded px-2 py-0.5 font-mono text-xs">
|
||||
{s.keys}
|
||||
</kbd>
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@ export function StrictModeBanner() {
|
||||
return (
|
||||
<div
|
||||
role="alert"
|
||||
className="border-danger/40 bg-danger/10 flex flex-col gap-1 rounded-lg border px-3 py-2 text-xs text-danger"
|
||||
className="border-danger/40 bg-danger/10 text-danger flex flex-col gap-1 rounded-lg border px-3 py-2 text-xs"
|
||||
>
|
||||
<span className="flex items-center gap-1.5 font-semibold">
|
||||
<ShieldAlert className="h-3.5 w-3.5 shrink-0" />
|
||||
|
||||
@@ -13,7 +13,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
{label && (
|
||||
<label htmlFor={inputId} className="text-sm font-medium text-text-secondary">
|
||||
<label htmlFor={inputId} className="text-text-secondary text-sm font-medium">
|
||||
{label}
|
||||
</label>
|
||||
)}
|
||||
@@ -21,7 +21,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
ref={ref}
|
||||
id={inputId}
|
||||
className={clsx(
|
||||
"focus:ring-accent/50 min-h-[96px] resize-y rounded-lg border bg-surface-1 px-3 py-2.5 text-base text-text-primary transition-colors placeholder:text-text-muted focus:outline-none focus:ring-2 sm:text-sm",
|
||||
"focus:ring-accent/50 bg-surface-1 text-text-primary placeholder:text-text-muted min-h-[96px] resize-y rounded-lg border px-3 py-2.5 text-base transition-colors focus:ring-2 focus:outline-none sm:text-sm",
|
||||
error ? "border-danger" : "border-border focus:border-accent",
|
||||
className,
|
||||
)}
|
||||
|
||||
@@ -16,7 +16,7 @@ export function Toggle({ label, checked, onChange, className }: ToggleProps) {
|
||||
aria-checked={checked}
|
||||
onClick={() => onChange(!checked)}
|
||||
className={clsx(
|
||||
"focus:ring-accent/50 relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors focus:outline-none focus:ring-2",
|
||||
"focus:ring-accent/50 relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors focus:ring-2 focus:outline-none",
|
||||
checked ? "bg-accent" : "bg-surface-3",
|
||||
)}
|
||||
>
|
||||
@@ -27,7 +27,7 @@ export function Toggle({ label, checked, onChange, className }: ToggleProps) {
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
<span className="text-sm text-text-primary">{label}</span>
|
||||
<span className="text-text-primary text-sm">{label}</span>
|
||||
</label>
|
||||
);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ export function ValidatedInput({
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
<label className="text-sm font-medium text-text-secondary">{label}</label>
|
||||
<label className="text-text-secondary text-sm font-medium">{label}</label>
|
||||
<input
|
||||
type="text"
|
||||
value={displayValue}
|
||||
@@ -178,12 +178,12 @@ export function ValidatedInput({
|
||||
maxLength={maxLength}
|
||||
aria-invalid={touched && Boolean(message) ? true : undefined}
|
||||
className={clsx(
|
||||
"focus:ring-accent/50 min-h-touch rounded-lg border bg-surface-1 px-3 py-2.5 text-base text-text-primary transition-colors placeholder:text-text-muted focus:outline-none focus:ring-2 sm:text-sm",
|
||||
"focus:ring-accent/50 min-h-touch bg-surface-1 text-text-primary placeholder:text-text-muted rounded-lg border px-3 py-2.5 text-base transition-colors focus:ring-2 focus:outline-none sm:text-sm",
|
||||
touched && message ? "border-danger" : "border-border focus:border-accent",
|
||||
)}
|
||||
/>
|
||||
{touched && message && <p className="text-xs text-danger">{message}</p>}
|
||||
{helpText && !message && <p className="text-xs text-text-muted">{helpText}</p>}
|
||||
{touched && message && <p className="text-danger text-xs">{message}</p>}
|
||||
{helpText && !message && <p className="text-text-muted text-xs">{helpText}</p>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -27,7 +27,9 @@ export function useLanguagesReady(langs: readonly SupportedLanguage[]): boolean
|
||||
useEffect(() => {
|
||||
const wanted = (key ? key.split(",") : []) as SupportedLanguage[];
|
||||
if (wanted.every(hasLanguageBundles)) {
|
||||
setReadyKey(key);
|
||||
// Already in memory. Guarded so a re-run with an unchanged key doesn't
|
||||
// schedule a redundant render (react-hooks/set-state-in-effect).
|
||||
setReadyKey((prev) => (prev === key ? prev : key));
|
||||
return;
|
||||
}
|
||||
let cancelled = false;
|
||||
|
||||
@@ -1,16 +1,34 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useSyncExternalStore } from "react";
|
||||
|
||||
function readOnline(): boolean {
|
||||
function subscribe(onChange: () => void): () => void {
|
||||
if (typeof window === "undefined") return () => {};
|
||||
window.addEventListener("online", onChange);
|
||||
window.addEventListener("offline", onChange);
|
||||
return () => {
|
||||
window.removeEventListener("online", onChange);
|
||||
window.removeEventListener("offline", onChange);
|
||||
};
|
||||
}
|
||||
|
||||
function getSnapshot(): boolean {
|
||||
return typeof navigator === "undefined" ? true : navigator.onLine;
|
||||
}
|
||||
|
||||
/** SSR / non-browser: assume online, since nothing here gates core features. */
|
||||
function getServerSnapshot(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Track the browser's connectivity. Returns `true` when online.
|
||||
*
|
||||
* SSR/Tauri-safe (guards `navigator` / `window`). Re-syncs once on mount in
|
||||
* case the status flipped between the initial `useState` read and the effect
|
||||
* attaching. Mirrors the add/remove-listener shape of
|
||||
* {@link import("@hooks/use-global-error-handler").useGlobalErrorHandler}.
|
||||
* `useSyncExternalStore` rather than `useState` + `useEffect`: connectivity is
|
||||
* an external store, and the hand-rolled version had to re-read `navigator`
|
||||
* inside the effect to close the gap between the initial render and the
|
||||
* listeners attaching — a synchronous `setState` in an effect, which costs an
|
||||
* extra render pass on every mount and is what
|
||||
* `react-hooks/set-state-in-effect` exists to catch. Subscribing properly
|
||||
* removes the gap instead of patching it.
|
||||
*
|
||||
* Note: `navigator.onLine` only reports the OS/browser link state, not whether
|
||||
* the wider internet is reachable — which is exactly right here, since the app
|
||||
@@ -18,20 +36,5 @@ function readOnline(): boolean {
|
||||
* links, never core functionality.
|
||||
*/
|
||||
export function useOnlineStatus(): boolean {
|
||||
const [online, setOnline] = useState(readOnline);
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window === "undefined") return;
|
||||
const goOnline = () => setOnline(true);
|
||||
const goOffline = () => setOnline(false);
|
||||
window.addEventListener("online", goOnline);
|
||||
window.addEventListener("offline", goOffline);
|
||||
setOnline(readOnline());
|
||||
return () => {
|
||||
window.removeEventListener("online", goOnline);
|
||||
window.removeEventListener("offline", goOffline);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return online;
|
||||
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
||||
}
|
||||
+18
-18
@@ -105,16 +105,16 @@ export function AboutPage() {
|
||||
<div className="mx-auto flex max-w-3xl flex-col gap-8 p-6">
|
||||
<header className="flex flex-col gap-2">
|
||||
<div className="flex items-baseline gap-3">
|
||||
<h1 className="text-2xl font-bold text-text-primary">{ABOUT.appName}</h1>
|
||||
<span className="rounded bg-surface-2 px-2 py-0.5 font-mono text-xs text-text-secondary">
|
||||
<h1 className="text-text-primary text-2xl font-bold">{ABOUT.appName}</h1>
|
||||
<span className="bg-surface-2 text-text-secondary rounded px-2 py-0.5 font-mono text-xs">
|
||||
v{ABOUT.version}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-sm text-text-secondary">{t("about.tagline")}</p>
|
||||
<p className="text-text-secondary text-sm">{t("about.tagline")}</p>
|
||||
</header>
|
||||
|
||||
<section className="flex flex-col gap-3">
|
||||
<h2 className="text-sm font-semibold uppercase tracking-wide text-text-muted">
|
||||
<h2 className="text-text-muted text-sm font-semibold tracking-wide uppercase">
|
||||
{t("about.repoHeading")}
|
||||
</h2>
|
||||
<div className="grid gap-2 sm:grid-cols-2">
|
||||
@@ -135,7 +135,7 @@ export function AboutPage() {
|
||||
</section>
|
||||
|
||||
<section className="flex flex-col gap-3">
|
||||
<h2 className="text-sm font-semibold uppercase tracking-wide text-text-muted">
|
||||
<h2 className="text-text-muted text-sm font-semibold tracking-wide uppercase">
|
||||
{t("about.legalHeading")}
|
||||
</h2>
|
||||
<div className="grid gap-2 sm:grid-cols-2">
|
||||
@@ -151,10 +151,10 @@ export function AboutPage() {
|
||||
</section>
|
||||
|
||||
<section className="flex flex-col gap-3">
|
||||
<h2 className="text-sm font-semibold uppercase tracking-wide text-text-muted">
|
||||
<h2 className="text-text-muted text-sm font-semibold tracking-wide uppercase">
|
||||
{t("about.donateHeading")}
|
||||
</h2>
|
||||
<p className="text-xs text-text-muted">{t("about.donateHelp")}</p>
|
||||
<p className="text-text-muted text-xs">{t("about.donateHelp")}</p>
|
||||
<div className="grid gap-2 sm:grid-cols-2">
|
||||
{donateLinks.map((d) => (
|
||||
<ExternalLinkRow key={d.id} href={d.url} icon={d.icon} label={t(d.labelKey)} accent />
|
||||
@@ -164,7 +164,7 @@ export function AboutPage() {
|
||||
|
||||
{socials.length > 0 && (
|
||||
<section className="flex flex-col gap-3">
|
||||
<h2 className="text-sm font-semibold uppercase tracking-wide text-text-muted">
|
||||
<h2 className="text-text-muted text-sm font-semibold tracking-wide uppercase">
|
||||
{t("about.connectHeading")}
|
||||
</h2>
|
||||
<div className="grid gap-2 sm:grid-cols-2">
|
||||
@@ -176,26 +176,26 @@ export function AboutPage() {
|
||||
)}
|
||||
|
||||
<section className="flex flex-col gap-3">
|
||||
<h2 className="text-sm font-semibold uppercase tracking-wide text-text-muted">
|
||||
<h2 className="text-text-muted text-sm font-semibold tracking-wide uppercase">
|
||||
{t("about.thirdPartyHeading")}
|
||||
</h2>
|
||||
<p className="text-xs text-text-muted">{t("about.thirdPartyHelp")}</p>
|
||||
<p className="text-text-muted text-xs">{t("about.thirdPartyHelp")}</p>
|
||||
<ul className="grid gap-1.5 sm:grid-cols-2">
|
||||
{THIRD_PARTY.map((entry) => (
|
||||
<li
|
||||
key={entry.name}
|
||||
className="flex items-center justify-between rounded-lg border border-border bg-surface-1 px-3 py-2"
|
||||
className="border-border bg-surface-1 flex items-center justify-between rounded-lg border px-3 py-2"
|
||||
>
|
||||
<a
|
||||
href={entry.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-2 text-sm text-text-primary hover:text-accent"
|
||||
className="text-text-primary hover:text-accent flex items-center gap-2 text-sm"
|
||||
>
|
||||
<span className="font-medium">{entry.name}</span>
|
||||
<span className="font-mono text-xs text-text-muted">{entry.version}</span>
|
||||
<span className="text-text-muted font-mono text-xs">{entry.version}</span>
|
||||
</a>
|
||||
<span className="text-xs text-text-muted">{entry.license}</span>
|
||||
<span className="text-text-muted text-xs">{entry.license}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
@@ -219,17 +219,17 @@ function ExternalLinkRow({ href, icon: Icon, label, accent }: ExternalLinkRowPro
|
||||
rel="noopener noreferrer"
|
||||
className={
|
||||
accent
|
||||
? "flex items-center gap-3 rounded-lg border border-pink-500/30 bg-pink-500/5 px-3 py-2.5 text-sm text-text-primary transition-colors hover:border-pink-400/60 hover:bg-pink-500/10"
|
||||
: "flex items-center gap-3 rounded-lg border border-border bg-surface-1 px-3 py-2.5 text-sm text-text-primary transition-colors hover:border-accent hover:bg-surface-2"
|
||||
? "text-text-primary flex items-center gap-3 rounded-lg border border-pink-500/30 bg-pink-500/5 px-3 py-2.5 text-sm transition-colors hover:border-pink-400/60 hover:bg-pink-500/10"
|
||||
: "border-border bg-surface-1 text-text-primary hover:border-accent hover:bg-surface-2 flex items-center gap-3 rounded-lg border px-3 py-2.5 text-sm transition-colors"
|
||||
}
|
||||
>
|
||||
<Icon
|
||||
className={
|
||||
accent ? "h-4 w-4 shrink-0 text-pink-300" : "h-4 w-4 shrink-0 text-text-secondary"
|
||||
accent ? "h-4 w-4 shrink-0 text-pink-300" : "text-text-secondary h-4 w-4 shrink-0"
|
||||
}
|
||||
/>
|
||||
<span className="flex-1 truncate">{label}</span>
|
||||
<ExternalLink className="h-3.5 w-3.5 shrink-0 text-text-muted" />
|
||||
<ExternalLink className="text-text-muted h-3.5 w-3.5 shrink-0" />
|
||||
</a>
|
||||
);
|
||||
}
|
||||
+14
-14
@@ -158,11 +158,11 @@ export function BatchPage() {
|
||||
|
||||
return (
|
||||
<div className="mx-auto max-w-4xl p-4 sm:p-6">
|
||||
<h1 className="mb-4 text-lg font-bold text-text-primary">{t("batch.title")}</h1>
|
||||
<h1 className="text-text-primary mb-4 text-lg font-bold">{t("batch.title")}</h1>
|
||||
|
||||
{/* Language selector */}
|
||||
<div className="mb-4">
|
||||
<span className="mb-2 block text-sm font-medium text-text-secondary">
|
||||
<span className="text-text-secondary mb-2 block text-sm font-medium">
|
||||
{t("output.selectLanguages")}
|
||||
</span>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
@@ -215,7 +215,7 @@ export function BatchPage() {
|
||||
{rangeError && (
|
||||
<p
|
||||
role="alert"
|
||||
className="border-warning/40 bg-warning/10 mb-6 rounded-lg border px-3 py-2 text-xs text-warning"
|
||||
className="border-warning/40 bg-warning/10 text-warning mb-6 rounded-lg border px-3 py-2 text-xs"
|
||||
>
|
||||
{rangeError}
|
||||
</p>
|
||||
@@ -225,7 +225,7 @@ export function BatchPage() {
|
||||
</div>
|
||||
|
||||
{results.length === 0 ? (
|
||||
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
|
||||
<p className="border-border text-text-muted rounded-lg border border-dashed py-8 text-center text-sm">
|
||||
{t("batch.emptyState")}
|
||||
</p>
|
||||
) : (
|
||||
@@ -233,7 +233,7 @@ export function BatchPage() {
|
||||
<div className="mb-4 flex flex-col gap-2">
|
||||
<LimitBlockBanner status={batchStatus} titleKey="output.limits.batchAllBlocked" />
|
||||
<div className="flex flex-wrap items-center justify-between gap-2">
|
||||
<span className="text-sm text-text-secondary">
|
||||
<span className="text-text-secondary text-sm">
|
||||
{results.length} parts x {selectedLangs.length} languages
|
||||
</span>
|
||||
<CopyButton
|
||||
@@ -247,16 +247,16 @@ export function BatchPage() {
|
||||
{results.map((result) => (
|
||||
<div
|
||||
key={result.partNumber}
|
||||
className="rounded-lg border border-border bg-surface-1 p-4"
|
||||
className="border-border bg-surface-1 rounded-lg border p-4"
|
||||
>
|
||||
<h3 className="mb-3 text-sm font-semibold text-text-primary">
|
||||
<h3 className="text-text-primary mb-3 text-sm font-semibold">
|
||||
Part {result.partNumber}
|
||||
</h3>
|
||||
<div className="flex flex-col gap-3">
|
||||
{result.languages.map((lang) => (
|
||||
<div key={lang.language} className="rounded-lg bg-surface-2 p-3">
|
||||
<div key={lang.language} className="bg-surface-2 rounded-lg p-3">
|
||||
<div className="mb-1 flex flex-wrap items-center justify-between gap-2">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
<span className="text-text-muted text-xs font-medium uppercase">
|
||||
{lang.language.toUpperCase()}
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -270,26 +270,26 @@ export function BatchPage() {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<p className="mb-2 text-sm font-medium text-text-primary">
|
||||
<p className="text-text-primary mb-2 text-sm font-medium">
|
||||
{lang.output.title}
|
||||
</p>
|
||||
<pre className="mb-2 max-h-20 overflow-y-auto whitespace-pre-wrap font-sans text-xs text-text-secondary">
|
||||
<pre className="text-text-secondary mb-2 max-h-20 overflow-y-auto font-sans text-xs whitespace-pre-wrap">
|
||||
{lang.output.description.slice(0, 200)}...
|
||||
</pre>
|
||||
{/* Batch showed a counter for the title only, so a row
|
||||
could be 1500 characters over on the description with
|
||||
nothing on screen saying so. */}
|
||||
<div className="mb-2 flex flex-wrap items-center gap-3">
|
||||
<span className="text-xs text-text-muted">{t("output.description")}</span>
|
||||
<span className="text-text-muted text-xs">{t("output.description")}</span>
|
||||
<CharCounter
|
||||
text={lang.output.description}
|
||||
limit={YT_LIMITS.DESCRIPTION_MAX}
|
||||
/>
|
||||
<span className="text-xs text-text-muted">{t("output.tags")}</span>
|
||||
<span className="text-text-muted text-xs">{t("output.tags")}</span>
|
||||
<CharCounter text={lang.output.tagString} limit={YT_LIMITS.TAGS_MAX} />
|
||||
</div>
|
||||
{lang.status.blocked && (
|
||||
<p role="alert" className="mb-2 text-xs font-medium text-danger">
|
||||
<p role="alert" className="text-danger mb-2 text-xs font-medium">
|
||||
{t("output.limits.batchRowBlocked")}
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -26,7 +26,7 @@ export function HistoryPage() {
|
||||
return (
|
||||
<div className="mx-auto max-w-3xl p-6">
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<h1 className="text-lg font-bold text-text-primary">{t("history.title")}</h1>
|
||||
<h1 className="text-text-primary text-lg font-bold">{t("history.title")}</h1>
|
||||
{entries.length > 0 && (
|
||||
<Button variant="ghost" size="sm" onClick={() => setShowClearAll(true)}>
|
||||
<Trash2 className="h-3.5 w-3.5" />
|
||||
@@ -46,7 +46,7 @@ export function HistoryPage() {
|
||||
)}
|
||||
|
||||
{filtered.length === 0 ? (
|
||||
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
|
||||
<p className="border-border text-text-muted rounded-lg border border-dashed py-8 text-center text-sm">
|
||||
{t("history.emptyState")}
|
||||
</p>
|
||||
) : (
|
||||
|
||||
+12
-12
@@ -128,8 +128,8 @@ export function LogPage() {
|
||||
<div className="mx-auto max-w-4xl p-6">
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<div className="flex items-center gap-3">
|
||||
<h1 className="text-lg font-bold text-text-primary">{t("logs.title")}</h1>
|
||||
<span className="text-xs text-text-muted">
|
||||
<h1 className="text-text-primary text-lg font-bold">{t("logs.title")}</h1>
|
||||
<span className="text-text-muted text-xs">
|
||||
{entries.length} entries · {sessions.length} sessions
|
||||
{totalErrorCount > 0 && (
|
||||
<span className="ml-1 text-red-400">({totalErrorCount} errors)</span>
|
||||
@@ -161,7 +161,7 @@ export function LogPage() {
|
||||
|
||||
{/* Filters */}
|
||||
<div className="mb-4 flex flex-col gap-3 sm:flex-row sm:items-center">
|
||||
<div className="flex gap-1 rounded-lg bg-surface-1 p-1">
|
||||
<div className="bg-surface-1 flex gap-1 rounded-lg p-1">
|
||||
{LEVEL_FILTERS.map((f) => (
|
||||
<button
|
||||
key={f.value}
|
||||
@@ -188,7 +188,7 @@ export function LogPage() {
|
||||
|
||||
{/* Session-grouped entries */}
|
||||
{sessions.length === 0 ? (
|
||||
<p className="rounded-lg border border-dashed border-border py-12 text-center text-sm text-text-muted">
|
||||
<p className="border-border text-text-muted rounded-lg border border-dashed py-12 text-center text-sm">
|
||||
{t("logs.emptyState")}
|
||||
</p>
|
||||
) : (
|
||||
@@ -203,7 +203,7 @@ export function LogPage() {
|
||||
: !collapsedSessions.has(`__expanded__${session.id}`);
|
||||
|
||||
return (
|
||||
<div key={session.id} className="rounded-lg border border-border bg-surface-1">
|
||||
<div key={session.id} className="border-border bg-surface-1 rounded-lg border">
|
||||
<div
|
||||
className="flex cursor-pointer items-center gap-2 px-3 py-2"
|
||||
onClick={() => {
|
||||
@@ -220,19 +220,19 @@ export function LogPage() {
|
||||
}}
|
||||
>
|
||||
{effectivelyCollapsed ? (
|
||||
<ChevronRight className="h-4 w-4 text-text-muted" />
|
||||
<ChevronRight className="text-text-muted h-4 w-4" />
|
||||
) : (
|
||||
<ChevronDown className="h-4 w-4 text-text-muted" />
|
||||
<ChevronDown className="text-text-muted h-4 w-4" />
|
||||
)}
|
||||
<span className="text-sm font-semibold text-text-primary">
|
||||
<span className="text-text-primary text-sm font-semibold">
|
||||
{session.isCurrent
|
||||
? t("logs.sessionCurrent")
|
||||
: t("logs.sessionLabel", { n: sessions.length - idx })}
|
||||
</span>
|
||||
<span className="text-xs text-text-muted">
|
||||
<span className="text-text-muted text-xs">
|
||||
{formatRange(session.firstAt, session.lastAt)}
|
||||
</span>
|
||||
<span className="text-xs text-text-muted">
|
||||
<span className="text-text-muted text-xs">
|
||||
· {session.entries.length} {t("logs.entriesShort")}
|
||||
</span>
|
||||
{session.errorCount > 0 && (
|
||||
@@ -247,14 +247,14 @@ export function LogPage() {
|
||||
e.stopPropagation();
|
||||
clearSession(session.id);
|
||||
}}
|
||||
className="rounded p-1 text-text-muted hover:bg-surface-3 hover:text-danger"
|
||||
className="text-text-muted hover:bg-surface-3 hover:text-danger rounded p-1"
|
||||
title={t("logs.clearSession")}
|
||||
>
|
||||
<Trash2 className="h-3 w-3" />
|
||||
</button>
|
||||
</div>
|
||||
{!effectivelyCollapsed && (
|
||||
<div className="flex flex-col gap-1 border-t border-border p-2">
|
||||
<div className="border-border flex flex-col gap-1 border-t p-2">
|
||||
{session.entries.map((entry) => (
|
||||
<LogEntryCard key={entry.id} entry={entry} />
|
||||
))}
|
||||
|
||||
@@ -141,7 +141,7 @@ export function OutputPage() {
|
||||
</div>
|
||||
<div className="mb-4 flex flex-wrap items-start justify-between gap-3">
|
||||
<div className="flex-1">
|
||||
<span className="mb-2 block text-sm font-medium text-text-secondary">
|
||||
<span className="text-text-secondary mb-2 block text-sm font-medium">
|
||||
{t("output.selectLanguages")}
|
||||
</span>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
@@ -184,7 +184,7 @@ export function OutputPage() {
|
||||
</div>
|
||||
|
||||
{isMultiLang && (
|
||||
<div className="mb-4 flex gap-1 rounded-lg bg-surface-1 p-1">
|
||||
<div className="bg-surface-1 mb-4 flex gap-1 rounded-lg p-1">
|
||||
{selectedLangs.map((lang) => (
|
||||
<button
|
||||
key={lang}
|
||||
@@ -203,8 +203,8 @@ export function OutputPage() {
|
||||
)}
|
||||
|
||||
{isMultiVideoEnding && (
|
||||
<div className="border-accent/40 bg-accent/10 mb-4 flex items-center gap-2 rounded-lg border px-3 py-2 text-xs text-text-secondary">
|
||||
<Film className="h-3.5 w-3.5 shrink-0 text-accent" />
|
||||
<div className="border-accent/40 bg-accent/10 text-text-secondary mb-4 flex items-center gap-2 rounded-lg border px-3 py-2 text-xs">
|
||||
<Film className="text-accent h-3.5 w-3.5 shrink-0" />
|
||||
<span>
|
||||
{t("output.previewingVideo", {
|
||||
index: Math.min(endingVideoIndex, endingVideoCount),
|
||||
|
||||
@@ -119,7 +119,7 @@ export function PlaylistPage() {
|
||||
<div className="mx-auto flex max-w-5xl flex-col gap-6 p-6 lg:flex-row">
|
||||
{/* Form */}
|
||||
<div className="flex flex-1 flex-col gap-5">
|
||||
<h1 className="text-lg font-bold text-text-primary">{t("playlist.title")}</h1>
|
||||
<h1 className="text-text-primary text-lg font-bold">{t("playlist.title")}</h1>
|
||||
|
||||
<Select
|
||||
label={t("editor.language")}
|
||||
@@ -193,37 +193,37 @@ export function PlaylistPage() {
|
||||
|
||||
{/* Output */}
|
||||
<div className="w-full shrink-0 lg:w-96">
|
||||
<div className="sticky top-6 flex flex-col gap-4 rounded-lg border border-border bg-surface-1 p-4">
|
||||
<div className="border-border bg-surface-1 sticky top-6 flex flex-col gap-4 rounded-lg border p-4">
|
||||
<div>
|
||||
<div className="mb-1 flex items-center justify-between">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
<span className="text-text-muted text-xs font-medium uppercase">
|
||||
{t("output.title")}
|
||||
</span>
|
||||
<CopyButton text={output.title} label={t("output.copyTitle")} />
|
||||
</div>
|
||||
<p className="text-sm font-medium text-text-primary">{output.title || "..."}</p>
|
||||
<p className="text-text-primary text-sm font-medium">{output.title || "..."}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div className="mb-1 flex items-center justify-between">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
<span className="text-text-muted text-xs font-medium uppercase">
|
||||
{t("output.description")}
|
||||
</span>
|
||||
<CopyButton text={output.description} label={t("output.copyDescription")} />
|
||||
</div>
|
||||
<pre className="max-h-64 overflow-y-auto whitespace-pre-wrap rounded bg-surface-2 p-2 font-sans text-xs text-text-secondary">
|
||||
<pre className="bg-surface-2 text-text-secondary max-h-64 overflow-y-auto rounded p-2 font-sans text-xs whitespace-pre-wrap">
|
||||
{output.description || "..."}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div className="mb-1 flex items-center justify-between">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
<span className="text-text-muted text-xs font-medium uppercase">
|
||||
{t("playlist.pinnedComment")}
|
||||
</span>
|
||||
<CopyButton text={output.comment} label={t("output.copyComment")} />
|
||||
</div>
|
||||
<pre className="max-h-64 overflow-y-auto whitespace-pre-wrap rounded bg-surface-2 p-2 font-sans text-xs text-text-secondary">
|
||||
<pre className="bg-surface-2 text-text-secondary max-h-64 overflow-y-auto rounded p-2 font-sans text-xs whitespace-pre-wrap">
|
||||
{output.comment || "..."}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -177,7 +177,7 @@ export function ProfilesPage() {
|
||||
return (
|
||||
<div className="mx-auto max-w-3xl p-4 sm:p-6">
|
||||
<div className="mb-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="flex gap-1 rounded-lg bg-surface-1 p-1">
|
||||
<div className="bg-surface-1 flex gap-1 rounded-lg p-1">
|
||||
{(["profiles", "presets", "templates"] as const).map((t2) => (
|
||||
<button
|
||||
key={t2}
|
||||
|
||||
@@ -61,7 +61,7 @@ export function SettingsPage() {
|
||||
return (
|
||||
<div className="mx-auto max-w-2xl p-4 sm:p-6">
|
||||
<div className="mb-6 flex flex-wrap items-center justify-between gap-2">
|
||||
<h1 className="text-lg font-bold text-text-primary">{t("settings.title")}</h1>
|
||||
<h1 className="text-text-primary text-lg font-bold">{t("settings.title")}</h1>
|
||||
{/* Ungated since v0.35.0. This pair used to be desktop-only, a leftover
|
||||
from when "export" meant dumping the on-disk settings.json. Import
|
||||
has always been a plain <input type="file"> that needs no Tauri, and
|
||||
@@ -157,7 +157,7 @@ export function SettingsPage() {
|
||||
checked={settings.strictMode}
|
||||
onChange={(v) => settings.setSetting("strictMode", v)}
|
||||
/>
|
||||
<p className="text-xs text-text-muted">{t("settings.strictModeHint")}</p>
|
||||
<p className="text-text-muted text-xs">{t("settings.strictModeHint")}</p>
|
||||
</Accordion>
|
||||
|
||||
{/* 4. Title format — NEW in v0.7. Quality badge + format knobs. */}
|
||||
@@ -211,7 +211,7 @@ export function SettingsPage() {
|
||||
checked={settings.showGameCopyright}
|
||||
onChange={(v) => settings.setSetting("showGameCopyright", v)}
|
||||
/>
|
||||
<p className="-mt-1 ml-14 text-xs text-text-muted">
|
||||
<p className="text-text-muted -mt-1 ml-14 text-xs">
|
||||
{t("settings.showGameCopyrightHint")}
|
||||
</p>
|
||||
<Toggle
|
||||
@@ -230,7 +230,7 @@ export function SettingsPage() {
|
||||
onChange={(v) => settings.setSetting("showThirdPartyAds", v)}
|
||||
/>
|
||||
{settings.showThirdPartyAds && (
|
||||
<p className="-mt-1 ml-14 text-xs text-text-muted">{t("settings.thirdPartyAdsHint")}</p>
|
||||
<p className="text-text-muted -mt-1 ml-14 text-xs">{t("settings.thirdPartyAdsHint")}</p>
|
||||
)}
|
||||
<Toggle
|
||||
label={t("settings.splitContactEmail")}
|
||||
@@ -238,7 +238,7 @@ export function SettingsPage() {
|
||||
onChange={(v) => settings.setSetting("splitContactEmail", v)}
|
||||
/>
|
||||
{settings.splitContactEmail && (
|
||||
<p className="-mt-1 ml-14 text-xs text-text-muted">
|
||||
<p className="text-text-muted -mt-1 ml-14 text-xs">
|
||||
{t("settings.splitContactEmailHint")}
|
||||
</p>
|
||||
)}
|
||||
@@ -247,7 +247,7 @@ export function SettingsPage() {
|
||||
checked={settings.showTranslationQuality}
|
||||
onChange={(v) => settings.setSetting("showTranslationQuality", v)}
|
||||
/>
|
||||
<p className="-mt-1 ml-14 text-xs text-text-muted">
|
||||
<p className="text-text-muted -mt-1 ml-14 text-xs">
|
||||
{t("settings.showTranslationQualityHint")}
|
||||
</p>
|
||||
<Toggle
|
||||
@@ -256,7 +256,7 @@ export function SettingsPage() {
|
||||
onChange={(v) => settings.setSetting("showPinnedCommentTemplate", v)}
|
||||
/>
|
||||
{settings.showPinnedCommentTemplate && (
|
||||
<div className="ml-4 flex flex-col gap-2 border-l-2 border-border pl-4">
|
||||
<div className="border-border ml-4 flex flex-col gap-2 border-l-2 pl-4">
|
||||
<Toggle
|
||||
label={t("settings.pinnedCommentIncludeAskNextGame")}
|
||||
checked={settings.pinnedCommentIncludeAskNextGame}
|
||||
@@ -339,7 +339,7 @@ export function SettingsPage() {
|
||||
settings.setSetting("logRetentionDays", val);
|
||||
}}
|
||||
/>
|
||||
<p className="text-xs text-text-muted">{t("settings.logRetentionHint")}</p>
|
||||
<p className="text-text-muted text-xs">{t("settings.logRetentionHint")}</p>
|
||||
</Accordion>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+23
-23
@@ -225,8 +225,8 @@ export function SocialPage() {
|
||||
return (
|
||||
<div className="mx-auto max-w-4xl p-6">
|
||||
<div className="mb-4 flex flex-wrap items-center justify-between gap-3">
|
||||
<h1 className="text-lg font-bold text-text-primary">{t("socialPost.title")}</h1>
|
||||
<div className="flex gap-1 rounded-lg bg-surface-1 p-1">
|
||||
<h1 className="text-text-primary text-lg font-bold">{t("socialPost.title")}</h1>
|
||||
<div className="bg-surface-1 flex gap-1 rounded-lg p-1">
|
||||
{(["single", "bulk"] as const).map((m) => (
|
||||
<button
|
||||
key={m}
|
||||
@@ -245,7 +245,7 @@ export function SocialPage() {
|
||||
{mode === "single" ? (
|
||||
<>
|
||||
{/* Platform switcher */}
|
||||
<div className="mb-4 flex flex-wrap gap-1 rounded-lg bg-surface-1 p-1">
|
||||
<div className="bg-surface-1 mb-4 flex flex-wrap gap-1 rounded-lg p-1">
|
||||
{SOCIAL_PLATFORMS.map((p) => {
|
||||
const Icon = p.icon;
|
||||
return (
|
||||
@@ -282,16 +282,16 @@ export function SocialPage() {
|
||||
</div>
|
||||
|
||||
{!gameName ? (
|
||||
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
|
||||
<p className="border-border text-text-muted rounded-lg border border-dashed py-8 text-center text-sm">
|
||||
{t("socialPost.emptyState")}
|
||||
</p>
|
||||
) : (
|
||||
activePost && (
|
||||
<div className="rounded-lg border border-border bg-surface-1 p-4">
|
||||
<div className="border-border bg-surface-1 rounded-lg border p-4">
|
||||
<div className="mb-2 flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<ActiveIcon className="h-4 w-4 text-accent" />
|
||||
<span className="text-sm font-semibold text-text-primary">
|
||||
<ActiveIcon className="text-accent h-4 w-4" />
|
||||
<span className="text-text-primary text-sm font-semibold">
|
||||
{t(activeConfig.labelKey)}
|
||||
</span>
|
||||
</div>
|
||||
@@ -306,20 +306,20 @@ export function SocialPage() {
|
||||
</div>
|
||||
</div>
|
||||
{activePost.isOver && (
|
||||
<p className="mb-2 text-xs text-danger">
|
||||
<p className="text-danger mb-2 text-xs">
|
||||
{t("socialPost.overLimitHint", {
|
||||
platform: t(activeConfig.labelKey),
|
||||
})}
|
||||
</p>
|
||||
)}
|
||||
{activePost.droppedBlocks.length > 0 && (
|
||||
<p className="mb-2 text-xs text-warning">
|
||||
<p className="text-warning mb-2 text-xs">
|
||||
{t("socialPost.trimmedHint", {
|
||||
count: activePost.droppedBlocks.length,
|
||||
})}
|
||||
</p>
|
||||
)}
|
||||
<pre className="whitespace-pre-wrap break-words font-sans text-sm text-text-secondary">
|
||||
<pre className="text-text-secondary font-sans text-sm break-words whitespace-pre-wrap">
|
||||
{activePost.text}
|
||||
</pre>
|
||||
</div>
|
||||
@@ -329,7 +329,7 @@ export function SocialPage() {
|
||||
{imported && (
|
||||
<div className="border-accent/40 bg-accent/5 mt-6 rounded-lg border p-4">
|
||||
<div className="mb-3 flex items-center justify-between">
|
||||
<h2 className="text-sm font-semibold text-text-primary">
|
||||
<h2 className="text-text-primary text-sm font-semibold">
|
||||
{t("socialPost.importedHeading")}
|
||||
{imported.gameName ? ` — ${imported.gameName}` : ""}
|
||||
</h2>
|
||||
@@ -339,9 +339,9 @@ export function SocialPage() {
|
||||
</div>
|
||||
<div className="flex flex-col gap-3">
|
||||
{imported.posts.map((p) => (
|
||||
<div key={p.platform} className="rounded-lg bg-surface-2 p-3">
|
||||
<div key={p.platform} className="bg-surface-2 rounded-lg p-3">
|
||||
<div className="mb-1 flex items-center justify-between">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
<span className="text-text-muted text-xs font-medium uppercase">
|
||||
{platformLabel(p.platform)}
|
||||
</span>
|
||||
<CopyButton
|
||||
@@ -350,7 +350,7 @@ export function SocialPage() {
|
||||
limit={p.charLimit}
|
||||
/>
|
||||
</div>
|
||||
<pre className="whitespace-pre-wrap break-words font-sans text-xs text-text-secondary">
|
||||
<pre className="text-text-secondary font-sans text-xs break-words whitespace-pre-wrap">
|
||||
{p.text}
|
||||
</pre>
|
||||
</div>
|
||||
@@ -363,7 +363,7 @@ export function SocialPage() {
|
||||
<div className="flex flex-col gap-4">
|
||||
{/* Language selector */}
|
||||
<div>
|
||||
<span className="mb-2 block text-sm font-medium text-text-secondary">
|
||||
<span className="text-text-secondary mb-2 block text-sm font-medium">
|
||||
{t("output.selectLanguages")}
|
||||
</span>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
@@ -415,7 +415,7 @@ export function SocialPage() {
|
||||
{rangeError && (
|
||||
<p
|
||||
role="alert"
|
||||
className="border-warning/40 bg-warning/10 rounded-lg border px-3 py-2 text-xs text-warning"
|
||||
className="border-warning/40 bg-warning/10 text-warning rounded-lg border px-3 py-2 text-xs"
|
||||
>
|
||||
{rangeError}
|
||||
</p>
|
||||
@@ -423,13 +423,13 @@ export function SocialPage() {
|
||||
<StrictModeBanner />
|
||||
|
||||
{bulkResults.length === 0 ? (
|
||||
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
|
||||
<p className="border-border text-text-muted rounded-lg border border-dashed py-8 text-center text-sm">
|
||||
{t("batch.emptyState")}
|
||||
</p>
|
||||
) : (
|
||||
<>
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm text-text-secondary">
|
||||
<span className="text-text-secondary text-sm">
|
||||
{bulkResults.length} × {SOCIAL_PLATFORMS.length}
|
||||
</span>
|
||||
<CopyButton
|
||||
@@ -442,9 +442,9 @@ export function SocialPage() {
|
||||
{bulkResults.map((row) => (
|
||||
<div
|
||||
key={`${row.partNumber}-${row.language}`}
|
||||
className="rounded-lg border border-border bg-surface-1 p-4"
|
||||
className="border-border bg-surface-1 rounded-lg border p-4"
|
||||
>
|
||||
<h3 className="mb-3 text-sm font-semibold text-text-primary">
|
||||
<h3 className="text-text-primary mb-3 text-sm font-semibold">
|
||||
{row.partNumber} · {row.language.toUpperCase()}
|
||||
</h3>
|
||||
<div className="flex flex-col gap-3">
|
||||
@@ -452,9 +452,9 @@ export function SocialPage() {
|
||||
const post = row.posts[p.id];
|
||||
if (!post) return null;
|
||||
return (
|
||||
<div key={p.id} className="rounded-lg bg-surface-2 p-3">
|
||||
<div key={p.id} className="bg-surface-2 rounded-lg p-3">
|
||||
<div className="mb-1 flex items-center justify-between">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
<span className="text-text-muted text-xs font-medium uppercase">
|
||||
{t(p.labelKey)}
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -466,7 +466,7 @@ export function SocialPage() {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<pre className="max-h-24 overflow-y-auto whitespace-pre-wrap break-words font-sans text-xs text-text-secondary">
|
||||
<pre className="text-text-secondary max-h-24 overflow-y-auto font-sans text-xs break-words whitespace-pre-wrap">
|
||||
{post.text}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -32,13 +32,13 @@ export function GenrePlaylistsSection() {
|
||||
open={accordion.genrePlaylists ?? false}
|
||||
onToggle={() => toggleAccordion("genrePlaylists")}
|
||||
badge={
|
||||
<span className="rounded bg-surface-2 px-1.5 py-0.5 text-xs text-text-muted">
|
||||
<span className="bg-surface-2 text-text-muted rounded px-1.5 py-0.5 text-xs">
|
||||
{t("settings.genrePlaylistsBadge", { filled, total: GENRES.length })}
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<p className="text-xs text-text-muted">{t("settings.genrePlaylistsHelp")}</p>
|
||||
<p className="text-xs text-text-muted">{t("settings.genrePlaylistsEmptyHint")}</p>
|
||||
<p className="text-text-muted text-xs">{t("settings.genrePlaylistsHelp")}</p>
|
||||
<p className="text-text-muted text-xs">{t("settings.genrePlaylistsEmptyHint")}</p>
|
||||
<div className="flex flex-col gap-2">
|
||||
{GENRES.map((g) => (
|
||||
<ValidatedInput
|
||||
|
||||
+48
-7
@@ -1,6 +1,47 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
@import "tailwindcss";
|
||||
|
||||
/*
|
||||
* Tailwind 4 is configured in CSS, not `tailwind.config.ts` — the file is gone.
|
||||
*
|
||||
* Two things replace it:
|
||||
* @custom-variant dark — the project toggles a `.dark` / `.light` class on
|
||||
* <html> rather than following the OS, so the default
|
||||
* `prefers-color-scheme` variant would be wrong.
|
||||
* @theme — the design tokens, which now generate the utility
|
||||
* classes directly (bg-surface-1, text-text-muted…).
|
||||
*
|
||||
* The palette itself still lives in the plain `:root` / `.light` blocks below,
|
||||
* because those are what the theme *toggle* rewrites at runtime. `@theme` maps
|
||||
* Tailwind's names onto those variables; it does not own the values.
|
||||
*/
|
||||
@custom-variant dark (&:where(.dark, .dark *));
|
||||
|
||||
@theme {
|
||||
--color-surface-0: var(--surface-0);
|
||||
--color-surface-1: var(--surface-1);
|
||||
--color-surface-2: var(--surface-2);
|
||||
--color-surface-3: var(--surface-3);
|
||||
|
||||
--color-border: var(--border);
|
||||
--color-border-strong: var(--border-strong);
|
||||
|
||||
--color-text-primary: var(--text-primary);
|
||||
--color-text-secondary: var(--text-secondary);
|
||||
--color-text-muted: var(--text-muted);
|
||||
|
||||
--color-accent: var(--accent);
|
||||
--color-accent-hover: var(--accent-hover);
|
||||
--color-accent-muted: var(--accent-muted);
|
||||
|
||||
--color-success: var(--success);
|
||||
--color-warning: var(--warning);
|
||||
--color-danger: var(--danger);
|
||||
|
||||
--font-sans: var(--font-sans-stack);
|
||||
--font-mono: var(--font-mono-stack);
|
||||
|
||||
--spacing-touch: 44px;
|
||||
}
|
||||
|
||||
:root {
|
||||
/* Dark theme (default) */
|
||||
@@ -24,8 +65,8 @@
|
||||
--warning: #eab308;
|
||||
--danger: #ef4444;
|
||||
|
||||
--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
|
||||
--font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
|
||||
--font-sans-stack: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
|
||||
--font-mono-stack: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
|
||||
}
|
||||
|
||||
.light {
|
||||
@@ -51,7 +92,7 @@
|
||||
}
|
||||
|
||||
body {
|
||||
@apply bg-surface-0 font-sans text-text-primary;
|
||||
@apply bg-surface-0 text-text-primary font-sans;
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
}
|
||||
@@ -66,7 +107,7 @@ body {
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
@apply rounded-full bg-surface-3;
|
||||
@apply bg-surface-3 rounded-full;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
export default {
|
||||
content: ["./index.html", "./src/**/*.{ts,tsx}"],
|
||||
darkMode: "class",
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
surface: {
|
||||
0: "var(--surface-0)",
|
||||
1: "var(--surface-1)",
|
||||
2: "var(--surface-2)",
|
||||
3: "var(--surface-3)",
|
||||
},
|
||||
border: {
|
||||
DEFAULT: "var(--border)",
|
||||
strong: "var(--border-strong)",
|
||||
},
|
||||
text: {
|
||||
primary: "var(--text-primary)",
|
||||
secondary: "var(--text-secondary)",
|
||||
muted: "var(--text-muted)",
|
||||
},
|
||||
accent: {
|
||||
DEFAULT: "var(--accent)",
|
||||
hover: "var(--accent-hover)",
|
||||
muted: "var(--accent-muted)",
|
||||
},
|
||||
success: "var(--success)",
|
||||
warning: "var(--warning)",
|
||||
danger: "var(--danger)",
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ["var(--font-sans)"],
|
||||
mono: ["var(--font-mono)"],
|
||||
},
|
||||
spacing: {
|
||||
touch: "44px",
|
||||
},
|
||||
minHeight: {
|
||||
touch: "44px",
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
} satisfies Config;
|
||||
Reference in new issue
Block a user