diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4b1f53f..8e3932e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,11 @@ # Dependabot configuration. # -# This file exists only to configure SECURITY updates for cargo in /src-tauri. -# Version updates stay disabled (open-pull-requests-limit: 0); npm and -# GitHub Actions keep GitHub's default security-update behavior. +# Three ecosystems: npm (the app), cargo (the Tauri shell), and github-actions +# (the workflows). Security updates are on repo-wide by default; the entries +# below add scheduled VERSION updates so the tree does not silently rot between +# advisories, and carry the ignore rules that keep unfixable alerts quiet. # -# Why the ignores: `rand` and `glib` are transitive dependencies of tauri, +# Why the cargo ignores: `rand` and `glib` are transitive dependencies of tauri, # and their security fixes require semver-major bumps that the dependency # tree does not allow, so every Dependabot security-update job for them # fails with `security_update_not_possible` (runs 27387346373, 27387346324): @@ -20,12 +21,53 @@ version: 2 updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + commit-message: + prefix: "chore(deps)" + prefix-development: "chore(deps-dev)" + groups: + # One PR per family instead of one per package. A split React or + # typescript-eslint bump is never independently mergeable anyway, and + # CI has to run for each PR. + react: + patterns: ["react", "react-dom", "@types/react", "@types/react-dom"] + i18n: + patterns: ["i18next*", "react-i18next"] + tauri: + patterns: ["@tauri-apps/*"] + lint-and-format: + patterns: ["eslint*", "@eslint/*", "typescript-eslint", "prettier*", "knip"] + build-tooling: + patterns: ["vite", "vitest", "@vitejs/*", "tailwindcss", "postcss", "autoprefixer", "tsx"] + ignore: + # Majors land in their own planned release (see docs/ROADMAP.md) because + # each one needs a real migration — React 19, Tailwind 4 and ESLint 10 all + # change APIs the app uses directly. Dependabot handles minor + patch. + - dependency-name: "*" + update-types: ["version-update:semver-major"] + - package-ecosystem: "cargo" directory: "/src-tauri" schedule: interval: "weekly" - # No version-update PRs; this entry only feeds ignore rules to security updates. + # No version-update PRs; this entry only feeds ignore rules to security + # updates. The Rust side is pinned to whatever tauri's tree allows. open-pull-requests-limit: 0 ignore: - dependency-name: "rand" - dependency-name: "glib" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 3 + commit-message: + prefix: "ci" + groups: + actions: + patterns: ["*"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7b6903..099a228 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,20 @@ on: pull_request: branches: [main] +# Least privilege. The job only reads the repo — it publishes nothing, comments +# nowhere. Declaring it explicitly also silences CodeQL's +# `actions/missing-workflow-permissions`, which otherwise flags the implicit +# (and much wider) default token scope. +permissions: + contents: read + +# A force-push or a quick follow-up commit makes the older run worthless. Cancel +# it instead of paying for both — except on `main`, where every commit's result +# is a historical record the release process reads back. +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: check: runs-on: ubuntu-latest @@ -16,8 +30,40 @@ jobs: node-version: 22 cache: npm - run: npm ci - - run: npm run typecheck - - run: npm run lint - - run: npm run validate:locales - - run: npm run test:run - - run: npm run build + + # --- correctness ------------------------------------------------------ + # `typecheck` covers src/ (what Vite actually builds); `typecheck:all` + # adds tests/ and scripts/, which went unchecked until v0.35.0 and were + # hiding three silently-stale fixture fields. + - name: Type check (src) + run: npm run typecheck + - name: Type check (tests + scripts) + run: npm run typecheck:all + - name: Lint + run: npm run lint + - name: Validate locales + run: npm run validate:locales + - name: Test + run: npm run test:run + + # --- consistency ------------------------------------------------------ + - name: Check formatting + run: npm run format:check + - name: Check dead code + run: npm run knip + # The release ritual bumps SIX version fields by hand. This is the only + # thing that notices when one is missed — see scripts/check-version-sync.ts. + - name: Check version sync + run: npm run check:version + + # --- security --------------------------------------------------------- + # Advisory-only: a fresh high-severity advisory in a transitive dep must + # not turn every unrelated PR red before Dependabot has had a chance to + # open its fix PR. The Dependabot alerts tab is the source of truth. + - name: Audit dependencies + run: npm audit --audit-level=high + continue-on-error: true + + # --- build ------------------------------------------------------------ + - name: Build + run: npm run build diff --git a/CHANGELOG.md b/CHANGELOG.md index 78f4cf4..475339d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,55 @@ and **Facebook Group** moved in from the generic Social list. - Nine i18n keys per locale added, one (`social.fb_group`) removed, across all six locales (validator **975 ui / 559 templates**). typecheck, lint, locale validation, and **613 tests** (583 + 30: three new validators, v17 migration incl. the fb_group lift, community render/order/all-language cases, mapping parity) pass; verified live — Vietnamese output shows all five lines in order with a localized heading, English output drops the Zalo line while keeping the rest, and a malformed Signal link surfaces an inline hard-reject error. - Five manifests bumped 0.32.1 → 0.33.0. +## v0.32.1 — 2026-07-12 + +A **hotfix** to v0.32.0. The Messenger Community field accepted the wrong link +shape: `https://m.me/[id]` is a personal-page link, while a community/channel +invite is `https://m.me/ch/[id]` (e.g. `https://m.me/ch/Abb1hmBhU_97UMCF/`). +Creators following the in-app example published a link that did not open the +community. + +### Fixed + +- **Messenger community link format** ([src/utils/validation.ts](src/utils/validation.ts)) — `MESSENGER_URL_REGEX` now requires the `/ch/` segment (trailing slash optional) and hard-rejects the old bare form, so a wrong link can no longer reach the description. The shown example (`MESSENGER_URL_EXPECTED`) and the placeholder in all six locales moved to `https://m.me/ch/yourid`; stale doc comments were refreshed alongside. + +### Under the hood + +- Engine and store are untouched — the link is printed verbatim and the field's type and persist shape are unchanged, so no migration was needed. Validation, engine, and migration tests updated, with new trailing-slash-accept and bare-form-reject cases. +- Five manifests bumped 0.32.0 → 0.32.1. + +## v0.32.0 — 2026-07-08 + +A **feature** release adding the first two "join the chat" community links, in a +single `💬 COMMUNITY` description block — the block that v0.33.0 later grew to +five entries. + +### Added + +- **Messenger community + Zalo group** ([src/components/editor/CommunityEditor.tsx](src/components/editor/CommunityEditor.tsx), [src/utils/validation.ts](src/utils/validation.ts)) — a new **Community** section feeding a localized `💬 COMMUNITY` block. Messenger renders for **every** output language. Zalo is a Vietnam-audience app, so its input only appears — and its line only renders — when the output language is Vietnamese, mirroring the existing VN donate block; a value entered while in Vietnamese survives a language switch. Both links are hard-validated (`validateMessengerUrl` / `validateZaloGroupUrl`) so a malformed URL never reaches the output. + +### Under the hood + +- Two editor fields (`messengerCommunityLink`, `zaloGroupLink`) thread through defaults, the store (persist **v15 → v16**, an additive back-fill), `GeneratorInput`, the editor → engine mapping, and template snapshots — guarded by the existing parity test. +- i18n across all six locales (validator **967 ui / 559 templates**). typecheck, lint, locale validation, and **581 tests** (560 + 21: two new validators, the v16 migration, and community render/language-gating cases) pass. +- Five manifests bumped 0.31.0 → 0.32.0. + +## v0.31.0 — 2026-06-28 + +A **feature** release for the Playlist Generator: the pinned comment a series +needs on its latest video, and an honest answer to "why did this playlist stop?" + +### Added + +- **Status-adaptive playlist pinned comment** ([src/engine/playlist-builder.ts](src/engine/playlist-builder.ts)) — a new `buildPlaylistComment` engine function produces a pinned comment for the series' latest video whose wording follows the playlist status (completed / dropped / incomplete / in progress), rather than one generic template for all four. +- **Dropped reasons** ([src/config/dropped-reasons.ts](src/config/dropped-reasons.ts), [src/pages/PlaylistPage.tsx](src/pages/PlaylistPage.tsx)) — when a series is marked **dropped**, a multi-select of six predefined reasons (`😴 boring`, `🐌 performance`, `🐛 bugs`, `🗑️ delisted`, `📉 low views`, `⏳ time`) plus a free-text "other reason" field. Selected reasons render in **both** the playlist description and the pinned comment. Reason labels are localized in both namespaces — `ui` for the selection chips, `templates` for the rendered output — the same split content warnings use. + +### Under the hood + +- Playlist state stays local to the page; nothing was added to the editor store, so there is no migration in this release. +- i18n across all six locales (validator **959 ui / 558 templates**). `playlist-builder` gained its first test file — **197 lines** covering comment generation per status and dropped-reason rendering. +- Five manifests bumped 0.30.0 → 0.31.0. + ## v0.30.0 — 2026-06-27 A **feature** release adding two things creators kept doing by hand: advertising a diff --git a/eslint.config.js b/eslint.config.js index 0978647..82eaccc 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -15,6 +15,17 @@ export default tseslint.config( "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], }, }, + { + // Tests index into fixture arrays constantly, and `noUncheckedIndexedAccess` + // makes every one of those reads `T | undefined`. A `!` there asserts the + // fixture the test itself just built — the alternative is a guard clause per + // lookup that can only ever fail if the test is already broken. Production + // code keeps the rule. + files: ["tests/**/*.ts", "tests/**/*.tsx"], + rules: { + "@typescript-eslint/no-non-null-assertion": "off", + }, + }, { ignores: ["dist/", "node_modules/", "*.config.*"], }, diff --git a/knip.json b/knip.json index 1041da9..de1b23c 100644 --- a/knip.json +++ b/knip.json @@ -5,7 +5,6 @@ "ignoreExportsUsedInFile": true, "ignoreDependencies": [ "@tauri-apps/plugin-fs", - "@tauri-apps/plugin-opener", "@tauri-apps/plugin-shell", "@testing-library/jest-dom", "@testing-library/react" diff --git a/package-lock.json b/package-lock.json index 50bf144..51c8785 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "@eslint/js": "^9.0.0", "@testing-library/jest-dom": "^6.4.0", "@testing-library/react": "^16.0.0", + "@types/node": "^26.2.0", "@types/react": "^18.3.0", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^5.2.0", @@ -2327,6 +2328,16 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/node": { + "version": "26.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.2.0.tgz", + "integrity": "sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.3.0" + } + }, "node_modules/@types/prop-types": { "version": "15.7.15", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", @@ -4657,9 +4668,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.16", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", - "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", + "version": "3.3.18", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", + "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", "dev": true, "funding": [ { @@ -5989,6 +6000,13 @@ "node": ">=14" } }, + "node_modules/undici-types": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "dev": true, + "license": "MIT" + }, "node_modules/update-browserslist-db": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", diff --git a/package.json b/package.json index 8e5e75b..b933152 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,14 @@ "test": "vitest", "test:run": "vitest run", "test:coverage": "vitest run --coverage", - "lint": "eslint src/", - "lint:fix": "eslint src/ --fix", + "lint": "eslint src/ tests/ scripts/", + "lint:fix": "eslint src/ tests/ scripts/ --fix", "knip": "knip", "typecheck": "tsc --noEmit", - "format": "prettier --write \"src/**/*.{ts,tsx,json,css}\"", + "typecheck:all": "tsc --noEmit -p tsconfig.check.json", + "format": "prettier --write \"{src,tests,scripts}/**/*.{ts,tsx,css}\"", + "format:check": "prettier --check \"{src,tests,scripts}/**/*.{ts,tsx,css}\"", + "check:version": "tsx scripts/check-version-sync.ts", "validate:locales": "tsx scripts/validate-locales.ts", "generate:locale": "tsx scripts/generate-locale-template.ts", "tauri": "tauri", @@ -43,6 +46,7 @@ "@eslint/js": "^9.0.0", "@testing-library/jest-dom": "^6.4.0", "@testing-library/react": "^16.0.0", + "@types/node": "^26.2.0", "@types/react": "^18.3.0", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^5.2.0", diff --git a/scripts/check-version-sync.ts b/scripts/check-version-sync.ts new file mode 100644 index 0000000..4f34dd5 --- /dev/null +++ b/scripts/check-version-sync.ts @@ -0,0 +1,113 @@ +/** + * Verify that every manifest carrying the app version agrees. + * + * A release bumps SIX places, and nothing but this script notices when one is + * missed. A stale `tauri.conf.json` ships an installer whose About screen and + * updater metadata disagree with the tag; a stale `Cargo.lock` self-entry makes + * the next `cargo build` rewrite the lockfile mid-release. + * + * Run via `npm run check:version`. Exits non-zero (and prints every mismatch, + * not just the first) so CI fails the PR rather than the release. + */ +import { readFileSync } from "fs"; +import { resolve } from "path"; + +interface VersionSource { + /** Human-readable location, printed on mismatch. */ + label: string; + /** Repo-relative path. */ + file: string; + /** Pull the version out of the file's raw text. */ + extract: (raw: string) => string | null; +} + +/** Read `version` from a top-level JSON object. */ +function jsonVersion(raw: string): string | null { + const parsed: unknown = JSON.parse(raw); + if (typeof parsed !== "object" || parsed === null) return null; + const version = (parsed as Record).version; + return typeof version === "string" ? version : null; +} + +const SOURCES: VersionSource[] = [ + { + label: "package.json → version", + file: "package.json", + extract: jsonVersion, + }, + { + label: "package-lock.json → version", + file: "package-lock.json", + extract: jsonVersion, + }, + { + label: 'package-lock.json → packages[""].version', + file: "package-lock.json", + extract: (raw) => { + const parsed: unknown = JSON.parse(raw); + if (typeof parsed !== "object" || parsed === null) return null; + const packages = (parsed as Record).packages; + if (typeof packages !== "object" || packages === null) return null; + const root = (packages as Record)[""]; + if (typeof root !== "object" || root === null) return null; + const version = (root as Record).version; + return typeof version === "string" ? version : null; + }, + }, + { + label: "src-tauri/tauri.conf.json → version", + file: "src-tauri/tauri.conf.json", + extract: jsonVersion, + }, + { + label: "src-tauri/Cargo.toml → [package] version", + file: "src-tauri/Cargo.toml", + // Anchor on the [package] table so a dependency's `version = "…"` in the + // same file can never be picked up instead. + extract: (raw) => /^\[package\][\s\S]*?^version\s*=\s*"([^"]+)"/m.exec(raw)?.[1] ?? null, + }, + { + label: "src-tauri/Cargo.lock → yt-desc-gen entry", + file: "src-tauri/Cargo.lock", + extract: (raw) => /^name = "yt-desc-gen"\r?\nversion = "([^"]+)"/m.exec(raw)?.[1] ?? null, + }, +]; + +function main(): void { + const found: { label: string; version: string | null }[] = SOURCES.map((source) => { + let raw: string; + try { + raw = readFileSync(resolve(source.file), "utf8"); + } catch { + return { label: source.label, version: null }; + } + let version: string | null = null; + try { + version = source.extract(raw); + } catch { + version = null; + } + return { label: source.label, version }; + }); + + const missing = found.filter((entry) => entry.version === null); + const versions = [...new Set(found.map((entry) => entry.version).filter(Boolean))]; + + if (missing.length === 0 && versions.length === 1) { + console.log(`✓ All ${found.length} manifests agree on version ${versions[0]}`); + return; + } + + console.error("✗ Version manifests are out of sync.\n"); + for (const entry of found) { + const mark = entry.version === null ? "?" : entry.version === versions[0] ? " " : "!"; + console.error(` ${mark} ${entry.version ?? ""} ${entry.label}`); + } + console.error( + "\nBump every manifest to the same version before tagging. `npm version --no-git-tag-version `", + ); + console.error("covers package.json + package-lock.json; the three Rust/Tauri files are manual."); + process.exit(1); +} + +main(); diff --git a/scripts/generate-locale-template.ts b/scripts/generate-locale-template.ts new file mode 100644 index 0000000..99892f3 --- /dev/null +++ b/scripts/generate-locale-template.ts @@ -0,0 +1,133 @@ +/** + * Scaffold a new locale directory from the English source. + * + * `package.json` has advertised `npm run generate:locale` since v0.1, and + * `docs/I18N.md` step 1 tells contributors to run it — but the script was never + * committed, so the documented first step of adding a language failed outright. + * This is that script. + * + * Usage: + * npm run generate:locale -- --lang pt-BR # empty values to translate + * npm run generate:locale -- --lang id --copy-english # pre-fill with EN text + * npm run generate:locale -- --lang id --force # overwrite an existing dir + * + * Output mirrors `src/i18n/locales/en/{ui,templates}.json` key-for-key, so + * `npm run validate:locales` passes the moment the files are written (it checks + * key parity, not whether the values were actually translated). + * + * Registering the locale in code is NOT done here — see the checklist printed + * on success, and docs/I18N.md. + */ +import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs"; +import { join, resolve } from "path"; + +const LOCALES_DIR = resolve("src/i18n/locales"); +const SOURCE_LOCALE = "en"; +const NAMESPACES = ["ui", "templates"] as const; + +/** BCP-47-ish: `pt`, `pt-BR`, `zh-Hant`. Keeps a typo from creating a junk dir. */ +const LANG_PATTERN = /^[a-z]{2,3}(-[A-Za-z]{2,8})*$/; + +interface Options { + lang: string; + copyEnglish: boolean; + force: boolean; +} + +function parseArgs(argv: string[]): Options { + let lang = ""; + let copyEnglish = false; + let force = false; + + for (let i = 0; i < argv.length; i++) { + const arg = argv[i]; + if (arg === "--lang" || arg === "-l") { + lang = argv[++i] ?? ""; + } else if (arg?.startsWith("--lang=")) { + lang = arg.slice("--lang=".length); + } else if (arg === "--copy-english") { + copyEnglish = true; + } else if (arg === "--force") { + force = true; + } + } + + if (!lang) { + console.error("Missing --lang.\n\n npm run generate:locale -- --lang pt-BR\n"); + process.exit(1); + } + if (!LANG_PATTERN.test(lang)) { + console.error(`Invalid language code "${lang}". Expected e.g. "id", "pt-BR", "zh-Hant".\n`); + process.exit(1); + } + return { lang, copyEnglish, force }; +} + +/** + * Rebuild the tree with every leaf replaced by `""`, preserving key order so + * the generated file diffs cleanly against the English source. + */ +function blankLeaves(value: unknown): unknown { + if (Array.isArray(value)) return value.map(blankLeaves); + if (typeof value === "object" && value !== null) { + const out: Record = {}; + for (const [key, child] of Object.entries(value as Record)) { + out[key] = blankLeaves(child); + } + return out; + } + return ""; +} + +function countLeaves(value: unknown): number { + if (Array.isArray(value)) return value.reduce((n, v) => n + countLeaves(v), 0); + if (typeof value === "object" && value !== null) { + return Object.values(value as Record).reduce( + (n, v) => n + countLeaves(v), + 0, + ); + } + return 1; +} + +function main(): void { + const { lang, copyEnglish, force } = parseArgs(process.argv.slice(2)); + const targetDir = join(LOCALES_DIR, lang); + + if (existsSync(targetDir) && !force) { + console.error(`✗ ${targetDir} already exists. Pass --force to overwrite.\n`); + process.exit(1); + } + mkdirSync(targetDir, { recursive: true }); + + let total = 0; + for (const ns of NAMESPACES) { + const sourcePath = join(LOCALES_DIR, SOURCE_LOCALE, `${ns}.json`); + if (!existsSync(sourcePath)) { + console.error(`✗ Source locale missing: ${sourcePath}`); + process.exit(1); + } + const source: unknown = JSON.parse(readFileSync(sourcePath, "utf-8")); + const output = copyEnglish ? source : blankLeaves(source); + const outPath = join(targetDir, `${ns}.json`); + // Two-space indent + trailing newline matches the existing locale files. + writeFileSync(outPath, `${JSON.stringify(output, null, 2)}\n`, "utf-8"); + const leaves = countLeaves(source); + total += leaves; + console.log( + `✓ ${lang}/${ns}.json — ${leaves} keys${copyEnglish ? " (English text)" : " (empty)"}`, + ); + } + + console.log(`\n${total} strings to translate. Remaining steps to register "${lang}": + + 1. src/i18n/index.ts — add to SUPPORTED_LANGUAGES (flag + nativeName) + 2. src/engine/types.ts — add to the SupportedLanguage union + 3. src/store/settings-heal.ts — add to detectBrowserLanguage's supported list + 4. src/engine/tag-generator.ts— add a MULTILINGUAL_TAGS entry (TS enforces this) + 5. npm run validate:locales — must pass before committing + +See docs/I18N.md for the full checklist.`); +} + +main(); diff --git a/scripts/validate-locales.ts b/scripts/validate-locales.ts index f23b1c1..8ae7b13 100644 --- a/scripts/validate-locales.ts +++ b/scripts/validate-locales.ts @@ -74,9 +74,7 @@ function validate(): void { console.log(`✓ ${locale}/${filename} — ${actualKeys.length}/${expectedKeys.length} keys`); } else { hasErrors = true; - console.error( - `✗ ${locale}/${filename} — ${actualKeys.length}/${expectedKeys.length} keys`, - ); + console.error(`✗ ${locale}/${filename} — ${actualKeys.length}/${expectedKeys.length} keys`); if (missing.length > 0) { console.error(` Missing: ${missing.join(", ")}`); } diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 6fcbd6e..035553d 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -11,14 +11,6 @@ "fs:allow-read-text-file", "fs:allow-write-text-file", "shell:default", - "opener:default", - { - "identifier": "opener:allow-open-path", - "allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }] - }, - { - "identifier": "opener:allow-reveal-item-in-dir", - "allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }] - } + "opener:default" ] } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 1924fdc..33f40d8 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -27,19 +27,6 @@ fn read_from_file(path: String) -> Result { std::fs::read_to_string(&path).map_err(|e| e.to_string()) } -/// Ensure a directory exists on disk, creating it (and any missing -/// parents) if necessary. No-op when the path already exists as a -/// directory. Fixes the "Windows cannot find ... AppData\Roaming\ -/// com.skullmute.ytdescgen" Explorer error on first launch — see -/// `openSettingsFolder()` in `SettingsPage.tsx`, where this is called -/// before `openPath(dir)` so the OS shell never sees a non-existent -/// path. Returns the OS error string on failure (e.g. permission -/// denied) so the caller can surface it via the in-app log. -#[tauri::command] -fn ensure_dir(path: String) -> Result<(), String> { - std::fs::create_dir_all(&path).map_err(|e| e.to_string()) -} - /// Append `content` to the file at `path`, creating the file (and any /// missing parent directories) if necessary. Used by the v0.17.0 log /// persistence pipeline to write JSONL entries one line at a time, @@ -111,7 +98,6 @@ pub fn run() { .invoke_handler(tauri::generate_handler![ save_to_file, read_from_file, - ensure_dir, append_to_file, list_dir, delete_file diff --git a/src/App.tsx b/src/App.tsx index e7eed3e..abea0bd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -24,21 +24,13 @@ const HistoryPage = lazy(() => const SettingsPage = lazy(() => import("@pages/SettingsPage").then((m) => ({ default: m.SettingsPage })), ); -const BatchPage = lazy(() => - import("@pages/BatchPage").then((m) => ({ default: m.BatchPage })), -); -const SocialPage = lazy(() => - import("@pages/SocialPage").then((m) => ({ default: m.SocialPage })), -); +const BatchPage = lazy(() => import("@pages/BatchPage").then((m) => ({ default: m.BatchPage }))); +const SocialPage = lazy(() => import("@pages/SocialPage").then((m) => ({ default: m.SocialPage }))); const PlaylistPage = lazy(() => import("@pages/PlaylistPage").then((m) => ({ default: m.PlaylistPage })), ); -const LogPage = lazy(() => - import("@pages/LogPage").then((m) => ({ default: m.LogPage })), -); -const AboutPage = lazy(() => - import("@pages/AboutPage").then((m) => ({ default: m.AboutPage })), -); +const LogPage = lazy(() => import("@pages/LogPage").then((m) => ({ default: m.LogPage }))); +const AboutPage = lazy(() => import("@pages/AboutPage").then((m) => ({ default: m.AboutPage }))); function PageLoader() { return
Loading...
; @@ -152,35 +144,67 @@ export default function App() { /> } + element={ + + + + } /> } + element={ + + + + } /> } + element={ + + + + } /> } + element={ + + + + } /> } + element={ + + + + } /> } + element={ + + + + } /> } + element={ + + + + } /> } + element={ + + + + } /> {/* Designed error pages — siblings of the AppShell group so they diff --git a/src/components/editor/CommunityEditor.tsx b/src/components/editor/CommunityEditor.tsx index 80a7bdd..4c4d907 100644 --- a/src/components/editor/CommunityEditor.tsx +++ b/src/components/editor/CommunityEditor.tsx @@ -42,9 +42,7 @@ export function CommunityEditor() { return (
- - {t("editor.community")} - + {t("editor.community")}

{t("editor.communityHelp")}

diff --git a/src/components/editor/ContentWarningChecklist.tsx b/src/components/editor/ContentWarningChecklist.tsx index 3ca4c40..a5b4830 100644 --- a/src/components/editor/ContentWarningChecklist.tsx +++ b/src/components/editor/ContentWarningChecklist.tsx @@ -3,10 +3,7 @@ import { useTranslation } from "react-i18next"; import { ChevronDown, ChevronRight, Search, X } from "lucide-react"; import clsx from "clsx"; import { useEditorStore } from "@store/editor-store"; -import { - CONTENT_WARNING_GROUPS, - type ContentWarningGroup, -} from "@config/content-warning-groups"; +import { CONTENT_WARNING_GROUPS, type ContentWarningGroup } from "@config/content-warning-groups"; import type { ContentWarning } from "@engine/types"; /** @@ -69,13 +66,9 @@ export function ContentWarningChecklist() { return (
- - {t("editor.warnings")} - + {t("editor.warnings")} {selected.length > 0 && ( - - {selected.length} selected - + {selected.length} selected )}
@@ -108,9 +101,7 @@ export function ContentWarningChecklist() {
{filteredGroups.map((group) => { const isOpen = isFiltering || openGroups[group.id]; - const groupSelectedCount = group.items.filter((id) => - selected.includes(id), - ).length; + const groupSelectedCount = group.items.filter((id) => selected.includes(id)).length; return (
{groupSelectedCount > 0 && ( - + {groupSelectedCount} )} @@ -154,7 +145,7 @@ export function ContentWarningChecklist() { type="checkbox" checked={checked} onChange={() => toggleItem(id)} - className="h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-border text-accent focus:ring-1 focus:ring-accent/40" + className="focus:ring-accent/40 h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-border text-accent focus:ring-1" /> {t(`editor.contentWarningOptions.${id}`)} diff --git a/src/components/editor/EndingsEditor.tsx b/src/components/editor/EndingsEditor.tsx index a2295d9..66ab312 100644 --- a/src/components/editor/EndingsEditor.tsx +++ b/src/components/editor/EndingsEditor.tsx @@ -4,10 +4,7 @@ import { Plus, Minus, AlertTriangle } from "lucide-react"; import { Input } from "@components/ui/Input"; import { Button } from "@components/ui/Button"; import { Select } from "@components/ui/Select"; -import { - useEditorStore, - computeContiguousRanges, -} from "@store/editor-store"; +import { useEditorStore, computeContiguousRanges } from "@store/editor-store"; import { parseTimeline } from "@engine/timeline-parser"; import { formatEndingEntry } from "@engine/endings-format"; import type { EndingEntry, EndingVideoRange } from "@engine/types"; @@ -78,7 +75,10 @@ export function EndingsEditor() { const nextEndings: EndingEntry[] = clamped <= count ? endings.slice(0, clamped) - : [...endings, ...Array.from({ length: clamped - count }, () => ({ number: null, name: "" }))]; + : [ + ...endings, + ...Array.from({ length: clamped - count }, () => ({ number: null, name: "" })), + ]; set("endings", nextEndings); // Re-derive endingVideoCount + ranges so the schema invariants @@ -86,10 +86,7 @@ export function EndingsEditor() { // stay true after a shrink/grow. const nextVideoCount = clamped === 0 ? 1 : Math.min(endingVideoCount, clamped); set("endingVideoCount", nextVideoCount); - set( - "endingVideoRanges", - clamped === 0 ? [] : computeContiguousRanges(clamped, nextVideoCount), - ); + set("endingVideoRanges", clamped === 0 ? [] : computeContiguousRanges(clamped, nextVideoCount)); }; /** Update one ending row's number / name. */ @@ -119,9 +116,7 @@ export function EndingsEditor() { * configurations after the fact, since mid-edit overlaps are * expected. */ const updateRange = (i: number, patch: Partial) => { - const next = endingVideoRanges.map((r, idx) => - idx === i ? { ...r, ...patch } : r, - ); + const next = endingVideoRanges.map((r, idx) => (idx === i ? { ...r, ...patch } : r)); set("endingVideoRanges", next); }; @@ -206,9 +201,7 @@ export function EndingsEditor() { )}
- {count === 0 && ( -

{t("editor.endings.emptyHint")}

- )} + {count === 0 &&

{t("editor.endings.emptyHint")}

} {/* CASE A: single ending — number + name pair, with preview. */} {count === 1 && endings[0] && ( @@ -297,7 +290,7 @@ export function EndingsEditor() { {/* Case B: timeline gate banner. */} {isMultiEnding && !isMultiVideo && timelineEndingCount < count && ( -

+

{t("editor.endings.warnings.timelineShort", { @@ -321,16 +314,12 @@ export function EndingsEditor() { /> {isMultiVideo && ( <> -

- {t("editor.endings.videoRangeHint")} -

+

{t("editor.endings.videoRangeHint")}

- + @@ -345,9 +334,7 @@ export function EndingsEditor() { min={1} max={count} value={String(r.from)} - onChange={(e) => - updateRange(i, { from: Number(e.target.value) || 1 }) - } + onChange={(e) => updateRange(i, { from: Number(e.target.value) || 1 })} /> @@ -367,7 +352,7 @@ export function EndingsEditor() {
- {t("editor.endings.videoLabel")} - {t("editor.endings.videoLabel")} From To
@@ -356,9 +343,7 @@ export function EndingsEditor() { min={1} max={count} value={String(r.to)} - onChange={(e) => - updateRange(i, { to: Number(e.target.value) || 1 }) - } + onChange={(e) => updateRange(i, { to: Number(e.target.value) || 1 })} />
{rangeWarnings.length > 0 && ( -
    +
      {rangeWarnings.map((w, i) => (
    • @@ -394,9 +379,7 @@ export function EndingsEditor() { value={String(Math.min(endingVideoIndex, endingVideoCount))} onChange={(v) => set("endingVideoIndex", Number(v) || 1)} /> -

      - {t("editor.endings.videoIndexHint")} -

      +

      {t("editor.endings.videoIndexHint")}

      )}
diff --git a/src/components/editor/ExtraFieldsInput.tsx b/src/components/editor/ExtraFieldsInput.tsx index 0ce6bba..7cb044d 100644 --- a/src/components/editor/ExtraFieldsInput.tsx +++ b/src/components/editor/ExtraFieldsInput.tsx @@ -32,9 +32,7 @@ export function ExtraFieldsInput() { const visibility = GACHA_QUEST_FIELD_VISIBILITY[questType]; const placeholders = GACHA_QUEST_PLACEHOLDERS[questType]; - const placeholderFor = ( - field: "chapterName" | "questName" | "partNumber", - ): string => { + const placeholderFor = (field: "chapterName" | "questName" | "partNumber"): string => { const key = `editor.placeholders.questType.${questType}.${field}`; const localised = t(key); if (localised && localised !== key) return localised; @@ -57,25 +55,17 @@ export function ExtraFieldsInput() {
{extraFields.includes("gachaQuestType") && (
-
)} diff --git a/src/components/editor/GenreSelector.tsx b/src/components/editor/GenreSelector.tsx index 6c45870..b1cb2a6 100644 --- a/src/components/editor/GenreSelector.tsx +++ b/src/components/editor/GenreSelector.tsx @@ -1,12 +1,7 @@ import { useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { ChipGroup } from "@components/ui/ChipGroup"; -import { - GENRES, - GENRE_GROUPS, - GENRE_GROUP_IDS, - type GenreGroupId, -} from "@config/genres"; +import { GENRES, GENRE_GROUPS, GENRE_GROUP_IDS, type GenreGroupId } from "@config/genres"; import { GENRES_WITHOUT_GRAPHICS_SETTINGS } from "@config/graphics-settings"; import { useEditorStore } from "@store/editor-store"; import { MAX_GENRES, type Genre } from "@engine/types"; @@ -55,9 +50,7 @@ export function GenreSelector() { return (
- - {t("editor.genre")} - + {t("editor.genre")} {genres.length}/{MAX_GENRES} @@ -79,12 +72,10 @@ export function GenreSelector() { value={filter} onChange={(e) => setFilter(e.target.value)} placeholder={t("editor.genreSearchPlaceholder")} - className="rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted transition-colors focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/50" + 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" /> {visibleOptions.length === 0 ? ( -

- {t("editor.genreSearchNoResults")} -

+

{t("editor.genreSearchNoResults")}

) : ( )} {showHint && ( -
+
{t("editor.skipGraphicsHintLabel")}
diff --git a/src/components/editor/RigEditor.tsx b/src/components/editor/RigEditor.tsx index 962cde8..8226500 100644 --- a/src/components/editor/RigEditor.tsx +++ b/src/components/editor/RigEditor.tsx @@ -66,10 +66,7 @@ export function RigEditor() { : [{ value: "", label: "—" }]; const currentSeries = currentBrand?.series.find((s) => s.id === series); const modelOptions = currentSeries - ? [ - { value: "", label: "—" }, - ...currentSeries.models.map((m) => ({ value: m, label: m })), - ] + ? [{ value: "", label: "—" }, ...currentSeries.models.map((m) => ({ value: m, label: m }))] : [{ value: "", label: "—" }]; const setBrand = (next: string) => { @@ -84,11 +81,7 @@ export function RigEditor() { setNested("rig", field.id, joinCascading(brand, series, next)); }; const setCustomText = (text: string) => { - setNested( - "rig", - field.id, - text ? joinCascading(GPU_CUSTOM_BRAND_ID, "", text) : "", - ); + setNested("rig", field.id, text ? joinCascading(GPU_CUSTOM_BRAND_ID, "", text) : ""); }; return ( @@ -141,9 +134,7 @@ export function RigEditor() { // Validate per field — only RAM has size/DDR semantics. Running the // RAM validator on the OS composite mis-fired "Pick a DDR generation." const issue = validateCompositeField(field.id, raw); - const partValues = field.composite.parts.map( - (_p, i) => storedParts[i] ?? "", - ); + const partValues = field.composite.parts.map((_p, i) => storedParts[i] ?? ""); // v0.23.0: setting a part also resets all downstream parts to "" so // a cascading parent change can't leave the form with a stale child @@ -181,9 +172,7 @@ export function RigEditor() { return (
{t(field.labelKey)} -
- {renderedParts} -
+
{renderedParts}
{renderValidationBadge(issue)}
); @@ -247,8 +236,7 @@ export function RigEditor() { const commit = (nextValue: string, nextVersion: string) => { // Keep the stored form compact: drop the pipe when empty. - const next = - !nextValue && !nextVersion ? "" : `${nextValue}|${nextVersion}`; + const next = !nextValue && !nextVersion ? "" : `${nextValue}|${nextVersion}`; setNested("rig", field.id, next); }; diff --git a/src/components/editor/StoreLinkEditor.tsx b/src/components/editor/StoreLinkEditor.tsx index 932150b..047409a 100644 --- a/src/components/editor/StoreLinkEditor.tsx +++ b/src/components/editor/StoreLinkEditor.tsx @@ -7,10 +7,7 @@ import { Select } from "@components/ui/Select"; import { PLATFORMS } from "@config/platforms"; import { useEditorStore } from "@store/editor-store"; import { validateUrlWithPattern } from "@utils/validation"; -import { - extractGameNameFromUrl, - isLinkNameMismatch, -} from "@utils/url-extractors"; +import { extractGameNameFromUrl, isLinkNameMismatch } from "@utils/url-extractors"; import type { StoreLinkType } from "@engine/types"; const STORE_LINK_TYPE_VALUES: readonly StoreLinkType[] = ["paid", "free", "demo"]; @@ -30,9 +27,9 @@ export function StoreLinkEditor() { const setNested = useEditorStore((s) => s.setNested); const setStoreLinkType = useEditorStore((s) => s.setStoreLinkType); - const [dismissedFingerprints, setDismissedFingerprints] = useState< - ReadonlySet - >(new Set()); + const [dismissedFingerprints, setDismissedFingerprints] = useState>( + new Set(), + ); const typeOptions = STORE_LINK_TYPE_VALUES.map((value) => ({ value, @@ -135,10 +132,7 @@ export function StoreLinkEditor() { // the optional game-copyright description line independently // of whether the publisher URL is filled. return ( -
+
- - {t("editor.techNotes")} - + {t("editor.techNotes")} {selected.length > 0 && ( - - {selected.length} selected - + {selected.length} selected )}
@@ -102,16 +95,12 @@ export function TechNotesChecklist() {
{isFiltering && totalMatching === 0 ? ( -

- {t("editor.techNoteEmpty")} -

+

{t("editor.techNoteEmpty")}

) : (
{filteredGroups.map((group) => { const isOpen = isFiltering || openGroups[group.id]; - const groupSelectedCount = group.items.filter((id) => - selected.includes(id), - ).length; + const groupSelectedCount = group.items.filter((id) => selected.includes(id)).length; return (
{groupSelectedCount > 0 && ( - + {groupSelectedCount} )} @@ -155,7 +144,7 @@ export function TechNotesChecklist() { type="checkbox" checked={checked} onChange={() => toggleItem(id)} - className="h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-border text-accent focus:ring-1 focus:ring-accent/40" + className="focus:ring-accent/40 h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-border text-accent focus:ring-1" /> {t(`editor.techNoteOptions.${id}`)} diff --git a/src/components/editor/VietnameseDonateEditor.tsx b/src/components/editor/VietnameseDonateEditor.tsx index 2176f29..c000a41 100644 --- a/src/components/editor/VietnameseDonateEditor.tsx +++ b/src/components/editor/VietnameseDonateEditor.tsx @@ -48,11 +48,8 @@ export function VietnameseDonateEditor() { () => isVi && isCustomVietnameseBank(vnBankName ?? ""), ); - const customMode = - isVi && (otherSticky || isCustomVietnameseBank(vnBankName ?? "")); - const selectValue = customMode - ? VIETNAMESE_BANK_OTHER - : (vnBankName ?? ""); + const customMode = isVi && (otherSticky || isCustomVietnameseBank(vnBankName ?? "")); + const selectValue = customMode ? VIETNAMESE_BANK_OTHER : (vnBankName ?? ""); const bankOptions = [ { value: "", label: t("editor.vnBankNameSelectPlaceholder") }, @@ -63,9 +60,7 @@ export function VietnameseDonateEditor() { return (
- - {t("editor.vnDonate")} - + {t("editor.vnDonate")}

{t("editor.vnDonateHelp")}

diff --git a/src/components/errors/ErrorPage.tsx b/src/components/errors/ErrorPage.tsx index 8cf4f9a..451d795 100644 --- a/src/components/errors/ErrorPage.tsx +++ b/src/components/errors/ErrorPage.tsx @@ -55,7 +55,7 @@ function FullscreenError({ kind }: ErrorPageProps) {
{meta.code !== null && ( -

+

{meta.code}

)} @@ -99,7 +99,7 @@ function ContainedError({ kind, onReset, detail }: ErrorPageProps) { return (
-
+

{title}

@@ -140,7 +140,7 @@ function ReportBugLink({ size = "md" }: { size?: "sm" | "md" }) { target="_blank" rel="noopener noreferrer" className={clsx( - "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", + "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", sizeClass, )} > diff --git a/src/components/errors/OfflineBanner.tsx b/src/components/errors/OfflineBanner.tsx index 77a1818..e9a293d 100644 --- a/src/components/errors/OfflineBanner.tsx +++ b/src/components/errors/OfflineBanner.tsx @@ -35,7 +35,7 @@ export function OfflineBanner() { return (
{t("errorPages.offlineBanner.message")} diff --git a/src/components/history/HistoryCard.tsx b/src/components/history/HistoryCard.tsx index 705aceb..f2574b7 100644 --- a/src/components/history/HistoryCard.tsx +++ b/src/components/history/HistoryCard.tsx @@ -19,7 +19,7 @@ export function HistoryCard({ entry }: HistoryCardProps) { const date = new Date(entry.createdAt).toLocaleDateString(); return ( -
+
setExpanded(!expanded)} diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 853a660..6d92156 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -37,9 +37,7 @@ export function Header({ onOpenMobileNav }: HeaderProps) { }; return ( -
+
{onOpenMobileNav && (
@@ -79,11 +75,7 @@ export function Header({ onOpenMobileNav }: HeaderProps) { title={t("header.toggleTheme")} aria-label={t("header.toggleTheme")} > - {theme === "dark" ? ( - - ) : ( - - )} + {theme === "dark" ? : }
{open && ( -
+
{SUPPORTED_LANGUAGES.map((lang) => ( diff --git a/src/components/output/CharCounter.tsx b/src/components/output/CharCounter.tsx index c10234f..6361ae3 100644 --- a/src/components/output/CharCounter.tsx +++ b/src/components/output/CharCounter.tsx @@ -19,10 +19,10 @@ export function CharCounter({ text, limit }: CharCounterProps) { return ( {count}/{limit} diff --git a/src/components/output/CopyAllBar.tsx b/src/components/output/CopyAllBar.tsx index 9da7d5f..218fb65 100644 --- a/src/components/output/CopyAllBar.tsx +++ b/src/components/output/CopyAllBar.tsx @@ -48,11 +48,7 @@ export function CopyAllBar({ extraText }: CopyAllBarProps) { return (
- diff --git a/src/components/output/OutputExtras.tsx b/src/components/output/OutputExtras.tsx index 755f918..a6ea015 100644 --- a/src/components/output/OutputExtras.tsx +++ b/src/components/output/OutputExtras.tsx @@ -27,9 +27,7 @@ export function OutputExtras() { const pinnedComment = useEditorStore((s) => s.pinnedComment); const showPinnedCommentTemplate = useSettingsStore((s) => s.showPinnedCommentTemplate); const includeAskNextGame = useSettingsStore((s) => s.pinnedCommentIncludeAskNextGame); - const includeGenrePlaylist = useSettingsStore( - (s) => s.pinnedCommentIncludeGenrePlaylist, - ); + const includeGenrePlaylist = useSettingsStore((s) => s.pinnedCommentIncludeGenrePlaylist); const genrePlaylists = useSettingsStore((s) => s.genrePlaylists); const input = useCurrentGeneratorInput(); @@ -75,9 +73,7 @@ export function OutputExtras() { {hasThumbnail && (
-

- {t("output.thumbnailText")} -

+

{t("output.thumbnailText")}

@@ -91,9 +87,7 @@ export function OutputExtras() { {hasPinned && (
-

- {t("output.pinnedComment")} -

+

{t("output.pinnedComment")}

diff --git a/src/components/output/OutputPreview.tsx b/src/components/output/OutputPreview.tsx index 3f530ff..b581257 100644 --- a/src/components/output/OutputPreview.tsx +++ b/src/components/output/OutputPreview.tsx @@ -42,7 +42,9 @@ export function OutputPreview({ output: outputProp }: OutputPreviewProps) {

{t("output.description")}

- {showCharCount && } + {showCharCount && ( + + )} +
{variants.map((variant) => (
diff --git a/src/components/presets/PresetCard.tsx b/src/components/presets/PresetCard.tsx index 1c6b29c..02a0eee 100644 --- a/src/components/presets/PresetCard.tsx +++ b/src/components/presets/PresetCard.tsx @@ -46,7 +46,7 @@ export function PresetCard({ preset }: PresetCardProps) { return ( <> -
+

{preset.gameName}

@@ -85,11 +85,7 @@ export function PresetCard({ preset }: PresetCardProps) { variant="danger" /> - setShowEdit(false)} - editPreset={preset} - /> + setShowEdit(false)} editPreset={preset} /> ); } diff --git a/src/components/presets/PresetSelector.tsx b/src/components/presets/PresetSelector.tsx index 2a341c6..f894da0 100644 --- a/src/components/presets/PresetSelector.tsx +++ b/src/components/presets/PresetSelector.tsx @@ -40,5 +40,7 @@ export function PresetSelector() { } }; - return + ); } diff --git a/src/components/profiles/ProfileCard.tsx b/src/components/profiles/ProfileCard.tsx index cdd846c..9e934e0 100644 --- a/src/components/profiles/ProfileCard.tsx +++ b/src/components/profiles/ProfileCard.tsx @@ -45,10 +45,12 @@ export function ProfileCard({ profile }: ProfileCardProps) { return ( <> -
+

{profile.name}

-

{profile.channelName || "No channel"}

+

+ {profile.channelName || "No channel"} +

{socialCount > 0 && {socialCount} social links} {rigCount > 0 && {rigCount} rig fields} @@ -81,11 +83,7 @@ export function ProfileCard({ profile }: ProfileCardProps) { variant="danger" /> - setShowEdit(false)} - editProfile={profile} - /> + setShowEdit(false)} editProfile={profile} /> ); } diff --git a/src/components/templates/TemplateCard.tsx b/src/components/templates/TemplateCard.tsx index 2c41c06..d68c177 100644 --- a/src/components/templates/TemplateCard.tsx +++ b/src/components/templates/TemplateCard.tsx @@ -24,7 +24,9 @@ export function TemplateCard({ template }: TemplateCardProps) { // patch via `normalizeEditorPatch`, but checking here lets us // surface a clearer toast and skip the no-op success message. if (!template.snapshot || typeof template.snapshot !== "object") { - toast.error(t("templates.applyFailed", { defaultValue: "Template is corrupt — cannot apply" })); + toast.error( + t("templates.applyFailed", { defaultValue: "Template is corrupt — cannot apply" }), + ); return; } loadProfile(template.snapshot); @@ -35,7 +37,7 @@ export function TemplateCard({ template }: TemplateCardProps) { return ( <> -
+

{template.name}

diff --git a/src/components/ui/Accordion.tsx b/src/components/ui/Accordion.tsx index 7166013..e1b4fd5 100644 --- a/src/components/ui/Accordion.tsx +++ b/src/components/ui/Accordion.tsx @@ -23,15 +23,7 @@ interface AccordionProps { * sections are open and persists that choice. Height animates via a * grid-rows trick so content can be any height without measurement. */ -export function Accordion({ - id, - title, - icon, - badge, - open, - onToggle, - children, -}: AccordionProps) { +export function Accordion({ id, title, icon, badge, open, onToggle, children }: AccordionProps) { return (
-
- {children} -
+
{children}
diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx index e2127c9..cbb16f2 100644 --- a/src/components/ui/Button.tsx +++ b/src/components/ui/Button.tsx @@ -23,7 +23,7 @@ export const Button = forwardRef( diff --git a/src/components/ui/Drawer.tsx b/src/components/ui/Drawer.tsx index 39c0d25..eadaed0 100644 --- a/src/components/ui/Drawer.tsx +++ b/src/components/ui/Drawer.tsx @@ -43,11 +43,7 @@ export function Drawer({ )} aria-hidden={!open} > -
@@ -154,12 +169,7 @@ export function AboutPage() {
{socials.map((s) => ( - + ))}
@@ -172,7 +182,10 @@ export function AboutPage() {

{t("about.thirdPartyHelp")}

    {THIRD_PARTY.map((entry) => ( -
  • +
  • {entry.name} - - {entry.version} - + {entry.version} {entry.license}
  • @@ -212,7 +223,11 @@ function ExternalLinkRow({ href, icon: Icon, label, accent }: ExternalLinkRowPro : "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" } > - + {label} diff --git a/src/pages/BatchPage.tsx b/src/pages/BatchPage.tsx index 17d46a5..428252b 100644 --- a/src/pages/BatchPage.tsx +++ b/src/pages/BatchPage.tsx @@ -206,7 +206,7 @@ export function BatchPage() { {rangeError && (

    {rangeError}

    @@ -227,7 +227,10 @@ export function BatchPage() {
{results.map((result) => ( -
+

Part {result.partNumber}

@@ -250,7 +253,10 @@ export function BatchPage() { {lang.output.description.slice(0, 200)}...
- + {lang.pinnedComment && ( +
{ @@ -204,9 +201,7 @@ export function LogPage() { // collapsed" semantic from leaking into the set. setCollapsedSessions((prev) => { const next = new Set(prev); - const key = session.isCurrent - ? session.id - : `__expanded__${session.id}`; + const key = session.isCurrent ? session.id : `__expanded__${session.id}`; if (next.has(key)) next.delete(key); else next.add(key); return next; @@ -230,14 +225,10 @@ export function LogPage() { · {session.entries.length} {t("logs.entriesShort")} {session.errorCount > 0 && ( - - · {session.errorCount} errors - + · {session.errorCount} errors )} {session.warnCount > 0 && ( - - · {session.warnCount} warnings - + · {session.warnCount} warnings )}
- - @@ -146,7 +166,7 @@ export function OutputPage() { )} {isMultiVideoEnding && ( -
+
{t("output.previewingVideo", { diff --git a/src/pages/PlaylistPage.tsx b/src/pages/PlaylistPage.tsx index 46b5b0d..130a163 100644 --- a/src/pages/PlaylistPage.tsx +++ b/src/pages/PlaylistPage.tsx @@ -20,7 +20,7 @@ import { type PlaylistContentType, type PlaylistInput, } from "@engine/playlist-builder"; -import { DROPPED_REASONS } from "@config/dropped-reasons"; +import { DROPPED_REASONS, type DroppedReasonId } from "@config/dropped-reasons"; import type { SupportedLanguage } from "@engine/types"; const STATUS_OPTIONS = [ @@ -50,7 +50,7 @@ export function PlaylistPage() { const [contentType, setContentType] = useState("full_gameplay"); const [totalVideos, setTotalVideos] = useState(""); const [customNote, setCustomNote] = useState(""); - const [droppedReasons, setDroppedReasons] = useState([]); + const [droppedReasons, setDroppedReasons] = useState([]); const [droppedReasonCustom, setDroppedReasonCustom] = useState(""); const [language, setLanguage] = useState(editor.language); @@ -78,9 +78,7 @@ export function PlaylistPage() { status, contentType, totalVideos: - totalVideosValidation.valid && totalVideos.trim() - ? parseInt(totalVideos) - : undefined, + totalVideosValidation.valid && totalVideos.trim() ? parseInt(totalVideos) : undefined, storeLinks: editor.storeLinks, playlistNote: customNote, droppedReasons, @@ -147,7 +145,10 @@ export function PlaylistPage() { icon: r.icon, }))} value={droppedReasons} - onChange={setDroppedReasons} + // ChipGroup is id-agnostic (`string[]`); the options come straight + // from DROPPED_REASONS, so every id it hands back is a + // DroppedReasonId. Narrowing here keeps the state typed. + onChange={(v) => setDroppedReasons(v as DroppedReasonId[])} />