Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a5b1f9e87 | ||
|
|
c29e04b15f | ||
|
|
23bec5fbda | ||
|
|
f86469485f | ||
|
|
3783c2b1a5 | ||
|
|
6796c78b7e | ||
|
|
3019be0610 | ||
|
|
6ba2acfd7e | ||
|
|
e4ba053951 | ||
|
|
58fce6d8d2 | ||
|
|
7b99f516ae | ||
|
|
b415d14f8b | ||
|
|
4650273b43 | ||
|
|
e691fc7c58 | ||
|
|
753a286706 | ||
|
|
494c3622ff | ||
|
|
86927eea63 | ||
|
|
fdeec0e913 | ||
|
|
5df2ef8227 | ||
|
|
b8e8e476f5 | ||
|
|
d0dd6bad12 | ||
|
|
a685b050d9 | ||
|
|
25d4e9e148 | ||
|
|
df7d734c74 | ||
|
|
8af06c425a | ||
|
|
406d68b19e | ||
|
|
00d19202f4 | ||
|
|
2ec146712b | ||
|
|
966da96d1b | ||
|
|
c9840c88a1 | ||
|
|
e6e49d329a | ||
|
|
bd2660e73a | ||
|
|
f7ebd1f078 | ||
|
|
4e64d5a25a | ||
|
|
a0d20617e2 | ||
|
|
43c77c99d4 | ||
|
|
14bb517a9a | ||
|
|
0b9dfcb0e6 | ||
|
|
404efa9a92 | ||
|
|
63212ef4b6 | ||
|
|
abb0a624d5 | ||
|
|
6fb476f7a5 | ||
|
|
9a6aafb173 | ||
|
|
d1cc09918b | ||
|
|
d5c0b2439f | ||
|
|
760c2090ca | ||
|
|
ebb819eec9 | ||
|
|
b4919d6075 | ||
|
|
3ebf3e0843 | ||
|
|
c4c65d8195 | ||
|
|
191985d218 | ||
|
|
49c0206744 | ||
|
|
92c453ab3c | ||
|
|
cacb1df694 | ||
|
|
d039378862 | ||
|
|
a325a5b44e | ||
|
|
6fd209e85c | ||
|
|
fa3ce87f61 | ||
|
|
25f0d0705f | ||
|
|
3f0622ac23 | ||
|
|
fa4c0534f4 | ||
|
|
d94e6ac024 |
No files matched your search
@@ -0,0 +1,6 @@
|
||||
github: poli0981
|
||||
ko_fi: skullmute
|
||||
buy_me_a_coffee: skullmute
|
||||
patreon: skullmute
|
||||
custom:
|
||||
- paypal.me/DungDang212
|
||||
@@ -0,0 +1,99 @@
|
||||
name: Bug report
|
||||
description: Something is broken or behaving unexpectedly.
|
||||
title: "[Bug]: "
|
||||
labels: ["bug", "triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to file a bug. Please fill in as much detail as you can —
|
||||
a clear reproduction is the difference between a fix today and a fix in 3 weeks.
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: App version
|
||||
description: From the About page or the title bar. Example `v0.13.0`.
|
||||
placeholder: v0.13.0
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: surface
|
||||
attributes:
|
||||
label: Where are you running YTDescGen?
|
||||
options:
|
||||
- Web (GitHub Pages)
|
||||
- Desktop — Windows (Tauri)
|
||||
- Desktop — macOS (Tauri)
|
||||
- Desktop — Linux (Tauri)
|
||||
- Local dev (npm run dev)
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: os
|
||||
attributes:
|
||||
label: Operating system
|
||||
description: e.g. Windows 11 25H2, macOS 14.6, Ubuntu 24.04
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: browser
|
||||
attributes:
|
||||
label: Browser (web only)
|
||||
description: e.g. Chrome 131, Brave 1.70, Safari 17. Leave blank for desktop.
|
||||
- type: dropdown
|
||||
id: language
|
||||
attributes:
|
||||
label: App language at the time of the bug
|
||||
options:
|
||||
- English (en)
|
||||
- Tiếng Việt (vi)
|
||||
- 日本語 (ja)
|
||||
- Español (es)
|
||||
- 한국어 (ko)
|
||||
- 中文 (zh)
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: repro
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Numbered steps. Include the exact inputs that triggered the bug.
|
||||
placeholder: |
|
||||
1. Open Editor
|
||||
2. Pick genre "Survival Horror"
|
||||
3. Toggle "eye_horror" warning
|
||||
4. Click Generate
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual
|
||||
attributes:
|
||||
label: Actual behavior
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: console
|
||||
attributes:
|
||||
label: Console / log output
|
||||
description: Open DevTools (web) or the log panel (desktop) and paste any errors. Rendered as code.
|
||||
render: shell
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots / screen recording (optional)
|
||||
description: Drag and drop images or videos here.
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: Pre-flight checks
|
||||
options:
|
||||
- label: I searched existing issues and this is not a duplicate.
|
||||
required: true
|
||||
- label: I'm on the latest released version (or noted my older version above).
|
||||
required: true
|
||||
@@ -0,0 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Discord — General chat
|
||||
url: https://discord.gg/2aNR3aVt
|
||||
about: For casual questions, gameplay chat, or quick help. Use a bug report or feature request for anything actionable.
|
||||
- name: GitHub Discussions
|
||||
url: https://github.com/poli0981/youtube-generator/discussions
|
||||
about: Ideas, Q&A, and release announcements live here.
|
||||
@@ -0,0 +1,48 @@
|
||||
name: Feature request
|
||||
description: Suggest a new feature or improvement.
|
||||
title: "[Feature]: "
|
||||
labels: ["enhancement", "triage"]
|
||||
body:
|
||||
- type: textarea
|
||||
id: problem
|
||||
attributes:
|
||||
label: Problem
|
||||
description: What pain point or workflow gap are you running into today?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: proposal
|
||||
attributes:
|
||||
label: Proposed solution
|
||||
description: What should YTDescGen do? Be concrete — UI sketch, example output, etc.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Alternatives considered
|
||||
description: Other approaches you thought about and why you ruled them out.
|
||||
- type: dropdown
|
||||
id: scope
|
||||
attributes:
|
||||
label: Scope
|
||||
description: Which surfaces does this affect?
|
||||
multiple: true
|
||||
options:
|
||||
- Editor
|
||||
- Output / preview
|
||||
- Profiles / presets
|
||||
- Templates (description, title, tags)
|
||||
- i18n / locales
|
||||
- Settings
|
||||
- Desktop (Tauri)
|
||||
- Documentation
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: Pre-flight checks
|
||||
options:
|
||||
- label: I searched existing issues and this is not a duplicate.
|
||||
required: true
|
||||
@@ -0,0 +1,47 @@
|
||||
## Summary
|
||||
|
||||
<!-- 1-3 bullet points describing the change -->
|
||||
|
||||
-
|
||||
-
|
||||
|
||||
## Type
|
||||
|
||||
- [ ] `feat` — new feature
|
||||
- [ ] `fix` — bug fix
|
||||
- [ ] `refactor` — code change with no behavior change
|
||||
- [ ] `docs` — documentation only
|
||||
- [ ] `test` — tests only
|
||||
- [ ] `ci` — CI / build pipeline
|
||||
- [ ] `chore` — other
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] `npm run typecheck` passes
|
||||
- [ ] `npm run lint` passes
|
||||
- [ ] `npm run validate:locales` passes (required if you touched `src/i18n/locales/` or `_schema.json`)
|
||||
- [ ] `npm run test:run` passes
|
||||
- [ ] No secrets, credentials, or PII committed
|
||||
- [ ] No new runtime dependencies without prior discussion in an issue
|
||||
- [ ] Commit messages follow `type(scope): message`
|
||||
|
||||
## UI Changes
|
||||
|
||||
<!--
|
||||
If this PR touches the UI, attach screenshots or short recordings at:
|
||||
- Desktop (≥1024px)
|
||||
- Tablet (768px)
|
||||
- Mobile (390px)
|
||||
Otherwise delete this section.
|
||||
-->
|
||||
|
||||
## AI-Assisted Contribution
|
||||
|
||||
- [ ] Yes — AI tool used: <!-- e.g. Claude Code 4.7 Opus, Cursor, GitHub Copilot -->
|
||||
- [ ] No
|
||||
|
||||
If yes: did you review every line of generated code/text yourself before submitting? <!-- yes/no -->
|
||||
|
||||
## Related Issues
|
||||
|
||||
<!-- Fixes #123, Closes #456 -->
|
||||
@@ -0,0 +1,41 @@
|
||||
name: Announce Release to Discord
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Existing release tag to re-announce"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# `link-discussion` needs `contents: write` (to edit the release) and
|
||||
# `discussions: write` (so GitHub auto-creates the linked Discussion under
|
||||
# the configured category). The reusable announce job only needs read.
|
||||
permissions:
|
||||
contents: write
|
||||
discussions: write
|
||||
|
||||
jobs:
|
||||
link-discussion:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Link release to Announcements discussion
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Setting --discussion-category on a published release causes
|
||||
# GitHub to auto-create the linked Discussion. Requires the
|
||||
# repo to have Discussions enabled with an "Announcements"
|
||||
# category (configured manually under repo Settings).
|
||||
run: |
|
||||
gh release edit "${{ github.event.release.tag_name || inputs.tag }}" \
|
||||
--repo "${{ github.repository }}" \
|
||||
--discussion-category "Announcements"
|
||||
|
||||
announce:
|
||||
needs: link-discussion
|
||||
uses: poli0981/.github/.github/workflows/announce-release.yml@main
|
||||
with:
|
||||
tag_override: ${{ inputs.tag || '' }}
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,19 @@
|
||||
name: Notify CI Failures
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
# Match the exact `name:` of the CI workflow (.github/workflows/ci.yml).
|
||||
# Renaming CI silently breaks this filter — keep them in sync.
|
||||
workflows: ["CI"]
|
||||
types: [completed]
|
||||
|
||||
# REQUIRED: declare permissions matching the reusable workflow's needs.
|
||||
# Reusable needs `actions: read` to inspect workflow_run details.
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
uses: poli0981/.github/.github/workflows/notify-ci-failure.yml@main
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,18 @@
|
||||
name: Notify Deploy Status
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
# Match the exact `name:` of the deploy workflow
|
||||
# (.github/workflows/deploy-web.yml). Renaming it silently breaks this
|
||||
# filter — keep them in sync.
|
||||
workflows: ["Deploy to GitHub Pages"]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
uses: poli0981/.github/.github/workflows/notify-deploy.yml@main
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,18 @@
|
||||
name: Notify Release Pipeline
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
# Match the exact `name:` of the release-pipeline producers
|
||||
# (release-desktop.yml + announce-release.yml). Renaming either silently
|
||||
# breaks this filter — keep them in sync.
|
||||
workflows: ["Release Desktop", "Announce Release to Discord"]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
uses: poli0981/.github/.github/workflows/notify-release-pipeline.yml@main
|
||||
secrets: inherit
|
||||
+602
@@ -2,6 +2,608 @@
|
||||
|
||||
All notable changes to YTDescGen ship as tagged releases on `main`.
|
||||
|
||||
## v0.24.1 — 2026-06-08
|
||||
|
||||
Maintenance patch: clears all `npm audit` advisories, drops unused Rust
|
||||
dependencies, and documents the v0.24.0 cross-post caption generator.
|
||||
|
||||
### Security / dependencies
|
||||
|
||||
- **react-router / react-router-dom 6.30.3 → 6.30.4** — patches the moderate open-redirect advisory ([GHSA-2j2x-hqr9-3h42](https://github.com/advisories/GHSA-2j2x-hqr9-3h42)). Non-breaking; a HashRouter SPA on static hosting was low-exposure, but patched for hygiene.
|
||||
- **vitest 3.2.4 → 4.1.8** — clears the critical Vitest-UI-server advisory ([GHSA-5xrq-8626-4rwp](https://github.com/advisories/GHSA-5xrq-8626-4rwp), dev-only — never in a shipped artifact). All 482 tests pass unchanged on the new major; no test or config code needed adjusting. `npm audit` now reports **0 vulnerabilities**.
|
||||
|
||||
### Removed
|
||||
|
||||
- **Unused `serde` / `serde_json` from `src-tauri/Cargo.toml`** — neither was referenced anywhere in `src-tauri/src/` (Tauri scaffolding leftovers; the `#[tauri::command]` functions only use `String` / `Result`). `cargo check` confirms the crate still compiles without them; `Cargo.lock`'s `yt-desc-gen` entry no longer lists them.
|
||||
|
||||
### Docs
|
||||
|
||||
- Documented the **cross-post caption generator** (Social tab — TikTok / Instagram Reels / Facebook Reels) in [README.md](README.md) and [docs/FEATURES.md](docs/FEATURES.md).
|
||||
|
||||
### Under the hood
|
||||
|
||||
- Five manifests bumped 0.24.0 → 0.24.1 (`package.json`, `package-lock.json` root + self-reference, `src-tauri/Cargo.toml`, `src-tauri/Cargo.lock` self-entry, `src-tauri/tauri.conf.json`). Gates green: typecheck, lint, validate:locales, knip, build, 482 tests, `npm audit` clean.
|
||||
|
||||
## v0.24.0 — 2026-06-08
|
||||
|
||||
Adds a **cross-post caption generator** that re-packages the YouTube
|
||||
source into TikTok / Instagram Reels / Facebook Reels captions, a
|
||||
navigation **theme toggle**, an opt-in **translation-quality notice**, and
|
||||
a **Telegram** social link — plus a fix for a stray validation warning on
|
||||
the OS Rig field.
|
||||
|
||||
### Added
|
||||
|
||||
- **Cross-Post Captions** — a new **Social** tab ([src/pages/SocialPage.tsx](src/pages/SocialPage.tsx), [src/engine/social-post-builder.ts](src/engine/social-post-builder.ts), [src/config/social-platforms.ts](src/config/social-platforms.ts), [src/hooks/use-social-posts.ts](src/hooks/use-social-posts.ts)). Re-packages the same editor source that drives the YouTube description into short-form captions for **TikTok (4000)**, **Instagram Reels (2200)**, and **Facebook Reels (2200)**. Each caption pulls Title (badge suppressed), 💻 MY RIG, ⚠️ Content Warnings, 🎁 Thanks, © Copyright, and hashtags (game + primary genre + a curated per-platform popular-hashtag set, deduped case-insensitively). Per-platform char counter + over-limit warning; when a caption overflows, optional blocks are dropped in priority order (warnings → copyright → thanks → rig) — Title + hashtags are never dropped, and there's no mid-string truncation. **Single** mode (platform tabs) and **Bulk** mode (part range × selected languages, reusing the Batch loop) with Copy-All. **JSON import/export** of the generated captions via a new `social` envelope type ([src/utils/file-schema.ts](src/utils/file-schema.ts) `ExportType` / `SCHEMA_VERSIONS` / `isExportType`); import is display-only since captions are derived artifacts. New `tabs.social` + `socialPost.*` locale block across all 6 locales (no new `templates.json` keys — captions reuse existing description/title strings).
|
||||
- **Dark/Light theme toggle in the header** ([src/components/layout/Header.tsx](src/components/layout/Header.tsx)). A Sun/Moon icon button next to the language picker, reusing the existing `settings.setTheme` action so it stays in sync with the Settings toggle both ways. New `header.toggleTheme` key across 6 locales. No store/persist change — the theme field + setter already existed.
|
||||
- **Translation-quality notice** ([src/engine/description-builder.ts](src/engine/description-builder.ts), [src/pages/SettingsPage.tsx](src/pages/SettingsPage.tsx)). New opt-in `showTranslationQuality` setting. When on, descriptions generated in a language **outside the trusted set (English / Vietnamese, which are human-reviewed)** get a bilingual `▸ 🌐 ABOUT THIS TRANSLATION` block: an intro naming the trusted languages + caveat bullets (accuracy not 100%, phrasing may be literal/stiff, may not match local style, corrections welcome). English/Vietnamese descriptions skip it. New `description.translationQuality.{header,intro,items.*}` template keys + `settings.showTranslationQuality{,Hint}` UI keys across 6 locales. Additive setting — `healSettings` back-fills the default, so no persist bump.
|
||||
- **Telegram social link** ([src/config/social-fields.ts](src/config/social-fields.ts)). New `telegram` field (`https://t.me/` prefix, ✈️ icon) in the Social category. `social` is a generic record, so no profile migration. New `social.telegram` label across 6 locales.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **"Pick a DDR generation" no longer appears on the OS Rig field** ([src/components/editor/RigEditor.tsx](src/components/editor/RigEditor.tsx), [src/utils/rig-validation.ts](src/utils/rig-validation.ts)). `renderComposite` hard-coded the RAM validator for **every** composite dropdown, so selecting an OS — also a composite — ran the RAM check (`"windows||"` parses as size=`"windows"`, ddr=`""`, tripping `ramMissingDdr`). Validator selection moved into a pure `validateCompositeField(fieldId, raw)` helper that only validates RAM; the OS composite (and any future one) shows no spurious badge.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- **Shared `buildBilingualBulletSection` helper** ([src/engine/description-builder.ts](src/engine/description-builder.ts)). The inline Content-Warnings render block and the standalone Tech-Notes function were collapsed into one exported pure helper (header + intro + `• EN · LOCAL` bullets, U+00B7 separator) — reused by Content Warnings, Tech Notes, the new Translation-Quality notice, and the social-post builder. Description output is byte-for-byte unchanged, guarded by the existing description tests.
|
||||
- **28 new tests** (454 → 482): 12 in [tests/utils/rig-validation.test.ts](tests/utils/rig-validation.test.ts) (new — RAM/GPU validators + `validateCompositeField` OS-vs-RAM guard), 13 in [tests/engine/social-post-builder.test.ts](tests/engine/social-post-builder.test.ts) (new — hashtag derivation/dedupe/sanitization, rig, bilingual warnings, copyright/sponsor gating, overflow drop-order), 3 translation-quality cases in [tests/engine/description-builder.test.ts](tests/engine/description-builder.test.ts), plus the `settings-heal` complete-payload guard updated for the new field.
|
||||
- Five manifests bumped 0.23.0 → 0.24.0 (`package.json`, `package-lock.json` root + self-reference, `src-tauri/Cargo.toml`, `src-tauri/Cargo.lock` self-entry, `src-tauri/tauri.conf.json`).
|
||||
- Pre-release gates run green: lint, typecheck, validate:locales (12/12 files complete; 864 ui + 501 template keys per locale), 482 tests, knip, build.
|
||||
|
||||
## v0.23.0 — 2026-05-27
|
||||
|
||||
Extends audience-protection coverage with eight VFX-intensity warnings
|
||||
and unlocks the new OS Rig field (introduced in v0.22.0) for macOS and
|
||||
Linux creators via a cascading dropdown that adapts its slot semantics
|
||||
to the chosen OS family.
|
||||
|
||||
### Added
|
||||
|
||||
- **8 new VFX content warnings in the `photosensitive` group** ([src/engine/types.ts](src/engine/types.ts), [src/config/content-warning-groups.ts](src/config/content-warning-groups.ts)). New IDs: `lens_flare_intense`, `bloom_excessive`, `particle_effects_dense`, `screen_overlay_flashing`, `color_saturation_extreme`, `motion_blur_heavy`, `depth_of_field_aggressive`, `post_processing_intense`. Closes the gap between blanket `flashing_lights` / `strobe_effects` and the AAA / horror games that ship intense visual-effects passes (bloom, particles, lens flares, post-processing) without ever triggering a strobe-style flash. Total content warnings 187 → 195 across 10 groups (no new group; `photosensitive` 5 → 13). Purely additive — engine renders each warning automatically; existing profiles round-trip unchanged. Fully translated across all 6 locales (`ui.json` short labels + `templates.json` description phrases) with `_schema.json` updated.
|
||||
- **macOS support in the OS Rig field** ([src/config/rig-fields.ts](src/config/rig-fields.ts) `MACOS_VERSION_OPTIONS`). 7 macOS major versions: `10` (Mojave era), `11 Big Sur`, `12 Monterey`, `13 Ventura`, `14 Sonoma`, `15 Sequoia`, `26 Tahoe`. The intentional 15 → 26 jump matches Apple's 2025 year-aligned marketing-number reset. Stored values carry the human label (e.g. `"macos|15 Sequoia|"`) so the description output reads as a single recognisable string. macOS has no Edition tier, so the third dropdown is hidden when macOS is selected.
|
||||
- **Linux support in the OS Rig field** ([src/config/rig-fields.ts](src/config/rig-fields.ts) `LINUX_DISTRO_OPTIONS`, `LINUX_VERSION_BY_DISTRO`). 7 distros gameplay creators actually use via Proton: Ubuntu (`20.04 / 22.04 / 24.04 / 26.04 LTS`), Fedora (`40 / 41 / 42`), Debian (`12 Bookworm / 13 Trixie`), Arch (`rolling`), Manjaro (`latest`), Pop!_OS (`22.04 / 24.04 LTS`), Linux Mint (`21 / 22`). When Linux is selected the second slot re-labels to "Distro" and the third slot re-labels to "Version" with a per-distro option list — so Ubuntu's versions don't bleed into Fedora's dropdown.
|
||||
- **Cascading composite dropdown** ([src/config/rig-fields.ts](src/config/rig-fields.ts) `CompositePart`, `resolveCompositeOptions`, `resolveCompositeLabelKey`). `CompositePart.options` widened from `RigFieldOption[]` to a union with `(previousParts) => RigFieldOption[]` so a part can resolve its option list from previously-selected siblings. New optional `labelKeyResolver` lets a single part swap its i18n key (Version / Distro), and `hiddenWhen` removes a part from both the editor form and the description output. RAM (the existing 2-part static composite) is unaffected — the union accepts arrays unchanged.
|
||||
- **`editor.os_distro` locale key** across all 6 locales (`Distro` / `Distro` / `ディストリ` / `Distro` / `배포판` / `发行版`) — the new Linux-only second-slot label.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Editor form resets downstream parts on parent change** ([src/components/editor/RigEditor.tsx](src/components/editor/RigEditor.tsx) `renderComposite`). When a user switches OS name from Windows to macOS, any previously-selected version / edition values are cleared so the form can't end up in an invalid state (e.g. `macOS 11 Pro`). The new `setPart` clears all indices `>` the changed one, so the cascading dropdown is always self-consistent.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- Composite dropdown `formatRigValue` walks parts with a `previousValues` accumulator now, calls `hiddenWhen` first to skip hidden parts entirely (so they don't leak empty tokens into the joined output), then resolves the option list with the accumulator. Stored shapes are unchanged — v0.22.0's `"windows|11|pro"` round-trips byte-for-byte.
|
||||
- 9 new tests in [tests/engine/rig-fields.test.ts](tests/engine/rig-fields.test.ts) (24 → 33): 7 OS cascading cases (macOS Sequoia / Tahoe, Linux Ubuntu / Arch / Fedora / Debian, hidden macOS edition fallback, Windows backward-compat guard), 1 empty-name fallback (degenerate input), 1 RAM regression check that confirms the static-array path still works after the union widening.
|
||||
- Five manifests bumped 0.22.0 → 0.23.0 (`package.json`, `package-lock.json` root + self-reference, `src-tauri/Cargo.toml`, `src-tauri/tauri.conf.json`).
|
||||
- Pre-release gates run green: lint, typecheck, validate:locales (12/12 files complete; 844 ui + 495 template keys per locale), 454 tests, build.
|
||||
|
||||
## v0.22.0 — 2026-05-27
|
||||
|
||||
Adds a dedicated **Audio / Sensory** content-warning group, introduces an
|
||||
opt-in video-style era credit that combines with the rig's Video Editor
|
||||
field, surfaces a structured **Operating System** dropdown in My Rig, and
|
||||
drops two stale Settings/About items (Default Genre, Dev Environment).
|
||||
|
||||
### Added
|
||||
|
||||
- **12 new audio content warnings in a new `audio` group** ([src/engine/types.ts](src/engine/types.ts), [src/config/content-warning-groups.ts](src/config/content-warning-groups.ts)). Splits audio-sensitive triggers out of the `photosensitive` group where they never quite fit. New IDs: `ear_piercing`, `jumpscare_audio`, `sudden_volume_changes`, `distorted_audio`, `screeching_metallic`, `persistent_high_pitch`, `audio_glitches`, `heavy_bass_rumble`, `screaming_audio`, `glass_breaking_audio`, `microphone_pops`, `white_noise_static`. `loud_noises` migrated out of `photosensitive` into this group. Total content warnings 175 → 187 across 9 → 10 groups. Purely additive; engine renders each warning automatically. Fully translated across all 6 locales (`ui.json` short labels + `templates.json` description phrases) with `_schema.json` updated.
|
||||
- **Video-style era toggle** ([src/config/video-styles.ts](src/config/video-styles.ts), [src/components/editor/VideoSettingsForm.tsx](src/components/editor/VideoSettingsForm.tsx), [src/engine/description-builder.ts](src/engine/description-builder.ts)). New per-video opt-in field `videoStyleEra` on `EditorData` — empty string sentinel for "off", 12 valid eras: `1980s`/`1990s`/`2000s`/`2010s`/`2020s` + `modern`/`cinematic`/`retro`/`vhs`/`film_noir`/`anime_mv`/`documentary`. When set, the description renderer emits a single line at the end of the Video Settings section combining the era with the rig's video editor: `"Edited in 1990s VHS style using DaVinci Resolve 19.1"`. Falls back to an editor-less template (`"Edited in 1990s VHS style"`) when `rig.video_editor` is empty. **Renders even when `skipGraphicsSettings` is on** — 2D / pixel-art creators still edit their footage, so the style credit survives as a standalone one-line section under the same header. New file exports `VIDEO_STYLE_ERAS` literal union + `isVideoStyleEra` type guard. Field shape mirrors the existing `artStyle` / `playthroughStatus` / `difficulty` per-video sentinels — no parallel boolean toggle.
|
||||
- **Operating System field in My Rig** ([src/config/rig-fields.ts](src/config/rig-fields.ts) `OS_COMPOSITE`). New `composite_dropdown` entry at the top of `RIG_FIELDS` modelled on the existing RAM pattern. Three parts: name → version → edition. Stored as `"windows|11|pro"` → renders `"Windows 11 Pro"` via `formatRigValue`. Windows 10 / 11 + Home / Pro / Enterprise / Education / IoT Enterprise. Pre-v0.22 profiles with no `rig.os` key pass through the existing empty-value filter chain in `description-builder.ts` — no migration needed. New schema keys `editor.os_name`, `editor.os_version`, `editor.os_edition` + `rig.os` across 6 locales.
|
||||
|
||||
### Removed
|
||||
|
||||
- **Default Genre setting** ([src/pages/SettingsPage.tsx](src/pages/SettingsPage.tsx), [src/store/settings-heal.ts](src/store/settings-heal.ts), [src/store/settings-store.ts](src/store/settings-store.ts), [src/config/defaults.ts](src/config/defaults.ts)). The `ChipGroup` never wired through to the editor — orphan field. Removed UI, `SettingsData.defaultGenres`, `setDefaultGenres` action, `initialSettings.defaultGenres`, `SettingsDefaults.defaultGenres`, `DEFAULTS.settings.defaultGenres`, `extractData` entry, and the v1→v2 migration block in `healSettings` (replaced by a single `delete incoming.defaultGenres` + `delete incoming.defaultGenre` so persisted blobs don't leak the dead field). Two migration tests removed from `settings-heal.test.ts`. `settings.defaultGenre` key removed from 6 `ui.json` + `_schema.json`.
|
||||
- **Dev Environment section from About** ([src/pages/AboutPage.tsx](src/pages/AboutPage.tsx), [src/config/about.ts](src/config/about.ts)). Hardcoded specs drift on every box upgrade. Removed the entire `<section>` block (~33 lines of JSX + `devEnvRows` constant), `Cpu`/`Monitor` icon imports, `ABOUT.pcSpecDocUrl` and `ABOUT.devEnvDocUrl`, and all `about.devEnvHeading` / `devEnvHelp` / `devEnv.{os,cpu,gpu,ram,ide,toolchains,fullSpecLink,fullDevEnvLink}` keys from 6 `ui.json` + `_schema.json` (10 keys per locale).
|
||||
|
||||
### Changed
|
||||
|
||||
- **`loud_noises` migrated from `photosensitive` to `audio`.** Sudden-volume / high-frequency triggers affect a different audience than strobe / motion-sickness triggers, so the group split is cleaner. Stored ID unchanged — existing profiles using `loud_noises` round-trip without any per-warning migration.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- **Editor-store persist version 13 → 14.** Adds `videoStyleEra` field with defensive coercion: unknown / hand-edited / future-downgrade values are coerced back to `""` via the `isVideoStyleEra` type guard so the form `Select` never lands on a missing option. Additive — pre-v0.22 drafts round-trip through the migration with `videoStyleEra` defaulting to off.
|
||||
- **`healSettings` strips both legacy keys.** Whether the persisted blob carries the v1 shape (`defaultGenre: string`) or the v2 shape (`defaultGenres: GenreId[]`), the heal step now deletes both before the final `{ ...initialSettings, ...incoming }` spread — guarantees the field never resurfaces.
|
||||
- **B3 "Localize My Rig labels" was a phantom task.** Initial planning assumed the `rig.{cpu,gpu,ram,storage,monitor,capture,motherboard,controller,video_editor}` locale keys didn't exist anywhere; verification showed all 6 locales already had them with proper translations. Only the new `rig.os` key was actually missing — folded into the OS-field work.
|
||||
- Five manifests bumped 0.21.0 → 0.22.0 (`package.json`, `package-lock.json` root + self-reference, `src-tauri/Cargo.toml`, `src-tauri/tauri.conf.json`).
|
||||
- Pre-release gates run green: lint, typecheck, validate:locales (12/12 files complete; 835 ui + 487 template keys per locale), 445 tests (was 416 — +5 video-style line render cases in `description-builder.test.ts`, +6 OS composite cases in `rig-fields.test.ts`, –2 deleted default-genre migration tests, plus pre-existing growth), build.
|
||||
|
||||
## v0.21.0 — 2026-05-27
|
||||
|
||||
Reduces YouTube auto-flag risk on Vietnamese descriptions, adds twelve
|
||||
method-specific death/violence warnings, rewords the channel copyright
|
||||
line to disambiguate video content from game IP, and adds an opt-in
|
||||
toggle for crediting the game's studio/publisher in the description.
|
||||
|
||||
### Added
|
||||
|
||||
- **12 new content warnings** ([src/engine/types.ts](src/engine/types.ts), [src/config/content-warning-groups.ts](src/config/content-warning-groups.ts)). Extends the **Sensitive** group with method-specific death/violence depictions that YouTube's auto-moderation flags harder than the umbrella `blood_gore` / `war_violence` labels: `hanging_depiction`, `drowning_depiction`, `burning_alive`, `asphyxiation_depiction`, `restraint_torture`, `public_execution`, `decapitation`, `impalement`, `mass_casualty_event`, `vehicular_violence`, `overdose_depiction`, `defenestration`. Total content warnings 175 → 187 across the existing 9 groups. Purely additive — engine renders each warning automatically; existing profiles round-trip unchanged. Fully translated across all 6 locales (`ui.json` short labels + `templates.json` description phrases) with `_schema.json` updated. VI labels follow the v0.21.0 censoring policy (see below).
|
||||
- **Game-copyright toggle** ([src/store/settings-heal.ts](src/store/settings-heal.ts) `showGameCopyright`, [src/engine/description-builder.ts](src/engine/description-builder.ts) section 4.5, [src/pages/SettingsPage.tsx](src/pages/SettingsPage.tsx)). New Settings → Description toggle (default **off**) that, when enabled with a non-empty `pubDevName`, emits a `© {publisher}. All rights reserved.` line right after the Store Links block. Decoupled from the publisher store-URL — the credit renders based on the studio name alone. Used by creators covering games whose dev/publisher contractually requires attribution in the description. New i18n key `description.sections.gameCopyright` across all 6 locales; new UI keys `settings.showGameCopyright` + `settings.showGameCopyrightHint`. Persists in `GamePreset` so a series spanning many episodes hydrates the studio name + toggle together on preset apply.
|
||||
- **`pubDevName` promoted to first-class field** ([src/components/editor/GameInfoForm.tsx](src/components/editor/GameInfoForm.tsx), [src/store/preset-store.ts](src/store/preset-store.ts) `GamePreset.pubDevName?`). Previously a side-label that only appeared under a non-empty Publisher store URL; now an always-visible "Studio / Publisher" input in Game Info that also drives the game-copyright section. Removed from [StoreLinkEditor.tsx](src/components/editor/StoreLinkEditor.tsx) lines 140–172. Optional in `GamePreset` so older presets hydrate without breaking.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Channel copyright line reworded across 6 locales** ([src/i18n/locales/*/templates.json](src/i18n/locales/) `description.sections.copyright`). Old: `© {year} {channelName}. All rights reserved.` (one short line, ambiguous about whether the channel claims the game's IP). New: a 2–3 sentence disclaimer making explicit that the copyright applies only to the video recording, and that the game, characters, music, and related IP belong to their respective owners. Same `{{year}}` / `{{channelName}}` placeholders — no engine change. JA/KO/ZH now ship a proper localised translation instead of falling back to English.
|
||||
- **VI censoring sweep — consistency + euphemism policy** ([src/i18n/locales/vi/ui.json](src/i18n/locales/vi/ui.json), [src/i18n/locales/vi/templates.json](src/i18n/locales/vi/templates.json)). The Vietnamese warning labels previously used asterisk censoring on some terms (`t* tử`, `b*o h*nh`, `g*ết người`) but left others uncensored (`Bạo lực liên quan chiến tranh`, `Bạo lực từ cảnh sát`) and had a malformed `b* ng*y h*i` for `child_harm`. Sweep unifies them under a 2-tier policy: asterisk for graphic verbs with no natural euphemism (`tự` → `t*`, `giết` → `g*ết`, `treo cổ` → `treo c*`, `bạo hành` → `b*o h*nh`), euphemism for words with a natural softer register (`bạo lực` → `tác động vật lý`, `nổ súng` → `khai hỏa`, `xử bắn` → `hành quyết`). Fixes `child_harm` to use the unambiguous euphemism `chịu tác động`. Proper nouns (game titles, character names) untouched. Goal is to reduce YouTube auto-flag risk on Vietnamese descriptions — purely a static i18n edit, no runtime utility.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- Persist version unchanged — `showGameCopyright` is additive (`healSettings` back-fills via `{ ...initialSettings, ...incoming }`) and `pubDevName` / `showGameCopyright` on `GamePreset` are optional. No migration step needed.
|
||||
- Description-builder section ordering: Store Links → **Game Copyright (new)** → Video Settings → … → Channel Copyright. The two `©` lines (channel + game) are intentional when both toggles are on; the Settings help text is explicit so creators don't mistake it for a bug.
|
||||
- Three test fixtures updated for the new wording / censoring / settings shape ([tests/engine/description-builder.test.ts](tests/engine/description-builder.test.ts), [tests/store/settings-heal.test.ts](tests/store/settings-heal.test.ts)). 435 tests still green.
|
||||
- Five manifests bumped 0.20.0 → 0.21.0 (`package.json`, `src-tauri/Cargo.toml`, `src-tauri/Cargo.lock` `yt-desc-gen` entry, `src-tauri/tauri.conf.json`).
|
||||
- Pre-release gates run green: lint, typecheck, validate:locales (12/12 files complete, 814 ui + 461 template keys), 435 tests, build.
|
||||
|
||||
## v0.20.0 — 2026-05-23
|
||||
|
||||
Fifty new content-warning IDs across three thematic axes — political /
|
||||
religion / war, social-psychological phenomena (autism, hikikomori,
|
||||
parasocial, etc.), and weather-related phobias — plus a tag-engine fix
|
||||
for game names containing comma / semicolon / pipe characters.
|
||||
|
||||
### Added
|
||||
|
||||
- **50 new content warnings** ([src/engine/types.ts](src/engine/types.ts), [src/config/content-warning-groups.ts](src/config/content-warning-groups.ts)). The **Phobias** group gains 10 weather-related fears — `homichlophobia` (fog), `lilapsophobia` (tornadoes / hurricanes), `ombrophobia` (heavy rain), `nephophobia` (clouds), `ancraophobia` (strong wind), `cryophobia` (extreme cold, distinct from `chionophobia`/snow), `heliophobia` (sunlight), `cymophobia` (large waves), `limnophobia` (lakes), `potamophobia` (rivers); 41 → 51. The **Sensitive** group gains 20 political / religious / war themes — `political_extremism`, `religious_extremism`, `genocide`, `holy_war`, `holocaust_themes`, `civil_war`, `mass_shooting`, `colonialism`, `propaganda`, `dystopian_state`, `conspiracy_theories`, `censorship_themes`, `ethnic_conflict`, `refugee_crisis`, `revolution_themes`, `assassination`, `coup_themes`, `inquisition`, `forced_labor`, `ultranationalism`; 29 → 49. A new **Social phenomena** group (inserted between *Mental health* and *Sensitive*) carries 20 psychological-social IDs that don't fit clinical mental-health framing — `autism_themes`, `adhd_themes`, `hikikomori`, `neet_themes`, `social_anxiety_themes`, `social_isolation`, `schizophrenia_themes`, `burnout_themes`, `survivor_guilt`, `abandonment_themes`, `parasocial_themes`, `gaslighting_themes`, `stockholm_syndrome`, `behavioral_addiction`, `existential_crisis`, `impostor_syndrome`, `midlife_crisis`, `quarter_life_crisis`, `workplace_harassment`, `masculinity_pressure`. Total content warnings 125 → 175 across 9 groups (was 8). Purely additive — engine renders each warning automatically; existing profiles / templates round-trip unchanged. Fully translated across all 6 locales (`ui.json` short labels + `templates.json` description phrases) with `_schema.json` updated.
|
||||
- **1 new locale key × 6 locales**: `editor.contentWarningGroups.social_phenomena` (the new group's heading). Initial-collapse default set in [ContentWarningChecklist.tsx](src/components/editor/ContentWarningChecklist.tsx) so the 20-item group stays scannable until expanded.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Tag generator splitting at commas / semicolons / pipes in game names** ([src/engine/tag-generator.ts](src/engine/tag-generator.ts)). YouTube treats `,` as a tag delimiter, so a game title like `Hello, World` previously produced composite tags such as `Hello, World gameplay` that YouTube split into two broken tags (`Hello` + `World gameplay`). New `sanitizeForTag` helper strips `,` `;` `|` from the game name before it enters bare / composite tags and is also called inside `tagFriendlyGameName` (idempotent). Title / description / hashtag paths still read `input.gameName` verbatim — the original punctuation is preserved for human-facing copy, only the tag list is cleaned. Nine new test cases in [tests/engine/tag-generator.test.ts](tests/engine/tag-generator.test.ts) cover the comma / semicolon / pipe paths plus idempotence.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- **Documentation count sweep.** `README.md` content-warning total bumped 125 → 175 and group count 8 → 9; `docs/CONTENT-INVENTORY.md` heading updated, three group sections regenerated (Phobias 41 → 51, Sensitive 29 → 49, new Social phenomena 20), Vietnamese mirror at `docs/i18n/vi/CONTENT-INVENTORY.md` kept in lock-step.
|
||||
- Persist version unchanged — this release adds no new persisted fields. Existing `contentWarnings: ContentWarning[]` profiles widen the allowed enum but reject nothing.
|
||||
- Five manifests bumped 0.19.0 → 0.20.0 (`package.json`, `package-lock.json` root + self-reference, `src-tauri/Cargo.toml`, `src-tauri/Cargo.lock` `yt-desc-gen` entry, `src-tauri/tauri.conf.json`).
|
||||
- Pre-release gates run green: lint, typecheck, validate:locales (12/12 files complete), 435 tests, knip, build, `npm audit` (zero vulnerabilities).
|
||||
|
||||
## v0.19.0 — 2026-05-20
|
||||
|
||||
Twenty-eight new content-warning IDs (twenty-five clinical phobias plus
|
||||
three discrimination themes) + a scroll-to-top button + a moderate-severity
|
||||
security patch + a dead-code sweep backed by new `knip` tooling + a
|
||||
documentation accuracy pass.
|
||||
|
||||
### Added
|
||||
|
||||
- **28 new content warnings** ([src/engine/types.ts](src/engine/types.ts), [src/config/content-warning-groups.ts](src/config/content-warning-groups.ts)). The **Phobias** group gains 25 clinically-recognised fears relevant to gameplay / horror content — automatonophobia (animatronics), megalophobia (giant objects), submechanophobia (submerged man-made objects), necrophobia, spectrophobia, demonophobia, selachophobia (sharks), mysophobia, emetophobia, scopophobia, monophobia, musophobia, chiroptophobia, ornithophobia, ichthyophobia, herpetophobia, katsaridaphobia, apiphobia, astraphobia, agoraphobia, enochlophobia, chionophobia, nosocomephobia, aichmophobia, pnigophobia — 16 → 41. The **Sensitive** group gains 3 bigotry-content warnings — `homophobia`, `transphobia`, `xenophobia` — placed next to `discrimination` / `hate_speech`. These are prejudices, not involuntary fear responses, so they are deliberately kept out of the Phobias group. Total content warnings 97 → 125. Purely additive — the engine auto-renders each warning, no persist migration. Fully translated across all 6 locales (`ui.json` short labels + `templates.json` description phrases) with `_schema.json` updated.
|
||||
- **Scroll-to-top button** ([src/components/layout/ScrollToTopButton.tsx](src/components/layout/ScrollToTopButton.tsx)). A floating up-arrow fixed to the bottom-right of the viewport that fades in once the page is scrolled past 300 px and smooth-scrolls back on click. The scroll target is the `<main>` element — the app's real scroll container, not `window` — which `AppShell` now passes down as a ref. Honors `prefers-reduced-motion`, uses a 44 px touch target with a focus ring, sits at `z-40` so toasts render above it, and re-checks visibility on route change. New `common.scrollToTop` locale key across all 6 locales.
|
||||
- **`knip` dead-code tooling** ([knip.json](knip.json) + `npm run knip`). Authoritative cross-file detection of unused files, exports, and dependencies — coverage TypeScript strict mode (in-file only) cannot provide. Configured so `scripts/` and `tests/` are recognised entry points.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **`brace-expansion` moderate-severity DoS** ([advisory GHSA-jxxr-4gwj-5jf2](https://github.com/advisories/GHSA-jxxr-4gwj-5jf2)). `npm audit fix` bumped the transitive dependency (reached through `@typescript-eslint`) 5.0.5 → 5.0.6. A dev/lint-time dependency only — no effect on shipped web or desktop binaries. `npm audit` now reports zero vulnerabilities.
|
||||
|
||||
### Removed
|
||||
|
||||
- **Dead-code sweep** (knip-driven). Deleted the unused `use-debounce.ts` hook plus ~13 unreferenced exports across config / engine / store / utils (`findGpuSeries`, `formatSingleEndingForTitle`, `PlaylistOutput`, `loadFile`, `exportToJsonFile`, `importFromJsonFile`, `EnglishTranslationFn`, `PlatformId`, `SocialFieldId`, `SocialCategory`, `VietnameseBank`, `RigFieldId`, `SupportedLanguageId`). A further ~12 symbols were tightened from `export` to module-private and the settings layer's redundant type re-exports were trimmed. No behaviour change — all 426 tests still pass.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- **Documentation accuracy pass.** `TECH-SPEC.md` package version (`0.1.0` → `0.19.0`) and CI Node version (`20` → `22`); `ROADMAP.md` corrected a never-built `TabBar` component reference to `Sidebar`; `FEATURES.md` video-type / genre / language counts refreshed, with the stale duplicate tables replaced by links to `CONTENT-INVENTORY.md` (the maintained source of truth); `CONTENT-INVENTORY.md` and its Vietnamese mirror updated for the new warning counts; `README.md` content-warning count corrected (91 → 125).
|
||||
- Persist version unchanged — this release adds no new persisted fields.
|
||||
- Five dependencies knip flagged as unused are intentionally kept and listed under `knip.json` `ignoreDependencies`: the three Tauri plugin packages cannot be safely verified without a desktop build, and `@testing-library/*` is documented test infrastructure.
|
||||
|
||||
## v0.18.0 — 2026-05-15
|
||||
|
||||
Vietnamese-bank dropdown for the donate form + two persistence-layer
|
||||
bug fixes (UI language reverting to English after relaunch, Settings
|
||||
export bundling unrelated stores) + one cleanup (Open Folder button
|
||||
removed) + a new content-inventory documentation page (EN + VI).
|
||||
|
||||
### Added
|
||||
|
||||
- **Vietnamese bank dropdown** in `VietnameseDonateEditor` ([src/components/editor/VietnameseDonateEditor.tsx](src/components/editor/VietnameseDonateEditor.tsx), [src/config/vietnamese-banks.ts](src/config/vietnamese-banks.ts)). When the output language is Vietnamese, the "Bank name" field upgrades from a plain text input to a `<Select>` listing 30 of Vietnam's most-used banks (Big 4 state-owned + top 22 joint-stock commercial banks by retail presence + 4 foreign banks with the strongest Vietnam footprint). Sourced from the State Bank of Vietnam's 2026 register via [bankervn.com](https://bankervn.com/danh-sach-ngan-hang/). Picking "Khác (nhập tay)" reveals an inline text input so unlisted / digital-only / regional banks still work. Persisted shape is unchanged — `vnBankName` stays a plain string — so saved profiles and exports round-trip cleanly. When the output language is not Vietnamese, the field falls back to the legacy text input.
|
||||
- **`docs/CONTENT-INVENTORY.md`** + **Vietnamese mirror** ([docs/i18n/vi/CONTENT-INVENTORY.md](docs/i18n/vi/CONTENT-INVENTORY.md)). Static, hand-maintained manifest of every video type (20), game genre (41), and content warning (96 across 8 groups) the editor surfaces. Linked from the main `README.md` Documentation table. Transparency aid for anyone evaluating the editor's coverage without reading source.
|
||||
- **2 new locale keys × 6 locales**: `editor.vnBankNameSelectPlaceholder`, `editor.vnBankNameOther`. Localised for VI; left in English for JA/KO/ZH/ES to match the existing convention for VN-donate fields. Schema (`src/i18n/locales/_schema.json`) updated accordingly.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **UI language reverts to English after app relaunch** ([src/App.tsx](src/App.tsx)). i18next initialises synchronously with `fallbackLng: "en"` while Zustand's persist middleware rehydrates `appLanguage` either synchronously (localStorage) or asynchronously (Tauri `settings.json`). Neither path bridged the persisted value back to i18n, so the UI rendered English even when the saved setting was Vietnamese / Japanese / etc. App.tsx now reads `appLanguage` at mount and calls `i18n.changeLanguage` once, then subscribes to subsequent store changes so the async Tauri rehydrate (and any future external mutation) propagate to i18n automatically.
|
||||
- **Settings JSON export was a multi-store dump** ([src/pages/SettingsPage.tsx](src/pages/SettingsPage.tsx)). The pre-v0.18.0 "Export Settings" button copied the whole on-disk `settings.json` — which the storage adapter writes as a gross dump of every Zustand store (settings + profiles + presets + templates + history). The new exporter writes only the Settings data through `exportTypedToJsonFile("settings", …)` — the same envelope-typed flow the Profiles tab already uses. Importer is the matching `importParsedFromJsonFile` + `resolveForType("settings")` chain, with an explicit reject for the legacy multi-store dump (friendly toast instead of silent profile-store pollution). `extractData` was promoted from a private helper in `settings-store` to a named export for this. The IS_TAURI gate stays — surfacing the buttons on the web build is out of scope for this release.
|
||||
|
||||
### Removed
|
||||
|
||||
- **"Open Folder" button** in Settings → top bar ([src/pages/SettingsPage.tsx](src/pages/SettingsPage.tsx)). Niche utility — most users never opened the app-data folder, and Tauri-only meant web builds never saw it. The `ensure_dir` Tauri command stays in the Rust side for the export/import paths that still rely on it. ~25 LOC removed including the unused `FolderOpen` icon import.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- `App.tsx` mount effect now subscribes to `useSettingsStore` for `appLanguage` changes — Header and SettingsPage still call `i18n.changeLanguage` directly when the user switches, which is now redundant but harmless. Cleanup deferred to a future PR.
|
||||
- Persist version unchanged — this release adds no new persisted fields.
|
||||
- Bundle: under the 500 KB cap. The bank list is a 33-entry static array, negligible weight; the new envelope flow is a net-negative on SettingsPage size (Tauri dialog + ensure_dir + read_from_file paths replaced with one browser-API call).
|
||||
|
||||
### Migration notes
|
||||
|
||||
- **Pre-v0.18.0 settings export files (multi-store dump)** are rejected with a friendly "Legacy export format from v0.17.x or earlier is no longer supported" toast on import. Re-export from v0.18.0+ to get a clean settings-only envelope file.
|
||||
- **Profiles, presets, templates, history** export/import flows on the Profiles tab are unchanged. v0.17.x exports of those types still import unmodified.
|
||||
- **Saved `vnBankName` values** that don't match any of the 30 preset banks auto-detect as "custom" on first render — the dropdown shows "Khác" and the inline text input is pre-filled with the saved value. No persisted data is lost.
|
||||
|
||||
## v0.17.1 — 2026-05-15
|
||||
|
||||
Per-video Output selector — closes the last deferred piece from the
|
||||
v0.16 ending redesign. Multi-video ending playthroughs (case C) can
|
||||
now flip between per-video previews of title / description / tags
|
||||
without leaving the editor.
|
||||
|
||||
### Added
|
||||
|
||||
- **`endingVideoIndex` field on `EditorData`** (1-indexed, default 1). Stored on the editor (vs. recomputed per render) so the creator's pick survives navigating away and back. Engine already respected the corresponding `GeneratorInput.endingVideoIndex` since v0.17.0 — this just persists it.
|
||||
- **"Preview video" Select dropdown** in `EndingsEditor` case C ([src/components/editor/EndingsEditor.tsx](src/components/editor/EndingsEditor.tsx)). Renders `endingVideoCount` options labelled `"Video N (X–Y)"` where X–Y are the matching ending-range bounds. Changing it pipes `endingVideoIndex` into the engine, which slices `endings[]` for both title (via `buildStructuredEndingLabel`) and description (via `sliceEndingsForVideo`).
|
||||
- **"Previewing Video X of Y — Endings A–B" banner** at the top of the Output page when in case C ([src/pages/OutputPage.tsx](src/pages/OutputPage.tsx)). Persistent reminder so a creator flipping through videos doesn't forget which slice they're looking at.
|
||||
- **3 new locale keys × 6 locales**: `editor.endings.videoIndexLabel`, `editor.endings.videoIndexHint`, `output.previewingVideo`. All 718/718 ui keys per locale (up from 715).
|
||||
|
||||
### Changed
|
||||
|
||||
- **`use-current-generator-input`** forwards `endingVideoIndex` only when `endingVideoCount > 1` — single-video mode passes `undefined` so the slice helpers short-circuit to "render the union", keeping the input cleaner for tests.
|
||||
- **`EndingsEditor.setVideoCount`** now clamps `endingVideoIndex` down when the creator shrinks `endingVideoCount` (e.g. 6 → 2 with index = 4 → snaps to 2), so the preview never targets a non-existent video.
|
||||
- **Persist version 12 → 13**. Additive — `endingVideoIndex` back-fills to 1 on first rehydrate; pre-v0.17.1 drafts with a stale higher index get clamped to `endingVideoCount` by `migrateEditorState`.
|
||||
|
||||
### Tests
|
||||
|
||||
- 4 new tests in `editor-store.endings.test.ts` for the v12 → v13 migration (default back-fill, valid value preserved, clamp above max, clamp below 1). Total 426/426 pass.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- The banner copy is locale-aware and pluralised inline via i18next interpolation (`{{index}} / {{total}} / {{from}} / {{to}}`).
|
||||
- `OutputPage` selects `endingVideoCount`, `endingVideoIndex`, `endingVideoRanges` as individual store slices so the page only re-renders when those specific fields change — no broader subscription drag.
|
||||
- Bundle: index 473.91 KB (+3 KB for Select + banner + migration). Under the 500 KB cap.
|
||||
|
||||
## v0.17.0 — 2026-05-14
|
||||
|
||||
Combined release: logging overhaul + the deferred ending title piece
|
||||
from v0.16.0. The Output title now reflects the structured endings
|
||||
the creator filled in (case-A/B/C aware), and the Logs tab persists
|
||||
entries across app restarts with session-grouped navigation and
|
||||
JSON/TXT export.
|
||||
|
||||
### Added
|
||||
|
||||
- **Structured ending titles** ([src/engine/title-builder.ts](src/engine/title-builder.ts)). When `videoType === "ending"` AND `endings[]` is filled, the title's video-type segment swaps from the static `"Ending"` to a context-aware label, picked by a four-tier resolver:
|
||||
1. Single entry → `formatEndingEntry()` (e.g. `"Ending 3: Best End"`, `"Ending 3"`, or `"Best End"` depending on which fields are filled).
|
||||
2. Multi-entry, every entry named → comma-joined names (`"True End, Bad End, Hidden"`).
|
||||
3. Multi-entry, every entry numbered + contiguous run → `title.endingLabel.range` (`"Endings 1–3"` / `"Kết thúc 1–3"`).
|
||||
4. Mixed / non-contiguous → `title.endingLabel.count` (`"3 Endings"`).
|
||||
Falls back to the legacy locale label when no usable entries — pre-v0.16 single-ending creators see byte-identical output. Slicing respects `endingVideoIndex` + `endingVideoRanges` so a per-video title renders only that video's slice (foundation for the v0.17.1 per-video Output selector).
|
||||
- **Persistent log storage** ([src/utils/log-storage.ts](src/utils/log-storage.ts)). Logs now survive app restarts:
|
||||
- Tauri: append-only JSONL file `{appData}/logs/ytdescgen-YYYYMMDD.jsonl`. Daily rotation; cleanup deletes whole files older than `logRetentionDays` so retention sweeps are O(files) not O(entries). Three new Tauri commands feed this: `append_to_file`, `list_dir`, `delete_file`.
|
||||
- Web: localStorage key `ytdescgen-logs`, FIFO-capped at 5000 entries.
|
||||
- Best-effort: persistence failures never throw, so a disk hiccup can't recurse into a log loop.
|
||||
- **Session-grouped LogPage** ([src/pages/LogPage.tsx](src/pages/LogPage.tsx)). Each entry now carries a `sessionId` (one per app boot). The page renders one collapsible block per session — current session expanded, prior sessions collapsed — with a per-session "Clear this session" affordance. Header shows entry count + error/warning counts + time range per session.
|
||||
- **Log export buttons**:
|
||||
- **JSON** — envelope-wrapped via the v0.15 `exportTypedToJsonFile` (currently keyed `_type: "history"`; promote to a dedicated `log` type later when re-import becomes a use case).
|
||||
- **TXT** — `[ISO time] [LEVEL] [source] message — details` one line per entry, chronological. Pastes cleanly into bug reports.
|
||||
- **`logRetentionDays` setting** ([src/store/settings-store.ts](src/store/settings-store.ts), [src/store/settings-heal.ts](src/store/settings-heal.ts)). Default 7 days; clamped to `[1, 90]` by `healSettings`. New section in Settings → Logs with inline hint. Persist-store version bumped 9 → 10.
|
||||
- **Boot-time log hydration** ([src/App.tsx](src/App.tsx)). `hydrateLogStore(retentionDays)` runs in the root `useEffect`, loads recent persisted entries before the UI mounts, then schedules `pruneOldLogs` so the AppData folder stays trim.
|
||||
- **Locale keys (10 new × 6 locales)**: `title.endingLabel.{range,count}` (2 templates keys), `settings.{logSettings,logRetentionDays,logRetentionHint}` + `logs.{clearPersistedConfirm,clearSession,exportJson,exportTxt,sessionCurrent,sessionLabel,entriesShort}` (10 ui keys). All 715 ui + 370 templates keys per locale.
|
||||
|
||||
### Changed
|
||||
|
||||
- **`log-store` schema** — `LogEntry` gained a `sessionId` field; in-memory cap raised from 500 → 2000 with persistence in play so a current session can fully populate the accordion without pagination. New actions: `clearAllPersisted` (in-memory + disk), `clearSession(id)`.
|
||||
- **LogPage "Clear All"** now clears in-memory state AND deletes persisted JSONL files / localStorage. Two-step confirm via `clearPersistedConfirm` toast.
|
||||
- **File envelope** — `SCHEMA_VERSIONS.settings` bumped 9 → 10 to match the persist version. v0.15+ settings exports still import unchanged via the `healSettings` defensive merge.
|
||||
|
||||
### Tests
|
||||
|
||||
- 11 new title-builder tests covering all four ending-label tiers + Vietnamese localisation + slice + fallback. 422/422 pass overall.
|
||||
- 3 new settings-heal tests for the `logRetentionDays` default and `[1, 90]` clamp.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- Tauri command surface gained 3 entries (`append_to_file`, `list_dir`, `delete_file`). All stdlib — no new crates.
|
||||
- `pruneOldLogs` runs *after* `loadRecentLogs` at boot, so an entry on the retention edge is read into memory before being deleted from disk (last-chance access).
|
||||
- Bundle: index 470.51 KB (+7 KB for title-builder ending logic), LogPage chunk 8.37 KB (+3 KB for session accordion + export buttons). Still under the 500 KB cap.
|
||||
|
||||
### Migration notes
|
||||
|
||||
- **Settings persist version 9 → 10**. Additive — `logRetentionDays` back-fills to 7 on first rehydrate, no user action required.
|
||||
- **First-run on Tauri**: app creates `%APPDATA%\com.skullmute.ytdescgen\logs\` on the first log entry. The new `append_to_file` command auto-creates the parent dir via `std::fs::create_dir_all`.
|
||||
- **Web users**: persisted entries live in `localStorage["ytdescgen-logs"]`; nothing to migrate.
|
||||
- **Pre-v0.16 ending creators**: title behaviour unchanged unless they fill the new structured fields. Filling triggers the new resolver immediately.
|
||||
|
||||
## v0.16.0 — 2026-05-14
|
||||
|
||||
Structured ending editor + multi-video split. The Playthrough Notes
|
||||
section's free-form "Endings shown" Input is replaced with a
|
||||
structured row table that knows about ending numbers, names,
|
||||
multi-video splits, and timeline cross-validation.
|
||||
|
||||
### Added
|
||||
|
||||
- **`EndingsEditor` component ([src/components/editor/EndingsEditor.tsx](src/components/editor/EndingsEditor.tsx))** — three logical cases driven by ending count + video count:
|
||||
- **Case A** (1 ending) — `Number` + `Name` pair with live preview. At least one of the two must be filled; otherwise an inline warning explains the bullet will be dropped.
|
||||
- **Case B** (≥2 endings, 1 video) — full table row per ending. A gate inspects the Timestamps textarea — if it doesn't contain at least `endings.length` lines tagged with the `ending` keyword, a warning banner surfaces ("Timeline needs N markers; only M found").
|
||||
- **Case C** (≥2 endings, ≥2 videos) — endings table + per-video range table. Default ranges are contiguous and balanced via the new `computeContiguousRanges` helper (extras spill into the *last* video for the climactic-final convention); the creator can override per-row. Overlap / gap / out-of-bounds errors surface inline.
|
||||
- **Structured `endings: EndingEntry[]` schema** in `EditorData` (v0.16.0). Each entry pairs an optional `number` (1–100) with an optional `name`. Empty entries are dropped silently. Companions: `endingVideoCount`, `endingVideoRanges: EndingVideoRange[]`, `endingVideoIndex?` (engine-only — picks which video's slice to render).
|
||||
- **Engine `endings-format.ts`** — pure helpers `formatEndingEntry`, `sliceEndingsForVideo`, `clampRange`. Used by both the description builder and the editor's live preview so creators see exactly what will render.
|
||||
- **Ending ordinal capture in `timeline-parser.ts`** — the `ending` keyword pattern now captures an optional trailing number, so timeline lines like `1:23:45 Ending 3: Best End` parse into `{ keyword: "ending", number: 3, rest: ": Best End" }`. Unblocks the case-B timeline gate.
|
||||
- **Locale keys (19 new × 6 locales)** under `editor.endings.*` covering count / video-count labels, per-row labels, the preview line, warnings (`singleEmpty`, `timelineShort`, `rangeInvalid`, `rangeGap`, `rangeOverlap`, `rangeShort`), and helper hints. Schema bumped from 686 to 705 ui keys.
|
||||
- **Tests** — 42 new tests (367 → 409): `endings-format.test.ts` (15), `editor-store.endings.test.ts` (16), `description-builder.test.ts` (5 added inline), `timeline-parser.test.ts` (6 added inline).
|
||||
|
||||
### Changed
|
||||
|
||||
- **`PlaythroughNotesForm`** — the old single `<Input label="Endings shown">` is replaced by `<EndingsEditor />`. The legacy `endingsShown` freeform is kept on the editor type for migration round-trip but no longer surfaces in the UI.
|
||||
- **`description-builder` endings bullet** — reads from structured `endings[]` first, falls back to legacy `endingsShown` only when the array is empty (covers migrated drafts that still carry both). Multi-row entries render as comma-joined: `Ending 1: True End, Ending 3: Bad End, Hidden`. When `endingVideoIndex` is supplied, only that video's slice renders.
|
||||
- **`timeline-parser` keyword templates** — every locale's `timeline.keywords.ending` is now `"Ending {{n}}"` instead of `"Ending"`. The renderer collapses trailing whitespace so a bare `Boss` (no ordinal) still renders cleanly as `Boss` instead of `Boss `.
|
||||
- **`TemplateSnapshot`** in `template-store.ts` — gained `endings?`, `endingVideoCount?`, `endingVideoRanges?` (all optional for back-compat with pre-v0.16 templates).
|
||||
|
||||
### Migration
|
||||
|
||||
- **`migrateEditorState` v11 → v12** — `liftLegacyEndingString` parses the freeform `endingsShown` into a single-row structured entry:
|
||||
- `"Ending 3: Best End"` → `{ number: 3, name: "Best End" }`
|
||||
- `"Ending 3"` → `{ number: 3, name: "" }`
|
||||
- `"True ending only"` → `{ number: null, name: "True ending only" }`
|
||||
- `""` → `[]` (no entry)
|
||||
Localised "Kết thúc N", "エンディングN", etc. are also recognised. After lifting, `endingVideoCount` defaults to 1, `endingVideoRanges` to a single span; the existing `endingsShown` string is left in place but unused.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- `EndingEntry` and `EndingVideoRange` types live in `src/engine/types.ts`. The 1-indexed inclusive `from/to` convention matches the user-facing "Video 1, Video 2…" labels.
|
||||
- The Output preview for case C currently renders the *union* of all endings (same as case B) — per-video output rendering is wired into the engine via `endingVideoIndex` but the UI selector for it lands in a follow-up patch. Documented inline in `EndingsEditor` as `multiVideoOutputNote`.
|
||||
- Bundle: index 463.08 KB (+62 KB for EndingsEditor + endings-format + table-row UI). Still under the 500 KB cap.
|
||||
- 409/409 tests pass. Lint + typecheck + locale-validate all clean.
|
||||
|
||||
## v0.15.0 — 2026-05-14
|
||||
|
||||
Import / export overhaul + stability hardening. Closes the "black
|
||||
screen on bad file" class of bugs and gives every JSON export an
|
||||
auto-detect header so users can no longer confuse profile / preset /
|
||||
template files with each other.
|
||||
|
||||
### Added
|
||||
|
||||
- **`ErrorBoundary` ([src/components/ErrorBoundary.tsx](src/components/ErrorBoundary.tsx))** wrapping every `<Route>` plus a top-level boundary in `main.tsx`. Catches render-time errors that previously black-screened the app, surfaces a fallback UI with `Try again` (remount the subtree) + `Reload page` actions, and copies the error into the Logs tab via the in-app `logger`. Per-route boundaries mean a crash on the Profiles tab doesn't take down the Editor — the user can navigate elsewhere and recover.
|
||||
- **File envelope format ([src/utils/file-schema.ts](src/utils/file-schema.ts))** — every `.json` export written from this version onwards is wrapped in `{ _app: "ytdescgen", _type, _schemaVersion, _exportedAt, data }`. The `_type` discriminator (`"profile" | "preset" | "template" | "settings" | "history"`) lets imports detect "you opened a Template file in the Profiles importer" and offer to switch tabs instead of silently failing.
|
||||
- **`detectShape` / `resolveForType`** — shape inspector handles envelope files (authoritative `_type`), legacy bare arrays (best-effort guess from `snapshot` / `channelName` + `social` + `rig` / `gameName` + `storeLinks` / `createdAt` + title), and the multi-store settings dump (recognised by the `ytdescgen-settings` key). 17 new unit tests in `tests/utils/file-schema.test.ts` cover the round-trip + every detection branch.
|
||||
- **`importTypedFromJsonFile(expectedType)`** — high-level reader that resolves to a tagged-union `ImportResult`: either `{ ok: true; data; sourceVersion? }` or `{ ok: false; failure }` with one of five kinds (`cancelled`, `read-failed`, `empty`, `parse-error`, `wrong-shape`, `newer-schema`). Replaces the throw/catch-and-show-generic-toast pattern.
|
||||
- **Auto tab-switch on wrong-type import** — when the user clicks Import on the Profiles tab but the file is detected as a Templates export, the toast says "This file looks like a Templates export. Switching tabs…" and `setTab("templates")` runs immediately. One click instead of three.
|
||||
- **Import-result summary** in toasts — `Imported 5 of 7 profiles (some skipped).` when the store-level validator drops malformed rows. Previously a partial success surfaced as a plain "Imported!" even when half the file got rejected.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Black-screen crash** on loading a corrupt profile or template ("Cannot convert undefined or null to object"). Root cause was three unguarded spreads/`Object.values` chained together:
|
||||
- [src/components/profiles/TemplateCard.tsx:21](src/components/profiles/TemplateCard.tsx) `loadProfile(template.snapshot)` with `snapshot: null` →
|
||||
- [src/store/editor-store.ts:149](src/store/editor-store.ts) `normalizeEditorPatch` spread of `null` patch →
|
||||
- [src/components/profiles/ProfileCard.tsx:34](src/components/profiles/ProfileCard.tsx) `Object.values(profile.social)` with `social: null`.
|
||||
All three now null-guard. `normalizeEditorPatch` returns `{}` for a falsy patch; `loadProfile`-chain spreads degrade to a no-op; `Object.values(profile.social ?? {})` returns 0 instead of throwing. The new ErrorBoundary catches anything that still slips through.
|
||||
- **Store-level import validators** in [profile-store.ts](src/store/profile-store.ts), [preset-store.ts](src/store/preset-store.ts), [template-store.ts](src/store/template-store.ts) now filter incoming arrays for rows with a string `id` of non-zero length; templates additionally require a non-null `snapshot` object. Bad rows are silently dropped (count surfaces in the import toast).
|
||||
|
||||
### Changed
|
||||
|
||||
- **`exportToJsonFile` → `exportTypedToJsonFile`** at every ProfilesPage call site. The legacy bare-value exporter is retained for back-compat but unused.
|
||||
- **`importFromJsonFile<T>` → `importTypedFromJsonFile`** at every ProfilesPage handler. Legacy bare reader retained for the same reason — callers outside Profiles can migrate later.
|
||||
- **`detectShape` is forward-compatible**: an envelope from a future version (whose `_schemaVersion` exceeds `SCHEMA_VERSIONS[expected]`) returns `newer-schema` instead of importing silently. Tells the user to upgrade the app.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- Two layers of validation by design: `detectShape` confirms the file *kind*; per-store `importX` rejects malformed *rows*. A future tab-specific quirk in one validator can't corrupt other stores' data.
|
||||
- `normalizeEditorPatch` signature widened to `Partial<EditorData> | null | undefined` so TS forces null-handling at call sites. Existing callers still work — `Partial<T>` is assignable to the new union.
|
||||
- Vite reports one dynamic-import-also-statically-imported warning for `logger.ts`. Intentional: the boundary uses a dynamic import so logger init failures during the *primary* render error don't escalate into a secondary boundary crash. Bundle is not split.
|
||||
- Bundle: index 401.06 KB (+2.49 KB), ProfilesPage chunk 18.44 KB (+4.38 KB for envelope + failure-toast rendering). Total still well under the 500 KB cap.
|
||||
- 367/367 tests pass (350 + 17 new for file-schema).
|
||||
|
||||
### Migration notes
|
||||
|
||||
- **No store schema bump**. v0.14.x persisted state loads unchanged in v0.15.0; new envelope only affects on-disk JSON export files.
|
||||
- **Legacy export files still import** via the shape-detector path. Re-export to get the envelope header + tab-switch hints.
|
||||
- **Envelope schema versions**: profile=1, preset=2, template=1, settings=9, history=2. Bump per-type when introducing a non-additive change to that store's shape.
|
||||
|
||||
## v0.14.1 — 2026-05-14
|
||||
|
||||
Same-day patch on v0.14.0. Two desktop-only items closing user-reported
|
||||
issues on Windows + a small Settings convenience.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Windows "cannot find ... `AppData\Roaming\com.skullmute.ytdescgen`"** when clicking *Settings → Open Folder* on a fresh install ([`src/pages/SettingsPage.tsx:25-35`](src/pages/SettingsPage.tsx)). Root cause: `appDataDir()` only resolves the path string — the directory itself is created lazily on the first `save_to_file` write, so first-run users hit the OS shell before any setting had been persisted. New Rust command `ensure_dir(path)` ([`src-tauri/src/lib.rs:18-27`](src-tauri/src/lib.rs)) wraps `std::fs::create_dir_all` and is invoked before both `openPath(dir)` and `read_from_file` in `exportSettingsToFile`, so the shell + read paths can never encounter a non-existent folder.
|
||||
|
||||
### Added
|
||||
|
||||
- **Settings → Import button** (Tauri-only, next to *Export*). Reads a `.json` settings file via the existing `loadFile()` Tauri dialog, accepts either the full multi-store dump produced by *Export* (object keyed by `ytdescgen-settings`) or a bare `SettingsData` payload, runs it through `healSettings()` to back-fill any missing keys, then dispatches via `useSettingsStore.setState`. Theme class on `<html>` is re-applied directly because `setState` bypasses the `setTheme` action. Five distinct failure modes get their own toast: dialog-cancel (silent), `read_from_file` error, empty file, JSON parse error, non-object root. Each failure logs to the in-app logger with the source `"settings"` so it surfaces in the Logs tab without leaving the UI.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- New Tauri command `ensure_dir` registered in `invoke_handler!` macro alongside `save_to_file` and `read_from_file`. Pure stdlib — no new crates.
|
||||
- `exportSettingsToFile` also pre-creates the data folder so *Export* works on a fresh install without first triggering any other write.
|
||||
- Settings store gained no schema fields; the import path reuses the existing `healSettings` (v9) for back-fill so no `version` bump on the persist store.
|
||||
- 350/350 tests still pass; lint + typecheck clean.
|
||||
- Bundle: SettingsPage chunk grew ~0.18 KB raw for the new icon import + import handler; main bundle and overall gzip totals unchanged.
|
||||
|
||||
### Migration notes
|
||||
|
||||
- No store schema bump. Existing v0.14.0 installs upgrade in place.
|
||||
- Web (GitHub Pages) build is unchanged — both fixes are Tauri-only by virtue of the `IS_TAURI` gate on the Settings toolbar.
|
||||
|
||||
## v0.14.0 — 2026-05-14
|
||||
|
||||
Three independent strands land together:
|
||||
|
||||
1. **License flip MIT → Apache-2.0.** The repo previously claimed MIT in README/CLAUDE.md but had no `LICENSE` file. Adds canonical Apache License 2.0 text, a `NOTICE` asserting copyright + AI-assisted-development disclosure, and the `license` field in `package.json` + `src-tauri/Cargo.toml`. Per the production-docs spec.
|
||||
2. **Content warnings 69 → 91** across a new 8th group `gameplay_disclosure`. Adds horror-channel staples plus transparency disclosures for non-vanilla play. See "Added" below for the full ID list.
|
||||
3. **Mobile-responsive web** without PWA or Tauri-mobile. The GitHub Pages build is now usable on phones (drawer nav below `md`, touch-sized form controls, iOS-safe focus behavior, safe-area-inset padding for notch/home indicator).
|
||||
|
||||
Plus a documentation sweep: full `README.md` rewrite, new root policy files for public release (`SECURITY`, `CONTRIBUTING`, `CODE_OF_CONDUCT`, `PRIVACY`, `DISCLAIMER`, `TERMS`, `THIRD_PARTY_NOTICES`, `MAINTAINERS`), `docs/DEVELOPMENT.md` merging the deleted `pc_spec.md` + `dev_env.md`, Vietnamese mirrors for DEVELOPMENT and DISCLAIMER, and a `.github/PULL_REQUEST_TEMPLATE.md`.
|
||||
|
||||
### Added
|
||||
|
||||
- **`LICENSE`** (root) — canonical Apache License 2.0 text. **`NOTICE`** asserting `Copyright 2026 poli0981` + Claude Code 4.7 Opus (1M context) co-authorship disclosure. `license` field added to `package.json` and `src-tauri/Cargo.toml`.
|
||||
- **22 new content-warning IDs** across 8 groups ([src/engine/types.ts](src/engine/types.ts), [src/config/content-warning-groups.ts](src/config/content-warning-groups.ts)):
|
||||
- Phobias (+3): `coulrophobia` (clowns), `ablutophobia` (drowning), `taphophobia` (live burial).
|
||||
- Photosensitive (+2): `strobe_effects`, `screen_shake_intense`.
|
||||
- Mental Health (+3): `paranoia_themes`, `intrusive_thoughts`, `medical_horror`.
|
||||
- Sensitive (+3): `human_experimentation`, `cannibalism`, `nuclear_themes`.
|
||||
- Horror-Specific (+5): `liminal_spaces`, `analog_horror`, `unreality_themes`, `pursuit_chase`, `entity_horror`.
|
||||
- Playstyle (+2): `first_time_playing`, `returning_player`.
|
||||
- **NEW group Gameplay Disclosure (+4)**: `mods_used`, `cheats_enabled`, `glitch_exploits`, `assisted_run`.
|
||||
- **`src/components/ui/Drawer.tsx`** — slide-in mobile-nav drawer. Reuses overlay + Esc patterns from `Modal.tsx`; body-scroll lock + safe-area-inset padding; tap-outside-to-close.
|
||||
- **`tailwind.config.ts`** — `theme.extend.spacing.touch = "44px"` (iOS HIG minimum), exposed via `min-h-touch` / `h-touch` utilities.
|
||||
- **Mobile keyboard hints** — `inputMode` / `autoComplete` / `enterKeyHint` on game-name, channel-name, contact-email, and playlist-URL fields so iOS shows the right keyboard.
|
||||
- **Root policy file set** for public release: `SECURITY.md` (private-disclosure flow), `CONTRIBUTING.md` (PR process, validate:locales gate, auto-ignore rules), `CODE_OF_CONDUCT.md` (Contributor Covenant v2.1 link), `PRIVACY.md` (offline-first, localStorage keys listed, GDPR/CCPA), `DISCLAIMER.md` (AI-assistance + translation-quality disclosure), `TERMS.md` (Apache-2.0 + GitHub ToS + GDPR/CCPA/PIPL/LGPD/VN Cybersecurity), `THIRD_PARTY_NOTICES.md` (full dep table + AI disclosure paragraph), `MAINTAINERS.md`. Plus `.github/PULL_REQUEST_TEMPLATE.md`.
|
||||
- **`docs/DEVELOPMENT.md`** (EN) + **`docs/i18n/vi/DEVELOPMENT.md`** (VI) — merge of the deleted `pc_spec.md` + `dev_env.md`. Covers toolchain (Node ≥ 22, Rust stable, Tauri 2), JetBrains 2026.x + VS Code setup, build commands, per-OS Tauri prerequisites, troubleshooting.
|
||||
- **`docs/i18n/vi/DISCLAIMER.md`** — VI mirror of `DISCLAIMER.md`.
|
||||
|
||||
### Changed
|
||||
|
||||
- **`Sidebar.tsx`** — extracts `<SidebarNavList collapsed onItemClick?>` so the same nav can render inside the desktop sidebar **and** the new mobile Drawer. Outer `<aside>` now `hidden md:flex`.
|
||||
- **`AppShell.tsx`** — wires `mobileNavOpen` state + renders `<Drawer side="left">` containing `<SidebarNavList />` for mobile. Header gets `onOpenMobileNav` prop.
|
||||
- **`Header.tsx`** — adds `Menu` hamburger (md:hidden), `pt-[max(0.75rem,env(safe-area-inset-top))]` for iOS notch, donate icon-only below md, language dropdown width `min-w-[200px] max-w-[calc(100vw-2rem)]` so it never overflows at 360px width.
|
||||
- **`Button.tsx` / `Input.tsx` / `Textarea.tsx` / `ValidatedInput.tsx`** — bump heights to `min-h-touch` (44 px) for `md` / `lg`; `sm` to `min-h-[36px]` (iOS minimum). Inputs / textareas use `text-base sm:text-sm` to prevent iOS Safari focus zoom (Safari zooms when font-size < 16 px).
|
||||
- **`EditorPage.tsx`** — responsive padding `gap-6 p-6 lg:flex-row` → `gap-4 p-3 sm:p-4 md:gap-6 md:p-6 lg:flex-row`. Sticky preview wrapper changed to `lg:sticky lg:top-6` so mobile portrait doesn't lock the preview.
|
||||
- **`OutputPreview.tsx`** — description scroll-box `max-h-[400px]` → `max-h-[60vh] sm:max-h-[400px]`.
|
||||
- **`CopyAllBar.tsx`** — `pb-[max(0.75rem,env(safe-area-inset-bottom))]` for iOS home indicator; button class compaction below `sm`.
|
||||
- **`README.md`** — full rewrite (~200 lines). Badges (Apache-2.0 / Node ≥ 22 / latest release / last commit), Use Cases (esp. horror gameplay), Privacy section, full doc table, AI disclosure, channel/socials block.
|
||||
- **`CLAUDE.md`** — license MIT → Apache-2.0; project-structure tree updated (`PRD.md` removed, `DEVELOPMENT.md` added with VI mirror sibling).
|
||||
- **`src/config/about.ts`** — `license` MIT → Apache-2.0. `pcSpecDocUrl` / `devEnvDocUrl` field names preserved for About-page layout compat but now point to `docs/DEVELOPMENT.md` (EN) and `docs/i18n/vi/DEVELOPMENT.md` (VI) respectively.
|
||||
- **`webapp/TAURI.md`** — cross-links updated to `docs/DEVELOPMENT.md`.
|
||||
|
||||
### Removed
|
||||
|
||||
- **`docs/PRD.md`** — Product Requirements Document V1.0 (2026-04-07). Shipped through v0.13.1; no longer load-bearing for public readers.
|
||||
- **`docs/pc_spec.md`** + **`docs/dev_env.md`** — merged into `docs/DEVELOPMENT.md`.
|
||||
- **`docs/i18n/vi/pc_spec.md`** + **`docs/i18n/vi/dev_env.md`** — merged into `docs/i18n/vi/DEVELOPMENT.md`.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- **`_schema.json`** updated with the 23 new keys (1 new group label + 22 new option keys + 22 new long-description keys). All 6 locales × 2 files now at 686/686 ui + 368/368 templates.
|
||||
- **No engine logic changes.** `description-builder.ts:415-431` already loops content warnings by user selection order — the new IDs are pure-data additions.
|
||||
- 350/350 tests still pass — no engine math changed.
|
||||
- Bundle: 443.55 KB raw / 136.55 KB gzip (under the 500 KB cap; ~+30 KB vs v0.13.1 from the docs imports being inlined).
|
||||
- Repository URL canonicalized — all README / CLAUDE / DEVELOPMENT references that pointed to `github.com/poli0981/yt-desc-gen` now correctly resolve `github.com/poli0981/youtube-generator`. `src/config/about.ts` still uses the canonical name; no behavior change.
|
||||
- Tauri app-data identifier (`com.skullmute.ytdescgen`) documented correctly in `PRIVACY.md`.
|
||||
|
||||
### Migration notes
|
||||
|
||||
- **License change is not a code migration** — your build environment doesn't need any action. If you redistribute the source, the new `LICENSE` + `NOTICE` apply per Apache 2.0 §§ 4(a)–4(d). Pre-v0.14 forks may continue under their snapshot's license; this is a forward change.
|
||||
- **No store schema bump.** Editor / settings / profile / preset / template store versions unchanged. Persisted drafts containing the legacy `contentWarnings` array round-trip unchanged — the array just renders against the expanded ID set.
|
||||
- **Mobile users** get the new layout automatically on next visit; nothing to opt in to.
|
||||
|
||||
## v0.13.1 — 2026-05-11
|
||||
|
||||
Same-day hotfix for v0.13.0. Three small but load-bearing pieces:
|
||||
|
||||
### Added
|
||||
|
||||
- **GitHub-side housekeeping** — `.github/FUNDING.yml` (mirrors `Donate.txt`), `.github/ISSUE_TEMPLATE/{config,bug_report,feature_request}.yml`, `docs/pc_spec.md` + `docs/dev_env.md` (+ VI mirrors), `webapp/TAURI.md`. Auto-link-discussion job added to `announce-release.yml` (`gh release edit --discussion-category "Announcements"`) so every future release auto-creates a linked Discussion thread.
|
||||
- **AboutPage restructure** — split into Repository / Donate / Connect / Dev Environment / Third-Party sections. Ko-fi / Patreon moved out of `ABOUT.socials` into a new `@config/donate` (`PRIMARY_DONATE_URL` constant feeds the Header donate button). Socials expanded with Bluesky, Mastodon, Steam, Telegram (bot + user), email, game-server Discord.
|
||||
- **Header donate button** — persistent pink Ko-fi link to the left of the language switcher.
|
||||
- **Sidebar external link** — Report Bug item added to the tabs array via a new `external?: boolean` field on `TabItem`; branches render between `<NavLink>` and plain `<a target="_blank">`.
|
||||
- **Basic SEO** — expanded `<head>` (description, OG, Twitter card, JSON-LD `WebApplication`, 6 locale alternates) + new `useDocumentTitle(title)` hook applied to all 9 page components + `public/{robots.txt,sitemap.xml,manifest.webmanifest,favicon.svg}` (favicon is a placeholder SVG).
|
||||
- **Heavy-horror content-warning group** (7 IDs: `eye_horror`, `body_horror`, `face_horror`, `cosmic_horror`, `extreme_gore`, `decay_rot`, `mutilation`) translated to all 6 locales in both short-label and long-description forms.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Workflow `workflow_run` filters narrowed** — `notify-ci-failure.yml` / `notify-deploy.yml` / `notify-release-pipeline.yml` switched from `workflows: ["*"]` to specific producer names. Eliminates Skipped-row spam in the Actions tab.
|
||||
- **`@tauri-apps/api` 2.10.1 → 2.11.0** to match Rust `tauri` 2.11.1 (Dependabot bumped Rust side; tauri-action requires the npm and Rust minors to match).
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Tauri-action `releaseDraft: true` is search-by-version, not search-by-tag.** The initial v0.13.1 tag push silently uploaded `0.13.0`-labelled binaries to the existing v0.13.0 release object because `src-tauri/{tauri.conf.json, Cargo.toml, Cargo.lock}` stayed at `0.13.0`. Recovered with PR #58 (Tauri-side manifests to 0.13.1), then PR #59 (`@tauri-apps/api` bump), then force-moving the signed `v0.13.1` tag twice via `git tag -fs` + `git push origin v0.13.1 --force`, finally `gh workflow run release-desktop.yml -f tag=v0.13.0` to rebuild and restore v0.13.0's binaries.
|
||||
|
||||
### Migration notes
|
||||
|
||||
- **Version-bump ritual is now SIX files**, not five: `package.json`, `package-lock.json`, `src-tauri/Cargo.toml`, `src-tauri/Cargo.lock` (the `yt-desc-gen` entry only), `src-tauri/tauri.conf.json`, and — when Rust `tauri` minor moves — `@tauri-apps/api` in `package.json` (its minor must equal Rust `tauri` crate minor).
|
||||
|
||||
## v0.13.0 — 2026-05-08
|
||||
|
||||
A scope-broadening release: two UI/Gacha bugs squashed, Gacha-quest editor extended with three structured fields (Anniversary year dropdown, Showcase character name, free-form `gachaVersion`), copy buttons hard-stop when text exceeds YouTube's title/description/tags limits, the Tauri desktop window is now locked at 1100×750 (no resize, no maximize), 27 new content warnings — including a brand-new "Playstyle disclosures" group — fill the phobia / mental-health / sensitive / playstyle gaps, and the My Rig editor's free-text GPU and RAM inputs are replaced with structured cascading dropdowns (Brand → Series → Model for GPU, Size + DDR generation for RAM) covering ~200+ GPU models across 14 series and 4 brands. Two QoL touches round it out: per-quest-type smart placeholders ("Day 12" for Daily Commission, "Floor 12" for Endgame, "Part 1" for Main Story) and inline validation badges that nudge the creator when a rig field is half-filled.
|
||||
|
||||
### Added
|
||||
|
||||
- **Anniversary year dropdown (1–20)** ([src/components/editor/ExtraFieldsInput.tsx](src/components/editor/ExtraFieldsInput.tsx)) — replaces the v0.12 `chapterName` text input for the `anniversary` quest type. Title and description templates render `"{{anniversaryYear}}{{ordinalSuffix}} Anniversary"` (e.g. "2nd Anniversary", "11th Anniversary") with a locale-aware `ordinalSuffix()` helper that returns `st/nd/rd/th` for English and an empty string for non-English locales (so "周年記念" / "주년" / "周年纪念" don't pick up an English suffix).
|
||||
- **Showcase character name** — when `gachaQuestType === "showcase"`, the editor swaps Chapter/Quest/Part for a single `characterName` input. The description renders the user's exact requested phrasing: "This video showcases the skills, appearance, and details of {{characterName}} in {{gameName}}{{versionLabel}} on {{channelName}}." Title becomes "{{gameName}} — Character Showcase: {{characterName}}".
|
||||
- **Gacha `gachaVersion` field** ([src/store/editor-store.ts](src/store/editor-store.ts)) — free-form game version label like "1.2", "2.4", scoped to the Gacha Quest video type. Distinct from `versionInfo` (driver/general game version, rendered in the 🖥 VIDEO SETTINGS block for any video type). Surfaces in Gacha-specific intros via a new `description.intro.versionInline` template helper that renders only when non-empty (so the parenthetical "(version 1.2)" disappears entirely when the field is blank — no "(version )" artifact).
|
||||
- **Cascading GPU dropdown** ([src/config/gpu-catalog.ts](src/config/gpu-catalog.ts), [src/config/rig-fields.ts](src/config/rig-fields.ts)) — three-level Brand → Series → Model picker covering NVIDIA (GTX 700/900/10/16, RTX 20/30/40/50), AMD (HD 7000, R7/R9 200/300, RX 400/500/Vega/5000/6000/7000/9000), Intel Arc (A and B series), and Apple Silicon (M1–M4 with Pro/Max/Ultra variants). A `Custom` brand swap-in keeps free-text entry available for niche cards. Stored as pipe-delimited `"<brand>|<series>|<model>"` so the rig store stays a flat `Record<string, string>` — no schema migration vs. v0.12. `formatRigValue("gpu", …)` outputs `"NVIDIA RTX 4090"` (drops the redundant series label).
|
||||
- **Composite RAM input** — two cascading dropdowns (Size + DDR) replace the free-text RAM field. Sizes: 4/6/8/12/16/32/64/96/128/256 GB plus a `Custom…` numeric input for unusual sticks. DDR generations: DDR1–DDR7. Output renders as `"32 GB DDR5"` / `"48 GB DDR5"` (custom). Same flat-string storage approach as GPU (`"<size>|<ddr>"`, with `"custom:48|DDR5"` for custom numeric).
|
||||
- **27 new content warnings + Playstyle disclosures group** ([src/engine/types.ts](src/engine/types.ts), [src/config/content-warning-groups.ts](src/config/content-warning-groups.ts)) — Phobias gain `cynophobia / nyctophobia / pyrophobia / pediophobia / hemophobia` (5). Mental health gains `bipolar_themes / ocd_themes / panic_attacks / dissociation` (4). Sensitive gains `hate_speech / historical_atrocity / slavery_themes / terrorism_themes / bullying_themes` (5). A brand-new **Playstyle disclosures** group (8 items) covers `blind_playthrough / no_spoilers_chat / casual_difficulty / hardcore_difficulty / permadeath_run / speedrun_attempt / completionist_run / learning_mechanics` — disclosure-style warnings that aren't really "content" but viewers benefit from knowing (e.g. "Blind playthrough — first time" sets expectations for repeated dying).
|
||||
- **Smart placeholders per Quest Type** ([src/config/gacha-quest-types.ts](src/config/gacha-quest-types.ts)) — `GACHA_QUEST_PLACEHOLDERS` map drives the Chapter / Quest / Part inputs to show context-specific hints based on the selected quest type: `"Day 12"` for Daily Commission, `"Floor 12"` for Endgame, `"Part 1"` and `"Chapter 5 Act 2"` for Main Story, etc. Placeholders only — no value clearing or auto-fill, so user input is preserved when switching types.
|
||||
- **Inline rig validation badges** ([src/utils/rig-validation.ts](src/utils/rig-validation.ts)) — `validateGpuValue` / `validateRamValue` flag half-filled selections (brand picked but no model, RAM size set but DDR missing, custom numeric empty) and the rig editor renders a small ⚠️ warning under the affected field. Soft warning only — the description still renders, but the badge nudges the creator to complete the field.
|
||||
- **Copy-over-limit guard** ([src/hooks/use-clipboard.ts](src/hooks/use-clipboard.ts)) — `useClipboard().copy(text, { limit, fieldLabel })` now refuses to write to the clipboard when `text.length > limit`. Surfaces a toast like "Title is too long: 117/100 chars. Trim before copying." Each output button (Title / Description / Tags) passes its respective `YT_LIMITS.*` cap; the Copy All bar pre-validates Title and Description and shows a combined error if either is over. Over-limit copy buttons render with a `text-danger` style and a ⚠️ icon so the lock state is visible before the user clicks.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Editor store v10 → v11** ([src/store/editor-store.ts](src/store/editor-store.ts)) — additive only: `characterName: ""`, `anniversaryYear: null`, `gachaVersion: ""` back-fills. Out-of-range or non-integer `anniversaryYear` values coerce to `null` so a hand-edited persistent blob with `anniversaryYear: 99` doesn't render "99th Anniversary" in titles. Existing fields round-trip unchanged.
|
||||
- **Tauri window locked** ([src-tauri/tauri.conf.json](src-tauri/tauri.conf.json)) — `resizable: false`, `maximizable: false`, and `minWidth = maxWidth = 1100` / `minHeight = maxHeight = 750` ensure the desktop binary opens at the design resolution and stays there. Eliminates layout drift from users dragging the window to ultra-wide ratios where the editor → preview split breaks.
|
||||
- **AppShell layout reflow** ([src/components/layout/AppShell.tsx](src/components/layout/AppShell.tsx)) — root `min-h-screen` swapped for `h-screen overflow-hidden` so the outer container can't grow beyond viewport height. The `<main>` scroll container now actually constrains content, fixing the v0.12 bug where long descriptions caused the entire page (sidebar + header included) to scroll instead of just the main pane.
|
||||
- **Showcase template renders character, not quest** — `gachaQuestType.showcase` title and `description.intro.gacha_quest_showcase` now consume `characterName` instead of `questName`. Pre-v0.13 drafts that picked `showcase` and filled `questName` will see `characterName` empty after upgrade — re-enter the character into the new field.
|
||||
- **Anniversary template renders year + ordinal** — `gachaQuestType.anniversary` and `description.intro.gacha_quest_anniversary` consume `anniversaryYear` (number) instead of `chapterName` (free text). The English title is now `"<game> — 2nd Anniversary - Day N"` driven by the new ordinal helper; locale variants render in their native conventions ("2周年記念", "2주년 기념", "Aniversario 2", etc.).
|
||||
- **`formatRigValue()` extended** — switches on `field.type` to handle the two new cascading / composite types. Pre-v0.13 free-text GPU and RAM values (no pipes) pass through unchanged so existing profiles render the same string they did before; the editor displays them under the Custom brand for further editing.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- **Schema-driven locale validation** still passes with 629 ui keys + 339 templates keys across all 6 locales (en/es/ja/ko/vi/zh) — every new key is mirrored in the schema and translated where applicable. Validation errors are caught at the build / pre-merge step via `npm run validate:locales`.
|
||||
- **`tests/engine/rig-fields.test.ts`** grew from 7 → 18 cases — new coverage for `cascading_dropdown` (brand+model formatting, custom-brand verbatim, brand-only fallback, legacy free-text passthrough) and `composite_dropdown` (size+DDR, custom numeric, partial values, legacy passthrough).
|
||||
- **`tests/store/editor-store.migrate.test.ts`** grew from 9 → 13 cases — new v10 → v11 migration tests assert the Gacha field back-fills, the 1–20 anniversary-year range guard, and the round-trip preservation of valid persisted values.
|
||||
- **`tests/engine/title-builder.test.ts`** updated — the Anniversary test now passes `anniversaryYear: 7` instead of `chapterName: "7th"` to match the new template shape.
|
||||
- Test count: 350/350 (was 335/335).
|
||||
|
||||
### Migration notes
|
||||
|
||||
- v10 → v11 is automatic and additive; the migration runs once on first launch of v0.13. Existing drafts are preserved.
|
||||
- **Showcase users**: the `questName` you previously typed for showcase videos won't be carried into `characterName`. Open the editor, pick Showcase, and re-enter the character — the field name change is intentional (Showcase = character, not quest).
|
||||
- **Anniversary users**: the free-text `chapterName` you used to type "2nd" / "Year 2" / etc. is no longer used by the Anniversary template. Pick the year from the new dropdown instead.
|
||||
- **Free-text GPU / RAM users**: existing profiles render identically. The editor will show your old free-text under the Custom brand / RAM legacy fallback; switch to the structured dropdowns when convenient.
|
||||
|
||||
## v0.12.1 — 2026-05-06
|
||||
|
||||
Hotfix for v0.12.0. Ticking a Tech Notes checkbox (or filling any of the new Playthrough Notes structured fields — Endings shown, Language patch, Game version) updated the editor state but never reached the description preview, because the editor → engine mapping in `useCurrentGeneratorInput` wasn't kept in sync when the new fields were added. The unit-test suite caught nothing because every v0.12 description-builder test passed `GeneratorInput` directly to the engine, bypassing the hook.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Editor → engine pipeline carries every v0.12 field** ([src/hooks/use-current-generator-input.ts](src/hooks/use-current-generator-input.ts)) — `endingsShown`, `languagePatch`, `languagePatchCustom`, `gameVersion`, `gameVersionCustom`, and `techNotes` are now forwarded into `GeneratorInput`. Symptom of the bug was that the description preview (and Output / Batch tabs) didn't change when the user ticked tech-note items or filled language-patch / game-version, even though the editor checkboxes / selects reflected the change correctly.
|
||||
- **Save-as-template captures every v0.12 field** ([src/components/templates/TemplateSaveForm.tsx](src/components/templates/TemplateSaveForm.tsx)) — the snapshot builder explicitly enumerates each editor field and was missing the same six fields. A v0.12.0 user saving a template lost their Tech Notes / Playthrough Notes selections; loading the template later didn't restore them.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Hook field-mapping extracted into a pure helper** — `buildGeneratorInputFromEditor(state, languageOverride?)` is now exported alongside the React hook. Pure function so it's directly unit-testable; the hook just wraps it in `useMemo`. Same change pattern used for `migrateEditorState` in v0.12.0 — pull the load-bearing logic out of React-coupled wrappers so tests can hit it without a render harness.
|
||||
- **Hook `useMemo` deps simplified** — the previous list enumerated every field individually (50+ entries); a missing field would silently freeze that field's value in the memoised output. Replaced with a single `[state, languageOverride]` since `useEditorStore()` returns a fresh state reference on every store update — equivalent invalidation, fewer footguns.
|
||||
- **`TemplateSnapshot` carries the v0.12 fields as optional** ([src/store/template-store.ts](src/store/template-store.ts)) — `endingsShown`, `languagePatch`, `languagePatchCustom`, `gameVersion`, `gameVersionCustom`, `techNotes` joined the snapshot type. Optional for back-compat with templates saved before this hotfix; the editor's `loadProfile` spread keeps existing values when the patch lacks them.
|
||||
- **`EditorData` is now `export interface`** in `src/store/editor-store.ts` so the shared snapshot helper can reference it.
|
||||
- **package-lock.json** synced to the v0.12 / v0.12.1 version line — was carrying a stale v0.11.0 root version since the v0.12.0 PR forgot it (the v0.9.0 lockfile-bump-miss memory note reminded us, but only after the v0.12.0 ship).
|
||||
|
||||
### Under the hood
|
||||
|
||||
- New `tests/hooks/generator-input-mapping.test.ts` (6 cases) — direct assertions that each v0.12 field reaches `GeneratorInput` (`endingsShown`, `languagePatch + custom`, `gameVersion + custom`, `techNotes` selection-order), plus a parity guard that walks every key of an `EditorData` instance and fails if any non-allowlisted field is dropped from the resulting `GeneratorInput`. The allowlist is exactly two keys (`thumbnailText`, `pinnedComment` — both feed the pinned-comment builder via a separate code path); anything else added in the future will trip the assertion immediately.
|
||||
- Test count: 335/335 (was 329/329). Bundle: 345.50 KB raw / 115.52 KB gzipped (essentially flat versus v0.12.0 — only swapped a deps array for a single ref).
|
||||
|
||||
### Migration notes
|
||||
|
||||
- No state migration needed. `loadProfile` / `loadPreset` continue to spread snapshots over current state, and the new fields are all optional on `TemplateSnapshot`. A v0.12.0 user with templates saved during the bug window will see those templates load with empty Tech Notes / Playthrough Notes — re-save the template after upgrading to capture the fields properly.
|
||||
|
||||
## v0.12.0 — 2026-05-06
|
||||
|
||||
A bug fix and a description overhaul. The Tauri desktop build picks up `tauri-plugin-single-instance` so launching the app twice no longer stacks tray icons / orphan processes — second launches refocus the existing window. The description's Playthrough block consolidates the v0.7 standalone "🎯 Playthrough" line and the standalone "🎮 DIFFICULTY" block into a unified `▸ 🎮 PLAYTHROUGH NOTES` section with three new structured fields (`endingsShown`, `languagePatch`, `gameVersion`), and a new `▸ 🛠 TECH NOTES` bilingual checklist (24 items across 5 groups) sits alongside Content Warnings for production / playstyle disclaimers.
|
||||
|
||||
### Added
|
||||
|
||||
- **Single-instance enforcement (desktop)** — `src-tauri/Cargo.toml` adds `tauri-plugin-single-instance = "2"`, registered first in the `Builder` chain in `src-tauri/src/lib.rs` with a `get_webview_window("main")` → show + unminimize + focus callback. Closing-to-tray then double-clicking the launcher / start-menu shortcut surfaces the existing window instead of spawning a fresh process with its own tray icon.
|
||||
- **Unified `▸ 🎮 PLAYTHROUGH NOTES` description block** — replaces the v0.7 standalone "🎯 Playthrough:" line and the v0.7 standalone "🎮 DIFFICULTY" block with one bulleted section that renders five fields: Run type (reads from existing `playthroughStatus`), Difficulty (reads from existing `difficulty` + `difficultyCustomLabel`), Endings shown (NEW free text), Language patch (NEW enum + custom slot), Game version (NEW enum + custom slot). Empty bullets are skipped; the whole block is skipped when every field is empty. Bilingual `EN · LOCAL` rendering for both label and value when `tEn` is provided and output language ≠ English. Section sits in slot 1.5 (right after the intro), matching the position of the pre-v0.12 standalone playthrough line.
|
||||
- **`▸ 🛠 TECH NOTES` checklist** — a 24-item, 5-group bilingual multi-select for production / playstyle disclaimers: audio (5: copyright muting, volume reduction, music replacement, cutscene-only mute, original-audio kept), video quality (3: low resolution, low graphics, FPS drops with FPS counter pointer), recording issues (4: bug-from-game, crash kept, loading cut, OBS artifacts), playstyle (8: not no-hit, not clean walkthrough, casual no-commentary, many deaths, slow exploration, puzzle-stuck, grinding cut, not speedrun), production (4: exploration-focused, edited-for-pacing, support-developers, online-connectivity-issues). Same render pattern as v0.11 Content Warnings — header / two-line intro / `EN · LOCAL` bullets with U+00B7 MIDDLE DOT separator. Section sits right after Content Warnings; both transparency blocks group together.
|
||||
- **`languagePatch` enum** with options `none / official_en / official_other / fan_translation / mtl / custom` and a paired free-form `languagePatchCustom` slot — covers the most common patch states (canonical EN release, official non-EN locale, fan TL, machine TL) plus an escape hatch for niche cases. `none` is the skip-bullet sentinel; `official_other` and `custom` both surface the free-form input under the Select.
|
||||
- **`gameVersion` enum** with options `full_release / demo / early_access / beta / prologue / pre_release / custom` and a paired `gameVersionCustom` slot — `full_release` is the implicit default (no bullet rendered) so creators recording the released game don't have to fill anything; "Steam Next Fest demo" / "Kickstarter backer build" / similar niche cases go through `custom`.
|
||||
- **Free-text `endingsShown` field** — captures values like "1 of 3", "True ending only", "All routes 100%", "Normal + True". Free text on purpose — the natural value space is too varied for an enum, and a `custom` escape hatch would catch 80% of selections anyway.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Editor store** v9 → v10 — additive only: `endingsShown: ""`, `languagePatch: "none"`, `languagePatchCustom: ""`, `gameVersion: "full_release"`, `gameVersionCustom: ""`, `techNotes: []` back-fills. Existing `playthroughStatus` / `difficulty` / `difficultyCustomLabel` values round-trip unchanged — only the description-builder render path moves them into the unified block. Invalid persisted enum values coerce to their skip-sentinel default; unknown `techNotes` ids are filtered out (defensive against hand-edited blobs). The `migrate` function is now extracted into a named `migrateEditorState` export so the v9→v10 path can be unit-tested without going through localStorage.
|
||||
- **`ContentDetailsForm.tsx`** is removed and replaced with the v0.12 `PlaythroughNotesForm.tsx` — the new component owns all five PN fields (Run type, Difficulty + custom, Endings shown, Language patch + custom, Game version + custom) in one block, with the custom-slot inputs only appearing when their parent enum carries one. The Editor page mounts `PlaythroughNotesForm` then `ContentWarningChecklist` then `TechNotesChecklist` inside the Content Details accordion.
|
||||
- **`description-builder.ts`** — the v0.7 standalone playthrough conditional (`if (input.playthroughStatus !== "none") sections.push(...)`) and the standalone difficulty conditional (`if (input.difficulty !== "none") sections.push(...)`) are gone; replaced with one call to a new `buildPlaythroughNotesSection(input, t, tEn)` helper at slot 1.5. A new `buildTechNotesSection(input, t, tEn)` helper at slot 7.5 mirrors the v0.11 content-warnings render pattern.
|
||||
|
||||
### Removed
|
||||
|
||||
- **`description.sections.playthrough` / `description.sections.difficulty`** template keys — section heading is now bullet-formatted inside the `▸ 🎮 PLAYTHROUGH NOTES` block via `description.playthroughNotes.labels.*`. The per-status / per-level value labels (`description.playthrough.{blind,replay,…}`, `description.difficulty.{easy,normal,…}`) are kept — the new block reads them for the "Run type" and "Difficulty" bullet values.
|
||||
- **`ContentDetailsForm.tsx`** — superseded by `PlaythroughNotesForm.tsx`.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- New `src/config/tech-note-groups.ts` carries the 5-group UI structure (`audio` / `video_quality` / `recording_issues` / `playstyle` / `production`). Engine doesn't read groups — output follows selection order — but the editor uses them to render collapsible sections.
|
||||
- New `src/config/playthrough-options.ts` exports `LANGUAGE_PATCH_UI_OPTIONS` / `GAME_VERSION_UI_OPTIONS` (Select-friendly `{id, labelKey}` shapes) plus `languagePatchHasCustomSlot` / `gameVersionHasCustomSlot` predicates so the editor knows when to show the paired custom-text input.
|
||||
- `src/engine/types.ts` adds `LANGUAGE_PATCH_OPTIONS` / `LanguagePatch`, `GAME_VERSION_OPTIONS` / `GameVersion`, `TECH_NOTES` / `TechNote` const-and-type pairs, plus six new optional fields on `GeneratorInput`.
|
||||
- All 6 locales (en / vi / ja / es / ko / zh) updated with `description.playthroughNotes.{header,intro,labels,languagePatchOptions,gameVersionOptions}` + `description.techNotes.{header,intro,items}` (24 items) + matching editor short labels (`editor.playthroughNotes.*`, `editor.techNoteOptions.*`, `editor.techNoteGroups.*`). `validate:locales` clean at 585 ui + 316 templates per locale.
|
||||
- Engine tests grow by 14 cases: PN block bullet formatting (en single-language, all five filled), PN block omission when every field is empty, regression that the old standalone `🎯 Playthrough:` and `🎮 DIFFICULTY` lines no longer render, custom-difficulty label passthrough, custom-difficulty blank-label skip, PN bilingual VI mode, PN with `languagePatch: official_other` + custom slot, PN with `gameVersion: custom` + custom slot, TN selection-order preservation, TN bilingual VI / JA modes, TN single-language fallback when `tEn` omitted, TN block omission when list is empty. Plus a new `tests/store/editor-store.migrate.test.ts` with 9 cases covering the v9→v10 migration: default back-fills, preservation of existing playthrough / difficulty / contentWarnings, invalid enum coercion, unknown tech-note id filtering, idempotency on a v10 blob, and null / undefined handling. Full suite: 329 / 329 green.
|
||||
- Bundle: main chunk 345.85 KB raw / 115.78 KB gzipped (under the 500 KB constraint).
|
||||
|
||||
### Migration notes
|
||||
|
||||
- No manual action required. First launch after upgrade migrates state in place: pre-v0.12 drafts gain the new PN + TN field defaults; existing `playthroughStatus` / `difficulty` keep their values, the description just renders them under the unified PN header now.
|
||||
- The Tauri single-instance fix only takes effect after a fresh install of the v0.12 build; existing v0.11 desktop installs need to be uninstalled / replaced. Web builds are unaffected.
|
||||
|
||||
## v0.11.0 — 2026-05-06
|
||||
|
||||
Three independent features: vendor-aware graphics dropdowns (DLAA + XeSS Ultra Quality joined the ladder, multipliers cap per vendor), a third-party advertising block driven by a per-profile copy field, and a major content-warning overhaul — the v0.7 trio (`spoilerWarning` / `matureWarning` toggles + 3-item checklist) becomes a unified bilingual checklist of 44 items across 5 categories with `EN · output-language` rendering and asterisk-masked Vietnamese terms for YouTube ToS safety.
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
**YTDescGen** is a desktop-capable web application that generates YouTube video titles, descriptions, and tags for Gameplay No Commentary channels. It supports multiple languages, game genres, and video types with a profile/preset system to eliminate repetitive data entry.
|
||||
|
||||
- **Repository**: `github.com/poli0981/yt-desc-gen` (private)
|
||||
- **License**: MIT
|
||||
- **Repository**: `github.com/poli0981/youtube-generator`
|
||||
- **License**: Apache-2.0 (see `LICENSE` + `NOTICE`)
|
||||
- **Primary Language**: TypeScript
|
||||
- **Stack**: React 18 + Vite + Tailwind CSS + Zustand + Tauri (desktop)
|
||||
- **Target Platforms**: Web (GitHub Pages), Desktop (Windows/macOS via Tauri)
|
||||
- **Stack**: React 18 + Vite 7 + Tailwind CSS 3 + Zustand + Tauri 2 (desktop)
|
||||
- **Target Platforms**: Web (GitHub Pages), Desktop (Windows/macOS/Linux via Tauri)
|
||||
|
||||
## Tech Stack
|
||||
|
||||
@@ -40,13 +40,14 @@ yt-desc-gen/
|
||||
├── index.html
|
||||
│
|
||||
├── docs/ # Project documentation
|
||||
│ ├── PRD.md # Product Requirements Document
|
||||
│ ├── DEVELOPMENT.md # Toolchain / IDE / build commands (EN)
|
||||
│ ├── ARCHITECTURE.md # Technical architecture
|
||||
│ ├── FEATURES.md # Complete feature list
|
||||
│ ├── ROADMAP.md # Development phases
|
||||
│ ├── TECH-SPEC.md # Technical specifications
|
||||
│ ├── I18N.md # Internationalization guide
|
||||
│ └── PACKAGING.md # Desktop packaging guide
|
||||
│ ├── PACKAGING.md # Desktop packaging guide
|
||||
│ └── i18n/vi/ # Vietnamese mirrors (DEVELOPMENT, DISCLAIMER)
|
||||
│
|
||||
├── src/
|
||||
│ ├── main.tsx # Entry point
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# Code of Conduct
|
||||
|
||||
This project adopts the **[Contributor Covenant v2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/)** in full.
|
||||
|
||||
By participating in this project — opening issues, submitting pull requests, commenting, translating locales, or any other form of contribution — you agree to abide by its terms.
|
||||
|
||||
## Reporting
|
||||
|
||||
Report violations privately to the maintainer: `lopop05905@proton.me`.
|
||||
|
||||
All reports are reviewed and investigated promptly and fairly. The maintainer is obligated to respect the privacy and security of the reporter.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Examples of enforcement actions, in escalating order:
|
||||
|
||||
1. A private warning.
|
||||
2. A public warning on the relevant issue / PR.
|
||||
3. A temporary ban from contributing.
|
||||
4. A permanent ban — applied without warning for serious violations (harassment, threats, malicious code submissions per [`CONTRIBUTING.md`](./CONTRIBUTING.md) auto-ignore rules).
|
||||
|
||||
For the full list of enforcement guidelines, read the [Contributor Covenant v2.1 — Enforcement Section](https://www.contributor-covenant.org/version/2/1/code_of_conduct/#enforcement).
|
||||
@@ -0,0 +1,80 @@
|
||||
# Contributing to YTDescGen
|
||||
|
||||
Thanks for taking the time to contribute. Read this once before opening your first PR — it saves time on both sides.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
Participation is governed by the [Code of Conduct](./CODE_OF_CONDUCT.md). By contributing, you agree to its terms.
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. Read the [Development Guide](./docs/DEVELOPMENT.md) — also available in [Vietnamese](./docs/i18n/vi/DEVELOPMENT.md).
|
||||
2. Install dependencies: `npm install`.
|
||||
3. Start the dev server: `npm run dev`.
|
||||
4. Before opening a PR run all gates:
|
||||
```bash
|
||||
npm run typecheck
|
||||
npm run lint
|
||||
npm run validate:locales
|
||||
npm run test:run
|
||||
```
|
||||
|
||||
## How to Contribute
|
||||
|
||||
### Issues
|
||||
|
||||
Use the templates in `.github/ISSUE_TEMPLATE/`:
|
||||
|
||||
- **Bug report** — only if you can reproduce on the latest release.
|
||||
- **Feature request** — only with a concrete use case, not abstract requests.
|
||||
|
||||
### Pull Requests
|
||||
|
||||
- Branch from `dev`, not `main`.
|
||||
- Commit format: `type(scope): message` — e.g. `feat(engine): add Spanish template support`. Types: `feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`.
|
||||
- One logical change per PR. Don't bundle unrelated refactors.
|
||||
- All locale files must stay in lock-step — see the i18n section below.
|
||||
- AI-assisted contributions are welcome but **must be disclosed** in the PR description.
|
||||
|
||||
### i18n Contributions
|
||||
|
||||
If your change adds or removes any user-facing string:
|
||||
|
||||
1. Update the locale schema at `src/i18n/locales/_schema.json` first.
|
||||
2. Add the key to **all 6 locales** (`en` / `vi` / `ja` / `es` / `ko` / `zh`).
|
||||
3. `npm run validate:locales` must pass.
|
||||
|
||||
Native-speaker corrections to AI-translated locales (JA / ES / KO / ZH) are especially welcome — see [DISCLAIMER.md](./DISCLAIMER.md) for the current translation-quality status.
|
||||
|
||||
## Auto-ignored Contributions
|
||||
|
||||
The following are closed without review and may result in a contributor ban — no exceptions:
|
||||
|
||||
- **Suspected malicious code.** If a PR contains code we suspect may be a supply-chain attack, obfuscation, credential harvesting, cryptominer, or any form of malware — even if CodeQL and Dependabot don't flag it, the maintainer may investigate manually. **Detection equals ban.**
|
||||
- **Unverified or suspicious links** in issues, PRs, or comments (pastebin scrapers, redirect chains, unfamiliar shortlinks, link-shortener URLs without context).
|
||||
- **Behavior or language violating** [GitHub's Acceptable Use Policies](https://docs.github.com/en/site-policy/acceptable-use-policies).
|
||||
- **Off-topic / rambling reports** that don't get to the point. Example of what gets ignored: *"Good morning, today is a beautiful day, I was just wondering if maybe…"* — get straight to the problem.
|
||||
- **PRs that touch hundreds of files for a one-line fix** (typical sign of an auto-formatter run on unrelated files).
|
||||
- **Tests deleted, or `--no-verify` used to bypass pre-commit hooks.**
|
||||
- **"AI rewrote my entire codebase in a different style" PRs.** AI-assisted edits are welcome (disclosed); whole-repo rewrites are not.
|
||||
- **Spam, drive-by typo fixes** that don't address a real issue, and karma-farming PRs.
|
||||
|
||||
## What We Want
|
||||
|
||||
- Bug fixes with a reproduction case and a regression test.
|
||||
- Locale corrections from native speakers.
|
||||
- New content-warning IDs with all 6 translations and a clear rationale (especially horror-genre vocabulary).
|
||||
- New video types or genres that fit the gameplay no-commentary use case.
|
||||
- Accessibility and mobile-responsive improvements.
|
||||
- Performance fixes with a `before/after` measurement.
|
||||
|
||||
## What We Don't Want
|
||||
|
||||
- Cosmetic refactors with no behavior change.
|
||||
- Adding new runtime dependencies without first opening an issue to discuss the tradeoff.
|
||||
- Renaming files without coordinating with open PRs.
|
||||
- Changes to the LICENSE or NOTICE files (these are governance, not contributions).
|
||||
|
||||
## License
|
||||
|
||||
By contributing, you agree your contribution will be licensed under the [Apache License 2.0](./LICENSE), the same license as the project, and that you have the right to grant that license.
|
||||
@@ -0,0 +1,53 @@
|
||||
# Disclaimer
|
||||
|
||||
## Solo project, AI-assisted
|
||||
|
||||
YTDescGen is a personal project built by a single maintainer (`@poli0981`) for use with the [`@SkullMute`](https://www.youtube.com/@SkullMute) YouTube channel and shared publicly as open source. It is **not a commercial product** and there is no support obligation.
|
||||
|
||||
Code, documentation, locale translations, and design decisions in this repository were **co-authored with the assistance of Anthropic's Claude Code (model 4.7 Opus, 1M-context variant)**. All commits, releases, and architectural decisions are reviewed and approved by the maintainer before merging.
|
||||
|
||||
This disclosure applies to:
|
||||
|
||||
- Source code in `src/` and `src-tauri/`.
|
||||
- Documentation in `docs/` and all root markdown files.
|
||||
- Locale files in `src/i18n/locales/`.
|
||||
- CI/CD workflows in `.github/workflows/`.
|
||||
|
||||
See also: [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md) § "AI-Assisted Development Disclosure".
|
||||
|
||||
## Translation quality
|
||||
|
||||
The application UI ships in six languages. Authoring quality varies:
|
||||
|
||||
| Locale | Authoring | Notes |
|
||||
| --- | --- | --- |
|
||||
| English (`en`) | Maintainer + AI | Primary working locale. Strings reviewed before commit. |
|
||||
| Vietnamese (`vi`) | Maintainer (native) + AI | Reviewed by the maintainer, who is a native Vietnamese speaker. |
|
||||
| Japanese (`ja`) | AI-translated | Not native-reviewed. Grammar and tone may be imperfect. |
|
||||
| Spanish (`es`) | AI-translated | Not native-reviewed. Regional voice (LatAm vs. Castilian) not specifically targeted. |
|
||||
| Korean (`ko`) | AI-translated | Not native-reviewed. Honorific register chosen for neutrality, not specific cultural fit. |
|
||||
| Chinese (`zh`) | AI-translated | Simplified Chinese only. Not native-reviewed. |
|
||||
|
||||
If you're a native speaker and spot mistranslations, please open an issue or PR — see [CONTRIBUTING.md](./CONTRIBUTING.md) § "i18n Contributions".
|
||||
|
||||
## Voice and tone
|
||||
|
||||
Generated description templates use an opinionated tone tailored to the **gameplay no-commentary** YouTube niche, with extra emphasis on horror / scary games (because that's the maintainer's channel). The output may not fit every channel's voice or every country's reader expectations. The application is template-driven — you can edit any generated text before publishing.
|
||||
|
||||
Some Vietnamese phrasings deliberately keep loanwords and casual tone reflecting how Vietnamese gameplay creators commonly write descriptions. These are not "incorrect translations"; they are stylistic choices for the target audience.
|
||||
|
||||
## No warranty
|
||||
|
||||
This software is provided **as-is, with no warranty of any kind**. See [`LICENSE`](./LICENSE) (Apache 2.0) §§ 7 and 8 for the full disclaimer of warranty and limitation of liability.
|
||||
|
||||
In plain English: if the application crashes, mangles your draft, generates a description that gets your video flagged by YouTube, or causes any other harm — the maintainer is not liable. Use at your own risk; back up your drafts.
|
||||
|
||||
## Not affiliated with YouTube / Anthropic
|
||||
|
||||
YTDescGen is **not** affiliated with, endorsed by, or sponsored by YouTube, Google LLC, or Alphabet Inc. The generated output is intended to be pasted into the YouTube Studio editor; this application does not interact with the YouTube API.
|
||||
|
||||
Use of Claude Code during development does **not** make this an Anthropic product. Anthropic, Claude, and Claude Code are trademarks of Anthropic, PBC. This project is independent.
|
||||
|
||||
## Not legal or financial advice
|
||||
|
||||
Any mention of GDPR, CCPA, copyright law, YouTube's monetization policies, or similar topics in this repository's documentation is provided for orientation only and is **not legal advice**. Consult a qualified lawyer in your jurisdiction if you need an authoritative answer.
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for describing the origin of the Work and
|
||||
reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Support. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or support.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,28 @@
|
||||
# Maintainers
|
||||
|
||||
## Active Maintainers
|
||||
|
||||
### `@poli0981`
|
||||
|
||||
- **GitHub**: <https://github.com/poli0981>
|
||||
- **YouTube** (reference channel): <https://www.youtube.com/@SkullMute>
|
||||
- **Email** (security & private contact): `lopop05905@proton.me`
|
||||
- **Areas of responsibility**: all — core engine, locale management, UI, Tauri desktop shell, releases, CI/CD.
|
||||
|
||||
## Maintainer Responsibilities
|
||||
|
||||
- Triage incoming issues and PRs.
|
||||
- Run the release process: `CHANGELOG.md` entry, version bump, build artifacts, signed tag.
|
||||
- Enforce the [Code of Conduct](./CODE_OF_CONDUCT.md).
|
||||
- Review and approve locale translation contributions.
|
||||
- Coordinate security advisory disclosure per [SECURITY.md](./SECURITY.md).
|
||||
|
||||
## Becoming a Maintainer
|
||||
|
||||
There is currently no formal pathway. The project has been solo since inception. If you'd like to help maintain a specific area — most realistically, native-speaker review for one of the AI-translated locales (JA / ES / KO / ZH) — open an issue describing what you'd like to take on.
|
||||
|
||||
Persistent, high-quality contributions over time are the path. There is no application form.
|
||||
|
||||
## Past Maintainers
|
||||
|
||||
None — solo project since v0.1.0.
|
||||
@@ -0,0 +1,15 @@
|
||||
YTDescGen — YouTube Gameplay Description Generator
|
||||
Copyright 2026 poli0981 (https://github.com/poli0981)
|
||||
|
||||
This product includes software developed by poli0981 and contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
see LICENSE for the full terms, or visit:
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
This product was co-developed with the assistance of Anthropic's
|
||||
Claude Code 4.7 Opus (1M context). See DISCLAIMER.md and
|
||||
THIRD_PARTY_NOTICES.md for details.
|
||||
|
||||
Third-party dependencies retain their respective licenses; see
|
||||
THIRD_PARTY_NOTICES.md for the complete attribution list.
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
# Privacy Policy
|
||||
|
||||
**Effective:** 2026-05-14
|
||||
|
||||
YTDescGen is an **offline-first** template engine for generating YouTube video metadata. This document describes what data the application handles, where it lives, and what it never collects.
|
||||
|
||||
## What We Collect
|
||||
|
||||
**Nothing.** The application sends no data to any server controlled by the maintainer.
|
||||
|
||||
There is no analytics provider, no telemetry, no crash reporter, no A/B testing, no advertising network, no behavioral tracking. There is no backend.
|
||||
|
||||
## What Stays on Your Device
|
||||
|
||||
### Web version (GitHub Pages)
|
||||
|
||||
The web build stores your work in your browser's **`localStorage`** only. Keys used:
|
||||
|
||||
| Key prefix | Purpose |
|
||||
| --- | --- |
|
||||
| `ytdesc:editor` | Current editor draft |
|
||||
| `ytdesc:settings` | Theme, default language, accordion state, hashtag preferences |
|
||||
| `ytdesc:profiles` | Saved channel / social / rig profiles |
|
||||
| `ytdesc:presets` | Saved game presets |
|
||||
| `ytdesc:templates` | Saved full-form snapshots |
|
||||
| `ytdesc:history` | Recently generated outputs |
|
||||
| `ytdesc:logs` | Application event log |
|
||||
|
||||
`localStorage` is scoped to the origin and never transmitted. Clearing your browser data, browsing in a private/incognito window, or signing out wipes all of it.
|
||||
|
||||
### Desktop version (Tauri)
|
||||
|
||||
The desktop build uses the operating system's standard application-data directory:
|
||||
|
||||
- **Windows**: `%APPDATA%\com.skullmute.ytdescgen`
|
||||
- **macOS**: `~/Library/Application Support/com.skullmute.ytdescgen`
|
||||
- **Linux**: `~/.config/com.skullmute.ytdescgen`
|
||||
|
||||
The same key set as the web version is stored as JSON files there. Uninstalling the application or deleting that directory removes everything.
|
||||
|
||||
## Third-Party Services
|
||||
|
||||
The application does **not** call third-party APIs at runtime.
|
||||
|
||||
Optional links you may click — donation buttons, store links you paste into a draft, social links you save to your profile — navigate **away** from the application to third-party sites. Those sites have their own privacy policies; the maintainer is not responsible for them.
|
||||
|
||||
YouTube oEmbed, the Steam store API, Twitch helix, and similar services are **not** fetched by this application.
|
||||
|
||||
## Cookies / Local Storage Distinction
|
||||
|
||||
The web version uses **`localStorage`**, not cookies. No cookie is set by the application. GitHub Pages itself may issue a session cookie at the platform level — that is GitHub's, not ours, and is governed by [GitHub's Privacy Statement](https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement).
|
||||
|
||||
## Children's Privacy
|
||||
|
||||
This application is not directed at children under 13 and does not knowingly process any personal data from anyone.
|
||||
|
||||
## GDPR / CCPA / Equivalent Rights
|
||||
|
||||
Because no data ever leaves your device:
|
||||
|
||||
- **Right to access**: your data is already accessible — open DevTools → Application → Local Storage on the web, or browse the application-data directory on desktop.
|
||||
- **Right to erasure**: clear your browser's site data (web) or delete the application-data directory / uninstall the app (desktop).
|
||||
- **Right to portability**: use the in-app **Export** action in `Profiles` / `Presets` / `Templates` / `History` / `Logs` to download JSON.
|
||||
- **Right to object / restrict processing**: not applicable — no processing happens off-device.
|
||||
- **Right to know what is sold or shared**: nothing. Nothing is sold or shared.
|
||||
|
||||
## Changes to This Policy
|
||||
|
||||
If this policy changes, the change is committed to the repository under `PRIVACY.md` with the `Effective` date updated. There is no notification mechanism because the application has no way to reach you.
|
||||
|
||||
## Contact
|
||||
|
||||
`lopop05905@proton.me`
|
||||
@@ -1,56 +1,122 @@
|
||||
# 🎮 YTDescGen
|
||||
|
||||
**YouTube Gameplay Description Generator** — A template engine for Gameplay No Commentary channels.
|
||||
**YouTube Gameplay Description Generator** — an offline-first template engine for Gameplay No Commentary YouTube channels.
|
||||
|
||||
Generate YouTube video titles, descriptions, and tags in multiple languages with one click.
|
||||
Generate YouTube titles, descriptions, and tags in six languages with one click. Save channel, rig, and game presets to skip repetitive data entry. Works in the browser (GitHub Pages) or as a ~8 MB native desktop app (Tauri).
|
||||
|
||||
[](./LICENSE)
|
||||
[](./docs/DEVELOPMENT.md)
|
||||
[](https://github.com/poli0981/youtube-generator/releases)
|
||||
[](https://github.com/poli0981/youtube-generator/commits)
|
||||
|
||||
---
|
||||
|
||||
## What is YTDescGen
|
||||
|
||||
YTDescGen is a single-purpose template engine. It does **one** job: turn a small set of structured fields (video type, game name, genres, rig, social links, content warnings, …) into a publish-ready YouTube title + description + tag set.
|
||||
|
||||
It doesn't talk to the YouTube API. It doesn't upload anything. It doesn't track you. There is no server. State lives in your browser's `localStorage` (web) or your OS application-data directory (desktop) — and nowhere else.
|
||||
|
||||
Built for the gameplay no-commentary niche — especially horror / scary games — by someone running the [@SkullMute](https://www.youtube.com/@SkullMute) channel who got tired of pasting the same boilerplate into every video. Released under Apache 2.0 in case it's useful to anyone else.
|
||||
|
||||
## Features
|
||||
|
||||
- **14 video types** — Full Gameplay, Part, Boss Fight, Speedrun, 100%, DLC, and more
|
||||
- **12 languages** — English, Vietnamese, Japanese, Spanish, Korean, Chinese, and more
|
||||
- **25 game genres** — Action, Horror, RPG, FPS, Open World, Souls-like, and more
|
||||
- **Profile system** — Save social/rig/channel info once, reuse forever
|
||||
- **Game presets** — Save game info once, reuse for multi-part series
|
||||
- **Smart tags** — Auto-generated from genre + platform + quality + multilingual
|
||||
- **Character counters** — Real-time limits for title (100), description (5000), tags (500)
|
||||
- **Batch mode** — Generate descriptions for multiple parts at once
|
||||
- **Desktop app** — Windows & macOS via Tauri (~8MB binary)
|
||||
- **Offline** — Full functionality without internet
|
||||
- **20 video types** — Full Gameplay, Part, Boss Fight, Boss No-Hit, Ending, Speedrun, 100%, DLC, NG+, Challenge, Side Quest, Secret, Comparison, Guide, Mods, Collectibles, Livestream, Gacha Quest, Demo, Demo Part.
|
||||
- **6 UI languages** — English, Vietnamese, Japanese, Spanish, Korean, Chinese. *(VI authored by a native speaker; JA / ES / KO / ZH AI-translated — see [DISCLAIMER.md](./DISCLAIMER.md).)*
|
||||
- **40+ game genres** — across action, RPG, FPS, horror, soulslike, indie, simulation, fighting, and more.
|
||||
- **187 content-warning IDs** across 9 groups — spoilers, photosensitive, phobias, mental health, social phenomena, sensitive themes (incl. method-specific death/violence), horror-specific, playstyle, and gameplay disclosure (mods / cheats / glitches / guide-assisted). Sets viewer expectations before they hit play.
|
||||
- **Profile system** — save channel / social / rig info once, reuse across every video.
|
||||
- **Game presets** — save game name + store links once, reuse across the entire part series.
|
||||
- **Snapshot templates** — save full-form configurations and recall in one click.
|
||||
- **Smart tag generation** — combines genre pool, platform, quality tier, multilingual hooks, and trending terms; auto-dedup and 500-char-limit aware.
|
||||
- **Character counters** — real-time limits for title (100), description (5000), tags (500).
|
||||
- **Batch mode** — generate metadata for all parts of a series in one pass.
|
||||
- **Cross-post captions** — a dedicated **Social** tab re-packages the same YouTube source into short-form captions for **TikTok** (4,000-char), **Instagram Reels**, and **Facebook Reels** — title, rig, content warnings, copyright, thanks, and hashtags (game + genre + curated per-platform popular tags). Single + bulk modes, per-platform character limits with smart overflow trimming, and JSON import/export.
|
||||
- **Desktop app** — Windows, macOS & Linux native binaries via Tauri (~8 MB).
|
||||
- **Mobile-responsive web** — drawer navigation, touch-sized controls, iOS-safe text-input behavior. Tested down to 360 × 640.
|
||||
- **100% offline** — no server, no telemetry, no account. See [PRIVACY.md](./PRIVACY.md).
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Clone
|
||||
git clone https://github.com/poli0981/yt-desc-gen.git
|
||||
git clone https://github.com/poli0981/youtube-generator.git
|
||||
cd yt-desc-gen
|
||||
|
||||
# Install
|
||||
npm install
|
||||
|
||||
# Dev
|
||||
npm run dev
|
||||
|
||||
# Build
|
||||
npm run build
|
||||
npm run dev # web dev server at http://localhost:5173
|
||||
```
|
||||
|
||||
Desktop build (Windows / macOS / Linux):
|
||||
|
||||
```bash
|
||||
npm run tauri:build
|
||||
# Output: src-tauri/target/release/bundle/{msi,deb,dmg,app}
|
||||
```
|
||||
|
||||
Full development setup, IDE config, and troubleshooting: see [`docs/DEVELOPMENT.md`](./docs/DEVELOPMENT.md). Vietnamese version: [`docs/i18n/vi/DEVELOPMENT.md`](./docs/i18n/vi/DEVELOPMENT.md).
|
||||
|
||||
## Use Cases
|
||||
|
||||
- **Gameplay no-commentary channels** — the primary target. Default templates assume no voice-over and lean on visual hooks, music attribution, and timestamps.
|
||||
- **Horror / scary-game channels** — the content-warning system is especially deep here (analog horror, liminal spaces, pursuit / chase, entity / SCP-style, body horror, etc.).
|
||||
- **Demo / Early Access playthroughs** — dedicated video types and language-patch / game-version disclosure fields.
|
||||
- **Speedrunners and 100% completionists** — playstyle disclosures, run-type metadata, and difficulty fields.
|
||||
- **Solo creators tired of copy-paste** — profiles and presets exist specifically to eliminate repetitive data entry.
|
||||
|
||||
## Privacy & Offline-First
|
||||
|
||||
Nothing leaves your device. No analytics, no telemetry, no tracking. The web version stores your work in `localStorage`; the desktop version stores it in the OS application-data directory. Clearing site data (web) or uninstalling the app (desktop) wipes everything. Full details in [PRIVACY.md](./PRIVACY.md).
|
||||
|
||||
## Tech Stack
|
||||
|
||||
React 18 • TypeScript • Vite • Tailwind CSS • Zustand • i18next • Tauri 2
|
||||
React 18 · TypeScript (strict) · Vite 7 · Tailwind CSS 3 · Zustand · i18next · Tauri 2 (Rust stable).
|
||||
|
||||
Architecture overview: [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md).
|
||||
|
||||
## Documentation
|
||||
|
||||
| Document | Description |
|
||||
|----------|-------------|
|
||||
| [CLAUDE.md](./CLAUDE.md) | Claude Code instructions & project overview |
|
||||
| [PRD](./docs/PRD.md) | Product Requirements Document |
|
||||
| [Architecture](./docs/ARCHITECTURE.md) | Technical architecture & data flow |
|
||||
| [Features](./docs/FEATURES.md) | Complete feature list |
|
||||
| [Roadmap](./docs/ROADMAP.md) | Development phases & timeline |
|
||||
| [Tech Spec](./docs/TECH-SPEC.md) | Implementation details & configs |
|
||||
| [i18n Guide](./docs/I18N.md) | How to add new languages |
|
||||
| [Packaging](./docs/PACKAGING.md) | Desktop app build guide |
|
||||
| Document | What's in it |
|
||||
| --- | --- |
|
||||
| [Development Guide](./docs/DEVELOPMENT.md) | Toolchain, IDE setup, build commands, troubleshooting. *(Also: [Vietnamese](./docs/i18n/vi/DEVELOPMENT.md).)* |
|
||||
| [Architecture](./docs/ARCHITECTURE.md) | Layer model, data flow, engine design. |
|
||||
| [Features](./docs/FEATURES.md) | Full feature matrix. |
|
||||
| [Content Inventory](./docs/CONTENT-INVENTORY.md) | Every video type, genre, and content warning the editor surfaces. *(Also: [Vietnamese](./docs/i18n/vi/CONTENT-INVENTORY.md).)* |
|
||||
| [Roadmap](./docs/ROADMAP.md) | Development phases. |
|
||||
| [Tech Spec](./docs/TECH-SPEC.md) | Implementation details and configs. |
|
||||
| [i18n Guide](./docs/I18N.md) | Adding new locales. |
|
||||
| [Packaging](./docs/PACKAGING.md) | Tauri release builds and signing. |
|
||||
| [Contributing](./CONTRIBUTING.md) | PR process, commit conventions, auto-ignore rules. |
|
||||
| [Security](./SECURITY.md) | Reporting vulnerabilities. |
|
||||
| [Privacy](./PRIVACY.md) | Data handling (TL;DR: none). |
|
||||
| [Disclaimer](./DISCLAIMER.md) | AI-assistance and translation-quality disclosure. *(Also: [Vietnamese](./docs/i18n/vi/DISCLAIMER.md).)* |
|
||||
| [Terms of Use](./TERMS.md) | Acceptable use and license compliance. |
|
||||
| [Code of Conduct](./CODE_OF_CONDUCT.md) | Contributor Covenant v2.1. |
|
||||
| [Maintainers](./MAINTAINERS.md) | Who runs this. |
|
||||
| [Third-Party Notices](./THIRD_PARTY_NOTICES.md) | Dependency attribution. |
|
||||
| [Changelog](./CHANGELOG.md) | Per-release notes. |
|
||||
|
||||
## Contributing
|
||||
|
||||
PRs welcome — read [CONTRIBUTING.md](./CONTRIBUTING.md) first. Native-speaker corrections to AI-translated locales (JA / ES / KO / ZH) are especially appreciated.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
Licensed under the **[Apache License 2.0](./LICENSE)**. See [`NOTICE`](./NOTICE) for the copyright statement and [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md) for dependency licenses.
|
||||
|
||||
## AI Disclosure
|
||||
|
||||
This project was co-authored with **Anthropic's Claude Code (model 4.7 Opus, 1M-context variant)**. Source code, locale translations, documentation, and CI workflows were generated or edited with AI assistance, then reviewed by the human maintainer (`@poli0981`) before being committed. See [DISCLAIMER.md](./DISCLAIMER.md) for the full disclosure.
|
||||
|
||||
## Channel & Socials
|
||||
|
||||
Reference channel and maintainer links:
|
||||
|
||||
- **YouTube**: [@SkullMute](https://www.youtube.com/@SkullMute)
|
||||
- **X / Twitter**: [@SkullMute0011](https://x.com/SkullMute0011)
|
||||
- **Bluesky**: [skullmute0011.bsky.social](https://bsky.app/profile/skullmute0011.bsky.social)
|
||||
- **Mastodon**: [@skullmute1122@mastodon.social](https://mastodon.social/@skullmute1122)
|
||||
- **Discord** (project / repo): [join](https://discord.gg/2aNR3aVt)
|
||||
- **Discord** (gaming): [join](https://discord.gg/kDM9GMu5vm)
|
||||
- **Steam**: [profile](https://steamcommunity.com/profiles/76561199544666292/)
|
||||
- **Patreon / Ko-fi**: `skullmute`
|
||||
- **Telegram**: `@SkullMute0011` (bot: `@my_skull_bot`)
|
||||
- **Email** (security & private contact): `lopop05905@proton.me`
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Only the latest released version of YTDescGen receives security updates. This is a solo open-source project; there are no LTS branches.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | --------- |
|
||||
| 0.13.x | ✅ |
|
||||
| < 0.13 | ❌ |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please report security issues **privately**. Do not open a public issue.
|
||||
|
||||
**Preferred channels (in order):**
|
||||
|
||||
1. **GitHub Security Advisory** — open a draft advisory in this repository's `Security` tab.
|
||||
2. **Email** — `lopop05905@proton.me` with subject prefix `[SECURITY]`.
|
||||
|
||||
Include:
|
||||
|
||||
- A description of the issue and its potential impact.
|
||||
- Steps to reproduce, ideally a minimal proof-of-concept.
|
||||
- The affected version (`node -p "require('./package.json').version"`).
|
||||
- Whether the issue is already public.
|
||||
|
||||
## Response Timeline
|
||||
|
||||
- **Initial reply**: within 7 days.
|
||||
- **Triage + planned fix**: within 30 days for high-severity issues.
|
||||
- **Disclosure**: coordinated with the reporter after a fix ships, or at most 90 days from initial reply.
|
||||
|
||||
## Scope
|
||||
|
||||
In scope:
|
||||
|
||||
- The web bundle deployed to GitHub Pages.
|
||||
- The Tauri desktop binaries (Windows, macOS, Linux).
|
||||
- CI/CD workflows in `.github/workflows/`.
|
||||
|
||||
Out of scope:
|
||||
|
||||
- Vulnerabilities in third-party dependencies — report those upstream and we'll bump.
|
||||
- Issues requiring physical access to the user's device.
|
||||
- Self-XSS in user-supplied template content (the app deliberately renders user input as plain text in the preview).
|
||||
|
||||
## No Bounty
|
||||
|
||||
This is a solo open-source project. Credit in release notes and a thank-you in `MAINTAINERS.md` is the only reward we can offer.
|
||||
@@ -0,0 +1,67 @@
|
||||
# Terms of Use
|
||||
|
||||
**Effective:** 2026-05-14
|
||||
|
||||
These terms govern your use of YTDescGen — both the web version hosted at the project's GitHub Pages URL and any Tauri desktop binaries distributed under this project.
|
||||
|
||||
## License
|
||||
|
||||
YTDescGen is licensed under the **[Apache License 2.0](./LICENSE)**. You may use, modify, and redistribute it under those terms.
|
||||
|
||||
Apache 2.0 grants a patent license (Section 3) and an irrevocable copyright license (Section 2). It does **not** grant trademark rights — see Section 6 of the LICENSE.
|
||||
|
||||
## Acceptable Use
|
||||
|
||||
You may use YTDescGen for any lawful purpose. You may **not** use it to:
|
||||
|
||||
- Generate content that harasses, threatens, defames, or incites violence against any person or group.
|
||||
- Generate content intended to mislead or impersonate (faked attribution, false sponsor disclosure, deepfake-adjacent metadata).
|
||||
- Generate content that violates any third party's intellectual-property rights (including misleading copyright or licensing claims in descriptions).
|
||||
- Distribute modified versions of YTDescGen in a way that violates Apache-2.0 — e.g. stripping copyright notices, omitting the NOTICE file, falsely indicating endorsement.
|
||||
- Violate applicable law in your jurisdiction, including but not limited to **GDPR** (EU), **CCPA / CPRA** (California), **PIPL** (China), **LGPD** (Brazil), the **Vietnamese Cybersecurity Law**, or equivalent data-protection / cybercrime regulation in your country.
|
||||
- Bypass YouTube's policies on metadata (misleading thumbnails / titles / tags) using the application.
|
||||
|
||||
## GitHub Terms
|
||||
|
||||
If you use the web version hosted on GitHub Pages, your use is also subject to:
|
||||
|
||||
- [GitHub's Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service)
|
||||
- [GitHub's Acceptable Use Policies](https://docs.github.com/en/site-policy/acceptable-use-policies)
|
||||
|
||||
These apply alongside this document; in case of conflict, GitHub's policies govern the hosted artifact.
|
||||
|
||||
## No Warranty
|
||||
|
||||
See [DISCLAIMER.md](./DISCLAIMER.md) and `LICENSE` §§ 7–8. The software is provided **as-is** with no warranty of any kind, express or implied.
|
||||
|
||||
## Generated Content
|
||||
|
||||
YTDescGen produces text intended to be pasted into YouTube descriptions. **You — the operator pasting that text — are solely responsible for**:
|
||||
|
||||
- Confirming the generated description complies with [YouTube's Community Guidelines](https://www.youtube.com/howyoutubeworks/policies/community-guidelines/) and [YouTube's Terms of Service](https://www.youtube.com/static?template=terms).
|
||||
- Disclosing paid promotions, sponsorships, and any AI-generated portions per YouTube's monetization and disclosure rules.
|
||||
- Not including misleading information, copyright-infringing material, or any prohibited content listed in YouTube's policies.
|
||||
- Truthful representation of run-type, difficulty, blind status, mod / cheat usage, and similar disclosures the application optionally exposes.
|
||||
|
||||
## Contributions
|
||||
|
||||
By submitting a contribution (issue, pull request, comment, locale translation, screenshot, log dump), you agree:
|
||||
|
||||
1. Your contribution is licensed under Apache 2.0, the same as the project.
|
||||
2. You have the right to grant that license (you wrote it, or it's compatibly licensed and credited).
|
||||
3. You will not include malicious code or knowingly vulnerable dependencies.
|
||||
4. You will follow the [Code of Conduct](./CODE_OF_CONDUCT.md) and [Contributing Guide](./CONTRIBUTING.md).
|
||||
|
||||
Violations may result in your contribution being closed and, in severe cases, a permanent ban from the repository — see `CONTRIBUTING.md` § "Auto-ignored Contributions".
|
||||
|
||||
## Termination
|
||||
|
||||
These terms remain in effect for as long as you use the software. Your rights under Apache 2.0 are perpetual subject to that license's termination clauses (notably § 3 patent retaliation).
|
||||
|
||||
## Changes
|
||||
|
||||
Updates to these terms are committed under `TERMS.md` with the `Effective` date updated. Continued use of the software after a change constitutes acceptance.
|
||||
|
||||
## Contact
|
||||
|
||||
`lopop05905@proton.me`
|
||||
@@ -0,0 +1,79 @@
|
||||
# Third-Party Notices
|
||||
|
||||
YTDescGen incorporates the following third-party software. Each dependency retains its own license; consult the linked project page for the full text of each license.
|
||||
|
||||
## Runtime Dependencies (web bundle)
|
||||
|
||||
| Package | Version | License | Project |
|
||||
| --- | --- | --- | --- |
|
||||
| `react` | ^18.3.0 | MIT | <https://github.com/facebook/react> |
|
||||
| `react-dom` | ^18.3.0 | MIT | <https://github.com/facebook/react> |
|
||||
| `react-router-dom` | ^6.26.0 | MIT | <https://github.com/remix-run/react-router> |
|
||||
| `react-i18next` | ^15.0.0 | MIT | <https://github.com/i18next/react-i18next> |
|
||||
| `i18next` | ^23.15.0 | MIT | <https://github.com/i18next/i18next> |
|
||||
| `zustand` | ^4.5.0 | MIT | <https://github.com/pmndrs/zustand> |
|
||||
| `react-hot-toast` | ^2.4.0 | MIT | <https://github.com/timolins/react-hot-toast> |
|
||||
| `lucide-react` | ^0.400.0 | ISC | <https://github.com/lucide-icons/lucide> |
|
||||
| `clsx` | ^2.1.0 | MIT | <https://github.com/lukeed/clsx> |
|
||||
| `@tauri-apps/api` | ^2.11.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
|
||||
| `@tauri-apps/plugin-dialog` | ^2.0.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
| `@tauri-apps/plugin-fs` | ^2.0.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
| `@tauri-apps/plugin-opener` | ^2.0.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
| `@tauri-apps/plugin-shell` | ^2.0.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
|
||||
## Build / Dev Dependencies
|
||||
|
||||
| Package | Version | License | Project |
|
||||
| --- | --- | --- | --- |
|
||||
| `vite` | ^7.3.3 | MIT | <https://github.com/vitejs/vite> |
|
||||
| `@vitejs/plugin-react` | ^4.3.0 | MIT | <https://github.com/vitejs/vite-plugin-react> |
|
||||
| `typescript` | ^5.5.0 | Apache-2.0 | <https://github.com/microsoft/TypeScript> |
|
||||
| `tsx` | ^4.16.0 | MIT | <https://github.com/privatenumber/tsx> |
|
||||
| `tailwindcss` | ^3.4.0 | MIT | <https://github.com/tailwindlabs/tailwindcss> |
|
||||
| `prettier-plugin-tailwindcss` | ^0.6.0 | MIT | <https://github.com/tailwindlabs/prettier-plugin-tailwindcss> |
|
||||
| `postcss` | ^8.5.14 | MIT | <https://github.com/postcss/postcss> |
|
||||
| `autoprefixer` | ^10.4.0 | MIT | <https://github.com/postcss/autoprefixer> |
|
||||
| `eslint` | ^9.0.0 | MIT | <https://github.com/eslint/eslint> |
|
||||
| `@eslint/js` | ^9.0.0 | MIT | <https://github.com/eslint/eslint> |
|
||||
| `eslint-plugin-react-hooks` | ^5.0.0 | MIT | <https://github.com/facebook/react> |
|
||||
| `typescript-eslint` | ^8.0.0 | MIT | <https://github.com/typescript-eslint/typescript-eslint> |
|
||||
| `prettier` | ^3.3.0 | MIT | <https://github.com/prettier/prettier> |
|
||||
| `vitest` | ^3.2.4 | MIT | <https://github.com/vitest-dev/vitest> |
|
||||
| `@testing-library/react` | ^16.0.0 | MIT | <https://github.com/testing-library/react-testing-library> |
|
||||
| `@testing-library/jest-dom` | ^6.4.0 | MIT | <https://github.com/testing-library/jest-dom> |
|
||||
| `@types/react` | ^18.3.0 | MIT | DefinitelyTyped |
|
||||
| `@types/react-dom` | ^18.3.0 | MIT | DefinitelyTyped |
|
||||
|
||||
## Tauri Desktop (Rust crates)
|
||||
|
||||
| Crate | Version | License | Project |
|
||||
| --- | --- | --- | --- |
|
||||
| `tauri` | ^2 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
|
||||
| `tauri-build` | ^2 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
|
||||
| `tauri-plugin-dialog` | ^2 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
| `tauri-plugin-fs` | ^2 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
| `tauri-plugin-opener` | ^2 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
| `tauri-plugin-shell` | ^2 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
| `tauri-plugin-single-instance` | ^2 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
| `serde` | ^1 | Apache-2.0 OR MIT | <https://github.com/serde-rs/serde> |
|
||||
| `serde_json` | ^1 | Apache-2.0 OR MIT | <https://github.com/serde-rs/json> |
|
||||
|
||||
Transitive dependencies are not enumerated here. `cargo tree` (in `src-tauri/`) and `npm list --all` produce the exhaustive trees; this list covers the direct dependencies declared in `package.json` and `src-tauri/Cargo.toml`.
|
||||
|
||||
## Fonts & Icons
|
||||
|
||||
The application uses **system fonts** (`Inter` / `SF Pro` / `Segoe UI` / `Roboto`, fallback `sans-serif`). No custom font files are bundled in the web build.
|
||||
|
||||
Icons are provided by [`lucide-react`](https://github.com/lucide-icons/lucide) (ISC license — see above).
|
||||
|
||||
## AI-Assisted Development Disclosure
|
||||
|
||||
Per [`DISCLAIMER.md`](./DISCLAIMER.md), this project was co-authored with **Anthropic's Claude Code (model 4.7 Opus, 1M-context variant)**. The model contributed to source code, locale translations, documentation, and CI configuration. All output was reviewed by the human maintainer (`@poli0981`) before being committed.
|
||||
|
||||
No third-party content was reproduced verbatim from the model's training data. Any external text quoted in this repository (notably the Apache License 2.0 in [`LICENSE`](./LICENSE) and the Contributor Covenant link in [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md)) is sourced from canonical public locations.
|
||||
|
||||
Claude is a product of Anthropic, PBC — <https://www.anthropic.com>. No license is granted by Anthropic to use this project; the Apache 2.0 license in `LICENSE` is granted by `@poli0981` as the project author.
|
||||
|
||||
## Reporting an Omission
|
||||
|
||||
If you believe a dependency is missing from this list, please open an issue or PR per [`CONTRIBUTING.md`](./CONTRIBUTING.md).
|
||||
@@ -0,0 +1,149 @@
|
||||
# Content Inventory
|
||||
|
||||
A static manifest of every video type, game genre, and content warning surfaced in YTDescGen's editor. Maintained manually — when adding a new option to one of the source files below, **add a row here too** in the same PR.
|
||||
|
||||
This file exists for **transparency** — anyone curious about what the editor can describe (without installing the app or reading the source) can scan it in one minute.
|
||||
|
||||
**Vietnamese mirror:** [`docs/i18n/vi/CONTENT-INVENTORY.md`](./i18n/vi/CONTENT-INVENTORY.md).
|
||||
|
||||
**Source of truth:**
|
||||
- Video types: [`src/config/video-types.ts`](../src/config/video-types.ts)
|
||||
- Game genres: [`src/config/genres.ts`](../src/config/genres.ts)
|
||||
- Content warnings: [`src/config/content-warning-groups.ts`](../src/config/content-warning-groups.ts)
|
||||
|
||||
---
|
||||
|
||||
## 1. Video types (20)
|
||||
|
||||
Each video type drives a dedicated description template + title structure + tag bias. The "Extra fields" column lists fields the editor reveals when this type is selected.
|
||||
|
||||
| Icon | Type | Extra fields |
|
||||
|---|---|---|
|
||||
| 🎮 | Full Gameplay | — |
|
||||
| 📂 | Gameplay Part | Part Number |
|
||||
| 🎬 | Full Demo | — |
|
||||
| 🎞 | Demo Part | Part Number |
|
||||
| 👹 | Boss Fight | Boss Name |
|
||||
| 💀 | Boss No Hit | Boss Name |
|
||||
| 🏁 | Ending / All Endings | — |
|
||||
| ⚡ | Speedrun | — |
|
||||
| 💯 | 100% Completion | — |
|
||||
| 📦 | DLC Content | DLC Name |
|
||||
| 🔄 | New Game+ | — |
|
||||
| 🏆 | Challenge Run | Challenge Name |
|
||||
| 📌 | Side Quests | — |
|
||||
| 🔍 | Secrets / Hidden | — |
|
||||
| ⚖️ | Graphics Comparison | — |
|
||||
| 📘 | Silent Guide | — |
|
||||
| 🧩 | Modded Gameplay | Mod Name |
|
||||
| ⭐ | All Collectibles | — |
|
||||
| 🔴 | Livestream | Live URL, Scheduled Time |
|
||||
| 🎴 | Gacha Quest | Quest Type, Chapter Name, Quest Name, Part Number |
|
||||
|
||||
---
|
||||
|
||||
## 2. Game genres (41)
|
||||
|
||||
Selected genres feed the title format, the tag pool, and (when configured in Settings → Genre Playlists) the pinned-comment recommendation.
|
||||
|
||||
Bulk-select groups available in the editor: **All RPGs** (rpg + jrpg + action_rpg + crpg), **All Shooters** (fps + arena_shooter + tactical_fps + boomer_shooter + extraction_shooter + shmup), **All Horror** (horror + survival_horror + psychological_horror).
|
||||
|
||||
| Icon | Genre |
|
||||
|---|---|
|
||||
| ⚔️ | Action / Adventure |
|
||||
| 🗡 | Hack & Slash |
|
||||
| 👊 | Beat 'em Up |
|
||||
| 🦘 | Platformer |
|
||||
| 👻 | Horror / Survival |
|
||||
| 🧟 | Survival Horror |
|
||||
| 🧠 | Psychological Horror |
|
||||
| 🛡 | RPG |
|
||||
| 🎎 | JRPG |
|
||||
| 🏹 | Action RPG |
|
||||
| 📜 | CRPG / Isometric |
|
||||
| 🔫 | FPS / Shooter |
|
||||
| 🎯 | Arena Shooter |
|
||||
| 🎖 | Tactical FPS |
|
||||
| 💥 | Boomer Shooter |
|
||||
| 🎒 | Extraction Shooter |
|
||||
| 🛸 | SHMUP / Bullet Hell |
|
||||
| 🌍 | Open World / Sandbox |
|
||||
| 🕹 | Indie |
|
||||
| 💀 | Souls-like |
|
||||
| 🏎 | Racing / Sports |
|
||||
| 📖 | Story / Narrative |
|
||||
| 🏗 | Simulation / Strategy |
|
||||
| 🏙 | City Builder |
|
||||
| 🥊 | Fighting |
|
||||
| 🥷 | Stealth / Espionage |
|
||||
| ⛏ | Survival / Crafting |
|
||||
| 🎲 | Roguelike / Roguelite |
|
||||
| 🗺 | Metroidvania |
|
||||
| 🌐 | MMO / Online |
|
||||
| 🎵 | Rhythm / Music |
|
||||
| 🧩 | Puzzle |
|
||||
| 🏰 | Tower Defense |
|
||||
| 🃏 | Card Game |
|
||||
| 🎴 | Deck Builder |
|
||||
| 🤖 | Auto Battler |
|
||||
| 🏆 | Battle Royale |
|
||||
| ♟ | Tactical / Turn-based |
|
||||
| 🚀 | Space / Sci-Fi |
|
||||
| 🌾 | Farming / Life Sim |
|
||||
| 🎬 | FMV / Interactive Movie |
|
||||
| 💬 | Visual Novel |
|
||||
|
||||
---
|
||||
|
||||
## 3. Content warnings (187, grouped)
|
||||
|
||||
Selected warnings are appended to a `⚠ CONTENT WARNINGS` block in the description, ahead of timestamps. Each group is collapsible in the editor; warnings render in description order = user's selection order.
|
||||
|
||||
### Spoilers (6)
|
||||
|
||||
Story / ending spoilers · Ending spoilers · True-ending spoilers · Post-game / NG+ spoilers · Secret-ending spoilers · DLC story spoilers
|
||||
|
||||
### Photosensitive / Health (6)
|
||||
|
||||
Flashing lights · Motion sickness · Migraine trigger · Loud / sudden sounds · Strobe lighting · Heavy screen shake
|
||||
|
||||
### Phobias (51)
|
||||
|
||||
Jumpscares · Heights (acrophobia) · Holes / clusters (trypophobia) · Deep water (thalassophobia) · Confined spaces (claustrophobia) · Spiders (arachnophobia) · Insects (entomophobia) · Snakes (ophidiophobia) · Dogs (cynophobia) · Darkness (nyctophobia) · Fire (pyrophobia) · Dolls (pediophobia) · Blood (hemophobia) · Clowns (coulrophobia) · Drowning / water immersion (ablutophobia) · Live burial (taphophobia) · Animatronics / mannequins (automatonophobia) · Large objects (megalophobia) · Submerged man-made objects (submechanophobia) · Corpses (necrophobia) · Ghosts (spectrophobia) · Demons (demonophobia) · Sharks (selachophobia) · Germs / contamination (mysophobia) · Vomiting (emetophobia) · Being watched (scopophobia) · Isolation (monophobia) · Mice / rats (musophobia) · Bats (chiroptophobia) · Birds (ornithophobia) · Fish (ichthyophobia) · Reptiles (herpetophobia) · Cockroaches (katsaridaphobia) · Bees / wasps (apiphobia) · Thunder / lightning (astraphobia) · Open spaces (agoraphobia) · Crowds (enochlophobia) · Snow / extreme cold (chionophobia) · Hospitals (nosocomephobia) · Sharp objects (aichmophobia) · Choking / suffocation (pnigophobia) · Fog / mist (homichlophobia) · Tornadoes / hurricanes (lilapsophobia) · Heavy rain (ombrophobia) · Clouds (nephophobia) · Strong wind (ancraophobia) · Extreme cold (cryophobia) · Sunlight (heliophobia) · Large waves (cymophobia) · Lakes / still water (limnophobia) · Rivers / currents (potamophobia)
|
||||
|
||||
### Mental health (17)
|
||||
|
||||
Anxiety-inducing scenes · Depression themes · Eating disorders · Substance use · Self-harm / suicide · PTSD content · Needles · Body fluids · Pregnancy / birth horror · Illness / infection · Bipolar themes · OCD themes · Panic attacks · Dissociation · Paranoia · Intrusive thoughts · Medical horror
|
||||
|
||||
### Social phenomena (20)
|
||||
|
||||
Autism / neurodivergence themes · ADHD / executive dysfunction · Hikikomori / social withdrawal · NEET themes · Social anxiety themes · Social isolation / loneliness · Schizophrenia / psychosis · Burnout / overwork · Survivor guilt · Abandonment themes · Parasocial relationships · Gaslighting · Stockholm syndrome · Gaming / gambling addiction · Existential / nihilistic themes · Impostor syndrome · Midlife crisis · Quarter-life crisis · Workplace harassment · Gender-role pressure
|
||||
|
||||
### Mature / Sensitive content (61)
|
||||
|
||||
Blood and gore · Mature 18+ · Disturbing imagery · Animal cruelty · Violence against minors · Domestic violence · Sexual assault references · Torture · Religious themes · War violence · Discrimination · State / police violence · Smoking / drinking · Detailed killing · Cult / occult · Psychological manipulation · Loss / grief · Kidnapping · Hate speech · Historical atrocities · Slavery themes · Terrorism themes · Bullying themes · Human experimentation · Cannibalism · Nuclear / radiation · Homophobia / anti-LGBTQ+ · Transphobia / anti-trans · Xenophobia / anti-foreigner · Political extremism · Religious extremism / fundamentalism · Genocide / ethnic cleansing · Holy war / sectarian conflict · Holocaust themes · Civil war · Mass / school shootings · Colonialism / imperialism · State propaganda · Surveillance / dystopian state · Conspiracy theories · Censorship themes · Ethnic / racial conflict · Refugee crisis · Revolution / uprising · Political assassination · Coup d'état · Inquisition / religious persecution · Forced labor · Ultranationalism · Hanging / strangulation · Drowning scene · Burning alive / immolation · Asphyxiation / suffocation · Bound / restrained victim · Public execution · Decapitation · Impalement · Mass-casualty event · Vehicular violence · Overdose scene · Falling from height (intentional)
|
||||
|
||||
### Heavy horror (12)
|
||||
|
||||
Eyes / eyeball clusters · Body horror (flesh distortion) · Distorted / mutilated faces · Cosmic / eldritch horror · Extreme gore / dismemberment · Decay, rot, maggots · Mutilation / amputation · Liminal spaces · Analog horror / VHS · Unreality / distortion · Pursuit / chase · Entity / SCP horror
|
||||
|
||||
### Playstyle disclosures (10)
|
||||
|
||||
Blind playthrough · No spoilers in chat · Casual / story mode · Hardcore / max difficulty · Permadeath / Iron Man · Speedrun attempt · 100% completionist · Still learning mechanics · First time playing · Returning / NG+
|
||||
|
||||
### Gameplay disclosure (4)
|
||||
|
||||
Mods used · Cheats / debug · Glitches used · Guide-assisted
|
||||
|
||||
---
|
||||
|
||||
## 4. Maintenance
|
||||
|
||||
When adding a new item to any of the source files:
|
||||
|
||||
1. **Video types** → append to [`src/config/video-types.ts`](../src/config/video-types.ts) AND add a row in section 1 above.
|
||||
2. **Genres** → append to [`src/config/genres.ts`](../src/config/genres.ts) AND add a row in section 2.
|
||||
3. **Content warnings** → append to the relevant group in [`src/config/content-warning-groups.ts`](../src/config/content-warning-groups.ts) AND add the label to the right group in section 3 — keep the group count in the heading accurate.
|
||||
4. Update the Vietnamese mirror at [`docs/i18n/vi/CONTENT-INVENTORY.md`](./i18n/vi/CONTENT-INVENTORY.md) in the same PR.
|
||||
|
||||
Mismatch between this file and the source files is treated as a documentation bug — open an issue or PR.
|
||||
@@ -0,0 +1,143 @@
|
||||
# Development Guide
|
||||
|
||||
This guide covers setting up YTDescGen for local development on Windows, macOS, or Linux. The application is a Vite/React web app with an optional Tauri desktop shell.
|
||||
|
||||
## Reference Workstation
|
||||
|
||||
The reference workstation used to develop and ship this project:
|
||||
|
||||
| Component | Spec |
|
||||
| --- | --- |
|
||||
| OS | Windows 11 Pro (24H2 or newer) |
|
||||
| CPU | Modern x86-64 — 6+ cores with AVX2 (Intel 11th-gen / AMD Zen 3 or newer) |
|
||||
| GPU | Discrete or integrated — Tauri's WebView2 backend runs fine on iGPU |
|
||||
| RAM | 16 GB minimum, 32 GB recommended for parallel typecheck + dev server |
|
||||
| Storage | 5 GB free for `node_modules` + Cargo `target/` after a full Tauri build |
|
||||
| Display | 1920×1080 minimum; mobile-responsive layout tested down to 360×640 |
|
||||
|
||||
macOS and Linux work for development. Tauri release builds are cross-compiled or run on dedicated CI runners — see [PACKAGING.md](./PACKAGING.md).
|
||||
|
||||
## Toolchain
|
||||
|
||||
Install in this order:
|
||||
|
||||
| Tool | Version | Why |
|
||||
| --- | --- | --- |
|
||||
| **Node.js** | `>= 22.0.0` | Vite 7 dropped support for older Node. Use [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm). |
|
||||
| **npm** | bundled with Node 22 | The project uses npm; `pnpm` and `yarn` are not tested. |
|
||||
| **Rust** | stable, `>= 1.78` | Required for the Tauri desktop build. Install via [rustup](https://rustup.rs/). |
|
||||
| **Python** | `3.12` | Optional — only needed for some Tauri platform tooling on Windows. |
|
||||
| **Tauri prerequisites** | per OS | See <https://v2.tauri.app/start/prerequisites/>. |
|
||||
|
||||
### Windows specifics
|
||||
|
||||
- Install **Visual Studio Build Tools 2022** with the "Desktop development with C++" workload (required by `tauri-build`).
|
||||
- Install the **WebView2 Runtime** (usually pre-installed on Windows 11).
|
||||
- Long path support: `git config --global core.longpaths true`.
|
||||
|
||||
### macOS specifics
|
||||
|
||||
- Install Xcode Command Line Tools: `xcode-select --install`.
|
||||
|
||||
### Linux specifics
|
||||
|
||||
- Install per-distro Tauri prerequisites — `libwebkit2gtk-4.1-dev`, `libappindicator3-dev`, etc. See the Tauri docs linked above.
|
||||
|
||||
## IDE Setup
|
||||
|
||||
The reference workflow uses **JetBrains 2026.x** IDEs (WebStorm or RustRover) as primary, with **VS Code** for quick edits.
|
||||
|
||||
### JetBrains (WebStorm / RustRover / IntelliJ Ultimate)
|
||||
|
||||
- Enable the **Tailwind CSS** plugin.
|
||||
- Enable the **i18next** plugin (or rely on `src/i18n/locales/_schema.json` for autocomplete).
|
||||
- Settings → Languages → TypeScript → "Use TypeScript from `node_modules/typescript`".
|
||||
- Settings → Code Style → Prettier → Run on save (`src/**/*.{ts,tsx,json,css}`).
|
||||
|
||||
### VS Code
|
||||
|
||||
Recommended extensions (no `.vscode/extensions.json` is committed — install manually):
|
||||
|
||||
- `dbaeumer.vscode-eslint`
|
||||
- `esbenp.prettier-vscode`
|
||||
- `bradlc.vscode-tailwindcss`
|
||||
- `rust-lang.rust-analyzer` (if you touch `src-tauri/`)
|
||||
- `tauri-apps.tauri-vscode`
|
||||
|
||||
## First Run
|
||||
|
||||
```bash
|
||||
# 1. Clone
|
||||
git clone https://github.com/poli0981/youtube-generator.git
|
||||
cd youtube-generator
|
||||
|
||||
# 2. Install web dependencies
|
||||
npm install
|
||||
|
||||
# 3. Start the web dev server
|
||||
npm run dev
|
||||
# → http://localhost:5173
|
||||
```
|
||||
|
||||
## Common Commands
|
||||
|
||||
| Command | What it does |
|
||||
| --- | --- |
|
||||
| `npm run dev` | Vite dev server, hot reload, web only. |
|
||||
| `npm run build` | Production web bundle into `dist/`. |
|
||||
| `npm run preview` | Serve the production bundle for sanity-testing. |
|
||||
| `npm run typecheck` | `tsc --noEmit`. Run before every PR. |
|
||||
| `npm run lint` | ESLint. Use `npm run lint:fix` to autofix. |
|
||||
| `npm run format` | Prettier write across `src/`. |
|
||||
| `npm run test` | Vitest watch mode. |
|
||||
| `npm run test:run` | Vitest single-run (for CI / pre-commit). |
|
||||
| `npm run test:coverage` | Coverage report into `coverage/`. |
|
||||
| `npm run validate:locales` | Enforces all 6 locales match `_schema.json` exactly. **Must pass before any locale-touching PR merges.** |
|
||||
| `npm run generate:locale` | Scaffold an empty locale from `_schema.json` for a new language. |
|
||||
| `npm run tauri:dev` | Tauri desktop in dev mode (auto-restarts on Rust or frontend changes). |
|
||||
| `npm run tauri:build` | Tauri release binary for the current platform. |
|
||||
|
||||
## Tauri Desktop Build
|
||||
|
||||
See [PACKAGING.md](./PACKAGING.md) for the full release pipeline. Quick local build:
|
||||
|
||||
```bash
|
||||
npm run tauri:build
|
||||
# Output: src-tauri/target/release/bundle/{msi,deb,dmg,app}
|
||||
```
|
||||
|
||||
The first build takes ~5–10 minutes (cold Cargo cache). Subsequent builds are incremental.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### `validate:locales` fails after adding a key
|
||||
|
||||
You forgot to update `src/i18n/locales/_schema.json`. The schema is the source of truth; locales must match it exactly.
|
||||
|
||||
### Tauri build fails with `link.exe not found` (Windows)
|
||||
|
||||
Install Visual Studio Build Tools 2022 + Desktop C++ workload, then restart your shell so the new PATH is picked up.
|
||||
|
||||
### Tauri build fails with `pkg-config not found` (Linux)
|
||||
|
||||
Install the per-distro Tauri prerequisites listed at <https://v2.tauri.app/start/prerequisites/>.
|
||||
|
||||
### `npm install` is slow or hangs
|
||||
|
||||
Disable corporate VPNs / proxies that block the npm registry. The lock file is committed; offline installs work after one successful online install.
|
||||
|
||||
### Hot reload not picking up locale edits
|
||||
|
||||
Locale JSON is bundled at build time, not watched. Restart the dev server after editing `src/i18n/locales/*`.
|
||||
|
||||
### Pre-commit hook fails on `validate:locales` but I didn't touch locales
|
||||
|
||||
You probably added a new key to `_schema.json` indirectly via the engine types (`src/engine/types.ts` → `CONTENT_WARNINGS`). New IDs require translations in all 6 locales.
|
||||
|
||||
## See Also
|
||||
|
||||
- [ARCHITECTURE.md](./ARCHITECTURE.md) — layer model, data flow, engine design.
|
||||
- [I18N.md](./I18N.md) — adding new languages step-by-step.
|
||||
- [PACKAGING.md](./PACKAGING.md) — Tauri release builds and signing.
|
||||
- [Top-level CONTRIBUTING.md](../CONTRIBUTING.md) — PR process, commit conventions, auto-ignore rules.
|
||||
- [Top-level SECURITY.md](../SECURITY.md) — reporting vulnerabilities.
|
||||
+51
-66
@@ -4,84 +4,40 @@
|
||||
|
||||
---
|
||||
|
||||
## 🎬 Video Types (14 types)
|
||||
## 🎬 Video Types (20 types)
|
||||
|
||||
| ID | Label (EN) | Label (VI) | Label (JA) | Extra Fields |
|
||||
|----|-----------|------------|------------|--------------|
|
||||
| `full` | Full Gameplay | Full Gameplay | フルゲームプレイ | — |
|
||||
| `part` | Gameplay Part | Gameplay Phần | ゲームプレイ パート | `partNumber` |
|
||||
| `boss` | Boss Fight | Boss Fight | ボス戦 | `bossName` |
|
||||
| `boss_nohit` | Boss No Hit | Boss No Hit | ボス ノーヒット | `bossName` |
|
||||
| `ending` | Ending / All Endings | Kết thúc | エンディング | — |
|
||||
| `speedrun` | Speedrun | Speedrun | スピードラン | — |
|
||||
| `100percent` | 100% Completion | 100% Completion | 100%クリア | — |
|
||||
| `dlc` | DLC Content | Nội dung DLC | DLCコンテンツ | `dlcName` |
|
||||
| `newgame_plus` | New Game+ | New Game+ | 強くてニューゲーム | — |
|
||||
| `challenge` | Challenge Run | Challenge Run | チャレンジラン | `challengeName` |
|
||||
| `side_quest` | Side Quests | Nhiệm vụ phụ | サブクエスト | — |
|
||||
| `secret` | Secrets / Hidden | Bí mật | 隠し要素 | — |
|
||||
| `comparison` | Graphics Comparison | So sánh đồ họa | グラフィック比較 | — |
|
||||
| `guide` | Silent Guide | Hướng dẫn | 攻略ガイド | — |
|
||||
Twenty video types, each driving a dedicated description template, title
|
||||
structure, and tag bias. The complete table — every type with its icon and
|
||||
the extra fields the editor reveals — is in
|
||||
[Content Inventory](./CONTENT-INVENTORY.md).
|
||||
|
||||
## 🌐 Languages (12 languages)
|
||||
## 🌐 Languages (6 shipped)
|
||||
|
||||
All six locales ship today — UI strings and description templates fully
|
||||
translated and parity-validated by `npm run validate:locales`.
|
||||
|
||||
### Launch (Phase 1)
|
||||
| Code | Language | Native Name | Status |
|
||||
|------|----------|-------------|--------|
|
||||
| `en` | English | English | ✅ Ready |
|
||||
| `vi` | Vietnamese | Tiếng Việt | ✅ Ready |
|
||||
| `ja` | Japanese | 日本語 | ✅ Ready |
|
||||
| `en` | English | English | ✅ Shipped |
|
||||
| `vi` | Vietnamese | Tiếng Việt | ✅ Shipped |
|
||||
| `ja` | Japanese | 日本語 | ✅ Shipped |
|
||||
| `es` | Spanish | Español | ✅ Shipped |
|
||||
| `ko` | Korean | 한국어 | ✅ Shipped |
|
||||
| `zh` | Chinese (Simplified) | 简体中文 | ✅ Shipped |
|
||||
|
||||
### Phase 2
|
||||
| Code | Language | Native Name |
|
||||
|------|----------|-------------|
|
||||
| `es` | Spanish | Español |
|
||||
| `ko` | Korean | 한국어 |
|
||||
| `zh` | Chinese (Simplified) | 简体中文 |
|
||||
|
||||
### Phase 3+
|
||||
| Code | Language | Native Name |
|
||||
|------|----------|-------------|
|
||||
| `fr` | French | Français |
|
||||
| `de` | German | Deutsch |
|
||||
| `pt` | Portuguese | Português |
|
||||
| `ru` | Russian | Русский |
|
||||
| `th` | Thai | ภาษาไทย |
|
||||
| `ar` | Arabic | العربية |
|
||||
Further locales (French, German, Portuguese, Russian, Thai, Arabic) are
|
||||
tracked in [Roadmap § 5.3](./ROADMAP.md).
|
||||
|
||||
Each language requires:
|
||||
- `ui.json` — UI labels, buttons, placeholders, error messages
|
||||
- `templates.json` — Title patterns, description sections, CTA text
|
||||
|
||||
## 🎮 Game Genres (25 genres)
|
||||
## 🎮 Game Genres (41 genres)
|
||||
|
||||
| ID | Label | Icon | Tag Keywords (sample) |
|
||||
|----|-------|------|-----------------------|
|
||||
| `action` | Action / Adventure | ⚔️ | action game, hack and slash, action adventure |
|
||||
| `horror` | Horror / Survival | 👻 | horror game, survival horror, scary game, psychological horror |
|
||||
| `rpg` | RPG / JRPG | 🛡 | RPG, JRPG, action RPG, turn based RPG |
|
||||
| `fps` | FPS / Shooter | 🔫 | FPS, shooter, tactical shooter, third person shooter |
|
||||
| `openworld` | Open World / Sandbox | 🌍 | open world, sandbox, free roam, exploration |
|
||||
| `indie` | Indie / Platformer | 🕹 | indie game, platformer, pixel art |
|
||||
| `soulslike` | Souls-like | 💀 | souls like, soulsborne, boss fight, no death run |
|
||||
| `racing` | Racing / Sports | 🏎 | racing game, driving sim, sports game |
|
||||
| `story` | Story / Visual Novel | 📖 | story game, visual novel, narrative game, interactive drama |
|
||||
| `simulation` | Simulation / Strategy | 🏗 | simulation, city builder, management, tycoon |
|
||||
| `fighting` | Fighting | 🥊 | fighting game, combo, versus, arcade |
|
||||
| `stealth` | Stealth / Espionage | 🥷 | stealth game, stealth gameplay, infiltration |
|
||||
| `survival_craft` | Survival / Crafting | 🏕 | survival game, crafting, base building |
|
||||
| `mmo` | MMO / Online | 🌐 | MMO, MMORPG, online game, multiplayer |
|
||||
| `rhythm` | Rhythm / Music | 🎵 | rhythm game, music game, beat game |
|
||||
| `puzzle` | Puzzle | 🧩 | puzzle game, brain teaser, logic game |
|
||||
| `roguelike` | Roguelike / Roguelite | 🎲 | roguelike, roguelite, procedural, permadeath |
|
||||
| `metroidvania` | Metroidvania | 🗺 | metroidvania, exploration, ability unlock |
|
||||
| `tower_defense` | Tower Defense | 🏰 | tower defense, TD game, strategy |
|
||||
| `card_game` | Card / Deck Builder | 🃏 | card game, deck builder, TCG |
|
||||
| `battle_royale` | Battle Royale | 🏆 | battle royale, last man standing, BR |
|
||||
| `crpg` | CRPG / Isometric | 📜 | CRPG, isometric RPG, classic RPG |
|
||||
| `tactical` | Tactical / Turn-based | ♟ | tactical, turn based strategy, XCOM-like |
|
||||
| `space` | Space / Sci-Fi | 🚀 | space game, sci-fi, space exploration |
|
||||
| `farming` | Farming / Life Sim | 🌾 | farming sim, life sim, cozy game |
|
||||
Forty-one genres feed the title format, the tag pool, and (when configured
|
||||
in Settings → Genre Playlists) the pinned-comment playlist recommendation.
|
||||
The complete list — with icons and bulk-select groups — is in
|
||||
[Content Inventory](./CONTENT-INVENTORY.md).
|
||||
|
||||
## 🛒 Store Platforms (9 platforms)
|
||||
|
||||
@@ -153,6 +109,35 @@ Mỗi ngôn ngữ có description structure như sau (tất cả sections option
|
||||
14. Hashtags (3 max, auto-generated)
|
||||
```
|
||||
|
||||
## 🔁 Cross-Post Captions (Social tab)
|
||||
|
||||
A dedicated **Social** tab re-packages the same editor source that drives the
|
||||
YouTube description into short-form captions for other platforms — no
|
||||
re-typing. Each caption is derived live from the current form.
|
||||
|
||||
| Platform | Caption limit | Popular hashtags appended |
|
||||
|----------|--------------|----------------------------|
|
||||
| TikTok | 4,000 | `#fyp #foryou #foryoupage #gaming #gamingtiktok #gameplay #gamer` |
|
||||
| Instagram Reels | 2,200 | `#reels #reelsinstagram #gaming #gamingreels #gamer #instagaming #videogames` |
|
||||
| Facebook Reels | 2,200 | `#reels #facebookreels #fbreels #gaming #gameplay #gamingcommunity #videogames` |
|
||||
|
||||
Each caption pulls, in order: **Title** (quality badge suppressed for
|
||||
short-form), **My Rig**, **Content Warnings**, **Thanks / sponsor credit**,
|
||||
**Copyright**, and **hashtags** (game + primary genre + the curated
|
||||
per-platform popular set, deduplicated case-insensitively).
|
||||
|
||||
- **Overflow handling** — when a caption exceeds the platform limit, optional
|
||||
blocks are dropped in priority order (warnings → copyright → thanks → rig).
|
||||
The title and the hashtag line are never dropped, and there is no
|
||||
mid-string truncation.
|
||||
- **Single mode** — platform tabs with a live character counter and
|
||||
over-limit warning.
|
||||
- **Bulk mode** — generate a part range (e.g. Parts 1–10) across selected
|
||||
languages in one pass, reusing the Batch loop.
|
||||
- **Import / Export** — round-trip the generated captions as a typed JSON
|
||||
bundle (`_type: "social"`); import is display-only since captions are
|
||||
derived artifacts (the source round-trips via Profiles / Presets).
|
||||
|
||||
## 🏷 Tag Generation
|
||||
|
||||
### Tag Pools by Category
|
||||
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
# Product Requirements Document (PRD)
|
||||
|
||||
## YTDescGen — YouTube Gameplay Description Generator
|
||||
|
||||
**Version**: 1.0
|
||||
**Author**: Kokone (skullmute)
|
||||
**Last Updated**: 2026-04-07
|
||||
|
||||
---
|
||||
|
||||
## 1. Problem Statement
|
||||
|
||||
Kênh YouTube Gameplay No Commentary cần tạo title, description, và tags cho mỗi video upload. Quy trình hiện tại:
|
||||
|
||||
1. Mở file template → copy → paste vào YouTube Studio
|
||||
2. Thay thế từng placeholder bằng thông tin game cụ thể
|
||||
3. Tìm và thêm tags phù hợp thể loại
|
||||
4. Lặp lại toàn bộ cho mỗi ngôn ngữ
|
||||
5. Lặp lại toàn bộ cho mỗi video trong series
|
||||
|
||||
**Pain Points:**
|
||||
- Lặp lại thao tác nhập Social/Rig/Channel info mỗi lần
|
||||
- Dễ quên/sai khi thay placeholder
|
||||
- Tags phải nhớ hoặc tra cứu từ file Excel
|
||||
- Không có cách kiểm tra character limit trước khi paste
|
||||
- Multi-language phải làm riêng từng bản
|
||||
- Không tái sử dụng được game info cho multi-part series
|
||||
|
||||
## 2. Solution
|
||||
|
||||
Ứng dụng web (+ desktop) với form-based UI:
|
||||
- Chọn video type, ngôn ngữ, thể loại game
|
||||
- Nhập thông tin một lần → lưu Profile
|
||||
- Nhập game info một lần → lưu Preset cho cả series
|
||||
- Tự động generate title + description + tags
|
||||
- Copy trực tiếp vào clipboard, paste vào YouTube Studio
|
||||
- Hỗ trợ batch mode cho nhiều video cùng game
|
||||
|
||||
## 3. Target Users
|
||||
|
||||
- **Primary**: Bản thân Kokone — kênh Gameplay No Commentary
|
||||
- **Secondary**: Các YouTuber gameplay nhỏ lẻ cùng niche
|
||||
- **Future**: Mở rộng cho community qua GitHub release
|
||||
|
||||
## 4. Core User Stories
|
||||
|
||||
### Must Have (P0)
|
||||
|
||||
| ID | Story | Acceptance Criteria |
|
||||
|----|-------|-------------------|
|
||||
| US-01 | Chọn loại video (Full, Part, Boss, etc.) | UI hiển thị đúng form fields theo loại video đã chọn |
|
||||
| US-02 | Chọn ngôn ngữ output (EN/VI/JA) | Toàn bộ generated output chuyển sang ngôn ngữ đã chọn |
|
||||
| US-03 | Chọn thể loại game | Tags được generate phù hợp thể loại |
|
||||
| US-04 | Nhập game info (tên, platform, store links) | Thông tin được đưa vào title + description đúng vị trí |
|
||||
| US-05 | Nhập timestamps | Timestamps xuất hiện trong description với format YouTube chapters |
|
||||
| US-06 | Nhập Social/Donate links | Links xuất hiện trong description section phù hợp |
|
||||
| US-07 | Nhập Rig info | Rig xuất hiện dưới dạng compact format trong description |
|
||||
| US-08 | Xem preview title + description + tags | Preview cập nhật real-time khi thay đổi input |
|
||||
| US-09 | Copy từng phần (title / desc / tags) | Clipboard chứa đúng nội dung, toast confirm |
|
||||
| US-10 | Copy tất cả | Clipboard chứa title + desc, tags riêng |
|
||||
| US-11 | Hiển thị character count | Description ≤ 5000, Tags ≤ 500, warning khi gần/vượt limit |
|
||||
| US-12 | Toggle Spoiler/18+ warning | Dòng warning xuất hiện/ẩn trong description |
|
||||
|
||||
### Should Have (P1)
|
||||
|
||||
| ID | Story | Acceptance Criteria |
|
||||
|----|-------|-------------------|
|
||||
| US-13 | Lưu Profile (social, rig, channel) | Profile persist qua sessions, load vào form |
|
||||
| US-14 | Lưu Game Preset (tên + store links) | Preset persist, selectable khi tạo video mới |
|
||||
| US-15 | Xem lịch sử generated outputs | Danh sách outputs đã tạo, có thể copy lại |
|
||||
| US-16 | Thêm ngôn ngữ mới dễ dàng | Chỉ cần thêm locale JSON files + register |
|
||||
| US-17 | Thêm thể loại game mới | Chỉ cần thêm entry trong config + tag pool |
|
||||
| US-18 | Import/Export settings | JSON export/import cho profiles + presets |
|
||||
| US-19 | Multi-language output đồng thời | Generate cả 3 ngôn ngữ cùng lúc, mỗi ngôn ngữ 1 tab |
|
||||
|
||||
### Nice to Have (P2)
|
||||
|
||||
| ID | Story | Acceptance Criteria |
|
||||
|----|-------|-------------------|
|
||||
| US-20 | Batch mode cho multi-part series | Nhập game info 1 lần, tạo N videos khác part/timestamps |
|
||||
| US-21 | Desktop app (Windows/macOS) | Tauri binary, hoạt động offline |
|
||||
| US-22 | Custom template editor | Người dùng tự sửa template structure |
|
||||
| US-23 | Keyboard shortcuts | Ctrl+Enter = generate, Ctrl+Shift+C = copy all |
|
||||
| US-24 | Dark/Light theme toggle | Theme persist qua sessions |
|
||||
| US-25 | Auto-save draft | Form state tự lưu, recover khi reload |
|
||||
| US-26 | Tag suggestions từ game name | Gợi ý tag dựa trên tên game + trending |
|
||||
| US-27 | YouTube API integration | Auto-fill qua YouTube Data API (future) |
|
||||
| US-28 | VS Code / IDE extension | Command palette → generate description |
|
||||
|
||||
## 5. Non-Functional Requirements
|
||||
|
||||
| Requirement | Target |
|
||||
|------------|--------|
|
||||
| First Contentful Paint | < 1.5s |
|
||||
| Bundle size (web) | < 500KB gzipped |
|
||||
| Desktop binary size | < 15MB (Tauri) |
|
||||
| Offline support | Full functionality without internet |
|
||||
| Browser support | Chrome 90+, Firefox 90+, Edge 90+ |
|
||||
| Accessibility | WCAG 2.1 Level AA |
|
||||
| Persistence | localStorage (web), file system (desktop) |
|
||||
|
||||
## 6. Out of Scope (v1)
|
||||
|
||||
- YouTube API auto-upload
|
||||
- Thumbnail generation
|
||||
- Video editing integration
|
||||
- Multi-user / team features
|
||||
- Cloud sync between devices
|
||||
- Analytics / tracking
|
||||
- Monetization
|
||||
|
||||
## 7. Success Metrics
|
||||
|
||||
| Metric | Target |
|
||||
|--------|--------|
|
||||
| Time to generate 1 video description | < 2 minutes (vs ~10 minutes manual) |
|
||||
| Error rate (missing fields, wrong format) | 0% — form validates before generate |
|
||||
| Languages supported at launch | 3 (EN, VI, JA) |
|
||||
| Genres supported at launch | 10+ |
|
||||
| Video types supported | 7+ |
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
- [x] editor/ components: StoreLinkEditor, RigEditor, SocialEditor, WarningToggles
|
||||
- [x] editor/ components: QuickPreview
|
||||
- [x] output/ components: OutputPreview, CopyButton, CharCounter, CopyAllBar
|
||||
- [x] layout/ components: AppShell, Header, TabBar
|
||||
- [x] layout/ components: AppShell, Header, Sidebar
|
||||
|
||||
1.7 Pages
|
||||
- [x] EditorPage (form + quick preview)
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@
|
||||
```jsonc
|
||||
{
|
||||
"name": "yt-desc-gen",
|
||||
"version": "0.1.0",
|
||||
"version": "0.20.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -320,7 +320,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run typecheck
|
||||
@@ -353,7 +353,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
# Danh mục Nội dung
|
||||
|
||||
Bản kê khai tĩnh cho mọi loại video, thể loại game, và cảnh báo nội dung trong editor của YTDescGen. Cập nhật thủ công — khi thêm mục mới vào một trong các file nguồn dưới đây, **thêm dòng tương ứng vào đây** trong cùng PR.
|
||||
|
||||
File này tồn tại để **minh bạch** — bất kỳ ai tò mò về việc editor có thể mô tả được gì (mà không cần cài app hay đọc source) đều có thể quét trong một phút.
|
||||
|
||||
**Bản gốc tiếng Anh:** [`docs/CONTENT-INVENTORY.md`](../../CONTENT-INVENTORY.md).
|
||||
|
||||
**Nguồn tham chiếu (source of truth):**
|
||||
- Loại video: [`src/config/video-types.ts`](../../../src/config/video-types.ts)
|
||||
- Thể loại game: [`src/config/genres.ts`](../../../src/config/genres.ts)
|
||||
- Cảnh báo nội dung: [`src/config/content-warning-groups.ts`](../../../src/config/content-warning-groups.ts)
|
||||
|
||||
---
|
||||
|
||||
## 1. Loại video (20)
|
||||
|
||||
Mỗi loại video kéo theo một template description, cấu trúc title, và tag bias riêng. Cột "Trường bổ sung" liệt kê các trường editor sẽ hiển thị khi chọn loại video tương ứng.
|
||||
|
||||
| Icon | Loại | Trường bổ sung |
|
||||
|---|---|---|
|
||||
| 🎮 | Gameplay đầy đủ | — |
|
||||
| 📂 | Gameplay theo phần | Số phần |
|
||||
| 🎬 | Demo đầy đủ | — |
|
||||
| 🎞 | Demo theo phần | Số phần |
|
||||
| 👹 | Đấu trùm | Tên trùm |
|
||||
| 💀 | Đấu trùm không trúng đòn | Tên trùm |
|
||||
| 🏁 | Kết thúc / Toàn bộ Ending | — |
|
||||
| ⚡ | Speedrun | — |
|
||||
| 💯 | Hoàn thành 100% | — |
|
||||
| 📦 | Nội dung DLC | Tên DLC |
|
||||
| 🔄 | New Game+ | — |
|
||||
| 🏆 | Thử thách | Tên thử thách |
|
||||
| 📌 | Nhiệm vụ phụ | — |
|
||||
| 🔍 | Bí mật / Ẩn | — |
|
||||
| ⚖️ | So sánh đồ họa | — |
|
||||
| 📘 | Hướng dẫn không lời | — |
|
||||
| 🧩 | Chơi với Mod | Tên Mod |
|
||||
| ⭐ | Toàn bộ vật phẩm sưu tầm | — |
|
||||
| 🔴 | Livestream | URL Live, Thời gian dự kiến |
|
||||
| 🎴 | Nhiệm vụ Gacha | Loại nhiệm vụ, Tên chapter, Tên quest, Số phần |
|
||||
|
||||
---
|
||||
|
||||
## 2. Thể loại game (41)
|
||||
|
||||
Thể loại được chọn ảnh hưởng đến định dạng title, tag pool, và (khi cấu hình ở Settings → Genre Playlists) gợi ý playlist trong pinned comment.
|
||||
|
||||
Các nhóm bulk-select trong editor: **All RPGs** (rpg + jrpg + action_rpg + crpg), **All Shooters** (fps + arena_shooter + tactical_fps + boomer_shooter + extraction_shooter + shmup), **All Horror** (horror + survival_horror + psychological_horror).
|
||||
|
||||
| Icon | Thể loại |
|
||||
|---|---|
|
||||
| ⚔️ | Hành động / Phiêu lưu |
|
||||
| 🗡 | Hack & Slash |
|
||||
| 👊 | Beat 'em Up |
|
||||
| 🦘 | Platformer |
|
||||
| 👻 | Kinh dị / Sinh tồn |
|
||||
| 🧟 | Kinh dị Sinh tồn |
|
||||
| 🧠 | Kinh dị Tâm lý |
|
||||
| 🛡 | RPG |
|
||||
| 🎎 | JRPG |
|
||||
| 🏹 | Action RPG |
|
||||
| 📜 | CRPG / Góc nhìn từ trên |
|
||||
| 🔫 | FPS / Bắn súng |
|
||||
| 🎯 | Bắn súng Arena |
|
||||
| 🎖 | Bắn súng Chiến thuật |
|
||||
| 💥 | Boomer Shooter |
|
||||
| 🎒 | Extraction Shooter |
|
||||
| 🛸 | SHMUP / Bullet Hell |
|
||||
| 🌍 | Thế giới mở / Sandbox |
|
||||
| 🕹 | Indie |
|
||||
| 💀 | Souls-like |
|
||||
| 🏎 | Đua xe / Thể thao |
|
||||
| 📖 | Cốt truyện |
|
||||
| 🏗 | Mô phỏng / Chiến thuật |
|
||||
| 🏙 | Xây thành |
|
||||
| 🥊 | Đối kháng |
|
||||
| 🥷 | Lén lút / Gián điệp |
|
||||
| ⛏ | Sinh tồn / Chế tạo |
|
||||
| 🎲 | Roguelike / Roguelite |
|
||||
| 🗺 | Metroidvania |
|
||||
| 🌐 | MMO / Trực tuyến |
|
||||
| 🎵 | Âm nhạc / Nhịp điệu |
|
||||
| 🧩 | Giải đố |
|
||||
| 🏰 | Tower Defense |
|
||||
| 🃏 | Bài / Card |
|
||||
| 🎴 | Deck Builder |
|
||||
| 🤖 | Auto Battler |
|
||||
| 🏆 | Battle Royale |
|
||||
| ♟ | Chiến thuật theo lượt |
|
||||
| 🚀 | Không gian / Sci-Fi |
|
||||
| 🌾 | Nông trại / Life Sim |
|
||||
| 🎬 | FMV / Phim tương tác |
|
||||
| 💬 | Visual Novel |
|
||||
|
||||
---
|
||||
|
||||
## 3. Cảnh báo nội dung (187, chia nhóm)
|
||||
|
||||
Cảnh báo được chọn sẽ thêm vào khối `⚠ CONTENT WARNINGS` trong description, trước phần timestamp. Mỗi nhóm có thể thu gọn trong editor; cảnh báo hiển thị theo thứ tự người dùng chọn.
|
||||
|
||||
### Spoiler (6)
|
||||
|
||||
Spoiler cốt truyện / ending · Spoiler ending · Spoiler ending thật · Spoiler hậu game / NG+ · Spoiler ending bí mật · Spoiler cốt truyện DLC
|
||||
|
||||
### Sức khỏe / Quang nhạy (6)
|
||||
|
||||
Đèn nháy · Say tàu xe · Kích thích migraine · Âm thanh lớn / đột ngột · Hiệu ứng strobe · Rung hình mạnh
|
||||
|
||||
### Ám ảnh / Phobia (51)
|
||||
|
||||
Jumpscare · Sợ độ cao (acrophobia) · Sợ lỗ / cụm (trypophobia) · Sợ nước sâu (thalassophobia) · Sợ không gian kín (claustrophobia) · Sợ nhện (arachnophobia) · Sợ côn trùng (entomophobia) · Sợ rắn (ophidiophobia) · Sợ chó (cynophobia) · Sợ bóng tối (nyctophobia) · Sợ lửa (pyrophobia) · Sợ búp bê (pediophobia) · Sợ máu (hemophobia) · Sợ chú hề (coulrophobia) · Sợ chết đuối (ablutophobia) · Sợ bị chôn sống (taphophobia) · Hình nhân máy (automatonophobia) · Vật thể khổng lồ (megalophobia) · Vật nhân tạo dưới nước (submechanophobia) · Xác chết (necrophobia) · Ma quỷ (spectrophobia) · Quỷ dữ (demonophobia) · Cá mập (selachophobia) · Vi trùng / ô nhiễm (mysophobia) · Nôn mửa (emetophobia) · Bị nhìn chằm chằm (scopophobia) · Cô lập (monophobia) · Chuột (musophobia) · Dơi (chiroptophobia) · Chim (ornithophobia) · Cá (ichthyophobia) · Bò sát (herpetophobia) · Gián (katsaridaphobia) · Ong (apiphobia) · Sấm sét (astraphobia) · Không gian rộng (agoraphobia) · Đám đông (enochlophobia) · Tuyết / giá lạnh (chionophobia) · Bệnh viện (nosocomephobia) · Vật sắc nhọn (aichmophobia) · Nghẹt thở (pnigophobia) · Sương mù (homichlophobia) · Lốc xoáy / bão (lilapsophobia) · Mưa lớn (ombrophobia) · Mây / trời u ám (nephophobia) · Gió mạnh (ancraophobia) · Cực lạnh (cryophobia) · Ánh nắng gay gắt (heliophobia) · Sóng lớn (cymophobia) · Hồ / nước tĩnh (limnophobia) · Sông / dòng chảy (potamophobia)
|
||||
|
||||
### Sức khỏe tâm thần (17)
|
||||
|
||||
Cảnh gây lo âu · Trầm cảm · Rối loạn ăn uống · Sử dụng chất kích thích · Tự hại / tự tử · PTSD · Kim tiêm · Dịch cơ thể · Mang thai / sinh nở kinh dị · Bệnh tật / nhiễm trùng · Lưỡng cực · OCD · Hoảng loạn · Phân ly · Hoang tưởng · Suy nghĩ xâm nhập · Y khoa kinh dị
|
||||
|
||||
### Hiện tượng tâm lý — xã hội (20)
|
||||
|
||||
Tự kỷ / thần kinh đa dạng · ADHD / rối loạn tập trung · Hikikomori / ẩn dật xã hội · NEET (không học không làm) · Lo âu xã hội · Cô lập xã hội / cô đơn · Tâm thần phân liệt / loạn thần · Burnout / kiệt sức · Mặc cảm sống sót · Bị bỏ rơi / sang chấn · Quan hệ parasocial · Gaslighting / thao túng · Hội chứng Stockholm · Nghiện game / cờ bạc · Khủng hoảng hiện sinh · Hội chứng kẻ mạo danh · Khủng hoảng tuổi trung niên · Khủng hoảng tuổi 1/4 · Quấy rối nơi làm việc · Áp lực vai trò giới
|
||||
|
||||
### Nội dung nhạy cảm / 18+ (61)
|
||||
|
||||
Máu me · 18+ · Hình ảnh gây khó chịu · B*o h*nh động vật · Trẻ em chịu tác động · B*o h*nh gia đình · Tham chiếu x*m h*i t*nh d*c · Tra tấn · Tôn giáo · Tác động vật lý chiến tranh · Phân biệt đối xử · Tác động vật lý từ chính quyền · Hút thuốc / uống rượu · G*ết người chi tiết · Tà giáo / huyền bí · Thao túng tâm lý · Mất mát / đau buồn · Bắt cóc · Phát ngôn thù hận · Tội ác lịch sử · Nô lệ · Khủng bố · Bắt nạt · Thử nghiệm trên người · Ăn thịt người · Hạt nhân / phóng xạ · Kỳ thị người đồng tính / LGBTQ+ (homophobia) · Kỳ thị người chuyển giới (transphobia) · Bài ngoại (xenophobia) · Cực đoan chính trị · Cực đoan tôn giáo / cuồng tín · Diệt chủng / thanh trừng sắc tộc · Thánh chiến / xung đột tôn giáo · Đại nạn Holocaust · Nội chiến · Xả súng hàng loạt / xả súng trường học · Chủ nghĩa thực dân / đế quốc · Tuyên truyền nhà nước · Nhà nước giám sát / dystopia · Thuyết âm mưu · Kiểm duyệt / cấm phát ngôn · Xung đột sắc tộc / chủng tộc · Khủng hoảng tị nạn · Cách mạng / nổi dậy · Ám sát chính trị · Đảo chính · Toà án dị giáo / săn phù thủy · Lao động cưỡng bức · Chủ nghĩa dân tộc cực đoan · Treo c* / siết c* · Cảnh ch*t đuối · Cảnh thiêu s*ng · Cảnh ngạt th* · Bị trói / cầm tù tra tấn · Cảnh hành quyết công khai · Cảnh chặt đầu · Cảnh đâm xuyên cơ thể · Thương vong hàng loạt · Tác động vật lý bằng phương tiện · Cảnh sử dụng quá liều · Ngã / nhảy từ trên cao
|
||||
|
||||
### Kinh dị nặng (12)
|
||||
|
||||
Mắt / cụm mắt · Body horror (biến dạng cơ thể) · Mặt biến dạng / cắt xén · Kinh dị vũ trụ · Máu me / phân thây cực độ · Phân hủy, thối rữa, dòi bọ · Cắt xẻo / cụt chi · Liminal space · Analog horror / VHS · Phi thực tế / méo mó · Truy đuổi · Thực thể / SCP
|
||||
|
||||
### Thông tin về playstyle (10)
|
||||
|
||||
Lần đầu chơi (blind) · Không spoiler trong chat · Chế độ easy / story · Chế độ khó cao · Permadeath / Iron Man · Thử speedrun · 100% completionist · Đang học cơ chế · Chơi lần đầu · Chơi lại / NG+
|
||||
|
||||
### Thông tin về gameplay (4)
|
||||
|
||||
Dùng mod · Bật cheat / debug · Dùng glitch · Có guide hỗ trợ
|
||||
|
||||
---
|
||||
|
||||
## 4. Bảo trì
|
||||
|
||||
Khi thêm mục mới vào bất kỳ file nguồn nào:
|
||||
|
||||
1. **Loại video** → thêm vào [`src/config/video-types.ts`](../../../src/config/video-types.ts) VÀ thêm dòng vào mục 1 ở trên.
|
||||
2. **Thể loại** → thêm vào [`src/config/genres.ts`](../../../src/config/genres.ts) VÀ thêm dòng vào mục 2.
|
||||
3. **Cảnh báo nội dung** → thêm vào nhóm phù hợp ở [`src/config/content-warning-groups.ts`](../../../src/config/content-warning-groups.ts) VÀ thêm label vào đúng nhóm ở mục 3 — giữ số đếm trong tiêu đề chính xác.
|
||||
4. Cập nhật cả bản gốc EN tại [`docs/CONTENT-INVENTORY.md`](../../CONTENT-INVENTORY.md) trong cùng PR.
|
||||
|
||||
Sai lệch giữa file này và file nguồn được xem là lỗi tài liệu — mở issue hoặc PR.
|
||||
@@ -0,0 +1,145 @@
|
||||
# Hướng dẫn phát triển
|
||||
|
||||
> **Lưu ý dịch thuật:** Tiếng Anh là phiên bản chính ([`docs/DEVELOPMENT.md`](../../DEVELOPMENT.md)). Bản tiếng Việt này có thể chậm cập nhật một vài commit.
|
||||
|
||||
Hướng dẫn này bao gồm cách cài đặt YTDescGen để phát triển cục bộ trên Windows, macOS hoặc Linux. Ứng dụng là một web app Vite/React với tùy chọn vỏ desktop Tauri.
|
||||
|
||||
## Cấu hình máy tham chiếu
|
||||
|
||||
Cấu hình máy đã dùng để phát triển và phát hành dự án:
|
||||
|
||||
| Thành phần | Thông số |
|
||||
| --- | --- |
|
||||
| OS | Windows 11 Pro (24H2 trở lên) |
|
||||
| CPU | x86-64 hiện đại — 6 nhân trở lên có AVX2 (Intel gen 11 / AMD Zen 3 hoặc mới hơn) |
|
||||
| GPU | Rời hoặc tích hợp — backend WebView2 của Tauri chạy thoải mái trên iGPU |
|
||||
| RAM | Tối thiểu 16 GB, khuyến nghị 32 GB để chạy song song typecheck + dev server |
|
||||
| Lưu trữ | 5 GB trống cho `node_modules` + `target/` Cargo sau khi build Tauri đầy đủ |
|
||||
| Màn hình | Tối thiểu 1920×1080; layout mobile đã test đến 360×640 |
|
||||
|
||||
macOS và Linux đều dùng được để phát triển. Build release Tauri được cross-compile hoặc chạy trên CI riêng — xem [PACKAGING.md](../../PACKAGING.md).
|
||||
|
||||
## Toolchain
|
||||
|
||||
Cài theo thứ tự:
|
||||
|
||||
| Công cụ | Phiên bản | Lý do |
|
||||
| --- | --- | --- |
|
||||
| **Node.js** | `>= 22.0.0` | Vite 7 đã bỏ hỗ trợ Node cũ. Dùng [nvm](https://github.com/nvm-sh/nvm) hoặc [fnm](https://github.com/Schniz/fnm). |
|
||||
| **npm** | đi kèm Node 22 | Dự án dùng npm; `pnpm` và `yarn` chưa test. |
|
||||
| **Rust** | stable, `>= 1.78` | Bắt buộc cho build Tauri. Cài qua [rustup](https://rustup.rs/). |
|
||||
| **Python** | `3.12` | Tùy chọn — chỉ cần cho một số tooling Tauri trên Windows. |
|
||||
| **Tauri prerequisites** | theo OS | Xem <https://v2.tauri.app/start/prerequisites/>. |
|
||||
|
||||
### Windows
|
||||
|
||||
- Cài **Visual Studio Build Tools 2022** với workload "Desktop development with C++" (bắt buộc cho `tauri-build`).
|
||||
- Cài **WebView2 Runtime** (Windows 11 thường đã có sẵn).
|
||||
- Bật long path: `git config --global core.longpaths true`.
|
||||
|
||||
### macOS
|
||||
|
||||
- Cài Xcode Command Line Tools: `xcode-select --install`.
|
||||
|
||||
### Linux
|
||||
|
||||
- Cài Tauri prerequisites theo từng distro — `libwebkit2gtk-4.1-dev`, `libappindicator3-dev`, v.v. Xem docs Tauri ở link trên.
|
||||
|
||||
## Cấu hình IDE
|
||||
|
||||
Quy trình tham chiếu dùng **JetBrains 2026.x** (WebStorm hoặc RustRover) làm IDE chính, **VS Code** cho chỉnh sửa nhanh.
|
||||
|
||||
### JetBrains (WebStorm / RustRover / IntelliJ Ultimate)
|
||||
|
||||
- Bật plugin **Tailwind CSS**.
|
||||
- Bật plugin **i18next** (hoặc dùng `src/i18n/locales/_schema.json` để autocomplete).
|
||||
- Settings → Languages → TypeScript → "Use TypeScript from `node_modules/typescript`".
|
||||
- Settings → Code Style → Prettier → Run on save (`src/**/*.{ts,tsx,json,css}`).
|
||||
|
||||
### VS Code
|
||||
|
||||
Extension đề xuất (không có `.vscode/extensions.json` được commit — cài thủ công):
|
||||
|
||||
- `dbaeumer.vscode-eslint`
|
||||
- `esbenp.prettier-vscode`
|
||||
- `bradlc.vscode-tailwindcss`
|
||||
- `rust-lang.rust-analyzer` (nếu động vào `src-tauri/`)
|
||||
- `tauri-apps.tauri-vscode`
|
||||
|
||||
## Chạy lần đầu
|
||||
|
||||
```bash
|
||||
# 1. Clone
|
||||
git clone https://github.com/poli0981/youtube-generator.git
|
||||
cd youtube-generator
|
||||
|
||||
# 2. Cài web dependencies
|
||||
npm install
|
||||
|
||||
# 3. Chạy web dev server
|
||||
npm run dev
|
||||
# → http://localhost:5173
|
||||
```
|
||||
|
||||
## Lệnh thường dùng
|
||||
|
||||
| Lệnh | Tác dụng |
|
||||
| --- | --- |
|
||||
| `npm run dev` | Vite dev server, hot reload, chỉ web. |
|
||||
| `npm run build` | Bundle web production vào `dist/`. |
|
||||
| `npm run preview` | Phục vụ bundle production để kiểm tra. |
|
||||
| `npm run typecheck` | `tsc --noEmit`. Chạy trước mỗi PR. |
|
||||
| `npm run lint` | ESLint. Dùng `npm run lint:fix` để autofix. |
|
||||
| `npm run format` | Chạy Prettier trên `src/`. |
|
||||
| `npm run test` | Vitest chế độ watch. |
|
||||
| `npm run test:run` | Vitest chạy một lần (cho CI / pre-commit). |
|
||||
| `npm run test:coverage` | Báo cáo coverage vào `coverage/`. |
|
||||
| `npm run validate:locales` | Bắt buộc cả 6 locale có cùng key với `_schema.json`. **Phải pass trước khi merge PR động đến locale.** |
|
||||
| `npm run generate:locale` | Scaffold locale rỗng từ `_schema.json` cho ngôn ngữ mới. |
|
||||
| `npm run tauri:dev` | Tauri desktop chế độ dev (tự restart khi đổi Rust hoặc frontend). |
|
||||
| `npm run tauri:build` | Build binary Tauri release cho platform hiện tại. |
|
||||
|
||||
## Build Tauri desktop
|
||||
|
||||
Xem [PACKAGING.md](../../PACKAGING.md) cho pipeline release đầy đủ. Build cục bộ nhanh:
|
||||
|
||||
```bash
|
||||
npm run tauri:build
|
||||
# Output: src-tauri/target/release/bundle/{msi,deb,dmg,app}
|
||||
```
|
||||
|
||||
Build đầu tiên mất khoảng 5–10 phút (Cargo cache rỗng). Build sau đó là incremental.
|
||||
|
||||
## Khắc phục sự cố
|
||||
|
||||
### `validate:locales` fail sau khi thêm key
|
||||
|
||||
Bạn quên cập nhật `src/i18n/locales/_schema.json`. Schema là source of truth; locale phải khớp 100%.
|
||||
|
||||
### Build Tauri báo `link.exe not found` (Windows)
|
||||
|
||||
Cài Visual Studio Build Tools 2022 + workload Desktop C++, sau đó khởi động lại shell để PATH được cập nhật.
|
||||
|
||||
### Build Tauri báo `pkg-config not found` (Linux)
|
||||
|
||||
Cài Tauri prerequisites theo distro tại <https://v2.tauri.app/start/prerequisites/>.
|
||||
|
||||
### `npm install` chậm / treo
|
||||
|
||||
Tắt VPN/proxy doanh nghiệp chặn npm registry. Lock file đã commit; install offline chạy được sau lần install thành công đầu tiên.
|
||||
|
||||
### Hot reload không bắt được sửa đổi locale
|
||||
|
||||
Locale JSON bundle vào lúc build, không được watch. Restart dev server sau khi sửa `src/i18n/locales/*`.
|
||||
|
||||
### Pre-commit hook fail ở `validate:locales` mà mình không động đến locale
|
||||
|
||||
Có thể bạn vô tình thêm key mới vào `_schema.json` thông qua `src/engine/types.ts` → `CONTENT_WARNINGS`. ID mới cần dịch ở cả 6 locale.
|
||||
|
||||
## Xem thêm
|
||||
|
||||
- [ARCHITECTURE.md](../../ARCHITECTURE.md) — mô hình layer, data flow, thiết kế engine.
|
||||
- [I18N.md](../../I18N.md) — thêm ngôn ngữ mới từng bước.
|
||||
- [PACKAGING.md](../../PACKAGING.md) — Tauri release build và signing.
|
||||
- [CONTRIBUTING.md ở root](../../../CONTRIBUTING.md) — quy trình PR, quy ước commit, auto-ignore rules.
|
||||
- [SECURITY.md ở root](../../../SECURITY.md) — báo cáo lỗ hổng bảo mật.
|
||||
@@ -0,0 +1,55 @@
|
||||
# Tuyên bố miễn trừ
|
||||
|
||||
> **Lưu ý dịch thuật:** Tiếng Anh là phiên bản chính ([`DISCLAIMER.md` ở root](../../../DISCLAIMER.md)). Bản tiếng Việt này có thể chậm cập nhật một vài commit.
|
||||
|
||||
## Dự án cá nhân, có sự hỗ trợ của AI
|
||||
|
||||
YTDescGen là dự án cá nhân do một người duy trì (`@poli0981`) để dùng cho kênh YouTube [`@SkullMute`](https://www.youtube.com/@SkullMute), và chia sẻ công khai dưới dạng mã nguồn mở. Đây **không phải sản phẩm thương mại** và không có nghĩa vụ hỗ trợ.
|
||||
|
||||
Mã nguồn, tài liệu, bản dịch locale, và các quyết định thiết kế trong repo này được **đồng tác giả với sự hỗ trợ của Anthropic's Claude Code (model 4.7 Opus, cửa sổ context 1M)**. Tất cả commit, release, và quyết định kiến trúc được người duy trì xem xét và phê duyệt trước khi merge.
|
||||
|
||||
Tuyên bố này áp dụng cho:
|
||||
|
||||
- Mã nguồn trong `src/` và `src-tauri/`.
|
||||
- Tài liệu trong `docs/` và các file markdown ở root.
|
||||
- File locale trong `src/i18n/locales/`.
|
||||
- Workflow CI/CD trong `.github/workflows/`.
|
||||
|
||||
Xem thêm: [`THIRD_PARTY_NOTICES.md`](../../../THIRD_PARTY_NOTICES.md) § "AI-Assisted Development Disclosure".
|
||||
|
||||
## Chất lượng bản dịch
|
||||
|
||||
UI ứng dụng hỗ trợ sáu ngôn ngữ. Chất lượng tác giả khác nhau:
|
||||
|
||||
| Locale | Tác giả | Ghi chú |
|
||||
| --- | --- | --- |
|
||||
| Tiếng Anh (`en`) | Người duy trì + AI | Locale làm việc chính. Chuỗi được review trước khi commit. |
|
||||
| Tiếng Việt (`vi`) | Người duy trì (bản ngữ) + AI | Review bởi người duy trì là người bản ngữ tiếng Việt. |
|
||||
| Tiếng Nhật (`ja`) | AI dịch | Không có review bản ngữ. Ngữ pháp và văn phong có thể chưa chuẩn. |
|
||||
| Tiếng Tây Ban Nha (`es`) | AI dịch | Không có review bản ngữ. Không nhắm cụ thể vào giọng vùng miền (LatAm vs. Castilian). |
|
||||
| Tiếng Hàn (`ko`) | AI dịch | Không có review bản ngữ. Honorific register chọn ở mức trung tính. |
|
||||
| Tiếng Trung (`zh`) | AI dịch | Giản thể. Không có review bản ngữ. |
|
||||
|
||||
Nếu bạn là người bản ngữ và phát hiện dịch sai, vui lòng mở issue hoặc PR — xem [CONTRIBUTING.md](../../../CONTRIBUTING.md) § "i18n Contributions".
|
||||
|
||||
## Giọng văn và phong cách
|
||||
|
||||
Template description sinh ra dùng giọng văn được điều chỉnh cho ngách **gameplay no-commentary** trên YouTube, đặc biệt nhấn mạnh game horror / kinh dị (vì đó là nội dung kênh của người duy trì). Output có thể không hợp với mọi kênh hay mọi văn hoá đọc. Ứng dụng dùng template — bạn có thể sửa bất kỳ text sinh ra nào trước khi đăng.
|
||||
|
||||
Một số cụm tiếng Việt cố tình giữ từ vay mượn và giọng casual phản ánh cách các creator gameplay Việt thường viết description. Đây không phải "dịch sai" mà là lựa chọn phong cách cho đối tượng đọc.
|
||||
|
||||
## Không bảo hành
|
||||
|
||||
Phần mềm cung cấp **nguyên trạng, không có bất kỳ bảo hành nào**. Xem [`LICENSE`](../../../LICENSE) (Apache 2.0) §§ 7 và 8 cho đầy đủ điều khoản miễn trừ bảo hành và giới hạn trách nhiệm.
|
||||
|
||||
Nói ngắn gọn: nếu ứng dụng crash, làm hỏng draft, sinh ra description khiến video bị YouTube flag, hoặc gây bất kỳ thiệt hại nào — người duy trì không chịu trách nhiệm. Dùng tự chịu rủi ro; back up draft của bạn.
|
||||
|
||||
## Không liên kết với YouTube / Anthropic
|
||||
|
||||
YTDescGen **không** liên kết, được tài trợ, hay được YouTube, Google LLC, hay Alphabet Inc. xác nhận. Output sinh ra dành để paste vào YouTube Studio editor; ứng dụng này không tương tác với YouTube API.
|
||||
|
||||
Việc dùng Claude Code trong quá trình phát triển **không** biến đây thành sản phẩm của Anthropic. Anthropic, Claude, và Claude Code là nhãn hiệu của Anthropic, PBC. Dự án này độc lập.
|
||||
|
||||
## Không phải tư vấn pháp lý hay tài chính
|
||||
|
||||
Bất kỳ đề cập nào đến GDPR, CCPA, luật bản quyền, chính sách monetization của YouTube, hay các chủ đề tương tự trong tài liệu repo này chỉ để định hướng — **không phải tư vấn pháp lý**. Tham vấn luật sư có chuyên môn ở khu vực của bạn nếu cần câu trả lời chính thống.
|
||||
+64
-1
@@ -3,7 +3,70 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>YTDescGen</title>
|
||||
<meta name="color-scheme" content="dark light" />
|
||||
<meta name="theme-color" content="#0a0a0a" />
|
||||
|
||||
<title>YTDescGen — YouTube Title, Description & Tag Generator for Gameplay Channels</title>
|
||||
<meta name="description" content="Generate YouTube titles, descriptions, and tags for Gameplay No Commentary channels — multilingual templates, profile presets, and a Tauri-based desktop build." />
|
||||
<meta name="keywords" content="youtube, gameplay, no commentary, description generator, tags generator, video title, vietnamese, japanese, korean, spanish, chinese, multilingual, tauri, desktop" />
|
||||
<meta name="author" content="SkullMute (poli0981)" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta name="generator" content="Vite + React" />
|
||||
|
||||
<link rel="canonical" href="https://poli0981.github.io/youtube-generator/" />
|
||||
<link rel="icon" type="image/svg+xml" href="/youtube-generator/favicon.svg" />
|
||||
<link rel="apple-touch-icon" href="/youtube-generator/apple-touch-icon.png" />
|
||||
<link rel="manifest" href="/youtube-generator/manifest.webmanifest" />
|
||||
|
||||
<!-- OpenGraph -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:site_name" content="YTDescGen" />
|
||||
<meta property="og:title" content="YTDescGen — YouTube Title, Description & Tag Generator" />
|
||||
<meta property="og:description" content="Multilingual title, description, and tag generator for Gameplay No Commentary channels." />
|
||||
<meta property="og:url" content="https://poli0981.github.io/youtube-generator/" />
|
||||
<meta property="og:image" content="https://poli0981.github.io/youtube-generator/og-image.png" />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
<meta property="og:locale:alternate" content="vi_VN" />
|
||||
<meta property="og:locale:alternate" content="ja_JP" />
|
||||
<meta property="og:locale:alternate" content="es_ES" />
|
||||
<meta property="og:locale:alternate" content="ko_KR" />
|
||||
<meta property="og:locale:alternate" content="zh_CN" />
|
||||
|
||||
<!-- Twitter / X card -->
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:site" content="@SkullMute0011" />
|
||||
<meta name="twitter:creator" content="@SkullMute0011" />
|
||||
<meta name="twitter:title" content="YTDescGen — YouTube Title, Description & Tag Generator" />
|
||||
<meta name="twitter:description" content="Multilingual title, description, and tag generator for Gameplay No Commentary channels." />
|
||||
<meta name="twitter:image" content="https://poli0981.github.io/youtube-generator/og-image.png" />
|
||||
|
||||
<!-- Structured data -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebApplication",
|
||||
"name": "YTDescGen",
|
||||
"alternateName": "YouTube Description Generator",
|
||||
"url": "https://poli0981.github.io/youtube-generator/",
|
||||
"applicationCategory": "MultimediaApplication",
|
||||
"operatingSystem": "Web, Windows, macOS, Linux",
|
||||
"description": "Generate YouTube titles, descriptions, and tags for Gameplay No Commentary channels — multilingual templates, profile presets, and a Tauri-based desktop build.",
|
||||
"inLanguage": ["en", "vi", "ja", "es", "ko", "zh"],
|
||||
"offers": {
|
||||
"@type": "Offer",
|
||||
"price": "0",
|
||||
"priceCurrency": "USD"
|
||||
},
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "SkullMute",
|
||||
"url": "https://github.com/poli0981"
|
||||
},
|
||||
"license": "https://github.com/poli0981/youtube-generator/blob/main/LICENSE"
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/knip@6/schema.json",
|
||||
"entry": ["scripts/*.ts", "tests/**/*.test.ts"],
|
||||
"project": ["src/**/*.{ts,tsx}", "scripts/**/*.ts", "tests/**/*.ts"],
|
||||
"ignoreExportsUsedInFile": true,
|
||||
"ignoreDependencies": [
|
||||
"@tauri-apps/plugin-fs",
|
||||
"@tauri-apps/plugin-opener",
|
||||
"@tauri-apps/plugin-shell",
|
||||
"@testing-library/jest-dom",
|
||||
"@testing-library/react"
|
||||
],
|
||||
"ignoreBinaries": ["tauri"]
|
||||
}
|
||||
Generated
+1262
-687
File diff suppressed because it is too large.
Load diff
+25
-22
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"name": "yt-desc-gen",
|
||||
"version": "0.11.0",
|
||||
"version": "0.24.1",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -12,6 +13,7 @@
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"lint": "eslint src/",
|
||||
"lint:fix": "eslint src/ --fix",
|
||||
"knip": "knip",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"format": "prettier --write \"src/**/*.{ts,tsx,json,css}\"",
|
||||
"validate:locales": "tsx scripts/validate-locales.ts",
|
||||
@@ -21,39 +23,40 @@
|
||||
"tauri:build": "tauri build"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^18.3.0",
|
||||
"react-dom": "^18.3.0",
|
||||
"react-router-dom": "^6.26.0",
|
||||
"zustand": "^4.5.0",
|
||||
"i18next": "^23.15.0",
|
||||
"react-i18next": "^15.0.0",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"lucide-react": "^0.400.0",
|
||||
"clsx": "^2.1.0",
|
||||
"@tauri-apps/api": "^2.0.0",
|
||||
"@tauri-apps/api": "^2.11.0",
|
||||
"@tauri-apps/plugin-dialog": "^2.0.0",
|
||||
"@tauri-apps/plugin-fs": "^2.0.0",
|
||||
"@tauri-apps/plugin-opener": "^2.0.0",
|
||||
"@tauri-apps/plugin-shell": "^2.0.0"
|
||||
"@tauri-apps/plugin-shell": "^2.0.0",
|
||||
"clsx": "^2.1.0",
|
||||
"i18next": "^23.15.0",
|
||||
"lucide-react": "^0.400.0",
|
||||
"react": "^18.3.0",
|
||||
"react-dom": "^18.3.0",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-i18next": "^15.0.0",
|
||||
"react-router-dom": "^6.26.0",
|
||||
"zustand": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.0.0",
|
||||
"@testing-library/jest-dom": "^6.4.0",
|
||||
"@testing-library/react": "^16.0.0",
|
||||
"@types/react": "^18.3.0",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@vitejs/plugin-react": "^4.3.0",
|
||||
"typescript": "^5.5.0",
|
||||
"vite": "^5.4.0",
|
||||
"vitest": "^2.0.0",
|
||||
"@testing-library/react": "^16.0.0",
|
||||
"@testing-library/jest-dom": "^6.4.0",
|
||||
"tailwindcss": "^3.4.0",
|
||||
"postcss": "^8.4.0",
|
||||
"autoprefixer": "^10.4.0",
|
||||
"eslint": "^9.0.0",
|
||||
"@eslint/js": "^9.0.0",
|
||||
"typescript-eslint": "^8.0.0",
|
||||
"eslint-plugin-react-hooks": "^5.0.0",
|
||||
"knip": "^6.14.1",
|
||||
"postcss": "^8.5.14",
|
||||
"prettier": "^3.3.0",
|
||||
"prettier-plugin-tailwindcss": "^0.6.0",
|
||||
"tsx": "^4.16.0"
|
||||
"tailwindcss": "^3.4.0",
|
||||
"tsx": "^4.16.0",
|
||||
"typescript": "^5.5.0",
|
||||
"typescript-eslint": "^8.0.0",
|
||||
"vite": "^7.3.3",
|
||||
"vitest": "^4.1.8"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
|
||||
<rect width="64" height="64" rx="12" fill="#0a0a0a"/>
|
||||
<rect x="14" y="14" width="36" height="36" rx="6" fill="none" stroke="#ec4899" stroke-width="3"/>
|
||||
<path d="M22 22h20M22 30h20M22 38h12" stroke="#ec4899" stroke-width="3" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 335 B |
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "YTDescGen",
|
||||
"short_name": "YTDescGen",
|
||||
"description": "YouTube title, description, and tag generator for Gameplay No Commentary channels.",
|
||||
"start_url": "/youtube-generator/",
|
||||
"scope": "/youtube-generator/",
|
||||
"display": "standalone",
|
||||
"background_color": "#0a0a0a",
|
||||
"theme_color": "#0a0a0a",
|
||||
"lang": "en",
|
||||
"categories": ["productivity", "utilities", "multimedia"],
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.svg",
|
||||
"sizes": "any",
|
||||
"type": "image/svg+xml",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
User-agent: *
|
||||
Allow: /
|
||||
Sitemap: https://poli0981.github.io/youtube-generator/sitemap.xml
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://poli0981.github.io/youtube-generator/</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
</urlset>
|
||||
Generated
+186
-63
@@ -616,14 +616,20 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ctor"
|
||||
version = "0.2.9"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501"
|
||||
checksum = "352d39c2f7bef1d6ad73db6f5160efcaed66d94ef8c6c573a8410c00bf909a98"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
"ctor-proc-macro",
|
||||
"dtor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ctor-proc-macro"
|
||||
version = "0.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1"
|
||||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.23.0"
|
||||
@@ -658,6 +664,17 @@ dependencies = [
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dbus"
|
||||
version = "0.9.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b942602992bb7acfd1f51c49811c58a610ef9181b6e66f3e519d79b540a3bf73"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"libdbus-sys",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deranged"
|
||||
version = "0.5.8"
|
||||
@@ -818,6 +835,21 @@ dependencies = [
|
||||
"dtoa",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dtor"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1057d6c64987086ff8ed0fd3fbf377a6b7d205cc7715868cd401705f715cbe4"
|
||||
dependencies = [
|
||||
"dtor-proc-macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dtor-proc-macro"
|
||||
version = "0.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5"
|
||||
|
||||
[[package]]
|
||||
name = "dunce"
|
||||
version = "1.0.5"
|
||||
@@ -1616,7 +1648,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"png",
|
||||
"png 0.17.16",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1967,6 +1999,15 @@ version = "0.2.184"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
|
||||
|
||||
[[package]]
|
||||
name = "libdbus-sys"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043"
|
||||
dependencies = [
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
version = "0.7.4"
|
||||
@@ -2105,9 +2146,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "muda"
|
||||
version = "0.17.2"
|
||||
version = "0.19.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c9fec5a4e89860383d778d10563a605838f8f0b2f9303868937e5ff32e86177"
|
||||
checksum = "0ae8844f63b5b118e334e205585b8c5c17b984121dbdb179d44aeb087ffad3cb"
|
||||
dependencies = [
|
||||
"crossbeam-channel",
|
||||
"dpi",
|
||||
@@ -2118,10 +2159,10 @@ dependencies = [
|
||||
"objc2-core-foundation",
|
||||
"objc2-foundation",
|
||||
"once_cell",
|
||||
"png",
|
||||
"png 0.18.1",
|
||||
"serde",
|
||||
"thiserror 2.0.18",
|
||||
"windows-sys 0.60.2",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2139,12 +2180,6 @@ dependencies = [
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ndk-context"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
|
||||
|
||||
[[package]]
|
||||
name = "ndk-sys"
|
||||
version = "0.6.0+11769913"
|
||||
@@ -2226,6 +2261,27 @@ dependencies = [
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-cloud-kit"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"objc2",
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-core-data"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa"
|
||||
dependencies = [
|
||||
"objc2",
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-core-foundation"
|
||||
version = "0.3.2"
|
||||
@@ -2250,6 +2306,38 @@ dependencies = [
|
||||
"objc2-io-surface",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-core-image"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006"
|
||||
dependencies = [
|
||||
"objc2",
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-core-location"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009"
|
||||
dependencies = [
|
||||
"objc2",
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-core-text"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"objc2",
|
||||
"objc2-core-foundation",
|
||||
"objc2-core-graphics",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-encode"
|
||||
version = "4.1.0"
|
||||
@@ -2308,8 +2396,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"block2",
|
||||
"objc2",
|
||||
"objc2-cloud-kit",
|
||||
"objc2-core-data",
|
||||
"objc2-core-foundation",
|
||||
"objc2-core-graphics",
|
||||
"objc2-core-image",
|
||||
"objc2-core-location",
|
||||
"objc2-core-text",
|
||||
"objc2-foundation",
|
||||
"objc2-quartz-core",
|
||||
"objc2-user-notifications",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-user-notifications"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e"
|
||||
dependencies = [
|
||||
"objc2",
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
@@ -2463,7 +2570,6 @@ version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
|
||||
dependencies = [
|
||||
"phf_macros 0.11.3",
|
||||
"phf_shared 0.11.3",
|
||||
]
|
||||
|
||||
@@ -2525,7 +2631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
|
||||
dependencies = [
|
||||
"phf_shared 0.10.0",
|
||||
"rand 0.8.5",
|
||||
"rand 0.8.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2535,7 +2641,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
|
||||
dependencies = [
|
||||
"phf_shared 0.11.3",
|
||||
"rand 0.8.5",
|
||||
"rand 0.8.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2562,19 +2668,6 @@ dependencies = [
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_macros"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216"
|
||||
dependencies = [
|
||||
"phf_generator 0.11.3",
|
||||
"phf_shared 0.11.3",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf_macros"
|
||||
version = "0.13.1"
|
||||
@@ -2673,6 +2766,19 @@ dependencies = [
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "png"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"crc32fast",
|
||||
"fdeflate",
|
||||
"flate2",
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "polling"
|
||||
version = "3.11.0"
|
||||
@@ -2841,9 +2947,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.8.5"
|
||||
version = "0.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
||||
checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rand_chacha 0.3.1",
|
||||
@@ -3629,15 +3735,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tao"
|
||||
version = "0.34.8"
|
||||
version = "0.35.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9103edf55f2da3c82aea4c7fab7c4241032bfeea0e71fa557d98e00e7ce7cc20"
|
||||
checksum = "a33f7f9e486ade65fcf1e45c440f9236c904f5c1002cdc7fc6ae582777345ce4"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"block2",
|
||||
"core-foundation",
|
||||
"core-graphics",
|
||||
"crossbeam-channel",
|
||||
"dbus",
|
||||
"dispatch2",
|
||||
"dlopen2",
|
||||
"dpi",
|
||||
@@ -3648,13 +3755,14 @@ dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
"ndk",
|
||||
"ndk-context",
|
||||
"ndk-sys",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
"objc2-foundation",
|
||||
"objc2-ui-kit",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"percent-encoding",
|
||||
"raw-window-handle",
|
||||
"tao-macros",
|
||||
"unicode-segmentation",
|
||||
@@ -3684,9 +3792,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
||||
|
||||
[[package]]
|
||||
name = "tauri"
|
||||
version = "2.10.3"
|
||||
version = "2.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da77cc00fb9028caf5b5d4650f75e31f1ef3693459dfca7f7e506d1ecef0ba2d"
|
||||
checksum = "b93bd86d231f0a8138f11a02a584769fe4b703dc36ae133d783228dbc4801405"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
@@ -3735,9 +3843,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-build"
|
||||
version = "2.5.6"
|
||||
version = "2.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4bbc990d1dbf57a8e1c7fa2327f2a614d8b757805603c1b9ba5c81bade09fd4d"
|
||||
checksum = "3a318b234cc2dea65f575467bafcfb76286bce228ebc3778e337d61d03213007"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cargo_toml",
|
||||
@@ -3751,22 +3859,21 @@ dependencies = [
|
||||
"serde_json",
|
||||
"tauri-utils",
|
||||
"tauri-winres",
|
||||
"toml 0.9.12+spec-1.1.0",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-codegen"
|
||||
version = "2.5.5"
|
||||
version = "2.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4a24476afd977c5d5d169f72425868613d82747916dd29e0a357c84c4bd6d29"
|
||||
checksum = "6bd11644962add2549a60b7e7c6800f17d7020156e02f516021d8103e80cc528"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"brotli",
|
||||
"ico",
|
||||
"json-patch",
|
||||
"plist",
|
||||
"png",
|
||||
"png 0.17.16",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"semver",
|
||||
@@ -3784,9 +3891,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-macros"
|
||||
version = "2.5.5"
|
||||
version = "2.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d39b349a98dadaffebb73f0a40dcd1f23c999211e5a2e744403db384d0c33de7"
|
||||
checksum = "fed9d3742a37a355d2e47c9af924e9fbc112abb76f9835d35d4780e318419502"
|
||||
dependencies = [
|
||||
"heck 0.5.0",
|
||||
"proc-macro2",
|
||||
@@ -3899,10 +4006,25 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.10.1"
|
||||
name = "tauri-plugin-single-instance"
|
||||
version = "2.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2826d79a3297ed08cd6ea7f412644ef58e32969504bc4fbd8d7dbeabc4445ea2"
|
||||
checksum = "5c8f29386f5e9fdc699182388a33ee80a56de436d91b67459e86afef426282af"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tauri",
|
||||
"thiserror 2.0.18",
|
||||
"tracing",
|
||||
"windows-sys 0.60.2",
|
||||
"zbus",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8fef478ba1d2ac21c2d528740b24d0cb315e1e8b1111aae53fafac34804371fc"
|
||||
dependencies = [
|
||||
"cookie",
|
||||
"dpi",
|
||||
@@ -3925,9 +4047,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime-wry"
|
||||
version = "2.10.1"
|
||||
version = "2.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e11ea2e6f801d275fdd890d6c9603736012742a1c33b96d0db788c9cdebf7f9e"
|
||||
checksum = "a3989df2ae1c476404fe0a2e8ffc4cfbde97e51efd613c2bb5355fbc9ab52cf0"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
@@ -3951,14 +4073,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-utils"
|
||||
version = "2.8.3"
|
||||
version = "2.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "219a1f983a2af3653f75b5747f76733b0da7ff03069c7a41901a5eb3ace4557d"
|
||||
checksum = "d57200389a2f82b4b0a40ae29ca19b6978116e8f4d4e974c3234ce40c0ffbdec"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"brotli",
|
||||
"cargo_metadata",
|
||||
"ctor",
|
||||
"dom_query",
|
||||
"dunce",
|
||||
"glob",
|
||||
"html5ever 0.29.1",
|
||||
@@ -3968,7 +4091,8 @@ dependencies = [
|
||||
"kuchikiki",
|
||||
"log",
|
||||
"memchr",
|
||||
"phf 0.11.3",
|
||||
"phf 0.13.1",
|
||||
"plist",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
@@ -4323,9 +4447,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tray-icon"
|
||||
version = "0.21.3"
|
||||
version = "0.23.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a5e85aa143ceb072062fc4d6356c1b520a51d636e7bc8e77ec94be3608e5e80c"
|
||||
checksum = "15edbb0d80583e85ee8df283410038e17314df5cba30da2087a54a85216c0773"
|
||||
dependencies = [
|
||||
"crossbeam-channel",
|
||||
"dirs",
|
||||
@@ -4337,10 +4461,10 @@ dependencies = [
|
||||
"objc2-core-graphics",
|
||||
"objc2-foundation",
|
||||
"once_cell",
|
||||
"png",
|
||||
"png 0.18.1",
|
||||
"serde",
|
||||
"thiserror 2.0.18",
|
||||
"windows-sys 0.60.2",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5323,9 +5447,9 @@ checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
|
||||
|
||||
[[package]]
|
||||
name = "wry"
|
||||
version = "0.54.4"
|
||||
version = "0.55.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5a8135d8676225e5744de000d4dff5a082501bf7db6a1c1495034f8c314edbc"
|
||||
checksum = "186f9871daa55fd9c016578b810d149de58367113db7fb72b462d2323ce19514"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"block2",
|
||||
@@ -5411,16 +5535,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "yt-desc-gen"
|
||||
version = "0.11.0"
|
||||
version = "0.24.1"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tauri",
|
||||
"tauri-build",
|
||||
"tauri-plugin-dialog",
|
||||
"tauri-plugin-fs",
|
||||
"tauri-plugin-opener",
|
||||
"tauri-plugin-shell",
|
||||
"tauri-plugin-single-instance",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
[package]
|
||||
name = "yt-desc-gen"
|
||||
version = "0.11.0"
|
||||
version = "0.24.1"
|
||||
description = "YouTube Gameplay Description Generator"
|
||||
authors = ["poli0981"]
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
|
||||
[lib]
|
||||
name = "yt_desc_gen_lib"
|
||||
@@ -18,5 +19,4 @@ tauri-plugin-dialog = "2"
|
||||
tauri-plugin-fs = "2"
|
||||
tauri-plugin-opener = "2"
|
||||
tauri-plugin-shell = "2"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
tauri-plugin-single-instance = "2"
|
||||
@@ -1 +1 @@
|
||||
{"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command Line truncated
|
||||
{"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-reLine truncated
|
||||
@@ -2385,10 +2385,10 @@
|
||||
"markdownDescription": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`"
|
||||
},
|
||||
{
|
||||
"description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`",
|
||||
"description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`",
|
||||
"type": "string",
|
||||
"const": "core:app:default",
|
||||
"markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`"
|
||||
"markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`"
|
||||
},
|
||||
{
|
||||
"description": "Enables the app_hide command without any pre-configured scope.",
|
||||
@@ -2462,6 +2462,12 @@
|
||||
"const": "core:app:allow-set-dock-visibility",
|
||||
"markdownDescription": "Enables the set_dock_visibility command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the supports_multiple_windows command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:app:allow-supports-multiple-windows",
|
||||
"markdownDescription": "Enables the supports_multiple_windows command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the tauri_version command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2546,6 +2552,12 @@
|
||||
"const": "core:app:deny-set-dock-visibility",
|
||||
"markdownDescription": "Denies the set_dock_visibility command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the supports_multiple_windows command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:app:deny-supports-multiple-windows",
|
||||
"markdownDescription": "Denies the supports_multiple_windows command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the tauri_version command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -3069,10 +3081,10 @@
|
||||
"markdownDescription": "Denies the close command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-show-menu-on-left-click`",
|
||||
"description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`",
|
||||
"type": "string",
|
||||
"const": "core:tray:default",
|
||||
"markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-show-menu-on-left-click`"
|
||||
"markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`"
|
||||
},
|
||||
{
|
||||
"description": "Enables the get_by_id command without any pre-configured scope.",
|
||||
@@ -3104,6 +3116,12 @@
|
||||
"const": "core:tray:allow-set-icon-as-template",
|
||||
"markdownDescription": "Enables the set_icon_as_template command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the set_icon_with_as_template command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:tray:allow-set-icon-with-as-template",
|
||||
"markdownDescription": "Enables the set_icon_with_as_template command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the set_menu command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -3170,6 +3188,12 @@
|
||||
"const": "core:tray:deny-set-icon-as-template",
|
||||
"markdownDescription": "Denies the set_icon_as_template command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the set_icon_with_as_template command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:tray:deny-set-icon-with-as-template",
|
||||
"markdownDescription": "Denies the set_icon_with_as_template command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the set_menu command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -3429,10 +3453,16 @@
|
||||
"markdownDescription": "Denies the webview_size command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-internal-toggle-maximize`",
|
||||
"description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`",
|
||||
"type": "string",
|
||||
"const": "core:window:default",
|
||||
"markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-internal-toggle-maximize`"
|
||||
"markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`"
|
||||
},
|
||||
{
|
||||
"description": "Enables the activity_name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:window:allow-activity-name",
|
||||
"markdownDescription": "Enables the activity_name command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the available_monitors command without any pre-configured scope.",
|
||||
@@ -3626,6 +3656,12 @@
|
||||
"const": "core:window:allow-scale-factor",
|
||||
"markdownDescription": "Enables the scale_factor command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the scene_identifier command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:window:allow-scene-identifier",
|
||||
"markdownDescription": "Enables the scene_identifier command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the set_always_on_bottom command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -3890,6 +3926,12 @@
|
||||
"const": "core:window:allow-unminimize",
|
||||
"markdownDescription": "Enables the unminimize command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the activity_name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:window:deny-activity-name",
|
||||
"markdownDescription": "Denies the activity_name command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the available_monitors command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4082,6 +4124,12 @@
|
||||
"const": "core:window:deny-scale-factor",
|
||||
"markdownDescription": "Denies the scale_factor command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the scene_identifier command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:window:deny-scene-identifier",
|
||||
"markdownDescription": "Denies the scene_identifier command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the set_always_on_bottom command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
|
||||
@@ -2385,10 +2385,10 @@
|
||||
"markdownDescription": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`"
|
||||
},
|
||||
{
|
||||
"description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`",
|
||||
"description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`",
|
||||
"type": "string",
|
||||
"const": "core:app:default",
|
||||
"markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`"
|
||||
"markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`"
|
||||
},
|
||||
{
|
||||
"description": "Enables the app_hide command without any pre-configured scope.",
|
||||
@@ -2462,6 +2462,12 @@
|
||||
"const": "core:app:allow-set-dock-visibility",
|
||||
"markdownDescription": "Enables the set_dock_visibility command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the supports_multiple_windows command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:app:allow-supports-multiple-windows",
|
||||
"markdownDescription": "Enables the supports_multiple_windows command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the tauri_version command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -2546,6 +2552,12 @@
|
||||
"const": "core:app:deny-set-dock-visibility",
|
||||
"markdownDescription": "Denies the set_dock_visibility command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the supports_multiple_windows command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:app:deny-supports-multiple-windows",
|
||||
"markdownDescription": "Denies the supports_multiple_windows command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the tauri_version command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -3069,10 +3081,10 @@
|
||||
"markdownDescription": "Denies the close command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-show-menu-on-left-click`",
|
||||
"description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`",
|
||||
"type": "string",
|
||||
"const": "core:tray:default",
|
||||
"markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-show-menu-on-left-click`"
|
||||
"markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`"
|
||||
},
|
||||
{
|
||||
"description": "Enables the get_by_id command without any pre-configured scope.",
|
||||
@@ -3104,6 +3116,12 @@
|
||||
"const": "core:tray:allow-set-icon-as-template",
|
||||
"markdownDescription": "Enables the set_icon_as_template command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the set_icon_with_as_template command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:tray:allow-set-icon-with-as-template",
|
||||
"markdownDescription": "Enables the set_icon_with_as_template command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the set_menu command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -3170,6 +3188,12 @@
|
||||
"const": "core:tray:deny-set-icon-as-template",
|
||||
"markdownDescription": "Denies the set_icon_as_template command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the set_icon_with_as_template command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:tray:deny-set-icon-with-as-template",
|
||||
"markdownDescription": "Denies the set_icon_with_as_template command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the set_menu command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -3429,10 +3453,16 @@
|
||||
"markdownDescription": "Denies the webview_size command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-internal-toggle-maximize`",
|
||||
"description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`",
|
||||
"type": "string",
|
||||
"const": "core:window:default",
|
||||
"markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-internal-toggle-maximize`"
|
||||
"markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`"
|
||||
},
|
||||
{
|
||||
"description": "Enables the activity_name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:window:allow-activity-name",
|
||||
"markdownDescription": "Enables the activity_name command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the available_monitors command without any pre-configured scope.",
|
||||
@@ -3626,6 +3656,12 @@
|
||||
"const": "core:window:allow-scale-factor",
|
||||
"markdownDescription": "Enables the scale_factor command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the scene_identifier command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:window:allow-scene-identifier",
|
||||
"markdownDescription": "Enables the scene_identifier command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Enables the set_always_on_bottom command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -3890,6 +3926,12 @@
|
||||
"const": "core:window:allow-unminimize",
|
||||
"markdownDescription": "Enables the unminimize command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the activity_name command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:window:deny-activity-name",
|
||||
"markdownDescription": "Denies the activity_name command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the available_monitors command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
@@ -4082,6 +4124,12 @@
|
||||
"const": "core:window:deny-scale-factor",
|
||||
"markdownDescription": "Denies the scale_factor command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the scene_identifier command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
"const": "core:window:deny-scene-identifier",
|
||||
"markdownDescription": "Denies the scene_identifier command without any pre-configured scope."
|
||||
},
|
||||
{
|
||||
"description": "Denies the set_always_on_bottom command without any pre-configured scope.",
|
||||
"type": "string",
|
||||
|
||||
+90
-1
@@ -20,6 +20,75 @@ fn read_from_file(path: String) -> Result<String, String> {
|
||||
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,
|
||||
/// rather than rewriting the whole file on every log call. Cheap
|
||||
/// enough that we can call it on every `addEntry` without batching.
|
||||
/// The caller is responsible for newline termination — this is a raw
|
||||
/// byte append, not a line writer.
|
||||
#[tauri::command]
|
||||
fn append_to_file(path: String, content: String) -> Result<(), String> {
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::Write;
|
||||
if let Some(parent) = std::path::Path::new(&path).parent() {
|
||||
std::fs::create_dir_all(parent).map_err(|e| e.to_string())?;
|
||||
}
|
||||
let mut file = OpenOptions::new()
|
||||
.append(true)
|
||||
.create(true)
|
||||
.open(&path)
|
||||
.map_err(|e| e.to_string())?;
|
||||
file.write_all(content.as_bytes()).map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
/// List entries in a directory, returning their file names (not full
|
||||
/// paths). Used by the v0.17.0 log retention sweep to find
|
||||
/// `ytdescgen-*.jsonl` files older than the configured retention
|
||||
/// window. Returns an empty vec if the directory doesn't exist
|
||||
/// (i.e. no logs have been written yet) — first-run safe.
|
||||
#[tauri::command]
|
||||
fn list_dir(path: String) -> Result<Vec<String>, String> {
|
||||
let dir = std::path::Path::new(&path);
|
||||
if !dir.exists() {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
let entries = std::fs::read_dir(dir).map_err(|e| e.to_string())?;
|
||||
let mut names = Vec::new();
|
||||
for entry in entries.flatten() {
|
||||
if let Some(name) = entry.file_name().to_str() {
|
||||
names.push(name.to_string());
|
||||
}
|
||||
}
|
||||
Ok(names)
|
||||
}
|
||||
|
||||
/// Delete a file at `path` if it exists. No-op when the file is
|
||||
/// missing (used by log retention sweep — racing with another sweep
|
||||
/// or a manual cleanup shouldn't error). Returns the OS error string
|
||||
/// on permission failures.
|
||||
#[tauri::command]
|
||||
fn delete_file(path: String) -> Result<(), String> {
|
||||
let p = std::path::Path::new(&path);
|
||||
if !p.exists() {
|
||||
return Ok(());
|
||||
}
|
||||
std::fs::remove_file(p).map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
// Flag that signals the user has requested a full quit (via tray menu).
|
||||
@@ -31,6 +100,19 @@ pub fn run() {
|
||||
let quitting_run = quitting.clone();
|
||||
|
||||
tauri::Builder::default()
|
||||
// Single-instance MUST be the first plugin registered (v0.12). Without
|
||||
// it, every launch spawns a fresh process — which then builds its own
|
||||
// tray icon in `setup()`, stacking duplicates in the system tray and
|
||||
// leaving orphan processes in Task Manager. The callback runs in the
|
||||
// *first* (already-running) instance when a second launch is attempted:
|
||||
// we surface its window instead of letting the second process boot.
|
||||
.plugin(tauri_plugin_single_instance::init(|app, _argv, _cwd| {
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
let _ = window.show();
|
||||
let _ = window.unminimize();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
}))
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
@@ -86,7 +168,14 @@ pub fn run() {
|
||||
}
|
||||
}
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![save_to_file, read_from_file])
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
save_to_file,
|
||||
read_from_file,
|
||||
ensure_dir,
|
||||
append_to_file,
|
||||
list_dir,
|
||||
delete_file
|
||||
])
|
||||
.build(tauri::generate_context!())
|
||||
.expect("error while building tauri application")
|
||||
.run(move |_app_handle, event| {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
|
||||
"productName": "YTDescGen",
|
||||
"version": "0.11.0",
|
||||
"version": "0.24.1",
|
||||
"identifier": "com.skullmute.ytdescgen",
|
||||
"build": {
|
||||
"beforeBuildCommand": "npm run build",
|
||||
@@ -15,9 +15,12 @@
|
||||
"title": "YTDescGen",
|
||||
"width": 1100,
|
||||
"height": 750,
|
||||
"minWidth": 800,
|
||||
"minHeight": 600,
|
||||
"resizable": true,
|
||||
"minWidth": 1100,
|
||||
"minHeight": 750,
|
||||
"maxWidth": 1100,
|
||||
"maxHeight": 750,
|
||||
"resizable": false,
|
||||
"maximizable": false,
|
||||
"fullscreen": false,
|
||||
"center": true
|
||||
}
|
||||
|
||||
+89
-39
@@ -1,12 +1,15 @@
|
||||
import { lazy, Suspense, useEffect } from "react";
|
||||
import { lazy, Suspense, useEffect, type ReactNode } from "react";
|
||||
import { HashRouter, Routes, Route } from "react-router-dom";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import toast from "react-hot-toast";
|
||||
import { AppShell } from "@components/layout/AppShell";
|
||||
import { ErrorBoundary } from "@components/ErrorBoundary";
|
||||
import { EditorPage } from "@pages/EditorPage";
|
||||
import { OutputPage } from "@pages/OutputPage";
|
||||
import { checkDataFileHealth } from "@utils/storage-adapter";
|
||||
import "@i18n/index";
|
||||
import { hydrateLogStore } from "@store/log-store";
|
||||
import { useSettingsStore } from "@store/settings-store";
|
||||
import i18n from "@i18n/index";
|
||||
|
||||
const ProfilesPage = lazy(() =>
|
||||
import("@pages/ProfilesPage").then((m) => ({ default: m.ProfilesPage })),
|
||||
@@ -20,6 +23,9 @@ const SettingsPage = lazy(() =>
|
||||
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 })),
|
||||
);
|
||||
@@ -34,11 +40,65 @@ function PageLoader() {
|
||||
return <div className="flex items-center justify-center p-12 text-text-muted">Loading...</div>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap a lazy-loaded page in both a {@link Suspense} (for the dynamic
|
||||
* import) and an {@link ErrorBoundary} (for render errors). The
|
||||
* boundary sits *outside* Suspense so a thrown error during lazy
|
||||
* resolution also gets caught, not just errors from rendered children.
|
||||
* Each route gets its own boundary instance so a crash on one tab
|
||||
* cannot black-screen the whole app — the user can navigate elsewhere
|
||||
* and recover.
|
||||
*/
|
||||
function PageBoundary({ label, children }: { label: string; children: ReactNode }) {
|
||||
return (
|
||||
<ErrorBoundary label={label}>
|
||||
<Suspense fallback={<PageLoader />}>{children}</Suspense>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
useEffect(() => {
|
||||
checkDataFileHealth().then((msg) => {
|
||||
if (msg) toast(msg, { icon: "⚠️", duration: 5000 });
|
||||
});
|
||||
// v0.17.0: hydrate the log store from persisted JSONL files /
|
||||
// localStorage so prior-session entries surface in the Logs tab
|
||||
// accordion. Uses the current `logRetentionDays` setting — read
|
||||
// directly off the store at mount time so we don't rerun on
|
||||
// every settings tweak.
|
||||
const retentionDays = useSettingsStore.getState().logRetentionDays;
|
||||
void hydrateLogStore(retentionDays);
|
||||
}, []);
|
||||
|
||||
// v0.18.0: bridge the persisted `appLanguage` setting back to i18next.
|
||||
//
|
||||
// i18n is initialised synchronously at module load with `fallbackLng:
|
||||
// "en"` and no `lng` field — so on a fresh app boot the UI renders in
|
||||
// English even when localStorage / settings.json contain a non-English
|
||||
// preference. Zustand's persist middleware rehydrates the store
|
||||
// synchronously from localStorage *before* React mounts, and the
|
||||
// storage-adapter then *asynchronously* reads the Tauri `settings.json`
|
||||
// and may overwrite the value again. We cover both paths:
|
||||
//
|
||||
// 1. Read the current `appLanguage` at mount time and push it into
|
||||
// i18n — handles the synchronous localStorage hydrate.
|
||||
// 2. Subscribe to subsequent changes so the async Tauri rehydrate
|
||||
// (and any future user-driven switch via Header / SettingsPage)
|
||||
// also propagates. The Header/SettingsPage callsites still call
|
||||
// `i18n.changeLanguage` directly, which is now redundant but
|
||||
// harmless — the subscribe is the single source of truth.
|
||||
useEffect(() => {
|
||||
const initialLang = useSettingsStore.getState().appLanguage;
|
||||
if (initialLang && i18n.language !== initialLang) {
|
||||
void i18n.changeLanguage(initialLang);
|
||||
}
|
||||
const unsub = useSettingsStore.subscribe((state, prev) => {
|
||||
if (state.appLanguage !== prev.appLanguage) {
|
||||
void i18n.changeLanguage(state.appLanguage);
|
||||
}
|
||||
});
|
||||
return () => unsub();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -46,63 +106,53 @@ export default function App() {
|
||||
<HashRouter>
|
||||
<Routes>
|
||||
<Route element={<AppShell />}>
|
||||
<Route index element={<EditorPage />} />
|
||||
<Route path="output" element={<OutputPage />} />
|
||||
<Route
|
||||
index
|
||||
element={
|
||||
<ErrorBoundary label="Editor">
|
||||
<EditorPage />
|
||||
</ErrorBoundary>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="output"
|
||||
element={
|
||||
<ErrorBoundary label="Output">
|
||||
<OutputPage />
|
||||
</ErrorBoundary>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="profiles"
|
||||
element={
|
||||
<Suspense fallback={<PageLoader />}>
|
||||
<ProfilesPage />
|
||||
</Suspense>
|
||||
}
|
||||
element={<PageBoundary label="Profiles"><ProfilesPage /></PageBoundary>}
|
||||
/>
|
||||
<Route
|
||||
path="history"
|
||||
element={
|
||||
<Suspense fallback={<PageLoader />}>
|
||||
<HistoryPage />
|
||||
</Suspense>
|
||||
}
|
||||
element={<PageBoundary label="History"><HistoryPage /></PageBoundary>}
|
||||
/>
|
||||
<Route
|
||||
path="settings"
|
||||
element={
|
||||
<Suspense fallback={<PageLoader />}>
|
||||
<SettingsPage />
|
||||
</Suspense>
|
||||
}
|
||||
element={<PageBoundary label="Settings"><SettingsPage /></PageBoundary>}
|
||||
/>
|
||||
<Route
|
||||
path="batch"
|
||||
element={
|
||||
<Suspense fallback={<PageLoader />}>
|
||||
<BatchPage />
|
||||
</Suspense>
|
||||
}
|
||||
element={<PageBoundary label="Batch"><BatchPage /></PageBoundary>}
|
||||
/>
|
||||
<Route
|
||||
path="social"
|
||||
element={<PageBoundary label="Social"><SocialPage /></PageBoundary>}
|
||||
/>
|
||||
<Route
|
||||
path="playlist"
|
||||
element={
|
||||
<Suspense fallback={<PageLoader />}>
|
||||
<PlaylistPage />
|
||||
</Suspense>
|
||||
}
|
||||
element={<PageBoundary label="Playlist"><PlaylistPage /></PageBoundary>}
|
||||
/>
|
||||
<Route
|
||||
path="logs"
|
||||
element={
|
||||
<Suspense fallback={<PageLoader />}>
|
||||
<LogPage />
|
||||
</Suspense>
|
||||
}
|
||||
element={<PageBoundary label="Logs"><LogPage /></PageBoundary>}
|
||||
/>
|
||||
<Route
|
||||
path="about"
|
||||
element={
|
||||
<Suspense fallback={<PageLoader />}>
|
||||
<AboutPage />
|
||||
</Suspense>
|
||||
}
|
||||
element={<PageBoundary label="About"><AboutPage /></PageBoundary>}
|
||||
/>
|
||||
</Route>
|
||||
</Routes>
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
import { Component, type ErrorInfo, type ReactNode } from "react";
|
||||
import { AlertTriangle, RotateCcw } from "lucide-react";
|
||||
|
||||
interface ErrorBoundaryProps {
|
||||
/** Children to render normally. The boundary only kicks in on render
|
||||
* errors thrown inside this subtree. */
|
||||
children: ReactNode;
|
||||
/** Human label that appears in the fallback UI to tell the user
|
||||
* *what* crashed (e.g. "Profiles tab", "Editor"). Defaults to a
|
||||
* generic "this section" copy so the boundary still degrades nicely
|
||||
* if a caller forgets the prop. */
|
||||
label?: string;
|
||||
/** Optional callback fired on every catch — useful in tests, or to
|
||||
* funnel boundary errors into a centralised reporter. The component
|
||||
* also logs to `useLogStore` directly so the in-app Log tab gets a
|
||||
* copy regardless. */
|
||||
onError?: (error: Error, info: ErrorInfo) => void;
|
||||
}
|
||||
|
||||
interface ErrorBoundaryState {
|
||||
error: Error | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class-based React error boundary — there is still no hook equivalent
|
||||
* in React 18 (and as of React 19 only `useErrorBoundary` from external
|
||||
* libraries cover the gap). Catches *render-time* exceptions from any
|
||||
* descendant component and swaps in a fallback UI so the rest of the
|
||||
* app keeps working.
|
||||
*
|
||||
* Motivation: v0.13.x had no boundary anywhere, so any render error —
|
||||
* most commonly `Cannot convert undefined or null to object` when a
|
||||
* malformed profile / template was loaded via Object spread — escalated
|
||||
* into a black-screen crash. The boundary nets those errors at the
|
||||
* route level, surfaces a recovery affordance, and writes a structured
|
||||
* entry to the in-app log tab so the user can copy it into a bug
|
||||
* report.
|
||||
*
|
||||
* Per-route boundaries (one per `<Route>`) mean a crash on the Profiles
|
||||
* tab does not take down the Editor — the user can navigate away,
|
||||
* adjust state, and click "Try again" to remount the broken subtree.
|
||||
*
|
||||
* Does NOT catch: async errors (Promise rejections), event-handler
|
||||
* errors, SSR errors. For those use try/catch + the in-app logger
|
||||
* directly (see `SettingsPage.importSettingsFromFile`).
|
||||
*/
|
||||
export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
||||
state: ErrorBoundaryState = { error: null };
|
||||
|
||||
static getDerivedStateFromError(error: Error): ErrorBoundaryState {
|
||||
return { error };
|
||||
}
|
||||
|
||||
componentDidCatch(error: Error, info: ErrorInfo): void {
|
||||
// Best-effort: pull the in-app logger lazily so the boundary stays
|
||||
// importable from non-React entry points. We never let the logger
|
||||
// itself throw a secondary error — if the log store is missing we
|
||||
// fall back to the browser console.
|
||||
try {
|
||||
// Dynamic import dodges a circular dep with files that themselves
|
||||
// import ErrorBoundary, e.g. when the boundary is mounted in
|
||||
// main.tsx before the store has registered.
|
||||
void import("@utils/logger").then(({ logger }) => {
|
||||
logger.error(
|
||||
"errorBoundary",
|
||||
`[${this.props.label ?? "app"}] ${error.message}`,
|
||||
info.componentStack ?? error.stack ?? "",
|
||||
);
|
||||
});
|
||||
} catch {
|
||||
console.error("ErrorBoundary caught:", error, info);
|
||||
}
|
||||
this.props.onError?.(error, info);
|
||||
}
|
||||
|
||||
private handleReset = (): void => {
|
||||
this.setState({ error: null });
|
||||
};
|
||||
|
||||
private handleReload = (): void => {
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
render(): ReactNode {
|
||||
if (!this.state.error) return this.props.children;
|
||||
|
||||
const label = this.props.label ?? "this section";
|
||||
|
||||
return (
|
||||
<div className="flex min-h-[200px] items-center justify-center p-6">
|
||||
<div className="w-full max-w-md rounded-lg border border-danger/40 bg-surface-2 p-5 shadow-md shadow-black/10">
|
||||
<div className="mb-3 flex items-center gap-2 text-danger">
|
||||
<AlertTriangle className="h-4 w-4" />
|
||||
<h2 className="text-sm font-semibold">
|
||||
Something went wrong in {label}
|
||||
</h2>
|
||||
</div>
|
||||
<p className="mb-3 text-xs text-text-secondary">
|
||||
The app caught a render error before it could crash the page.
|
||||
Your data is safe — the error has been logged to the Logs
|
||||
tab.
|
||||
</p>
|
||||
<pre className="mb-4 max-h-32 overflow-auto whitespace-pre-wrap rounded bg-surface-3 p-2 text-[11px] text-text-muted">
|
||||
{this.state.error.message}
|
||||
</pre>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={this.handleReset}
|
||||
className="inline-flex items-center gap-1.5 rounded bg-accent px-3 py-1.5 text-xs font-semibold text-white hover:bg-accent-hover"
|
||||
>
|
||||
<RotateCcw className="h-3.5 w-3.5" />
|
||||
Try again
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={this.handleReload}
|
||||
className="inline-flex items-center gap-1.5 rounded border border-border bg-surface-2 px-3 py-1.5 text-xs font-semibold text-text-primary hover:bg-surface-3"
|
||||
>
|
||||
Reload page
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Select } from "@components/ui/Select";
|
||||
import { Input } from "@components/ui/Input";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import {
|
||||
PLAYTHROUGH_STATUSES,
|
||||
DIFFICULTY_LEVELS,
|
||||
type PlaythroughStatus,
|
||||
type DifficultyLevel,
|
||||
} from "@engine/types";
|
||||
|
||||
/**
|
||||
* Metadata that tells viewers "what kind of run is this". Lives in the
|
||||
* Content Details accordion alongside timestamps. v0.11 moved the
|
||||
* content-warning checklist out into its own component
|
||||
* ({@link ContentWarningChecklist}) — 40+ items needed a searchable
|
||||
* grouped layout that didn't fit the generic ChipGroup primitive.
|
||||
*
|
||||
* Design notes:
|
||||
* - Playthrough + Difficulty default to `"none"`, which renders as "(no
|
||||
* value)" in the select and suppresses the section in the generated
|
||||
* description. Makes "no opinion" explicit rather than ambiguous.
|
||||
* - The custom-difficulty input only appears when the creator picks
|
||||
* `"custom"` — free-form text is intentionally not translated, so
|
||||
* game-specific names like "Lethal" or "Blueberry" survive a locale
|
||||
* switch unchanged.
|
||||
*/
|
||||
export function ContentDetailsForm() {
|
||||
const { t } = useTranslation("ui");
|
||||
const store = useEditorStore();
|
||||
|
||||
const playthroughOptions = PLAYTHROUGH_STATUSES.map((id) => ({
|
||||
value: id,
|
||||
label: t(`editor.playthroughOptions.${id}`),
|
||||
}));
|
||||
|
||||
const difficultyOptions = DIFFICULTY_LEVELS.map((id) => ({
|
||||
value: id,
|
||||
label: t(`editor.difficultyOptions.${id}`),
|
||||
}));
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<Select
|
||||
label={t("editor.playthrough")}
|
||||
options={playthroughOptions}
|
||||
value={store.playthroughStatus}
|
||||
onChange={(v) => store.set("playthroughStatus", v as PlaythroughStatus)}
|
||||
/>
|
||||
<Select
|
||||
label={t("editor.difficulty")}
|
||||
options={difficultyOptions}
|
||||
value={store.difficulty}
|
||||
onChange={(v) => store.set("difficulty", v as DifficultyLevel)}
|
||||
/>
|
||||
{store.difficulty === "custom" && (
|
||||
<Input
|
||||
label={t("editor.difficultyCustomLabel")}
|
||||
placeholder={t("editor.difficultyCustomPlaceholder")}
|
||||
value={store.difficultyCustomLabel}
|
||||
onChange={(e) => store.set("difficultyCustomLabel", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -31,7 +31,9 @@ export function ContentWarningChecklist() {
|
||||
photosensitive: false,
|
||||
phobias: false,
|
||||
mental_health: false,
|
||||
social_phenomena: false,
|
||||
sensitive: false,
|
||||
horror_specific: false,
|
||||
}));
|
||||
|
||||
const trimmedQuery = query.trim().toLowerCase();
|
||||
|
||||
@@ -0,0 +1,406 @@
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
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 { parseTimeline } from "@engine/timeline-parser";
|
||||
import { formatEndingEntry } from "@engine/endings-format";
|
||||
import type { EndingEntry, EndingVideoRange } from "@engine/types";
|
||||
|
||||
/** Editor cap, matching the original spec ("Giá trị từ 1 - 100"). */
|
||||
const MAX_ENDINGS = 100;
|
||||
|
||||
/**
|
||||
* Structured ending editor (v0.16.0). Replaces the freeform
|
||||
* "Endings shown" single Input that used to live in
|
||||
* `PlaythroughNotesForm`.
|
||||
*
|
||||
* Three logical cases drive the layout:
|
||||
*
|
||||
* • Case A — `endings.length <= 1`:
|
||||
* Single Number + Name pair. At least one of the two must be
|
||||
* filled; otherwise a banner explains that the entry will be
|
||||
* dropped from the description bullet.
|
||||
*
|
||||
* • Case B — `endings.length >= 2` AND `endingVideoCount === 1`:
|
||||
* Table with one row per ending. A gate inspects the
|
||||
* Timestamps textarea — if it doesn't contain at least
|
||||
* `endings.length` lines matching the `ending` keyword, a
|
||||
* warning banner surfaces. (The actual copy-blocking is wired
|
||||
* in CopyAllBar; this component just renders the banner so the
|
||||
* creator sees the problem inline with the field that caused
|
||||
* it.)
|
||||
*
|
||||
* • Case C — `endings.length >= 2` AND `endingVideoCount >= 2`:
|
||||
* Endings table + a per-video range table. Default ranges are
|
||||
* contiguous and balanced (extras spill into the last video);
|
||||
* the creator can override per-row. Invalid overlaps /
|
||||
* coverage gaps surface as inline warnings.
|
||||
*
|
||||
* The "Ending shown" preview line under each entry mirrors the
|
||||
* formatter used by the description builder so creators see exactly
|
||||
* what will land in the rendered bullet.
|
||||
*/
|
||||
export function EndingsEditor() {
|
||||
const { t } = useTranslation("ui");
|
||||
const endings = useEditorStore((s) => s.endings);
|
||||
const endingVideoCount = useEditorStore((s) => s.endingVideoCount);
|
||||
const endingVideoRanges = useEditorStore((s) => s.endingVideoRanges);
|
||||
const endingVideoIndex = useEditorStore((s) => s.endingVideoIndex);
|
||||
const timestamps = useEditorStore((s) => s.timestamps);
|
||||
const set = useEditorStore((s) => s.set);
|
||||
|
||||
const count = endings.length;
|
||||
const isMultiEnding = count >= 2;
|
||||
const isMultiVideo = isMultiEnding && endingVideoCount >= 2;
|
||||
|
||||
/**
|
||||
* Count timeline lines tagged as the "ending" keyword. Used by case
|
||||
* B as a copy-time validity gate — the creator must declare at
|
||||
* least as many timeline markers as the structured array claims.
|
||||
*/
|
||||
const timelineEndingCount = useMemo(() => {
|
||||
if (!isMultiEnding || isMultiVideo) return 0;
|
||||
const parsed = parseTimeline(timestamps);
|
||||
return parsed.filter((e) => e.keyword === "ending").length;
|
||||
}, [timestamps, isMultiEnding, isMultiVideo]);
|
||||
|
||||
/** Resize the structured `endings[]` array to a new length, padding
|
||||
* with empty entries or truncating. Triggers a range recompute so
|
||||
* case C stays in sync when going from 6→4 endings etc. */
|
||||
const setEndingCount = (next: number) => {
|
||||
const clamped = Math.max(0, Math.min(MAX_ENDINGS, Math.floor(next)));
|
||||
const nextEndings: EndingEntry[] =
|
||||
clamped <= count
|
||||
? endings.slice(0, clamped)
|
||||
: [...endings, ...Array.from({ length: clamped - count }, () => ({ number: null, name: "" }))];
|
||||
set("endings", nextEndings);
|
||||
|
||||
// Re-derive endingVideoCount + ranges so the schema invariants
|
||||
// (videoCount <= endings.length, ranges.length === videoCount)
|
||||
// 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),
|
||||
);
|
||||
};
|
||||
|
||||
/** Update one ending row's number / name. */
|
||||
const updateEnding = (i: number, patch: Partial<EndingEntry>) => {
|
||||
const next = endings.map((e, idx) => (idx === i ? { ...e, ...patch } : e));
|
||||
set("endings", next);
|
||||
};
|
||||
|
||||
/** Update the multi-video count (case C). Recomputes default ranges
|
||||
* on change unless the creator has already customised them — we
|
||||
* always reset on count change because a manual override at the old
|
||||
* count is unlikely to make sense at the new one. Also clamps
|
||||
* `endingVideoIndex` so a shrink doesn't leave us previewing a
|
||||
* video that no longer exists. */
|
||||
const setVideoCount = (next: number) => {
|
||||
if (count === 0) return;
|
||||
const clamped = Math.max(1, Math.min(count, Math.floor(next)));
|
||||
set("endingVideoCount", clamped);
|
||||
set("endingVideoRanges", computeContiguousRanges(count, clamped));
|
||||
if (endingVideoIndex > clamped) {
|
||||
set("endingVideoIndex", clamped);
|
||||
}
|
||||
};
|
||||
|
||||
/** Update one video's `from` / `to` bound (case C). Doesn't enforce
|
||||
* non-overlap inline — the warning banner surfaces invalid
|
||||
* configurations after the fact, since mid-edit overlaps are
|
||||
* expected. */
|
||||
const updateRange = (i: number, patch: Partial<EndingVideoRange>) => {
|
||||
const next = endingVideoRanges.map((r, idx) =>
|
||||
idx === i ? { ...r, ...patch } : r,
|
||||
);
|
||||
set("endingVideoRanges", next);
|
||||
};
|
||||
|
||||
/**
|
||||
* Inspect the current ranges array for overlap / gap / out-of-bounds
|
||||
* errors. Returns a translation-key list that the warning banner
|
||||
* iterates. Pure-ish — closes over `endingVideoRanges` + `count`.
|
||||
*/
|
||||
const rangeWarnings: string[] = useMemo(() => {
|
||||
if (!isMultiVideo) return [];
|
||||
const warnings: string[] = [];
|
||||
const sorted = [...endingVideoRanges]
|
||||
.map((r, idx) => ({ idx, ...r }))
|
||||
.sort((a, b) => a.from - b.from);
|
||||
for (const r of sorted) {
|
||||
if (r.from < 1 || r.to > count || r.from > r.to) {
|
||||
warnings.push(
|
||||
t("editor.endings.warnings.rangeInvalid", {
|
||||
video: r.idx + 1,
|
||||
from: r.from,
|
||||
to: r.to,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
// Coverage + overlap pass.
|
||||
let covered = 0;
|
||||
for (let i = 0; i < sorted.length; i++) {
|
||||
const r = sorted[i];
|
||||
if (!r) continue;
|
||||
if (r.from > covered + 1) {
|
||||
warnings.push(t("editor.endings.warnings.rangeGap", { at: covered + 1 }));
|
||||
}
|
||||
if (r.from <= covered) {
|
||||
warnings.push(t("editor.endings.warnings.rangeOverlap", { at: r.from }));
|
||||
}
|
||||
if (r.to > covered) covered = r.to;
|
||||
}
|
||||
if (covered < count) {
|
||||
warnings.push(t("editor.endings.warnings.rangeShort", { at: covered + 1, total: count }));
|
||||
}
|
||||
return warnings;
|
||||
}, [endingVideoRanges, count, isMultiVideo, t]);
|
||||
|
||||
/** Build the "Ending shown" preview string for a single entry. */
|
||||
const previewFor = (entry: EndingEntry): string =>
|
||||
formatEndingEntry(entry) ?? t("editor.endings.previewEmpty");
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex items-end gap-2">
|
||||
<div className="flex-1">
|
||||
<Input
|
||||
label={t("editor.endings.countLabel")}
|
||||
type="number"
|
||||
min={0}
|
||||
max={MAX_ENDINGS}
|
||||
value={String(count)}
|
||||
onChange={(e) => setEndingCount(Number(e.target.value) || 0)}
|
||||
/>
|
||||
</div>
|
||||
{count > 0 && (
|
||||
<div className="flex gap-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setEndingCount(count - 1)}
|
||||
aria-label={t("editor.endings.removeLast")}
|
||||
>
|
||||
<Minus className="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setEndingCount(count + 1)}
|
||||
aria-label={t("editor.endings.addOne")}
|
||||
disabled={count >= MAX_ENDINGS}
|
||||
>
|
||||
<Plus className="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{count === 0 && (
|
||||
<p className="text-xs text-text-muted">{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="grid grid-cols-[100px_1fr] gap-2">
|
||||
<Input
|
||||
label={t("editor.endings.numberLabel")}
|
||||
type="number"
|
||||
min={1}
|
||||
max={MAX_ENDINGS}
|
||||
value={endings[0].number?.toString() ?? ""}
|
||||
placeholder="3"
|
||||
onChange={(e) => {
|
||||
const v = e.target.value.trim();
|
||||
updateEnding(0, { number: v === "" ? null : Number(v) });
|
||||
}}
|
||||
/>
|
||||
<Input
|
||||
label={t("editor.endings.nameLabel")}
|
||||
placeholder={t("editor.endings.namePlaceholder")}
|
||||
value={endings[0].name}
|
||||
onChange={(e) => updateEnding(0, { name: e.target.value })}
|
||||
/>
|
||||
</div>
|
||||
<p className="text-xs text-text-muted">
|
||||
{t("editor.endings.previewLabel")}:{" "}
|
||||
<span className="font-mono text-text-secondary">{previewFor(endings[0])}</span>
|
||||
</p>
|
||||
{!endings[0].number && !endings[0].name.trim() && (
|
||||
<p className="flex items-center gap-1.5 text-xs text-warning">
|
||||
<AlertTriangle className="h-3 w-3" />
|
||||
{t("editor.endings.warnings.singleEmpty")}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* CASE B / C: multi-ending table. */}
|
||||
{count >= 2 && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<div className="overflow-hidden rounded-lg border border-border">
|
||||
<table className="w-full text-sm">
|
||||
<thead className="bg-surface-1 text-xs uppercase text-text-muted">
|
||||
<tr>
|
||||
<th className="px-2 py-1.5 text-left">#</th>
|
||||
<th className="w-[100px] px-2 py-1.5 text-left">
|
||||
{t("editor.endings.numberLabel")}
|
||||
</th>
|
||||
<th className="px-2 py-1.5 text-left">{t("editor.endings.nameLabel")}</th>
|
||||
<th className="px-2 py-1.5 text-left">{t("editor.endings.previewLabel")}</th>
|
||||
</tr>
|
||||
</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>
|
||||
<td className="px-2 py-1.5">
|
||||
<Input
|
||||
type="number"
|
||||
min={1}
|
||||
max={MAX_ENDINGS}
|
||||
value={entry.number?.toString() ?? ""}
|
||||
onChange={(e) => {
|
||||
const v = e.target.value.trim();
|
||||
updateEnding(i, { number: v === "" ? null : Number(v) });
|
||||
}}
|
||||
/>
|
||||
</td>
|
||||
<td className="px-2 py-1.5">
|
||||
<Input
|
||||
placeholder={t("editor.endings.namePlaceholder")}
|
||||
value={entry.name}
|
||||
onChange={(e) => updateEnding(i, { name: e.target.value })}
|
||||
/>
|
||||
</td>
|
||||
<td className="px-2 py-1.5 font-mono text-xs text-text-muted">
|
||||
{previewFor(entry)}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Case B: timeline gate banner. */}
|
||||
{isMultiEnding && !isMultiVideo && timelineEndingCount < count && (
|
||||
<p className="flex items-start gap-1.5 rounded border border-warning/40 bg-warning/10 p-2 text-xs text-warning">
|
||||
<AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0" />
|
||||
<span>
|
||||
{t("editor.endings.warnings.timelineShort", {
|
||||
needed: count,
|
||||
found: timelineEndingCount,
|
||||
})}
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* 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">
|
||||
<Input
|
||||
label={t("editor.endings.videoCountLabel")}
|
||||
type="number"
|
||||
min={1}
|
||||
max={count}
|
||||
value={String(endingVideoCount)}
|
||||
onChange={(e) => setVideoCount(Number(e.target.value) || 1)}
|
||||
/>
|
||||
{isMultiVideo && (
|
||||
<>
|
||||
<p className="text-xs text-text-muted">
|
||||
{t("editor.endings.videoRangeHint")}
|
||||
</p>
|
||||
<div className="overflow-hidden rounded border border-border">
|
||||
<table className="w-full text-sm">
|
||||
<thead className="bg-surface-2 text-xs uppercase text-text-muted">
|
||||
<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>
|
||||
<th className="px-2 py-1.5 text-left">To</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{endingVideoRanges.map((r, i) => (
|
||||
<tr key={i} className="border-t border-border">
|
||||
<td className="px-2 py-1.5">{i + 1}</td>
|
||||
<td className="px-2 py-1.5">
|
||||
<Input
|
||||
type="number"
|
||||
min={1}
|
||||
max={count}
|
||||
value={String(r.from)}
|
||||
onChange={(e) =>
|
||||
updateRange(i, { from: Number(e.target.value) || 1 })
|
||||
}
|
||||
/>
|
||||
</td>
|
||||
<td className="px-2 py-1.5">
|
||||
<Input
|
||||
type="number"
|
||||
min={1}
|
||||
max={count}
|
||||
value={String(r.to)}
|
||||
onChange={(e) =>
|
||||
updateRange(i, { to: Number(e.target.value) || 1 })
|
||||
}
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{rangeWarnings.length > 0 && (
|
||||
<ul className="flex flex-col gap-1 rounded border border-warning/40 bg-warning/10 p-2 text-xs text-warning">
|
||||
{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" />
|
||||
<span>{w}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{/* v0.17.1: preview-video selector. Lets the creator
|
||||
* pick which video's slice the Output renders. Engine
|
||||
* already respects `endingVideoIndex` for both title +
|
||||
* description; this just exposes the knob. */}
|
||||
<Select
|
||||
label={t("editor.endings.videoIndexLabel")}
|
||||
options={Array.from({ length: endingVideoCount }, (_, i) => {
|
||||
const r = endingVideoRanges[i];
|
||||
const rangeLabel = r ? ` (${r.from}–${r.to})` : "";
|
||||
return {
|
||||
value: String(i + 1),
|
||||
label: `${t("editor.endings.videoLabel")} ${i + 1}${rangeLabel}`,
|
||||
};
|
||||
})}
|
||||
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>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -4,10 +4,15 @@ import { Textarea } from "@components/ui/Textarea";
|
||||
import { VIDEO_TYPES } from "@config/video-types";
|
||||
import {
|
||||
GACHA_QUEST_TYPE_GROUPS,
|
||||
GACHA_QUEST_FIELD_VISIBILITY,
|
||||
GACHA_QUEST_PLACEHOLDERS,
|
||||
DEFAULT_GACHA_QUEST_TYPE,
|
||||
type GachaQuestType,
|
||||
} from "@config/gacha-quest-types";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
|
||||
const ANNIVERSARY_YEARS = Array.from({ length: 20 }, (_, i) => i + 1);
|
||||
|
||||
/**
|
||||
* Renders inputs for the extra fields required by the currently selected
|
||||
* video type — e.g. "Part Number" for `part`, "Boss Name" for `boss`,
|
||||
@@ -22,6 +27,32 @@ export function ExtraFieldsInput() {
|
||||
const extraFields: readonly string[] = currentVideoType?.extraFields ?? [];
|
||||
if (extraFields.length === 0) return null;
|
||||
|
||||
const isGacha = store.videoType === "gacha_quest";
|
||||
const questType = (store.gachaQuestType ?? DEFAULT_GACHA_QUEST_TYPE) as GachaQuestType;
|
||||
const visibility = GACHA_QUEST_FIELD_VISIBILITY[questType];
|
||||
const placeholders = GACHA_QUEST_PLACEHOLDERS[questType];
|
||||
|
||||
const placeholderFor = (
|
||||
field: "chapterName" | "questName" | "partNumber",
|
||||
): string => {
|
||||
const key = `editor.placeholders.questType.${questType}.${field}`;
|
||||
const localised = t(key);
|
||||
if (localised && localised !== key) return localised;
|
||||
const fromMap = placeholders[field];
|
||||
if (fromMap) return fromMap;
|
||||
return t(`editor.${field}Placeholder`);
|
||||
};
|
||||
|
||||
// For non-gacha video types, the original visibility logic still applies
|
||||
// — every extraField listed renders. Only gacha-quest gates the trio
|
||||
// through `GACHA_QUEST_FIELD_VISIBILITY` plus the new char/year/version
|
||||
// fields.
|
||||
const showField = (id: "chapterName" | "questName" | "partNumber"): boolean => {
|
||||
if (!extraFields.includes(id)) return false;
|
||||
if (!isGacha) return true;
|
||||
return visibility[id];
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
{extraFields.includes("gachaQuestType") && (
|
||||
@@ -55,30 +86,74 @@ export function ExtraFieldsInput() {
|
||||
</select>
|
||||
</div>
|
||||
)}
|
||||
{extraFields.includes("chapterName") && (
|
||||
{isGacha && visibility.characterName && (
|
||||
<Input
|
||||
label={t("editor.characterName")}
|
||||
placeholder={t("editor.characterNamePlaceholder")}
|
||||
value={store.characterName ?? ""}
|
||||
onChange={(e) => store.set("characterName", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
{isGacha && visibility.anniversaryYear && (
|
||||
<div className="flex flex-col gap-1">
|
||||
<label
|
||||
htmlFor="anniversary-year"
|
||||
className="text-sm font-medium text-text-secondary"
|
||||
>
|
||||
{t("editor.anniversaryYear")}
|
||||
</label>
|
||||
<select
|
||||
id="anniversary-year"
|
||||
value={store.anniversaryYear ?? ""}
|
||||
onChange={(e) =>
|
||||
store.set(
|
||||
"anniversaryYear",
|
||||
e.target.value === "" ? null : Number(e.target.value),
|
||||
)
|
||||
}
|
||||
className="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"
|
||||
>
|
||||
<option value="">—</option>
|
||||
{ANNIVERSARY_YEARS.map((y) => (
|
||||
<option key={y} value={y}>
|
||||
{t("editor.anniversaryYearOption", { count: y })}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
)}
|
||||
{showField("chapterName") && (
|
||||
<Input
|
||||
label={t("editor.chapterName")}
|
||||
placeholder={t("editor.chapterNamePlaceholder")}
|
||||
placeholder={isGacha ? placeholderFor("chapterName") : t("editor.chapterNamePlaceholder")}
|
||||
value={store.chapterName ?? ""}
|
||||
onChange={(e) => store.set("chapterName", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
{extraFields.includes("questName") && (
|
||||
{showField("questName") && (
|
||||
<Input
|
||||
label={t("editor.questName")}
|
||||
placeholder={t("editor.questNamePlaceholder")}
|
||||
placeholder={isGacha ? placeholderFor("questName") : t("editor.questNamePlaceholder")}
|
||||
value={store.questName ?? ""}
|
||||
onChange={(e) => store.set("questName", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
{extraFields.includes("partNumber") && (
|
||||
{showField("partNumber") && (
|
||||
<Input
|
||||
label={t("editor.partNumber")}
|
||||
placeholder={t("editor.partNumberPlaceholder")}
|
||||
placeholder={isGacha ? placeholderFor("partNumber") : t("editor.partNumberPlaceholder")}
|
||||
value={store.partNumber ?? ""}
|
||||
onChange={(e) => store.set("partNumber", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
{isGacha && (
|
||||
<Input
|
||||
label={t("editor.gachaVersion")}
|
||||
placeholder={t("editor.gachaVersionPlaceholder")}
|
||||
value={store.gachaVersion ?? ""}
|
||||
onChange={(e) => store.set("gachaVersion", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
{extraFields.includes("bossName") && (
|
||||
<Input
|
||||
label={t("editor.bossName")}
|
||||
|
||||
@@ -22,12 +22,16 @@ export function GameInfoForm() {
|
||||
placeholder={t("editor.gameNamePlaceholder")}
|
||||
value={store.gameName}
|
||||
onChange={(e) => store.set("gameName", e.target.value)}
|
||||
autoComplete="off"
|
||||
enterKeyHint="next"
|
||||
/>
|
||||
<Input
|
||||
label={t("editor.channelName")}
|
||||
placeholder={t("editor.channelNamePlaceholder")}
|
||||
value={store.channelName}
|
||||
onChange={(e) => store.set("channelName", e.target.value)}
|
||||
autoComplete="off"
|
||||
enterKeyHint="next"
|
||||
/>
|
||||
<Select
|
||||
label={t("editor.platform")}
|
||||
@@ -35,6 +39,21 @@ export function GameInfoForm() {
|
||||
value={store.platform}
|
||||
onChange={(v) => store.set("platform", v)}
|
||||
/>
|
||||
{/*
|
||||
* Dev/publisher name. v0.21.0 promoted this from a side-label
|
||||
* under the Publisher store link to a first-class field — it now
|
||||
* drives the optional `© {publisher}` description line (Settings →
|
||||
* "Show game studio copyright") and persists in GamePresets,
|
||||
* which is the common case for series where the publisher
|
||||
* requires credit across many episodes.
|
||||
*/}
|
||||
<Input
|
||||
label={t("editor.pubDevName")}
|
||||
placeholder={t("editor.pubDevNamePlaceholder")}
|
||||
value={store.pubDevName ?? ""}
|
||||
onChange={(e) => store.set("pubDevName", e.target.value)}
|
||||
autoComplete="off"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Select } from "@components/ui/Select";
|
||||
import { Input } from "@components/ui/Input";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import { EndingsEditor } from "./EndingsEditor";
|
||||
import {
|
||||
PLAYTHROUGH_STATUSES,
|
||||
DIFFICULTY_LEVELS,
|
||||
type PlaythroughStatus,
|
||||
type DifficultyLevel,
|
||||
type LanguagePatch,
|
||||
type GameVersion,
|
||||
} from "@engine/types";
|
||||
import {
|
||||
LANGUAGE_PATCH_UI_OPTIONS,
|
||||
GAME_VERSION_UI_OPTIONS,
|
||||
languagePatchHasCustomSlot,
|
||||
gameVersionHasCustomSlot,
|
||||
} from "@config/playthrough-options";
|
||||
|
||||
/**
|
||||
* v0.12 unified Playthrough Notes form. Replaces the v0.7
|
||||
* `ContentDetailsForm` (deleted in v0.12 — it only carried Playthrough
|
||||
* + Difficulty) with a 5-field block that maps 1:1 to the bullets of
|
||||
* the `▸ 🎮 PLAYTHROUGH NOTES` description section:
|
||||
*
|
||||
* • Run type ← `playthroughStatus` (existing)
|
||||
* • Difficulty ← `difficulty` (+ custom label, existing)
|
||||
* • Endings shown ← `endingsShown` (NEW free text)
|
||||
* • Language patch ← `languagePatch` (+ custom label, NEW)
|
||||
* • Game version ← `gameVersion` (+ custom label, NEW)
|
||||
*
|
||||
* Custom-text inputs only appear when their parent enum is set to a
|
||||
* custom-bearing value (`difficulty === "custom"`, language patch is
|
||||
* `"official_other"` or `"custom"`, etc.) — keeps the form compact in
|
||||
* the common path and surfaces the slot exactly when it's needed.
|
||||
*/
|
||||
export function PlaythroughNotesForm() {
|
||||
const { t } = useTranslation("ui");
|
||||
const store = useEditorStore();
|
||||
|
||||
const playthroughOptions = PLAYTHROUGH_STATUSES.map((id) => ({
|
||||
value: id,
|
||||
label: t(`editor.playthroughOptions.${id}`),
|
||||
}));
|
||||
|
||||
const difficultyOptions = DIFFICULTY_LEVELS.map((id) => ({
|
||||
value: id,
|
||||
label: t(`editor.difficultyOptions.${id}`),
|
||||
}));
|
||||
|
||||
const languagePatchOptions = LANGUAGE_PATCH_UI_OPTIONS.map((opt) => ({
|
||||
value: opt.id,
|
||||
label: t(opt.labelKey),
|
||||
}));
|
||||
|
||||
const gameVersionOptions = GAME_VERSION_UI_OPTIONS.map((opt) => ({
|
||||
value: opt.id,
|
||||
label: t(opt.labelKey),
|
||||
}));
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex items-baseline justify-between">
|
||||
<span className="text-sm font-medium text-text-secondary">
|
||||
{t("editor.playthroughNotes.title")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Select
|
||||
label={t("editor.playthroughNotes.runTypeLabel")}
|
||||
options={playthroughOptions}
|
||||
value={store.playthroughStatus}
|
||||
onChange={(v) => store.set("playthroughStatus", v as PlaythroughStatus)}
|
||||
/>
|
||||
|
||||
<Select
|
||||
label={t("editor.playthroughNotes.difficultyLabel")}
|
||||
options={difficultyOptions}
|
||||
value={store.difficulty}
|
||||
onChange={(v) => store.set("difficulty", v as DifficultyLevel)}
|
||||
/>
|
||||
{store.difficulty === "custom" && (
|
||||
<Input
|
||||
label={t("editor.difficultyCustomLabel")}
|
||||
placeholder={t("editor.difficultyCustomPlaceholder")}
|
||||
value={store.difficultyCustomLabel}
|
||||
onChange={(e) => store.set("difficultyCustomLabel", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* v0.16.0: free-form `endingsShown` Input replaced by the
|
||||
* structured EndingsEditor — number + name pairs, optional
|
||||
* multi-video split with auto-contiguous range, timeline
|
||||
* cross-validation. Legacy persisted string is migrated to a
|
||||
* single-row entry by editor-store v11→12 migrate. */}
|
||||
<EndingsEditor />
|
||||
|
||||
<Select
|
||||
label={t("editor.playthroughNotes.languagePatchLabel")}
|
||||
options={languagePatchOptions}
|
||||
value={store.languagePatch}
|
||||
onChange={(v) => store.set("languagePatch", v as LanguagePatch)}
|
||||
/>
|
||||
{languagePatchHasCustomSlot(store.languagePatch) && (
|
||||
<Input
|
||||
label={t("editor.playthroughNotes.languagePatchCustomLabel")}
|
||||
placeholder={t("editor.playthroughNotes.languagePatchCustomPlaceholder")}
|
||||
value={store.languagePatchCustom}
|
||||
onChange={(e) => store.set("languagePatchCustom", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
|
||||
<Select
|
||||
label={t("editor.playthroughNotes.gameVersionLabel")}
|
||||
options={gameVersionOptions}
|
||||
value={store.gameVersion}
|
||||
onChange={(v) => store.set("gameVersion", v as GameVersion)}
|
||||
/>
|
||||
{gameVersionHasCustomSlot(store.gameVersion) && (
|
||||
<Input
|
||||
label={t("editor.playthroughNotes.gameVersionCustomLabel")}
|
||||
placeholder={t("editor.playthroughNotes.gameVersionCustomPlaceholder")}
|
||||
value={store.gameVersionCustom}
|
||||
onChange={(e) => store.set("gameVersionCustom", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,48 +1,283 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { AlertTriangle } from "lucide-react";
|
||||
import { Input } from "@components/ui/Input";
|
||||
import { Select } from "@components/ui/Select";
|
||||
import { RIG_FIELDS } from "@config/rig-fields";
|
||||
import {
|
||||
RIG_FIELDS,
|
||||
parseCascadingValue,
|
||||
parseCompositeValue,
|
||||
resolveCompositeOptions,
|
||||
resolveCompositeLabelKey,
|
||||
type RigField,
|
||||
type CompositePart,
|
||||
} from "@config/rig-fields";
|
||||
import { GPU_CUSTOM_BRAND_ID, findGpuBrand } from "@config/gpu-catalog";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import {
|
||||
validateGpuValue,
|
||||
validateCompositeField,
|
||||
type RigValidationIssue,
|
||||
} from "@utils/rig-validation";
|
||||
|
||||
const CUSTOM_PREFIX = "custom:";
|
||||
|
||||
function joinCascading(brand: string, series: string, model: string): string {
|
||||
if (!brand && !series && !model) return "";
|
||||
return `${brand}|${series}|${model}`;
|
||||
}
|
||||
|
||||
function joinComposite(parts: readonly string[]): string {
|
||||
if (parts.every((p) => !p)) return "";
|
||||
return parts.join("|");
|
||||
}
|
||||
|
||||
export function RigEditor() {
|
||||
const { t } = useTranslation("ui");
|
||||
const rig = useEditorStore((s) => s.rig);
|
||||
const setNested = useEditorStore((s) => s.setNested);
|
||||
|
||||
const renderValidationBadge = (issue: RigValidationIssue | null) => {
|
||||
if (!issue) return null;
|
||||
return (
|
||||
<div className="flex items-center gap-1 text-xs text-warning">
|
||||
<AlertTriangle className="h-3 w-3" />
|
||||
<span>{t(issue.messageKey)}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const renderCascading = (field: RigField) => {
|
||||
const raw = rig[field.id] ?? "";
|
||||
const { brand, series, model } = parseCascadingValue(raw);
|
||||
const isCustom = brand === GPU_CUSTOM_BRAND_ID;
|
||||
const issue = validateGpuValue(raw);
|
||||
const catalog = field.catalog ?? [];
|
||||
|
||||
const brandOptions = [
|
||||
{ value: "", label: "—" },
|
||||
...catalog.map((b) => ({ value: b.id, label: b.label })),
|
||||
];
|
||||
const currentBrand = findGpuBrand(brand);
|
||||
const seriesOptions = currentBrand
|
||||
? [
|
||||
{ value: "", label: "—" },
|
||||
...currentBrand.series.map((s) => ({ value: s.id, label: s.label })),
|
||||
]
|
||||
: [{ 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: "—" }];
|
||||
|
||||
const setBrand = (next: string) => {
|
||||
// Switching brand resets series + model so the user can't end up
|
||||
// with mismatched cascading values (NVIDIA brand + AMD series).
|
||||
setNested("rig", field.id, next ? joinCascading(next, "", "") : "");
|
||||
};
|
||||
const setSeries = (next: string) => {
|
||||
setNested("rig", field.id, joinCascading(brand, next, ""));
|
||||
};
|
||||
const setModel = (next: string) => {
|
||||
setNested("rig", field.id, joinCascading(brand, series, next));
|
||||
};
|
||||
const setCustomText = (text: string) => {
|
||||
setNested(
|
||||
"rig",
|
||||
field.id,
|
||||
text ? joinCascading(GPU_CUSTOM_BRAND_ID, "", text) : "",
|
||||
);
|
||||
};
|
||||
|
||||
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>
|
||||
<div className="grid grid-cols-3 gap-2">
|
||||
<Select
|
||||
label={t("editor.gpu_brand")}
|
||||
value={brand}
|
||||
options={brandOptions}
|
||||
onChange={setBrand}
|
||||
/>
|
||||
{isCustom ? (
|
||||
<div className="col-span-2">
|
||||
<Input
|
||||
label={t("editor.gpu_custom")}
|
||||
placeholder="e.g. RTX 4090 (custom OC)"
|
||||
value={model}
|
||||
onChange={(e) => setCustomText(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<Select
|
||||
label={t("editor.gpu_series")}
|
||||
value={series}
|
||||
options={seriesOptions}
|
||||
onChange={setSeries}
|
||||
disabled={!brand}
|
||||
/>
|
||||
<Select
|
||||
label={t("editor.gpu_model")}
|
||||
value={model}
|
||||
options={modelOptions}
|
||||
onChange={setModel}
|
||||
disabled={!series}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{renderValidationBadge(issue)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const renderComposite = (field: RigField) => {
|
||||
if (!field.composite) return null;
|
||||
const raw = rig[field.id] ?? "";
|
||||
const { parts: storedParts } = parseCompositeValue(raw);
|
||||
// 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] ?? "",
|
||||
);
|
||||
|
||||
// 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
|
||||
// value that no longer exists in the new option list (e.g. switching
|
||||
// OS name from Windows to macOS clears any leftover "11" / "Pro").
|
||||
const setPart = (index: number, next: string) => {
|
||||
const updated = [...partValues];
|
||||
updated[index] = next;
|
||||
for (let j = index + 1; j < updated.length; j++) {
|
||||
updated[j] = "";
|
||||
}
|
||||
setNested("rig", field.id, joinComposite(updated));
|
||||
};
|
||||
|
||||
// Walk parts in declaration order; each part's resolvers see the
|
||||
// previously-rendered values so cascading option lists / dynamic
|
||||
// labels / hidden-when predicates work cleanly.
|
||||
const previousValues: string[] = [];
|
||||
const renderedParts: React.ReactNode[] = [];
|
||||
|
||||
field.composite.parts.forEach((part, index) => {
|
||||
const stored = partValues[index] ?? "";
|
||||
// hiddenWhen short-circuits BEFORE we render — and we still push
|
||||
// the stored value into previousValues so a later visible part
|
||||
// sees the full history (though in practice, parts after a
|
||||
// hidden one are rare).
|
||||
if (part.hiddenWhen?.(previousValues)) {
|
||||
previousValues.push(stored);
|
||||
return;
|
||||
}
|
||||
renderedParts.push(renderPart(part, index, previousValues, setPart));
|
||||
previousValues.push(stored);
|
||||
});
|
||||
|
||||
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>
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
{renderedParts}
|
||||
</div>
|
||||
{renderValidationBadge(issue)}
|
||||
</div>
|
||||
);
|
||||
|
||||
// Inner closure — needs access to `t`, `partValues`, and the part-
|
||||
// local mutators. Defined as a function so the forEach above stays
|
||||
// readable; not hoisted out because it captures lexical state.
|
||||
function renderPart(
|
||||
part: CompositePart,
|
||||
index: number,
|
||||
previousValues: readonly string[],
|
||||
setPart: (index: number, next: string) => void,
|
||||
) {
|
||||
const stored = partValues[index] ?? "";
|
||||
const isCustom = part.allowCustom && stored.startsWith(CUSTOM_PREFIX);
|
||||
const customText = isCustom ? stored.slice(CUSTOM_PREFIX.length) : "";
|
||||
const selectValue = isCustom ? "custom" : stored;
|
||||
const options = resolveCompositeOptions(part.options, previousValues);
|
||||
const labelKey = resolveCompositeLabelKey(part, previousValues);
|
||||
|
||||
const onSelectChange = (next: string) => {
|
||||
if (next === "custom" && part.allowCustom) {
|
||||
setPart(index, `${CUSTOM_PREFIX}`);
|
||||
} else {
|
||||
setPart(index, next);
|
||||
}
|
||||
};
|
||||
const onCustomChange = (next: string) => {
|
||||
setPart(index, `${CUSTOM_PREFIX}${next}`);
|
||||
};
|
||||
|
||||
return (
|
||||
<div key={part.id} className="flex flex-col gap-1">
|
||||
<Select
|
||||
label={t(labelKey)}
|
||||
value={selectValue}
|
||||
options={options}
|
||||
onChange={onSelectChange}
|
||||
/>
|
||||
{isCustom && part.allowCustom && (
|
||||
<div className="flex items-center gap-2">
|
||||
<Input
|
||||
placeholder={part.customPlaceholder}
|
||||
value={customText}
|
||||
inputMode="numeric"
|
||||
onChange={(e) => onCustomChange(e.target.value)}
|
||||
/>
|
||||
{part.customSuffix && (
|
||||
<span className="text-sm text-text-muted">{part.customSuffix.trim()}</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const renderDropdownWithVersion = (field: RigField) => {
|
||||
const raw = rig[field.id] ?? "";
|
||||
const [value = "", version = ""] = raw.split("|");
|
||||
|
||||
const commit = (nextValue: string, nextVersion: string) => {
|
||||
// Keep the stored form compact: drop the pipe when empty.
|
||||
const next =
|
||||
!nextValue && !nextVersion ? "" : `${nextValue}|${nextVersion}`;
|
||||
setNested("rig", field.id, next);
|
||||
};
|
||||
|
||||
return (
|
||||
<div key={field.id} className="col-span-2 grid grid-cols-[1fr_auto] gap-2">
|
||||
<Select
|
||||
label={t(field.labelKey)}
|
||||
value={value}
|
||||
options={field.options ?? []}
|
||||
onChange={(v) => commit(v, version)}
|
||||
/>
|
||||
<Input
|
||||
label={t("editor.version")}
|
||||
placeholder={field.versionPlaceholder}
|
||||
value={version}
|
||||
onChange={(e) => commit(value, e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<span className="text-sm font-medium text-text-secondary">{t("editor.rig")}</span>
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
{RIG_FIELDS.map((field) => {
|
||||
if (field.type === "dropdown_with_version") {
|
||||
const raw = rig[field.id] ?? "";
|
||||
const [value = "", version = ""] = raw.split("|");
|
||||
|
||||
const commit = (nextValue: string, nextVersion: string) => {
|
||||
// Keep the stored form compact: drop the pipe when empty.
|
||||
const next =
|
||||
!nextValue && !nextVersion ? "" : `${nextValue}|${nextVersion}`;
|
||||
setNested("rig", field.id, next);
|
||||
};
|
||||
|
||||
return (
|
||||
<div key={field.id} className="col-span-2 grid grid-cols-[1fr_auto] gap-2">
|
||||
<Select
|
||||
label={t(field.labelKey)}
|
||||
value={value}
|
||||
options={field.options ?? []}
|
||||
onChange={(v) => commit(v, version)}
|
||||
/>
|
||||
<Input
|
||||
label={t("editor.version")}
|
||||
placeholder={field.versionPlaceholder}
|
||||
value={version}
|
||||
onChange={(e) => commit(value, e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (field.type === "cascading_dropdown") return renderCascading(field);
|
||||
if (field.type === "composite_dropdown") return renderComposite(field);
|
||||
if (field.type === "dropdown_with_version") return renderDropdownWithVersion(field);
|
||||
return (
|
||||
<Input
|
||||
key={field.id}
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useMemo, useState } from "react";
|
||||
import type { ClipboardEvent } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import toast from "react-hot-toast";
|
||||
import { Input } from "@components/ui/Input";
|
||||
import { ValidatedInput } from "@components/ui/ValidatedInput";
|
||||
import { Select } from "@components/ui/Select";
|
||||
import { PLATFORMS } from "@config/platforms";
|
||||
@@ -27,7 +26,6 @@ export function StoreLinkEditor() {
|
||||
const storeLinks = useEditorStore((s) => s.storeLinks);
|
||||
const storeLinkTypes = useEditorStore((s) => s.storeLinkTypes);
|
||||
const gameName = useEditorStore((s) => s.gameName);
|
||||
const pubDevName = useEditorStore((s) => s.pubDevName);
|
||||
const setField = useEditorStore((s) => s.set);
|
||||
const setNested = useEditorStore((s) => s.setNested);
|
||||
const setStoreLinkType = useEditorStore((s) => s.setStoreLinkType);
|
||||
@@ -131,14 +129,11 @@ export function StoreLinkEditor() {
|
||||
{PLATFORMS.map((platform) => {
|
||||
const currentType = storeLinkTypes[platform.id] ?? "paid";
|
||||
const url = storeLinks[platform.id] ?? "";
|
||||
// Publisher / Developer site is the only platform that pairs
|
||||
// with a free-text name field (rendered below the URL once the
|
||||
// URL is non-empty). The name becomes a YouTube tag — see
|
||||
// tag-generator.ts. Keeping the input in this same grid (via
|
||||
// `col-span-2`) preserves vertical rhythm with the rest of
|
||||
// the platform rows.
|
||||
const showPubDevName =
|
||||
platform.id === "publisher" && url.trim().length > 0;
|
||||
// v0.21.0: the inline `pubDevName` input that previously
|
||||
// appeared under the Publisher store link has been promoted
|
||||
// to a first-class field in `GameInfoForm`, so it can drive
|
||||
// the optional game-copyright description line independently
|
||||
// of whether the publisher URL is filled.
|
||||
return (
|
||||
<div
|
||||
key={platform.id}
|
||||
@@ -161,16 +156,6 @@ export function StoreLinkEditor() {
|
||||
options={typeOptions}
|
||||
onChange={(v) => setStoreLinkType(platform.id, v as StoreLinkType)}
|
||||
/>
|
||||
{showPubDevName && (
|
||||
<div className="col-span-2">
|
||||
<Input
|
||||
label={t("editor.pubDevName")}
|
||||
placeholder={t("editor.pubDevNamePlaceholder")}
|
||||
value={pubDevName ?? ""}
|
||||
onChange={(e) => setField("pubDevName", e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
import { useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ChevronDown, ChevronRight, Search, X } from "lucide-react";
|
||||
import clsx from "clsx";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import {
|
||||
TECH_NOTE_GROUPS,
|
||||
type TechNoteGroup,
|
||||
} from "@config/tech-note-groups";
|
||||
import type { TechNote } from "@engine/types";
|
||||
|
||||
/**
|
||||
* v0.12 Tech Notes checklist — searchable, collapsible, grouped
|
||||
* multi-select for the 24 production / playstyle disclaimers that feed
|
||||
* the `▸ 🛠 TECH NOTES` description block. Cloned 1:1 from
|
||||
* {@link ContentWarningChecklist} since both share the same UX shape;
|
||||
* only the data source (`techNotes` vs `contentWarnings`), groups,
|
||||
* and i18n namespace differ.
|
||||
*
|
||||
* Selection order is preserved so the description renders bullets in
|
||||
* the order the user picked them.
|
||||
*/
|
||||
export function TechNotesChecklist() {
|
||||
const { t } = useTranslation("ui");
|
||||
const selected = useEditorStore((s) => s.techNotes);
|
||||
const set = useEditorStore((s) => s.set);
|
||||
|
||||
const [query, setQuery] = useState("");
|
||||
// Default all groups closed — 24 items across 5 groups is too tall to
|
||||
// expand by default. Users with a specific note in mind use search;
|
||||
// users browsing pop open the group they care about.
|
||||
const [openGroups, setOpenGroups] = useState<Record<string, boolean>>(() => ({
|
||||
audio: false,
|
||||
video_quality: false,
|
||||
recording_issues: false,
|
||||
playstyle: false,
|
||||
production: false,
|
||||
}));
|
||||
|
||||
const trimmedQuery = query.trim().toLowerCase();
|
||||
const isFiltering = trimmedQuery.length > 0;
|
||||
|
||||
const filteredGroups = useMemo<TechNoteGroup[]>(() => {
|
||||
if (!isFiltering) return [...TECH_NOTE_GROUPS];
|
||||
return TECH_NOTE_GROUPS.map((group) => ({
|
||||
...group,
|
||||
items: group.items.filter((id) =>
|
||||
t(`editor.techNoteOptions.${id}`).toLowerCase().includes(trimmedQuery),
|
||||
),
|
||||
})).filter((group) => group.items.length > 0);
|
||||
}, [t, trimmedQuery, isFiltering]);
|
||||
|
||||
const totalMatching = filteredGroups.reduce((acc, g) => acc + g.items.length, 0);
|
||||
|
||||
function toggleItem(id: TechNote) {
|
||||
if (selected.includes(id)) {
|
||||
set(
|
||||
"techNotes",
|
||||
selected.filter((x) => x !== id),
|
||||
);
|
||||
} else {
|
||||
set("techNotes", [...selected, id]);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleGroup(groupId: string) {
|
||||
setOpenGroups((prev) => ({ ...prev, [groupId]: !prev[groupId] }));
|
||||
}
|
||||
|
||||
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>
|
||||
{selected.length > 0 && (
|
||||
<span className="text-xs text-text-muted">
|
||||
{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" />
|
||||
<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"
|
||||
/>
|
||||
{query && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setQuery("")}
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-primary"
|
||||
aria-label="Clear search"
|
||||
>
|
||||
<X className="h-3.5 w-3.5" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{isFiltering && totalMatching === 0 ? (
|
||||
<p className="py-2 text-center text-xs text-text-muted">
|
||||
{t("editor.techNoteEmpty")}
|
||||
</p>
|
||||
) : (
|
||||
<div className="flex flex-col gap-1">
|
||||
{filteredGroups.map((group) => {
|
||||
const isOpen = isFiltering || openGroups[group.id];
|
||||
const groupSelectedCount = group.items.filter((id) =>
|
||||
selected.includes(id),
|
||||
).length;
|
||||
return (
|
||||
<div
|
||||
key={group.id}
|
||||
className="overflow-hidden rounded-md border border-border bg-surface-1"
|
||||
>
|
||||
<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"
|
||||
aria-expanded={isOpen}
|
||||
>
|
||||
<span className="flex items-center gap-1.5">
|
||||
{isOpen ? (
|
||||
<ChevronDown className="h-3.5 w-3.5" />
|
||||
) : (
|
||||
<ChevronRight className="h-3.5 w-3.5" />
|
||||
)}
|
||||
{t(group.labelKey)}
|
||||
</span>
|
||||
{groupSelectedCount > 0 && (
|
||||
<span className="rounded-full bg-accent/15 px-2 py-0.5 text-[10px] font-medium text-accent">
|
||||
{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">
|
||||
{group.items.map((id) => {
|
||||
const checked = selected.includes(id);
|
||||
return (
|
||||
<label
|
||||
key={id}
|
||||
className={clsx(
|
||||
"flex cursor-pointer items-center gap-2 rounded px-1.5 py-1 text-xs transition-colors",
|
||||
checked
|
||||
? "text-text-primary"
|
||||
: "text-text-secondary hover:text-text-primary",
|
||||
)}
|
||||
>
|
||||
<input
|
||||
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"
|
||||
/>
|
||||
<span>{t(`editor.techNoteOptions.${id}`)}</span>
|
||||
</label>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
coerceUpscaleQuality,
|
||||
coerceFrameGenMultiplier,
|
||||
} from "@engine/graphics-vendor";
|
||||
import { VIDEO_STYLE_ERA_IDS, type VideoStyleEra } from "@config/video-styles";
|
||||
|
||||
const RESOLUTION_OPTIONS = [
|
||||
{ value: "720p", label: "720p" },
|
||||
@@ -56,6 +57,18 @@ export function VideoSettingsForm() {
|
||||
label: t(`editor.frameGenVendorOptions.${v}`),
|
||||
}));
|
||||
|
||||
// v0.22.0 — video-style era opt-in. Renders independently of
|
||||
// `skipGraphicsSettings`, so we wire it above the toggle: 2D / pixel-art
|
||||
// creators still edit their footage and may want the style credit even
|
||||
// when the in-game graphics block is suppressed.
|
||||
const videoStyleOptions = [
|
||||
{ value: "", label: t("editor.videoStyleOff") },
|
||||
...VIDEO_STYLE_ERA_IDS.map((id) => ({
|
||||
value: id,
|
||||
label: t(`editor.videoStyleOptions.${id}`),
|
||||
})),
|
||||
];
|
||||
|
||||
// v0.11: vendor-filtered option lists. NVIDIA exposes DLAA + 4 quality
|
||||
// tiers, AMD exposes FSR Native AA + 4, Intel exposes XeSS Native AA +
|
||||
// Ultra Quality + 4. None falls back to the vendor-agnostic ladder so
|
||||
@@ -130,6 +143,14 @@ export function VideoSettingsForm() {
|
||||
/>
|
||||
)}
|
||||
|
||||
<Select
|
||||
label={t("editor.videoStyle")}
|
||||
options={videoStyleOptions}
|
||||
value={store.videoStyleEra}
|
||||
onChange={(v) => store.set("videoStyleEra", v as VideoStyleEra)}
|
||||
/>
|
||||
<p className="-mt-1 text-xs text-text-muted">{t("editor.videoStyleHelp")}</p>
|
||||
|
||||
<Toggle
|
||||
label={t("editor.skipGraphicsSettings")}
|
||||
checked={store.skipGraphicsSettings}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Input } from "@components/ui/Input";
|
||||
import { Select } from "@components/ui/Select";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import {
|
||||
VIETNAMESE_BANKS,
|
||||
VIETNAMESE_BANK_OTHER,
|
||||
isCustomVietnameseBank,
|
||||
} from "@config/vietnamese-banks";
|
||||
|
||||
/**
|
||||
* Vietnam-specific donate fields — bank transfer + e-wallets. The
|
||||
@@ -13,10 +20,45 @@ import { useEditorStore } from "@store/editor-store";
|
||||
* output language — we don't want creators to have to flip language
|
||||
* just to fill in their bank info, and the data is preserved in the
|
||||
* draft either way.
|
||||
*
|
||||
* v0.18.0: when the output language is Vietnamese, the bank-name field
|
||||
* upgrades to a dropdown sourced from
|
||||
* {@link VIETNAMESE_BANKS}. Picking "Khác" (Other) reveals an inline
|
||||
* text input so the field still accepts unlisted / digital-only / less
|
||||
* common banks. The persisted shape is unchanged — `vnBankName` is
|
||||
* still a `string` — so saved profiles and exports keep round-tripping.
|
||||
*/
|
||||
export function VietnameseDonateEditor() {
|
||||
const { t } = useTranslation("ui");
|
||||
const store = useEditorStore();
|
||||
const language = useEditorStore((s) => s.language);
|
||||
const vnBankName = useEditorStore((s) => s.vnBankName);
|
||||
|
||||
const isVi = language === "vi";
|
||||
|
||||
// Sticky flag for the "user explicitly chose Other from the dropdown"
|
||||
// case. We can't derive it purely from `vnBankName` because the user
|
||||
// might pick "Other" with the field still empty — at that point the
|
||||
// value is `""`, which the auto-detector would treat as "use the
|
||||
// dropdown placeholder". The initial value still uses the auto-detect
|
||||
// (any non-preset saved name lights up custom mode on mount), so a
|
||||
// reload of e.g. "Citibank Vietnam" renders correctly without the
|
||||
// sticky flag needing to be hydrated.
|
||||
const [otherSticky, setOtherSticky] = useState(
|
||||
() => isVi && isCustomVietnameseBank(vnBankName ?? ""),
|
||||
);
|
||||
|
||||
const customMode =
|
||||
isVi && (otherSticky || isCustomVietnameseBank(vnBankName ?? ""));
|
||||
const selectValue = customMode
|
||||
? VIETNAMESE_BANK_OTHER
|
||||
: (vnBankName ?? "");
|
||||
|
||||
const bankOptions = [
|
||||
{ value: "", label: t("editor.vnBankNameSelectPlaceholder") },
|
||||
...VIETNAMESE_BANKS.map((b) => ({ value: b, label: b })),
|
||||
{ value: VIETNAMESE_BANK_OTHER, label: t("editor.vnBankNameOther") },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
@@ -28,12 +70,39 @@ export function VietnameseDonateEditor() {
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<Input
|
||||
label={t("editor.vnBankName")}
|
||||
placeholder={t("editor.vnBankNamePlaceholder")}
|
||||
value={store.vnBankName ?? ""}
|
||||
onChange={(e) => store.set("vnBankName", e.target.value)}
|
||||
/>
|
||||
{isVi ? (
|
||||
<div className="flex flex-col gap-2">
|
||||
<Select
|
||||
label={t("editor.vnBankName")}
|
||||
options={bankOptions}
|
||||
value={selectValue}
|
||||
onChange={(v) => {
|
||||
if (v === VIETNAMESE_BANK_OTHER) {
|
||||
// Keep any value the creator already had — pre-existing
|
||||
// free-form names should survive a Khác re-selection.
|
||||
setOtherSticky(true);
|
||||
} else {
|
||||
setOtherSticky(false);
|
||||
store.set("vnBankName", v);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{customMode && (
|
||||
<Input
|
||||
placeholder={t("editor.vnBankNamePlaceholder")}
|
||||
value={vnBankName ?? ""}
|
||||
onChange={(e) => store.set("vnBankName", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<Input
|
||||
label={t("editor.vnBankName")}
|
||||
placeholder={t("editor.vnBankNamePlaceholder")}
|
||||
value={vnBankName ?? ""}
|
||||
onChange={(e) => store.set("vnBankName", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
<Input
|
||||
label={t("editor.vnBankAccount")}
|
||||
placeholder={t("editor.vnBankAccountPlaceholder")}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { useState } from "react";
|
||||
import { useRef, useState } from "react";
|
||||
import { Outlet } from "react-router-dom";
|
||||
import { Header } from "./Header";
|
||||
import { Sidebar } from "./Sidebar";
|
||||
import { Sidebar, SidebarNavList } from "./Sidebar";
|
||||
import { ScrollToTopButton } from "./ScrollToTopButton";
|
||||
import { Drawer } from "@components/ui/Drawer";
|
||||
import { ShortcutHelpModal } from "@components/ui/ShortcutHelpModal";
|
||||
import { useKeyboardShortcuts } from "@hooks/use-keyboard-shortcuts";
|
||||
import { useGlobalErrorHandler } from "@hooks/use-global-error-handler";
|
||||
@@ -9,6 +11,8 @@ import { useSettingsStore } from "@store/settings-store";
|
||||
|
||||
export function AppShell() {
|
||||
const [showShortcuts, setShowShortcuts] = useState(false);
|
||||
const [mobileNavOpen, setMobileNavOpen] = useState(false);
|
||||
const mainRef = useRef<HTMLElement>(null);
|
||||
const setSetting = useSettingsStore((s) => s.setSetting);
|
||||
const collapsed = useSettingsStore((s) => s.sidebarCollapsed);
|
||||
|
||||
@@ -19,15 +23,24 @@ export function AppShell() {
|
||||
useGlobalErrorHandler();
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen bg-surface-0">
|
||||
<div className="flex h-screen overflow-hidden bg-surface-0">
|
||||
<Sidebar />
|
||||
<div className="flex min-w-0 flex-1 flex-col">
|
||||
<Header />
|
||||
<main className="flex-1 overflow-y-auto">
|
||||
<Header onOpenMobileNav={() => setMobileNavOpen(true)} />
|
||||
<main ref={mainRef} className="min-h-0 flex-1 overflow-y-auto">
|
||||
<Outlet />
|
||||
</main>
|
||||
</div>
|
||||
<Drawer
|
||||
open={mobileNavOpen}
|
||||
onClose={() => setMobileNavOpen(false)}
|
||||
side="left"
|
||||
ariaLabel="Navigation"
|
||||
>
|
||||
<SidebarNavList collapsed={false} onItemClick={() => setMobileNavOpen(false)} />
|
||||
</Drawer>
|
||||
<ShortcutHelpModal open={showShortcuts} onClose={() => setShowShortcuts(false)} />
|
||||
<ScrollToTopButton scrollRef={mainRef} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,14 +1,19 @@
|
||||
import { useState, useRef, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ChevronDown } from "lucide-react";
|
||||
import { ChevronDown, Heart, Menu, Moon, Sun } from "lucide-react";
|
||||
import { SUPPORTED_LANGUAGES } from "@i18n/index";
|
||||
import { useSettingsStore } from "@store/settings-store";
|
||||
import { PRIMARY_DONATE_URL } from "@config/donate";
|
||||
import type { SupportedLanguage } from "@engine/types";
|
||||
import clsx from "clsx";
|
||||
|
||||
export function Header() {
|
||||
interface HeaderProps {
|
||||
onOpenMobileNav?: () => void;
|
||||
}
|
||||
|
||||
export function Header({ onOpenMobileNav }: HeaderProps) {
|
||||
const { t, i18n } = useTranslation("ui");
|
||||
const { appLanguage, setAppLanguage } = useSettingsStore();
|
||||
const { appLanguage, setAppLanguage, theme, setTheme } = useSettingsStore();
|
||||
const [open, setOpen] = useState(false);
|
||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -32,37 +37,83 @@ export function Header() {
|
||||
};
|
||||
|
||||
return (
|
||||
<header className="flex items-center justify-between border-b border-border bg-surface-1 px-6 py-3">
|
||||
<div>
|
||||
<h1 className="text-lg font-bold text-text-primary">{t("app.title")}</h1>
|
||||
<p className="text-xs text-text-muted">{t("app.subtitle")}</p>
|
||||
</div>
|
||||
<div className="relative" ref={dropdownRef}>
|
||||
<button
|
||||
onClick={() => setOpen(!open)}
|
||||
className="flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm transition-colors hover:bg-surface-2"
|
||||
>
|
||||
<span>{current?.flag}</span>
|
||||
<span className="text-text-primary">{current?.nativeName}</span>
|
||||
<ChevronDown className="h-3.5 w-3.5 text-text-muted" />
|
||||
</button>
|
||||
{open && (
|
||||
<div className="absolute right-0 top-full z-50 mt-1 min-w-44 rounded-lg border border-border bg-surface-1 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",
|
||||
lang.id === appLanguage ? "bg-accent-muted text-accent" : "text-text-primary",
|
||||
)}
|
||||
>
|
||||
<span>{lang.flag}</span>
|
||||
<span>{lang.nativeName}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<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"
|
||||
>
|
||||
<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"
|
||||
>
|
||||
<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">
|
||||
{t("app.title")}
|
||||
</h1>
|
||||
<p className="hidden truncate text-xs text-text-muted sm:block">
|
||||
{t("app.subtitle")}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-2">
|
||||
<a
|
||||
href={PRIMARY_DONATE_URL}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center gap-1.5 rounded-lg border border-pink-500/30 bg-pink-500/10 px-2.5 py-1.5 text-sm text-pink-300 transition-colors hover:border-pink-400/60 hover:bg-pink-500/20 hover:text-pink-200 sm:px-3"
|
||||
title={t("header.donate")}
|
||||
aria-label={t("header.donate")}
|
||||
>
|
||||
<Heart className="h-4 w-4 sm:h-3.5 sm:w-3.5" />
|
||||
<span className="hidden md:inline">{t("header.donate")}</span>
|
||||
</a>
|
||||
<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"
|
||||
title={t("header.toggleTheme")}
|
||||
aria-label={t("header.toggleTheme")}
|
||||
>
|
||||
{theme === "dark" ? (
|
||||
<Moon className="h-4 w-4" />
|
||||
) : (
|
||||
<Sun className="h-4 w-4" />
|
||||
)}
|
||||
</button>
|
||||
<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"
|
||||
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" />
|
||||
</button>
|
||||
{open && (
|
||||
<div className="absolute right-0 top-full z-50 mt-1 max-w-[calc(100vw-2rem)] min-w-[200px] rounded-lg border border-border bg-surface-1 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",
|
||||
lang.id === appLanguage ? "bg-accent-muted text-accent" : "text-text-primary",
|
||||
)}
|
||||
>
|
||||
<span>{lang.flag}</span>
|
||||
<span>{lang.nativeName}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import { useEffect, useState, type RefObject } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ArrowUp } from "lucide-react";
|
||||
import clsx from "clsx";
|
||||
|
||||
interface ScrollToTopButtonProps {
|
||||
/** The scrollable container to watch and scroll back to the top. */
|
||||
scrollRef: RefObject<HTMLElement>;
|
||||
}
|
||||
|
||||
/** Scroll distance (px) past which the button fades in. */
|
||||
const SHOW_AFTER_PX = 300;
|
||||
|
||||
/**
|
||||
* Floating "back to top" button, fixed to the bottom-right of the
|
||||
* viewport. Fades in once the app's scroll container is scrolled past
|
||||
* {@link SHOW_AFTER_PX} and smooth-scrolls back on click.
|
||||
*
|
||||
* The scroll container is the `<main>` element (see AppShell), not the
|
||||
* window — so the listener and `scrollTo` both target the passed ref.
|
||||
*/
|
||||
export function ScrollToTopButton({ scrollRef }: ScrollToTopButtonProps) {
|
||||
const { t } = useTranslation("ui");
|
||||
const location = useLocation();
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const el = scrollRef.current;
|
||||
if (!el) return;
|
||||
|
||||
let ticking = false;
|
||||
const update = () => {
|
||||
setVisible(el.scrollTop > SHOW_AFTER_PX);
|
||||
ticking = false;
|
||||
};
|
||||
const onScroll = () => {
|
||||
if (ticking) return;
|
||||
ticking = true;
|
||||
requestAnimationFrame(update);
|
||||
};
|
||||
|
||||
// Re-evaluate on mount and whenever the route changes — the same
|
||||
// <main> persists across tabs, so scrollTop does not reset itself.
|
||||
update();
|
||||
el.addEventListener("scroll", onScroll, { passive: true });
|
||||
return () => el.removeEventListener("scroll", onScroll);
|
||||
}, [scrollRef, location.pathname]);
|
||||
|
||||
function scrollToTop() {
|
||||
const el = scrollRef.current;
|
||||
if (!el) return;
|
||||
const reduceMotion = window.matchMedia(
|
||||
"(prefers-reduced-motion: reduce)",
|
||||
).matches;
|
||||
el.scrollTo({ top: 0, behavior: reduceMotion ? "auto" : "smooth" });
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={scrollToTop}
|
||||
aria-label={t("common.scrollToTop")}
|
||||
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",
|
||||
visible ? "opacity-100" : "pointer-events-none opacity-0",
|
||||
)}
|
||||
>
|
||||
<ArrowUp className="h-5 w-5" />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -7,27 +7,99 @@ import {
|
||||
Clock,
|
||||
Settings,
|
||||
Layers,
|
||||
Share2,
|
||||
ListVideo,
|
||||
ScrollText,
|
||||
Info,
|
||||
Bug,
|
||||
PanelLeftClose,
|
||||
PanelLeftOpen,
|
||||
type LucideIcon,
|
||||
} from "lucide-react";
|
||||
import clsx from "clsx";
|
||||
import { useSettingsStore } from "@store/settings-store";
|
||||
import { ABOUT } from "@config/about";
|
||||
|
||||
const tabs = [
|
||||
interface TabItem {
|
||||
to: string;
|
||||
labelKey: string;
|
||||
icon: LucideIcon;
|
||||
external?: boolean;
|
||||
}
|
||||
|
||||
const tabs: readonly TabItem[] = [
|
||||
{ to: "/", labelKey: "tabs.editor", icon: Pencil },
|
||||
{ to: "/output", labelKey: "tabs.output", icon: FileText },
|
||||
{ to: "/batch", labelKey: "tabs.batch", icon: Layers },
|
||||
{ to: "/social", labelKey: "tabs.social", icon: Share2 },
|
||||
{ to: "/profiles", labelKey: "tabs.profiles", icon: User },
|
||||
{ to: "/history", labelKey: "tabs.history", icon: Clock },
|
||||
{ to: "/playlist", labelKey: "tabs.playlist", icon: ListVideo },
|
||||
{ to: "/logs", labelKey: "tabs.logs", icon: ScrollText },
|
||||
{ to: "/settings", labelKey: "tabs.settings", icon: Settings },
|
||||
{ to: "/about", labelKey: "tabs.about", icon: Info },
|
||||
{ to: ABOUT.bugReportUrl, labelKey: "tabs.reportBug", icon: Bug, external: true },
|
||||
] as const;
|
||||
|
||||
interface SidebarNavListProps {
|
||||
collapsed: boolean;
|
||||
onItemClick?: () => void;
|
||||
}
|
||||
|
||||
export function SidebarNavList({ collapsed, onItemClick }: SidebarNavListProps) {
|
||||
const { t } = useTranslation("ui");
|
||||
|
||||
return (
|
||||
<nav className="flex flex-1 flex-col gap-0.5 overflow-y-auto p-2">
|
||||
{tabs.map((tab) => {
|
||||
const baseClass = clsx(
|
||||
"flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",
|
||||
collapsed && "justify-center px-0",
|
||||
);
|
||||
if (tab.external) {
|
||||
return (
|
||||
<a
|
||||
key={tab.to}
|
||||
href={tab.to}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
title={collapsed ? t(tab.labelKey) : undefined}
|
||||
onClick={onItemClick}
|
||||
className={clsx(
|
||||
baseClass,
|
||||
"text-text-secondary hover:bg-surface-2 hover:text-text-primary",
|
||||
)}
|
||||
>
|
||||
<tab.icon className="h-4 w-4 shrink-0" />
|
||||
{!collapsed && <span className="truncate">{t(tab.labelKey)}</span>}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<NavLink
|
||||
key={tab.to}
|
||||
to={tab.to}
|
||||
end={tab.to === "/"}
|
||||
title={collapsed ? t(tab.labelKey) : undefined}
|
||||
onClick={onItemClick}
|
||||
className={({ isActive }) =>
|
||||
clsx(
|
||||
baseClass,
|
||||
isActive
|
||||
? "bg-accent-muted text-accent"
|
||||
: "text-text-secondary hover:bg-surface-2 hover:text-text-primary",
|
||||
)
|
||||
}
|
||||
>
|
||||
<tab.icon className="h-4 w-4 shrink-0" />
|
||||
{!collapsed && <span className="truncate">{t(tab.labelKey)}</span>}
|
||||
</NavLink>
|
||||
);
|
||||
})}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
export function Sidebar() {
|
||||
const { t } = useTranslation("ui");
|
||||
const collapsed = useSettingsStore((s) => s.sidebarCollapsed);
|
||||
@@ -38,7 +110,7 @@ export function Sidebar() {
|
||||
return (
|
||||
<aside
|
||||
className={clsx(
|
||||
"flex shrink-0 flex-col border-r border-border bg-surface-1 transition-[width] duration-200",
|
||||
"hidden shrink-0 flex-col border-r border-border bg-surface-1 transition-[width] duration-200 md:flex",
|
||||
collapsed ? "w-14" : "w-56",
|
||||
)}
|
||||
>
|
||||
@@ -55,28 +127,7 @@ export function Sidebar() {
|
||||
<PanelLeftClose className="h-5 w-5" />
|
||||
)}
|
||||
</button>
|
||||
<nav className="flex flex-1 flex-col gap-0.5 overflow-y-auto p-2">
|
||||
{tabs.map((tab) => (
|
||||
<NavLink
|
||||
key={tab.to}
|
||||
to={tab.to}
|
||||
end={tab.to === "/"}
|
||||
title={collapsed ? t(tab.labelKey) : undefined}
|
||||
className={({ isActive }) =>
|
||||
clsx(
|
||||
"flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors",
|
||||
collapsed && "justify-center px-0",
|
||||
isActive
|
||||
? "bg-accent-muted text-accent"
|
||||
: "text-text-secondary hover:bg-surface-2 hover:text-text-primary",
|
||||
)
|
||||
}
|
||||
>
|
||||
<tab.icon className="h-4 w-4 shrink-0" />
|
||||
{!collapsed && <span className="truncate">{t(tab.labelKey)}</span>}
|
||||
</NavLink>
|
||||
))}
|
||||
</nav>
|
||||
<SidebarNavList collapsed={collapsed} />
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import toast from "react-hot-toast";
|
||||
import { ClipboardCopy } from "lucide-react";
|
||||
import { Button } from "@components/ui/Button";
|
||||
import { useGeneratedOutput } from "@hooks/use-generated-output";
|
||||
import { useClipboard } from "@hooks/use-clipboard";
|
||||
import { YT_LIMITS } from "@engine/types";
|
||||
|
||||
interface CopyAllBarProps {
|
||||
extraText?: string;
|
||||
@@ -14,13 +16,43 @@ export function CopyAllBar({ extraText }: CopyAllBarProps) {
|
||||
const { copy } = useClipboard();
|
||||
|
||||
const handleCopyAll = () => {
|
||||
const text = extraText || `${output.title}\n\n${output.description}`;
|
||||
copy(text);
|
||||
if (extraText) {
|
||||
copy(extraText);
|
||||
return;
|
||||
}
|
||||
const overflows: string[] = [];
|
||||
if (output.title.length > YT_LIMITS.TITLE_MAX) {
|
||||
overflows.push(
|
||||
t("output.copy.overLimit", {
|
||||
field: t("output.title"),
|
||||
count: output.title.length,
|
||||
limit: YT_LIMITS.TITLE_MAX,
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (output.description.length > YT_LIMITS.DESCRIPTION_MAX) {
|
||||
overflows.push(
|
||||
t("output.copy.overLimit", {
|
||||
field: t("output.description"),
|
||||
count: output.description.length,
|
||||
limit: YT_LIMITS.DESCRIPTION_MAX,
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (overflows.length > 0) {
|
||||
toast.error(overflows.join("\n"));
|
||||
return;
|
||||
}
|
||||
copy(`${output.title}\n\n${output.description}`);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="sticky bottom-0 flex items-center justify-end border-t border-border bg-surface-0 px-4 py-3">
|
||||
<Button onClick={handleCopyAll} size="lg">
|
||||
<div className="sticky bottom-0 flex items-center justify-end border-t border-border bg-surface-0 px-3 py-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] sm:px-4">
|
||||
<Button
|
||||
onClick={handleCopyAll}
|
||||
size="lg"
|
||||
className="text-sm sm:text-base"
|
||||
>
|
||||
<ClipboardCopy className="h-4 w-4" />
|
||||
{t("output.copyAll")}
|
||||
</Button>
|
||||
|
||||
@@ -1,18 +1,35 @@
|
||||
import { Copy, Check } from "lucide-react";
|
||||
import { Copy, Check, AlertTriangle } from "lucide-react";
|
||||
import clsx from "clsx";
|
||||
import { Button } from "@components/ui/Button";
|
||||
import { useClipboard } from "@hooks/use-clipboard";
|
||||
|
||||
interface CopyButtonProps {
|
||||
text: string;
|
||||
label: string;
|
||||
limit?: number;
|
||||
fieldLabel?: string;
|
||||
}
|
||||
|
||||
export function CopyButton({ text, label }: CopyButtonProps) {
|
||||
export function CopyButton({ text, label, limit, fieldLabel }: CopyButtonProps) {
|
||||
const { copy, copied } = useClipboard();
|
||||
const isOver = limit !== undefined && text.length > limit;
|
||||
|
||||
return (
|
||||
<Button variant="ghost" size="sm" onClick={() => copy(text)} disabled={!text}>
|
||||
{copied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => copy(text, { limit, fieldLabel })}
|
||||
disabled={!text}
|
||||
className={clsx(isOver && "text-danger hover:bg-surface-2 hover:text-danger")}
|
||||
title={isOver ? `${text.length}/${limit}` : undefined}
|
||||
>
|
||||
{isOver ? (
|
||||
<AlertTriangle className="h-4 w-4" />
|
||||
) : copied ? (
|
||||
<Check className="h-4 w-4" />
|
||||
) : (
|
||||
<Copy className="h-4 w-4" />
|
||||
)}
|
||||
{copied ? "Copied!" : label}
|
||||
</Button>
|
||||
);
|
||||
|
||||
@@ -24,7 +24,12 @@ export function OutputPreview({ output: outputProp }: OutputPreviewProps) {
|
||||
<h3 className="text-sm font-semibold text-text-primary">{t("output.title")}</h3>
|
||||
<div className="flex items-center gap-3">
|
||||
{showCharCount && <CharCounter text={output.title} limit={YT_LIMITS.TITLE_MAX} />}
|
||||
<CopyButton text={output.title} label={t("output.copyTitle")} />
|
||||
<CopyButton
|
||||
text={output.title}
|
||||
label={t("output.copyTitle")}
|
||||
limit={YT_LIMITS.TITLE_MAX}
|
||||
fieldLabel={t("output.title")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-lg border border-border bg-surface-1 p-3">
|
||||
@@ -38,10 +43,15 @@ export function OutputPreview({ output: outputProp }: OutputPreviewProps) {
|
||||
<h3 className="text-sm font-semibold text-text-primary">{t("output.description")}</h3>
|
||||
<div className="flex items-center gap-3">
|
||||
{showCharCount && <CharCounter text={output.description} limit={YT_LIMITS.DESCRIPTION_MAX} />}
|
||||
<CopyButton text={output.description} label={t("output.copyDescription")} />
|
||||
<CopyButton
|
||||
text={output.description}
|
||||
label={t("output.copyDescription")}
|
||||
limit={YT_LIMITS.DESCRIPTION_MAX}
|
||||
fieldLabel={t("output.description")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="max-h-[400px] overflow-y-auto rounded-lg border border-border bg-surface-1 p-3">
|
||||
<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">
|
||||
{output.description}
|
||||
</pre>
|
||||
@@ -56,7 +66,12 @@ export function OutputPreview({ output: outputProp }: OutputPreviewProps) {
|
||||
</h3>
|
||||
<div className="flex items-center gap-3">
|
||||
{showCharCount && <CharCounter text={output.tagString} limit={YT_LIMITS.TAGS_MAX} />}
|
||||
<CopyButton text={output.tagString} label={t("output.copyTags")} />
|
||||
<CopyButton
|
||||
text={output.tagString}
|
||||
label={t("output.copyTags")}
|
||||
limit={YT_LIMITS.TAGS_MAX}
|
||||
fieldLabel={t("output.tags")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="rounded-lg border border-border bg-surface-1 p-3">
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Upload, Pencil, Trash2 } from "lucide-react";
|
||||
import { Button } from "@components/ui/Button";
|
||||
import { ConfirmDialog } from "@components/ui/ConfirmDialog";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import { useSettingsStore } from "@store/settings-store";
|
||||
import { usePresetStore, type GamePreset } from "@store/preset-store";
|
||||
import { GENRES } from "@config/genres";
|
||||
import { PresetSaveForm } from "./PresetSaveForm";
|
||||
@@ -15,6 +16,7 @@ interface PresetCardProps {
|
||||
export function PresetCard({ preset }: PresetCardProps) {
|
||||
const { t } = useTranslation("ui");
|
||||
const loadPreset = useEditorStore((s) => s.loadPreset);
|
||||
const setSetting = useSettingsStore((s) => s.setSetting);
|
||||
const deletePreset = usePresetStore((s) => s.deletePreset);
|
||||
const [showDelete, setShowDelete] = useState(false);
|
||||
const [showEdit, setShowEdit] = useState(false);
|
||||
@@ -28,7 +30,14 @@ export function PresetCard({ preset }: PresetCardProps) {
|
||||
storeLinks: { ...preset.storeLinks },
|
||||
spoilerWarning: preset.spoilerWarning,
|
||||
matureWarning: preset.matureWarning,
|
||||
pubDevName: preset.pubDevName ?? "",
|
||||
});
|
||||
// v0.21.0: same pattern as PresetSelector — only flip the setting
|
||||
// when the preset explicitly carries it, so older presets don't
|
||||
// silently reset a user's preference on first load.
|
||||
if (preset.showGameCopyright !== undefined) {
|
||||
setSetting("showGameCopyright", preset.showGameCopyright);
|
||||
}
|
||||
};
|
||||
|
||||
const genreDefs = preset.genres
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Modal } from "@components/ui/Modal";
|
||||
import { Button } from "@components/ui/Button";
|
||||
import { Input } from "@components/ui/Input";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import { useSettingsStore } from "@store/settings-store";
|
||||
import { usePresetStore, type GamePreset } from "@store/preset-store";
|
||||
|
||||
interface PresetSaveFormProps {
|
||||
@@ -15,6 +16,7 @@ interface PresetSaveFormProps {
|
||||
export function PresetSaveForm({ open, onClose, editPreset }: PresetSaveFormProps) {
|
||||
const { t } = useTranslation("ui");
|
||||
const editor = useEditorStore();
|
||||
const showGameCopyrightSetting = useSettingsStore((s) => s.showGameCopyright);
|
||||
const { addPreset, updatePreset } = usePresetStore();
|
||||
|
||||
const [gameName, setGameName] = useState(editPreset?.gameName ?? editor.gameName);
|
||||
@@ -28,6 +30,8 @@ export function PresetSaveForm({ open, onClose, editPreset }: PresetSaveFormProp
|
||||
storeLinks: editPreset?.storeLinks ?? { ...editor.storeLinks },
|
||||
spoilerWarning: editPreset?.spoilerWarning ?? editor.spoilerWarning,
|
||||
matureWarning: editPreset?.matureWarning ?? editor.matureWarning,
|
||||
pubDevName: editPreset?.pubDevName ?? editor.pubDevName,
|
||||
showGameCopyright: editPreset?.showGameCopyright ?? showGameCopyrightSetting,
|
||||
};
|
||||
|
||||
if (editPreset) {
|
||||
|
||||
@@ -2,11 +2,13 @@ import { useTranslation } from "react-i18next";
|
||||
import { Select } from "@components/ui/Select";
|
||||
import { usePresetStore } from "@store/preset-store";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import { useSettingsStore } from "@store/settings-store";
|
||||
|
||||
export function PresetSelector() {
|
||||
const { t } = useTranslation("ui");
|
||||
const presets = usePresetStore((s) => s.presets);
|
||||
const loadPreset = useEditorStore((s) => s.loadPreset);
|
||||
const setSetting = useSettingsStore((s) => s.setSetting);
|
||||
|
||||
if (presets.length === 0) return null;
|
||||
|
||||
@@ -27,7 +29,15 @@ export function PresetSelector() {
|
||||
storeLinks: { ...preset.storeLinks },
|
||||
spoilerWarning: preset.spoilerWarning,
|
||||
matureWarning: preset.matureWarning,
|
||||
pubDevName: preset.pubDevName ?? "",
|
||||
});
|
||||
// v0.21.0: pull the per-preset toggle into the global setting so the
|
||||
// description re-renders with the right credit obligation. Missing
|
||||
// means "leave the user's setting alone" — older presets don't carry
|
||||
// this field.
|
||||
if (preset.showGameCopyright !== undefined) {
|
||||
setSetting("showGameCopyright", preset.showGameCopyright);
|
||||
}
|
||||
};
|
||||
|
||||
return <Select label={t("presets.selectPreset")} options={options} value="" onChange={handleSelect} />;
|
||||
|
||||
@@ -19,11 +19,16 @@ export function ProfileCard({ profile }: ProfileCardProps) {
|
||||
const [showEdit, setShowEdit] = useState(false);
|
||||
|
||||
const handleLoad = () => {
|
||||
// v0.15.0: defensive nullish-coalesce on the two nested record
|
||||
// fields. A malformed imported profile may carry `social: null` /
|
||||
// `rig: null` — spreading null throws "Cannot convert undefined or
|
||||
// null to object", which used to black-screen the app. `?? {}`
|
||||
// turns the bad import into a partial load instead of a crash.
|
||||
loadProfile({
|
||||
channelName: profile.channelName,
|
||||
contactEmail: profile.contactEmail,
|
||||
social: { ...profile.social },
|
||||
rig: { ...profile.rig },
|
||||
social: { ...(profile.social ?? {}) },
|
||||
rig: { ...(profile.rig ?? {}) },
|
||||
resolution: profile.resolution,
|
||||
fps: profile.fps,
|
||||
graphicsPreset: profile.graphicsPreset,
|
||||
@@ -31,8 +36,10 @@ export function ProfileCard({ profile }: ProfileCardProps) {
|
||||
});
|
||||
};
|
||||
|
||||
const socialCount = Object.values(profile.social).filter((v) => v).length;
|
||||
const rigCount = Object.values(profile.rig).filter((v) => v).length;
|
||||
// Same defence on render: `Object.values(null)` throws. With the
|
||||
// coalesce the count falls back to 0 and the chip just hides.
|
||||
const socialCount = Object.values(profile.social ?? {}).filter((v) => v).length;
|
||||
const rigCount = Object.values(profile.rig ?? {}).filter((v) => v).length;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -18,6 +18,15 @@ export function TemplateCard({ template }: TemplateCardProps) {
|
||||
const [showDelete, setShowDelete] = useState(false);
|
||||
|
||||
const handleApply = () => {
|
||||
// v0.15.0: defend against a template whose `snapshot` field is
|
||||
// null/undefined — most commonly when the template was imported
|
||||
// from a malformed JSON. `loadProfile` itself now ignores a null
|
||||
// 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" }));
|
||||
return;
|
||||
}
|
||||
loadProfile(template.snapshot);
|
||||
toast.success(t("templates.appliedToast", { name: template.name }));
|
||||
};
|
||||
|
||||
@@ -64,7 +64,13 @@ export function TemplateSaveForm({ open, onClose }: TemplateSaveFormProps) {
|
||||
playthroughStatus: editor.playthroughStatus,
|
||||
difficulty: editor.difficulty,
|
||||
difficultyCustomLabel: editor.difficultyCustomLabel,
|
||||
endingsShown: editor.endingsShown,
|
||||
languagePatch: editor.languagePatch,
|
||||
languagePatchCustom: editor.languagePatchCustom,
|
||||
gameVersion: editor.gameVersion,
|
||||
gameVersionCustom: editor.gameVersionCustom,
|
||||
contentWarnings: [...editor.contentWarnings],
|
||||
techNotes: [...editor.techNotes],
|
||||
storeLinks: { ...editor.storeLinks },
|
||||
storeLinkTypes: { ...editor.storeLinkTypes },
|
||||
social: { ...editor.social },
|
||||
|
||||
@@ -13,9 +13,9 @@ const variantClasses = {
|
||||
};
|
||||
|
||||
const sizeClasses = {
|
||||
sm: "px-2.5 py-1 text-xs",
|
||||
md: "px-4 py-2 text-sm",
|
||||
lg: "px-6 py-2.5 text-base",
|
||||
sm: "px-2.5 py-1 text-xs min-h-[36px]",
|
||||
md: "px-4 py-2 text-sm min-h-touch",
|
||||
lg: "px-6 py-2.5 text-base min-h-touch",
|
||||
};
|
||||
|
||||
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
import { useEffect, type ReactNode } from "react";
|
||||
import { X } from "lucide-react";
|
||||
import clsx from "clsx";
|
||||
|
||||
interface DrawerProps {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
side?: "left" | "right";
|
||||
title?: string;
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
ariaLabel?: string;
|
||||
}
|
||||
|
||||
export function Drawer({
|
||||
open,
|
||||
onClose,
|
||||
side = "left",
|
||||
title,
|
||||
children,
|
||||
className,
|
||||
ariaLabel,
|
||||
}: DrawerProps) {
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
const handleEsc = (e: KeyboardEvent) => {
|
||||
if (e.key === "Escape") onClose();
|
||||
};
|
||||
document.addEventListener("keydown", handleEsc);
|
||||
const prevOverflow = document.body.style.overflow;
|
||||
document.body.style.overflow = "hidden";
|
||||
return () => {
|
||||
document.removeEventListener("keydown", handleEsc);
|
||||
document.body.style.overflow = prevOverflow;
|
||||
};
|
||||
}, [open, onClose]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
"fixed inset-0 z-50 transition-opacity duration-200",
|
||||
open ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0",
|
||||
)}
|
||||
aria-hidden={!open}
|
||||
>
|
||||
<div
|
||||
className="absolute inset-0 bg-black/60"
|
||||
onClick={onClose}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div
|
||||
role="dialog"
|
||||
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",
|
||||
open
|
||||
? "translate-x-0"
|
||||
: side === "left"
|
||||
? "-translate-x-full"
|
||||
: "translate-x-full",
|
||||
className,
|
||||
)}
|
||||
style={{
|
||||
paddingTop: "env(safe-area-inset-top)",
|
||||
paddingBottom: "env(safe-area-inset-bottom)",
|
||||
}}
|
||||
>
|
||||
{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>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClose}
|
||||
className="rounded-lg p-2 text-text-muted hover:bg-surface-2 hover:text-text-primary"
|
||||
aria-label="Close"
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex-1 overflow-y-auto">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -21,7 +21,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
||||
ref={ref}
|
||||
id={inputId}
|
||||
className={clsx(
|
||||
"rounded-lg border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50",
|
||||
"min-h-touch rounded-lg border bg-surface-1 px-3 py-2.5 text-base text-text-primary placeholder:text-text-muted transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 sm:text-sm",
|
||||
error ? "border-danger" : "border-border focus:border-accent",
|
||||
className,
|
||||
)}
|
||||
|
||||
@@ -21,7 +21,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
||||
ref={ref}
|
||||
id={inputId}
|
||||
className={clsx(
|
||||
"min-h-[80px] rounded-lg border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 resize-y",
|
||||
"min-h-[96px] rounded-lg border bg-surface-1 px-3 py-2.5 text-base text-text-primary placeholder:text-text-muted transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 resize-y sm:text-sm",
|
||||
error ? "border-danger" : "border-border focus:border-accent",
|
||||
className,
|
||||
)}
|
||||
|
||||
@@ -10,6 +10,9 @@ interface ValidatedInputProps {
|
||||
validate: (value: string) => ValidationResult;
|
||||
placeholder?: string;
|
||||
helpText?: string;
|
||||
inputMode?: "text" | "email" | "url" | "numeric" | "tel" | "search" | "decimal";
|
||||
autoComplete?: string;
|
||||
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send";
|
||||
/**
|
||||
* Forwarded to the inner `<input>`. Used by StoreLinkEditor to sniff a
|
||||
* pasted URL and auto-fill the Game Name field — see
|
||||
@@ -26,6 +29,9 @@ export function ValidatedInput({
|
||||
validate,
|
||||
placeholder,
|
||||
helpText,
|
||||
inputMode,
|
||||
autoComplete,
|
||||
enterKeyHint,
|
||||
onPaste,
|
||||
}: ValidatedInputProps) {
|
||||
const { t } = useTranslation("ui");
|
||||
@@ -68,8 +74,11 @@ export function ValidatedInput({
|
||||
onBlur={() => setTouched(true)}
|
||||
onPaste={onPaste}
|
||||
placeholder={placeholder}
|
||||
inputMode={inputMode}
|
||||
autoComplete={autoComplete}
|
||||
enterKeyHint={enterKeyHint}
|
||||
className={clsx(
|
||||
"rounded-lg border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50",
|
||||
"min-h-touch rounded-lg border bg-surface-1 px-3 py-2.5 text-base text-text-primary placeholder:text-text-muted transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 sm:text-sm",
|
||||
touched && error ? "border-danger" : "border-border focus:border-accent",
|
||||
)}
|
||||
/>
|
||||
|
||||
+13
-3
@@ -6,21 +6,31 @@ import pkg from "../../package.json";
|
||||
* Versions come from `package.json` so the About page never lies after a
|
||||
* version bump. Empty social URLs are hidden by the page; fill in the
|
||||
* channel / handle URLs you want to expose before tagging a release.
|
||||
*
|
||||
* Note: Ko-fi / Patreon were moved out of `socials` into `@config/donate`
|
||||
* in v0.13.1 — they're "support" links, not "presence" links.
|
||||
*/
|
||||
export const ABOUT = {
|
||||
appName: "YTDescGen",
|
||||
version: pkg.version,
|
||||
license: "MIT",
|
||||
license: "Apache-2.0",
|
||||
repo: "https://github.com/poli0981/youtube-generator",
|
||||
issuesUrl: "https://github.com/poli0981/youtube-generator/issues",
|
||||
bugReportUrl: "https://github.com/poli0981/youtube-generator/issues/new?template=bug_report.yml",
|
||||
discussionsUrl: "https://github.com/poli0981/youtube-generator/discussions",
|
||||
licenseUrl: "https://github.com/poli0981/youtube-generator/blob/main/LICENSE",
|
||||
githubAuthor: "https://github.com/poli0981",
|
||||
socials: {
|
||||
youtube: "https://www.youtube.com/@SkullMute",
|
||||
x: "https://x.com/SkullMute0011",
|
||||
bluesky: "https://bsky.app/profile/skullmute0011.bsky.social",
|
||||
mastodon: "https://mastodon.social/@skullmute1122",
|
||||
discord: "https://discord.gg/2aNR3aVt",
|
||||
kofi: "https://ko-fi.com/skullmute",
|
||||
patreon: "https://www.patreon.com/skullmute",
|
||||
discordGame: "https://discord.gg/kDM9GMu5vm",
|
||||
steam: "https://steamcommunity.com/profiles/76561199544666292/",
|
||||
telegramBot: "https://t.me/my_skull_bot",
|
||||
telegramUser: "https://t.me/SkullMute0011",
|
||||
email: "mailto:lopop05905@proton.me",
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -35,7 +35,41 @@ export const CONTENT_WARNING_GROUPS: readonly ContentWarningGroup[] = [
|
||||
{
|
||||
id: "photosensitive",
|
||||
labelKey: "editor.contentWarningGroups.photosensitive",
|
||||
items: ["flashing_lights", "motion_sickness", "migraine_trigger", "loud_noises"],
|
||||
items: [
|
||||
"flashing_lights",
|
||||
"motion_sickness",
|
||||
"migraine_trigger",
|
||||
"strobe_effects",
|
||||
"screen_shake_intense",
|
||||
// v0.23.0: VFX intensity — share the photosensitive audience.
|
||||
"lens_flare_intense",
|
||||
"bloom_excessive",
|
||||
"particle_effects_dense",
|
||||
"screen_overlay_flashing",
|
||||
"color_saturation_extreme",
|
||||
"motion_blur_heavy",
|
||||
"depth_of_field_aggressive",
|
||||
"post_processing_intense",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "audio",
|
||||
labelKey: "editor.contentWarningGroups.audio",
|
||||
items: [
|
||||
"loud_noises",
|
||||
"ear_piercing",
|
||||
"jumpscare_audio",
|
||||
"sudden_volume_changes",
|
||||
"distorted_audio",
|
||||
"screeching_metallic",
|
||||
"persistent_high_pitch",
|
||||
"audio_glitches",
|
||||
"heavy_bass_rumble",
|
||||
"screaming_audio",
|
||||
"glass_breaking_audio",
|
||||
"microphone_pops",
|
||||
"white_noise_static",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "phobias",
|
||||
@@ -49,6 +83,49 @@ export const CONTENT_WARNING_GROUPS: readonly ContentWarningGroup[] = [
|
||||
"arachnophobia",
|
||||
"entomophobia",
|
||||
"ophidiophobia",
|
||||
"cynophobia",
|
||||
"nyctophobia",
|
||||
"pyrophobia",
|
||||
"pediophobia",
|
||||
"hemophobia",
|
||||
"coulrophobia",
|
||||
"ablutophobia",
|
||||
"taphophobia",
|
||||
"automatonophobia",
|
||||
"megalophobia",
|
||||
"submechanophobia",
|
||||
"necrophobia",
|
||||
"spectrophobia",
|
||||
"demonophobia",
|
||||
"selachophobia",
|
||||
"mysophobia",
|
||||
"emetophobia",
|
||||
"scopophobia",
|
||||
"monophobia",
|
||||
"musophobia",
|
||||
"chiroptophobia",
|
||||
"ornithophobia",
|
||||
"ichthyophobia",
|
||||
"herpetophobia",
|
||||
"katsaridaphobia",
|
||||
"apiphobia",
|
||||
"astraphobia",
|
||||
"agoraphobia",
|
||||
"enochlophobia",
|
||||
"chionophobia",
|
||||
"nosocomephobia",
|
||||
"aichmophobia",
|
||||
"pnigophobia",
|
||||
"homichlophobia",
|
||||
"lilapsophobia",
|
||||
"ombrophobia",
|
||||
"nephophobia",
|
||||
"ancraophobia",
|
||||
"cryophobia",
|
||||
"heliophobia",
|
||||
"cymophobia",
|
||||
"limnophobia",
|
||||
"potamophobia",
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -65,6 +142,39 @@ export const CONTENT_WARNING_GROUPS: readonly ContentWarningGroup[] = [
|
||||
"body_fluids",
|
||||
"pregnancy_horror",
|
||||
"illness_themes",
|
||||
"bipolar_themes",
|
||||
"ocd_themes",
|
||||
"panic_attacks",
|
||||
"dissociation",
|
||||
"paranoia_themes",
|
||||
"intrusive_thoughts",
|
||||
"medical_horror",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "social_phenomena",
|
||||
labelKey: "editor.contentWarningGroups.social_phenomena",
|
||||
items: [
|
||||
"autism_themes",
|
||||
"adhd_themes",
|
||||
"hikikomori",
|
||||
"neet_themes",
|
||||
"social_anxiety_themes",
|
||||
"social_isolation",
|
||||
"schizophrenia_themes",
|
||||
"burnout_themes",
|
||||
"survivor_guilt",
|
||||
"abandonment_themes",
|
||||
"parasocial_themes",
|
||||
"gaslighting_themes",
|
||||
"stockholm_syndrome",
|
||||
"behavioral_addiction",
|
||||
"existential_crisis",
|
||||
"impostor_syndrome",
|
||||
"midlife_crisis",
|
||||
"quarter_life_crisis",
|
||||
"workplace_harassment",
|
||||
"masculinity_pressure",
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -89,6 +199,88 @@ export const CONTENT_WARNING_GROUPS: readonly ContentWarningGroup[] = [
|
||||
"psychological_manipulation",
|
||||
"grief_loss",
|
||||
"kidnapping",
|
||||
"hate_speech",
|
||||
"historical_atrocity",
|
||||
"slavery_themes",
|
||||
"terrorism_themes",
|
||||
"bullying_themes",
|
||||
"human_experimentation",
|
||||
"cannibalism",
|
||||
"nuclear_themes",
|
||||
"homophobia",
|
||||
"transphobia",
|
||||
"xenophobia",
|
||||
"political_extremism",
|
||||
"religious_extremism",
|
||||
"genocide",
|
||||
"holy_war",
|
||||
"holocaust_themes",
|
||||
"civil_war",
|
||||
"mass_shooting",
|
||||
"colonialism",
|
||||
"propaganda",
|
||||
"dystopian_state",
|
||||
"conspiracy_theories",
|
||||
"censorship_themes",
|
||||
"ethnic_conflict",
|
||||
"refugee_crisis",
|
||||
"revolution_themes",
|
||||
"assassination",
|
||||
"coup_themes",
|
||||
"inquisition",
|
||||
"forced_labor",
|
||||
"ultranationalism",
|
||||
"hanging_depiction",
|
||||
"drowning_depiction",
|
||||
"burning_alive",
|
||||
"asphyxiation_depiction",
|
||||
"restraint_torture",
|
||||
"public_execution",
|
||||
"decapitation",
|
||||
"impalement",
|
||||
"mass_casualty_event",
|
||||
"vehicular_violence",
|
||||
"overdose_depiction",
|
||||
"defenestration",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "horror_specific",
|
||||
labelKey: "editor.contentWarningGroups.horror_specific",
|
||||
items: [
|
||||
"eye_horror",
|
||||
"body_horror",
|
||||
"face_horror",
|
||||
"cosmic_horror",
|
||||
"extreme_gore",
|
||||
"decay_rot",
|
||||
"mutilation",
|
||||
"liminal_spaces",
|
||||
"analog_horror",
|
||||
"unreality_themes",
|
||||
"pursuit_chase",
|
||||
"entity_horror",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "playstyle",
|
||||
labelKey: "editor.contentWarningGroups.playstyle",
|
||||
items: [
|
||||
"blind_playthrough",
|
||||
"no_spoilers_chat",
|
||||
"casual_difficulty",
|
||||
"hardcore_difficulty",
|
||||
"permadeath_run",
|
||||
"speedrun_attempt",
|
||||
"completionist_run",
|
||||
"learning_mechanics",
|
||||
"first_time_playing",
|
||||
"returning_player",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "gameplay_disclosure",
|
||||
labelKey: "editor.contentWarningGroups.gameplay_disclosure",
|
||||
items: ["mods_used", "cheats_enabled", "glitch_exploits", "assisted_run"],
|
||||
},
|
||||
] as const;
|
||||
+49
-2
@@ -8,6 +8,7 @@ import type {
|
||||
UpscaleQuality,
|
||||
ArtStyle,
|
||||
} from "./graphics-settings";
|
||||
import type { VideoStyleEra } from "./video-styles";
|
||||
import { DEFAULT_GACHA_QUEST_TYPE, type GachaQuestType } from "./gacha-quest-types";
|
||||
import type {
|
||||
SupportedLanguage,
|
||||
@@ -15,6 +16,11 @@ import type {
|
||||
PlaythroughStatus,
|
||||
DifficultyLevel,
|
||||
ContentWarning,
|
||||
LanguagePatch,
|
||||
GameVersion,
|
||||
TechNote,
|
||||
EndingEntry,
|
||||
EndingVideoRange,
|
||||
} from "@engine/types";
|
||||
|
||||
export interface EditorDefaults {
|
||||
@@ -42,6 +48,12 @@ export interface EditorDefaults {
|
||||
chapterName: string;
|
||||
/** Gacha-quest individual quest / event name (free-form). */
|
||||
questName: string;
|
||||
/** Gacha-quest character name (v0.13) — only rendered for `showcase` quest type. */
|
||||
characterName: string;
|
||||
/** Gacha-quest anniversary year (v0.13) — only rendered for `anniversary` quest type. 1–20 or null. */
|
||||
anniversaryYear: number | null;
|
||||
/** Gacha-quest game version label (v0.13) — e.g. "1.2", "2.4". Only used for `gacha_quest` videoType. */
|
||||
gachaVersion: string;
|
||||
resolution: string;
|
||||
fps: string;
|
||||
graphicsPreset: GraphicsPreset;
|
||||
@@ -52,6 +64,8 @@ export interface EditorDefaults {
|
||||
frameGenMultiplier: FrameGenMultiplier;
|
||||
upscaleQuality: UpscaleQuality;
|
||||
artStyle: ArtStyle;
|
||||
/** v0.22.0 opt-in. Empty string = no style line in the description. */
|
||||
videoStyleEra: VideoStyleEra;
|
||||
versionInfo: string;
|
||||
timestamps: string;
|
||||
playlistLink: string;
|
||||
@@ -84,7 +98,28 @@ export interface EditorDefaults {
|
||||
playthroughStatus: PlaythroughStatus;
|
||||
difficulty: DifficultyLevel;
|
||||
difficultyCustomLabel: string;
|
||||
/** Free-text endings descriptor for Playthrough Notes section (v0.12).
|
||||
* @deprecated v0.16.0 — superseded by structured {@link endings}. */
|
||||
endingsShown: string;
|
||||
/** Structured ending list (v0.16.0). */
|
||||
endings: EndingEntry[];
|
||||
/** Number of videos the playthrough is split across (v0.16.0). */
|
||||
endingVideoCount: number;
|
||||
/** Per-video ending range (v0.16.0). */
|
||||
endingVideoRanges: EndingVideoRange[];
|
||||
/** Which per-video slice the Output previews (v0.17.1). */
|
||||
endingVideoIndex: number;
|
||||
/** Language-patch enum for Playthrough Notes section (v0.12). */
|
||||
languagePatch: LanguagePatch;
|
||||
/** Free-form label when `languagePatch` is `"official_other"` or `"custom"`. */
|
||||
languagePatchCustom: string;
|
||||
/** Game-version enum for Playthrough Notes section (v0.12). */
|
||||
gameVersion: GameVersion;
|
||||
/** Free-form label when `gameVersion === "custom"`. */
|
||||
gameVersionCustom: string;
|
||||
contentWarnings: ContentWarning[];
|
||||
/** Tech / production / playstyle disclaimer checklist items (v0.12). */
|
||||
techNotes: TechNote[];
|
||||
storeLinks: Record<string, string>;
|
||||
storeLinkTypes: Record<string, StoreLinkType>;
|
||||
social: Record<string, string>;
|
||||
@@ -101,7 +136,6 @@ export interface EditorDefaults {
|
||||
export interface SettingsDefaults {
|
||||
theme: "dark" | "light";
|
||||
defaultLanguage: string;
|
||||
defaultGenres: GenreId[];
|
||||
}
|
||||
|
||||
export const DEFAULTS = {
|
||||
@@ -124,6 +158,9 @@ export const DEFAULTS = {
|
||||
gachaQuestType: DEFAULT_GACHA_QUEST_TYPE,
|
||||
chapterName: "",
|
||||
questName: "",
|
||||
characterName: "",
|
||||
anniversaryYear: null,
|
||||
gachaVersion: "",
|
||||
resolution: "1080p",
|
||||
fps: "60",
|
||||
graphicsPreset: "medium",
|
||||
@@ -134,6 +171,7 @@ export const DEFAULTS = {
|
||||
frameGenMultiplier: "none",
|
||||
upscaleQuality: "none",
|
||||
artStyle: "none",
|
||||
videoStyleEra: "" satisfies VideoStyleEra,
|
||||
versionInfo: "",
|
||||
timestamps: "",
|
||||
playlistLink: "",
|
||||
@@ -150,7 +188,17 @@ export const DEFAULTS = {
|
||||
playthroughStatus: "none",
|
||||
difficulty: "none",
|
||||
difficultyCustomLabel: "",
|
||||
endingsShown: "",
|
||||
endings: [],
|
||||
endingVideoCount: 1,
|
||||
endingVideoRanges: [],
|
||||
endingVideoIndex: 1,
|
||||
languagePatch: "none",
|
||||
languagePatchCustom: "",
|
||||
gameVersion: "full_release",
|
||||
gameVersionCustom: "",
|
||||
contentWarnings: [],
|
||||
techNotes: [],
|
||||
storeLinks: {},
|
||||
storeLinkTypes: {},
|
||||
social: {},
|
||||
@@ -165,6 +213,5 @@ export const DEFAULTS = {
|
||||
settings: {
|
||||
theme: "dark",
|
||||
defaultLanguage: "en",
|
||||
defaultGenres: ["action"],
|
||||
} satisfies SettingsDefaults,
|
||||
} as const;
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Donate / support links surfaced on the About page and via the persistent
|
||||
* Donate button in the Header.
|
||||
*
|
||||
* Mirrors `.github/FUNDING.yml` so GitHub's "Sponsor this project" picker
|
||||
* and the in-app surface stay aligned. Update both files together.
|
||||
*/
|
||||
export const DONATE = {
|
||||
githubSponsors: "https://github.com/sponsors/poli0981",
|
||||
kofi: "https://ko-fi.com/skullmute",
|
||||
buyMeACoffee: "https://buymeacoffee.com/skullmute",
|
||||
patreon: "https://www.patreon.com/skullmute",
|
||||
paypal: "https://paypal.me/DungDang212",
|
||||
} as const;
|
||||
|
||||
export type DonateId = keyof typeof DONATE;
|
||||
|
||||
/**
|
||||
* Single "primary" link the Header button points at. Ko-fi has no account
|
||||
* gate and lowest friction — change here to swap the Header default.
|
||||
*/
|
||||
export const PRIMARY_DONATE_URL = DONATE.kofi;
|
||||
@@ -114,3 +114,102 @@ export const GACHA_PART_SUFFIX_STYLES: Record<GachaQuestType, GachaPartSuffixSty
|
||||
daily_commission: "day",
|
||||
showcase: "none",
|
||||
};
|
||||
|
||||
/**
|
||||
* Quest-type → which extra fields to render in the Gacha-quest editor
|
||||
* (v0.13). Keeps the `extra-fields` UI surgical: Showcase replaces
|
||||
* Chapter/Quest with Character Name, Anniversary swaps the part-number
|
||||
* input for a 1–20 year dropdown, and the rest fall back to the default
|
||||
* Chapter/Quest/Part triplet. `gachaVersion` is always shown for the
|
||||
* `gacha_quest` video type, regardless of the selected quest type — it
|
||||
* applies broadly (game patch labels like "1.2", "2.4").
|
||||
*/
|
||||
export interface GachaQuestFieldVisibility {
|
||||
chapterName: boolean;
|
||||
questName: boolean;
|
||||
partNumber: boolean;
|
||||
characterName: boolean;
|
||||
anniversaryYear: boolean;
|
||||
}
|
||||
|
||||
const DEFAULT_FIELD_VISIBILITY: GachaQuestFieldVisibility = {
|
||||
chapterName: true,
|
||||
questName: true,
|
||||
partNumber: true,
|
||||
characterName: false,
|
||||
anniversaryYear: false,
|
||||
};
|
||||
|
||||
export const GACHA_QUEST_FIELD_VISIBILITY: Record<
|
||||
GachaQuestType,
|
||||
GachaQuestFieldVisibility
|
||||
> = {
|
||||
main_story: { ...DEFAULT_FIELD_VISIBILITY, questName: false },
|
||||
world_quest: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
side_quest: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
spinoff_quest: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
companion_quest: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
bond_quest: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
event: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
anniversary: {
|
||||
chapterName: false,
|
||||
questName: false,
|
||||
partNumber: true,
|
||||
characterName: false,
|
||||
anniversaryYear: true,
|
||||
},
|
||||
crossover: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
dating_event: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
tutorial_quest: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
guide_quest: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
trial_quest: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
endgame: { ...DEFAULT_FIELD_VISIBILITY, questName: false },
|
||||
coop: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, partNumber: false },
|
||||
daily_commission: { ...DEFAULT_FIELD_VISIBILITY, chapterName: false, questName: false },
|
||||
showcase: {
|
||||
chapterName: false,
|
||||
questName: false,
|
||||
partNumber: false,
|
||||
characterName: true,
|
||||
anniversaryYear: false,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Per-quest-type placeholder hints for Chapter Name / Quest Name / Part
|
||||
* Number inputs (v0.13 QoL). Surfaces concrete examples so creators
|
||||
* don't have to guess what each field expects under different quest
|
||||
* patterns. Translated via `editor.placeholders.questType.<id>.<field>`
|
||||
* — fall back to the static defaults when the locale lacks the override.
|
||||
*/
|
||||
export interface GachaQuestPlaceholders {
|
||||
chapterName?: string;
|
||||
questName?: string;
|
||||
partNumber?: string;
|
||||
}
|
||||
|
||||
export const GACHA_QUEST_PLACEHOLDERS: Record<GachaQuestType, GachaQuestPlaceholders> = {
|
||||
main_story: {
|
||||
chapterName: "e.g. Chapter 5 Act 2",
|
||||
partNumber: "e.g. Part 1",
|
||||
},
|
||||
world_quest: { questName: "e.g. The Hidden Path" },
|
||||
side_quest: { questName: "e.g. A Solitary Constellation" },
|
||||
spinoff_quest: { questName: "e.g. The Tale of Wuthering Waves" },
|
||||
companion_quest: { questName: "e.g. Yelan: Path of Stillness" },
|
||||
bond_quest: { questName: "e.g. Trust Mission - Hina" },
|
||||
event: { questName: "e.g. Summer Festival 2024" },
|
||||
anniversary: { partNumber: "Day 1, Day 7, etc." },
|
||||
crossover: { questName: "e.g. Honkai x Genshin Crossover" },
|
||||
dating_event: { questName: "e.g. Date with Furina" },
|
||||
tutorial_quest: { questName: "e.g. First Steps in Teyvat" },
|
||||
guide_quest: { questName: "e.g. How to upgrade artifacts" },
|
||||
trial_quest: { questName: "e.g. Adventure Trial - Diluc" },
|
||||
endgame: {
|
||||
chapterName: "e.g. Spiral Abyss / Memory of Chaos",
|
||||
partNumber: "Floor 12, Floor 11",
|
||||
},
|
||||
coop: { questName: "e.g. Co-op Boss Run" },
|
||||
daily_commission: { partNumber: "Day 1, Day 12, etc." },
|
||||
showcase: {},
|
||||
};
|
||||
@@ -0,0 +1,256 @@
|
||||
/**
|
||||
* GPU catalog for the My Rig editor (v0.13). Three-level taxonomy:
|
||||
*
|
||||
* Brand → Series → Model
|
||||
*
|
||||
* The cascading-dropdown UI in {@link RigEditor} stores the user's
|
||||
* choice as a pipe-delimited string `"<brandId>|<seriesId>|<model>"` so
|
||||
* the rig store stays a flat `Record<string, string>` (no schema
|
||||
* migration vs. v0.12). The third segment is the verbatim model display
|
||||
* string — it's stored as-is so we never need a reverse lookup table to
|
||||
* render the value back into the description output.
|
||||
*
|
||||
* Backward-compatibility: pre-v0.13 rigs persisted GPU as free-form text
|
||||
* (`"NVIDIA RTX 4090"`). Those values lack pipes, so `formatRigValue`
|
||||
* passes them through unchanged, and the editor renders them under the
|
||||
* `custom` brand for further editing.
|
||||
*
|
||||
* Scope: ambitious — covers the GPUs viewers commonly own in 2026,
|
||||
* which still includes 10+ years of legacy NVIDIA / AMD parts because
|
||||
* gameplay-no-commentary audiences run a wide spread of hardware ages.
|
||||
*
|
||||
* Apple Silicon is included for creators who edit on Mac and want their
|
||||
* rig listing to reflect that, even though Apple chips aren't really
|
||||
* "gaming GPUs" in the discrete-card sense.
|
||||
*/
|
||||
|
||||
interface GpuSeries {
|
||||
/** Stable id used in the storage tuple (`<brandId>|<seriesId>|<model>`). */
|
||||
readonly id: string;
|
||||
readonly label: string;
|
||||
/** Free-form display strings — stored verbatim as the model segment. */
|
||||
readonly models: readonly string[];
|
||||
}
|
||||
|
||||
export interface GpuBrand {
|
||||
readonly id: string;
|
||||
readonly label: string;
|
||||
readonly series: readonly GpuSeries[];
|
||||
}
|
||||
|
||||
export type GpuCatalog = readonly GpuBrand[];
|
||||
|
||||
const NVIDIA_SERIES: readonly GpuSeries[] = [
|
||||
{
|
||||
id: "rtx_50",
|
||||
label: "RTX 50 Series",
|
||||
models: ["RTX 5050", "RTX 5060", "RTX 5060 Ti", "RTX 5070", "RTX 5070 Ti", "RTX 5080", "RTX 5090"],
|
||||
},
|
||||
{
|
||||
id: "rtx_40",
|
||||
label: "RTX 40 Series",
|
||||
models: [
|
||||
"RTX 4050 (laptop)",
|
||||
"RTX 4060",
|
||||
"RTX 4060 Ti",
|
||||
"RTX 4070",
|
||||
"RTX 4070 SUPER",
|
||||
"RTX 4070 Ti",
|
||||
"RTX 4070 Ti SUPER",
|
||||
"RTX 4080",
|
||||
"RTX 4080 SUPER",
|
||||
"RTX 4090",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "rtx_30",
|
||||
label: "RTX 30 Series",
|
||||
models: [
|
||||
"RTX 3050",
|
||||
"RTX 3050 6GB",
|
||||
"RTX 3060",
|
||||
"RTX 3060 Ti",
|
||||
"RTX 3070",
|
||||
"RTX 3070 Ti",
|
||||
"RTX 3080",
|
||||
"RTX 3080 12GB",
|
||||
"RTX 3080 Ti",
|
||||
"RTX 3090",
|
||||
"RTX 3090 Ti",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "rtx_20",
|
||||
label: "RTX 20 Series",
|
||||
models: [
|
||||
"RTX 2060",
|
||||
"RTX 2060 SUPER",
|
||||
"RTX 2070",
|
||||
"RTX 2070 SUPER",
|
||||
"RTX 2080",
|
||||
"RTX 2080 SUPER",
|
||||
"RTX 2080 Ti",
|
||||
"TITAN RTX",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "gtx_16",
|
||||
label: "GTX 16 Series",
|
||||
models: ["GTX 1630", "GTX 1650", "GTX 1650 SUPER", "GTX 1660", "GTX 1660 SUPER", "GTX 1660 Ti"],
|
||||
},
|
||||
{
|
||||
id: "gtx_10",
|
||||
label: "GTX 10 Series",
|
||||
models: [
|
||||
"GTX 1050",
|
||||
"GTX 1050 Ti",
|
||||
"GTX 1060 3GB",
|
||||
"GTX 1060 6GB",
|
||||
"GTX 1070",
|
||||
"GTX 1070 Ti",
|
||||
"GTX 1080",
|
||||
"GTX 1080 Ti",
|
||||
"TITAN Xp",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "gtx_900",
|
||||
label: "GTX 900 Series",
|
||||
models: ["GTX 950", "GTX 960", "GTX 970", "GTX 980", "GTX 980 Ti", "TITAN X (Maxwell)"],
|
||||
},
|
||||
{
|
||||
id: "gtx_700",
|
||||
label: "GTX 700 Series",
|
||||
models: ["GTX 750", "GTX 750 Ti", "GTX 760", "GTX 770", "GTX 780", "GTX 780 Ti", "TITAN Black"],
|
||||
},
|
||||
];
|
||||
|
||||
const AMD_SERIES: readonly GpuSeries[] = [
|
||||
{
|
||||
id: "rx_9000",
|
||||
label: "Radeon RX 9000",
|
||||
models: ["RX 9060", "RX 9060 XT", "RX 9070", "RX 9070 XT", "RX 9080", "RX 9090 XT"],
|
||||
},
|
||||
{
|
||||
id: "rx_7000",
|
||||
label: "Radeon RX 7000",
|
||||
models: [
|
||||
"RX 7600",
|
||||
"RX 7600 XT",
|
||||
"RX 7700 XT",
|
||||
"RX 7800 XT",
|
||||
"RX 7900 GRE",
|
||||
"RX 7900 XT",
|
||||
"RX 7900 XTX",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "rx_6000",
|
||||
label: "Radeon RX 6000",
|
||||
models: [
|
||||
"RX 6400",
|
||||
"RX 6500 XT",
|
||||
"RX 6600",
|
||||
"RX 6600 XT",
|
||||
"RX 6650 XT",
|
||||
"RX 6700",
|
||||
"RX 6700 XT",
|
||||
"RX 6750 XT",
|
||||
"RX 6800",
|
||||
"RX 6800 XT",
|
||||
"RX 6900 XT",
|
||||
"RX 6950 XT",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "rx_5000",
|
||||
label: "Radeon RX 5000",
|
||||
models: ["RX 5500", "RX 5500 XT", "RX 5600", "RX 5600 XT", "RX 5700", "RX 5700 XT"],
|
||||
},
|
||||
{
|
||||
id: "rx_vega",
|
||||
label: "Radeon RX Vega",
|
||||
models: ["RX Vega 56", "RX Vega 64", "Radeon VII"],
|
||||
},
|
||||
{
|
||||
id: "rx_500",
|
||||
label: "Radeon RX 500",
|
||||
models: ["RX 550", "RX 560", "RX 570", "RX 580", "RX 590"],
|
||||
},
|
||||
{
|
||||
id: "rx_400",
|
||||
label: "Radeon RX 400",
|
||||
models: ["RX 460", "RX 470", "RX 480"],
|
||||
},
|
||||
{
|
||||
id: "r9_300",
|
||||
label: "Radeon R7/R9 300",
|
||||
models: ["R7 360", "R7 370", "R9 380", "R9 380X", "R9 390", "R9 390X", "R9 Fury", "R9 Fury X", "R9 Nano"],
|
||||
},
|
||||
{
|
||||
id: "r9_200",
|
||||
label: "Radeon R7/R9 200",
|
||||
models: ["R7 250", "R7 260", "R7 260X", "R9 270", "R9 270X", "R9 280", "R9 280X", "R9 290", "R9 290X"],
|
||||
},
|
||||
{
|
||||
id: "hd_7000",
|
||||
label: "Radeon HD 7000",
|
||||
models: ["HD 7750", "HD 7770", "HD 7850", "HD 7870", "HD 7950", "HD 7970"],
|
||||
},
|
||||
];
|
||||
|
||||
const INTEL_SERIES: readonly GpuSeries[] = [
|
||||
{
|
||||
id: "arc_b",
|
||||
label: "Arc B Series (Battlemage)",
|
||||
models: ["Arc B380", "Arc B570", "Arc B580"],
|
||||
},
|
||||
{
|
||||
id: "arc_a",
|
||||
label: "Arc A Series (Alchemist)",
|
||||
models: ["Arc A310", "Arc A380", "Arc A580", "Arc A750", "Arc A770"],
|
||||
},
|
||||
];
|
||||
|
||||
const APPLE_SERIES: readonly GpuSeries[] = [
|
||||
{
|
||||
id: "m4",
|
||||
label: "Apple M4",
|
||||
models: ["M4", "M4 Pro", "M4 Max"],
|
||||
},
|
||||
{
|
||||
id: "m3",
|
||||
label: "Apple M3",
|
||||
models: ["M3", "M3 Pro", "M3 Max", "M3 Ultra"],
|
||||
},
|
||||
{
|
||||
id: "m2",
|
||||
label: "Apple M2",
|
||||
models: ["M2", "M2 Pro", "M2 Max", "M2 Ultra"],
|
||||
},
|
||||
{
|
||||
id: "m1",
|
||||
label: "Apple M1",
|
||||
models: ["M1", "M1 Pro", "M1 Max", "M1 Ultra"],
|
||||
},
|
||||
];
|
||||
|
||||
export const GPU_CATALOG: GpuCatalog = [
|
||||
{ id: "nvidia", label: "NVIDIA", series: NVIDIA_SERIES },
|
||||
{ id: "amd", label: "AMD", series: AMD_SERIES },
|
||||
{ id: "intel", label: "Intel", series: INTEL_SERIES },
|
||||
{ id: "apple", label: "Apple Silicon", series: APPLE_SERIES },
|
||||
{ id: "custom", label: "Custom", series: [] },
|
||||
];
|
||||
|
||||
/** Stable signal that the user picked the free-text fallback. */
|
||||
export const GPU_CUSTOM_BRAND_ID = "custom";
|
||||
|
||||
/**
|
||||
* Lookup a brand by id without throwing. Returns `undefined` for unknown
|
||||
* ids so callers can render a graceful fallback (legacy free-text values
|
||||
* round-trip without exploding).
|
||||
*/
|
||||
export function findGpuBrand(brandId: string): GpuBrand | undefined {
|
||||
return GPU_CATALOG.find((b) => b.id === brandId);
|
||||
}
|
||||
@@ -99,5 +99,3 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
urlPattern: /^https:\/\/[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+(?:\/[^\s]*)?$/i,
|
||||
},
|
||||
] as const;
|
||||
|
||||
export type PlatformId = (typeof PLATFORMS)[number]["id"];
|
||||
@@ -0,0 +1,51 @@
|
||||
import {
|
||||
LANGUAGE_PATCH_OPTIONS,
|
||||
GAME_VERSION_OPTIONS,
|
||||
type LanguagePatch,
|
||||
type GameVersion,
|
||||
} from "@engine/types";
|
||||
|
||||
/**
|
||||
* UI-friendly option lists for the Playthrough Notes form (v0.12).
|
||||
* Mirrors the const arrays from `@engine/types` but as `{ id, labelKey }`
|
||||
* objects so Select renders both an i18n key and a stable value. The
|
||||
* engine continues to read straight from the typed unions — these
|
||||
* helpers exist purely so the editor doesn't repeat the i18n-key
|
||||
* convention in every component.
|
||||
*/
|
||||
export interface PlaythroughOption<T extends string> {
|
||||
id: T;
|
||||
/** i18n key for the localised display label. */
|
||||
labelKey: string;
|
||||
}
|
||||
|
||||
export const LANGUAGE_PATCH_UI_OPTIONS: readonly PlaythroughOption<LanguagePatch>[] =
|
||||
LANGUAGE_PATCH_OPTIONS.map((id) => ({
|
||||
id,
|
||||
labelKey: `editor.playthroughNotes.languagePatchOptions.${id}`,
|
||||
}));
|
||||
|
||||
export const GAME_VERSION_UI_OPTIONS: readonly PlaythroughOption<GameVersion>[] =
|
||||
GAME_VERSION_OPTIONS.map((id) => ({
|
||||
id,
|
||||
labelKey: `editor.playthroughNotes.gameVersionOptions.${id}`,
|
||||
}));
|
||||
|
||||
/**
|
||||
* Whether the language-patch enum value pairs with a free-form custom
|
||||
* label slot (`languagePatchCustom`). True for `"official_other"` (e.g.
|
||||
* "Official KR") and `"custom"` (everything else); false for the
|
||||
* canonical EN / fan / MTL options whose labels come from i18n.
|
||||
*/
|
||||
export function languagePatchHasCustomSlot(value: LanguagePatch): boolean {
|
||||
return value === "official_other" || value === "custom";
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the game-version enum value pairs with a free-form custom
|
||||
* label slot (`gameVersionCustom`). Only `"custom"` does — used for
|
||||
* niche cases like "Steam Next Fest demo", "Kickstarter backer build".
|
||||
*/
|
||||
export function gameVersionHasCustomSlot(value: GameVersion): boolean {
|
||||
return value === "custom";
|
||||
}
|
||||
+420
-20
@@ -1,3 +1,10 @@
|
||||
import {
|
||||
GPU_CATALOG,
|
||||
GPU_CUSTOM_BRAND_ID,
|
||||
findGpuBrand,
|
||||
type GpuCatalog,
|
||||
} from "./gpu-catalog";
|
||||
|
||||
/**
|
||||
* Supported rig field input types.
|
||||
*
|
||||
@@ -6,15 +13,101 @@
|
||||
* free-form version text input. The stored value is
|
||||
* `"<option_value>|<version>"` so we don't break the flat
|
||||
* `Partial<Record<string, string>>` rig shape in the editor store.
|
||||
* - `cascading_dropdown` (v0.13): three-level Brand → Series → Model
|
||||
* dropdown for GPU. Stored as `"<brand>|<series>|<model>"`. When
|
||||
* brand = `"custom"`, the UI swaps to a single free-text input and
|
||||
* stores `"custom||<freeText>"` (the model is the verbatim text the
|
||||
* user typed). Pre-v0.13 free-text values lack pipes — they pass
|
||||
* through `formatRigValue` unchanged so old profiles render the same
|
||||
* string they did before.
|
||||
* - `composite_dropdown` (v0.13): two-or-more dropdowns combined into
|
||||
* one logical field. Used by RAM (size + DDR generation). Each part
|
||||
* may opt into a free-text "Custom" override; the stored format is
|
||||
* pipe-delimited in the order parts are declared.
|
||||
*/
|
||||
export type RigFieldType = "text" | "dropdown_with_version";
|
||||
type RigFieldType =
|
||||
| "text"
|
||||
| "dropdown_with_version"
|
||||
| "cascading_dropdown"
|
||||
| "composite_dropdown";
|
||||
|
||||
export interface RigFieldOption {
|
||||
interface RigFieldOption {
|
||||
readonly value: string;
|
||||
/** Display label (not translated — software names are brand-preserved). */
|
||||
readonly label: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* v0.23.0: a composite part's options can now either be a static array
|
||||
* (the original RAM-style shape) OR a function that resolves the option
|
||||
* list based on previously-selected parts (the OS cascading shape, where
|
||||
* version-or-distro depends on OS name and the third slot depends on
|
||||
* both). Existing static-array call sites continue to work unchanged.
|
||||
*/
|
||||
type RigFieldOptionResolver =
|
||||
| readonly RigFieldOption[]
|
||||
| ((previousParts: readonly string[]) => readonly RigFieldOption[]);
|
||||
|
||||
export interface CompositePart {
|
||||
/** Stable id, used to assemble the storage tuple in declaration order. */
|
||||
readonly id: string;
|
||||
readonly labelKey: string;
|
||||
readonly options: RigFieldOptionResolver;
|
||||
/** When true, the part renders an extra free-text input when value === `"custom"`. */
|
||||
readonly allowCustom?: boolean;
|
||||
/** Suffix shown after the custom numeric input (e.g. " GB"). */
|
||||
readonly customSuffix?: string;
|
||||
/** Optional placeholder for the custom input. */
|
||||
readonly customPlaceholder?: string;
|
||||
/**
|
||||
* v0.23.0: dynamic label key override. Lets a single part show
|
||||
* "Distro" when OS = Linux but "Version" when OS = Windows / macOS.
|
||||
* Receives previously-selected parts; returns an i18n key.
|
||||
*/
|
||||
readonly labelKeyResolver?: (previousParts: readonly string[]) => string;
|
||||
/**
|
||||
* v0.23.0: hide this part entirely when the resolver returns `true`
|
||||
* (e.g. macOS has no Edition slot). `formatRigValue` also skips the
|
||||
* hidden part so it doesn't leak an empty token into the joined
|
||||
* output, and the editor doesn't render the dropdown.
|
||||
*/
|
||||
readonly hiddenWhen?: (previousParts: readonly string[]) => boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for {@link CompositePart.options} — call sites get a plain
|
||||
* `RigFieldOption[]` whether the part declares a static array or a
|
||||
* function-of-previous-parts resolver. Pure; exported for {@link RigEditor}.
|
||||
*/
|
||||
export function resolveCompositeOptions(
|
||||
opts: RigFieldOptionResolver,
|
||||
previousParts: readonly string[],
|
||||
): readonly RigFieldOption[] {
|
||||
return typeof opts === "function" ? opts(previousParts) : opts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for {@link CompositePart.labelKey} / {@link CompositePart.labelKeyResolver}.
|
||||
* Returns the dynamic label when present, falling back to the static
|
||||
* key on the part. Pure; exported for {@link RigEditor}.
|
||||
*/
|
||||
export function resolveCompositeLabelKey(
|
||||
part: CompositePart,
|
||||
previousParts: readonly string[],
|
||||
): string {
|
||||
return part.labelKeyResolver?.(previousParts) ?? part.labelKey;
|
||||
}
|
||||
|
||||
interface CompositeFieldSpec {
|
||||
readonly parts: readonly CompositePart[];
|
||||
/**
|
||||
* Format the stored parts into the description-output string. Receives
|
||||
* resolved labels (not raw ids) — for `custom` parts the resolved value
|
||||
* is the free-text the user typed.
|
||||
*/
|
||||
readonly format: (resolvedParts: readonly string[]) => string;
|
||||
}
|
||||
|
||||
export interface RigField {
|
||||
readonly id: string;
|
||||
readonly labelKey: string;
|
||||
@@ -22,6 +115,10 @@ export interface RigField {
|
||||
readonly placeholder?: string;
|
||||
readonly options?: readonly RigFieldOption[];
|
||||
readonly versionPlaceholder?: string;
|
||||
/** Set when {@link type} is `"cascading_dropdown"`. */
|
||||
readonly catalog?: GpuCatalog;
|
||||
/** Set when {@link type} is `"composite_dropdown"`. */
|
||||
readonly composite?: CompositeFieldSpec;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,7 +127,7 @@ export interface RigField {
|
||||
* Order loosely reflects popularity among no-commentary gameplay
|
||||
* creators. Add new entries here — the UI picks them up automatically.
|
||||
*/
|
||||
export const VIDEO_EDITOR_OPTIONS: readonly RigFieldOption[] = [
|
||||
const VIDEO_EDITOR_OPTIONS: readonly RigFieldOption[] = [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "davinci_resolve", label: "DaVinci Resolve" },
|
||||
{ value: "davinci_resolve_studio", label: "DaVinci Resolve Studio" },
|
||||
@@ -45,10 +142,221 @@ export const VIDEO_EDITOR_OPTIONS: readonly RigFieldOption[] = [
|
||||
{ value: "other", label: "Other" },
|
||||
];
|
||||
|
||||
/** RAM size options in GB. `custom` opens a numeric free-text input. */
|
||||
const RAM_SIZE_OPTIONS: readonly RigFieldOption[] = [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "4", label: "4 GB" },
|
||||
{ value: "6", label: "6 GB" },
|
||||
{ value: "8", label: "8 GB" },
|
||||
{ value: "12", label: "12 GB" },
|
||||
{ value: "16", label: "16 GB" },
|
||||
{ value: "32", label: "32 GB" },
|
||||
{ value: "64", label: "64 GB" },
|
||||
{ value: "96", label: "96 GB" },
|
||||
{ value: "128", label: "128 GB" },
|
||||
{ value: "256", label: "256 GB" },
|
||||
{ value: "custom", label: "Custom…" },
|
||||
];
|
||||
|
||||
/** DDR generation. DDR1 stays in the list for legacy gear; users with
|
||||
* unusual rigs (DDR6/DDR7) can pick early-spec options. */
|
||||
const RAM_DDR_OPTIONS: readonly RigFieldOption[] = [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "DDR1", label: "DDR1" },
|
||||
{ value: "DDR2", label: "DDR2" },
|
||||
{ value: "DDR3", label: "DDR3" },
|
||||
{ value: "DDR4", label: "DDR4" },
|
||||
{ value: "DDR5", label: "DDR5" },
|
||||
{ value: "DDR6", label: "DDR6" },
|
||||
{ value: "DDR7", label: "DDR7" },
|
||||
];
|
||||
|
||||
const RAM_COMPOSITE: CompositeFieldSpec = {
|
||||
parts: [
|
||||
{
|
||||
id: "size",
|
||||
labelKey: "editor.ram_size",
|
||||
options: RAM_SIZE_OPTIONS,
|
||||
allowCustom: true,
|
||||
customSuffix: " GB",
|
||||
customPlaceholder: "48",
|
||||
},
|
||||
{
|
||||
id: "ddr",
|
||||
labelKey: "editor.ram_ddr",
|
||||
options: RAM_DDR_OPTIONS,
|
||||
},
|
||||
],
|
||||
format: ([size = "", ddr = ""]) => {
|
||||
if (!size && !ddr) return "";
|
||||
if (!size) return ddr;
|
||||
if (!ddr) return size;
|
||||
return `${size} ${ddr}`;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* OS composite (v0.22.0, extended v0.23.0). Three dropdowns combined
|
||||
* into one logical field. The slot semantics now adapt to the chosen
|
||||
* OS family:
|
||||
*
|
||||
* - Windows: name → version (10/11) → edition (Home/Pro/…)
|
||||
* - macOS: name → version (10/11/12/13/14/15/26) → (hidden — Apple has no editions)
|
||||
* - Linux: name → distro (Ubuntu/Fedora/…) → version (per-distro)
|
||||
*
|
||||
* Stored pipe-delimited; format function joins all non-empty parts
|
||||
* with single spaces. v0.22.0 stored values like `"windows|11|pro"`
|
||||
* round-trip unchanged through the new resolver because the static
|
||||
* Windows path remains the default for `name === "windows"`.
|
||||
*/
|
||||
const OS_NAME_OPTIONS: readonly RigFieldOption[] = [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "windows", label: "Windows" },
|
||||
{ value: "macos", label: "macOS" },
|
||||
{ value: "linux", label: "Linux" },
|
||||
];
|
||||
|
||||
const WINDOWS_VERSION_OPTIONS: readonly RigFieldOption[] = [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "10", label: "10" },
|
||||
{ value: "11", label: "11" },
|
||||
];
|
||||
|
||||
/**
|
||||
* macOS major versions. Apple jumped from 15 (Sequoia, 2024) to 26
|
||||
* (Tahoe, 2025) to year-align the marketing number, so the list is
|
||||
* intentionally non-contiguous.
|
||||
*/
|
||||
const MACOS_VERSION_OPTIONS: readonly RigFieldOption[] = [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "10", label: "10 (Mojave era)" },
|
||||
{ value: "11 Big Sur", label: "11 Big Sur" },
|
||||
{ value: "12 Monterey", label: "12 Monterey" },
|
||||
{ value: "13 Ventura", label: "13 Ventura" },
|
||||
{ value: "14 Sonoma", label: "14 Sonoma" },
|
||||
{ value: "15 Sequoia", label: "15 Sequoia" },
|
||||
{ value: "26 Tahoe", label: "26 Tahoe" },
|
||||
];
|
||||
|
||||
/** Linux distros gameplay creators actually use via Proton. */
|
||||
const LINUX_DISTRO_OPTIONS: readonly RigFieldOption[] = [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "ubuntu", label: "Ubuntu" },
|
||||
{ value: "fedora", label: "Fedora" },
|
||||
{ value: "debian", label: "Debian" },
|
||||
{ value: "arch", label: "Arch" },
|
||||
{ value: "manjaro", label: "Manjaro" },
|
||||
{ value: "popos", label: "Pop!_OS" },
|
||||
{ value: "mint", label: "Linux Mint" },
|
||||
];
|
||||
|
||||
/**
|
||||
* Per-distro version lists. The map key matches the distro id from
|
||||
* {@link LINUX_DISTRO_OPTIONS}; values are stored verbatim (e.g. the
|
||||
* stored Ubuntu version is "22.04 LTS"). Rolling distros surface a
|
||||
* single "rolling" / "latest" placeholder so the dropdown isn't empty.
|
||||
*/
|
||||
const LINUX_VERSION_BY_DISTRO: Record<string, readonly RigFieldOption[]> = {
|
||||
ubuntu: [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "20.04 LTS", label: "20.04 LTS" },
|
||||
{ value: "22.04 LTS", label: "22.04 LTS" },
|
||||
{ value: "24.04 LTS", label: "24.04 LTS" },
|
||||
{ value: "26.04 LTS", label: "26.04 LTS" },
|
||||
],
|
||||
fedora: [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "40", label: "40" },
|
||||
{ value: "41", label: "41" },
|
||||
{ value: "42", label: "42" },
|
||||
],
|
||||
debian: [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "12 Bookworm", label: "12 Bookworm" },
|
||||
{ value: "13 Trixie", label: "13 Trixie" },
|
||||
],
|
||||
arch: [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "rolling", label: "rolling" },
|
||||
],
|
||||
manjaro: [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "latest", label: "latest stable" },
|
||||
],
|
||||
popos: [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "22.04 LTS", label: "22.04 LTS" },
|
||||
{ value: "24.04 LTS", label: "24.04 LTS" },
|
||||
],
|
||||
mint: [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "21", label: "21" },
|
||||
{ value: "22", label: "22" },
|
||||
],
|
||||
};
|
||||
|
||||
const OS_EDITION_OPTIONS: readonly RigFieldOption[] = [
|
||||
{ value: "", label: "—" },
|
||||
{ value: "home", label: "Home" },
|
||||
{ value: "pro", label: "Pro" },
|
||||
{ value: "enterprise", label: "Enterprise" },
|
||||
{ value: "education", label: "Education" },
|
||||
{ value: "iot", label: "IoT Enterprise" },
|
||||
];
|
||||
|
||||
const EMPTY_OPTIONS: readonly RigFieldOption[] = [{ value: "", label: "—" }];
|
||||
|
||||
const OS_COMPOSITE: CompositeFieldSpec = {
|
||||
parts: [
|
||||
{ id: "name", labelKey: "editor.os_name", options: OS_NAME_OPTIONS },
|
||||
{
|
||||
// Slot 2: Windows/macOS use this as "Version", Linux re-purposes it
|
||||
// as "Distro". The labelKeyResolver swaps the label so the editor
|
||||
// form reads naturally for each OS family.
|
||||
id: "version_or_distro",
|
||||
labelKey: "editor.os_version",
|
||||
labelKeyResolver: ([name = ""]) =>
|
||||
name === "linux" ? "editor.os_distro" : "editor.os_version",
|
||||
options: ([name = ""]) => {
|
||||
if (name === "windows") return WINDOWS_VERSION_OPTIONS;
|
||||
if (name === "macos") return MACOS_VERSION_OPTIONS;
|
||||
if (name === "linux") return LINUX_DISTRO_OPTIONS;
|
||||
return EMPTY_OPTIONS;
|
||||
},
|
||||
},
|
||||
{
|
||||
// Slot 3: Windows uses "Edition"; Linux re-purposes it as "Version"
|
||||
// (per-distro). macOS doesn't have a third slot at all — hidden.
|
||||
id: "edition_or_linux_version",
|
||||
labelKey: "editor.os_edition",
|
||||
labelKeyResolver: ([name = ""]) =>
|
||||
name === "linux" ? "editor.os_version" : "editor.os_edition",
|
||||
hiddenWhen: ([name = ""]) => name === "macos",
|
||||
options: ([name = "", distro = ""]) => {
|
||||
if (name === "windows") return OS_EDITION_OPTIONS;
|
||||
if (name === "linux") return LINUX_VERSION_BY_DISTRO[distro] ?? EMPTY_OPTIONS;
|
||||
return EMPTY_OPTIONS;
|
||||
},
|
||||
},
|
||||
],
|
||||
format: (parts) => parts.filter((p) => p.trim() !== "").join(" "),
|
||||
};
|
||||
|
||||
export const RIG_FIELDS: readonly RigField[] = [
|
||||
{ id: "os", labelKey: "rig.os", type: "composite_dropdown", composite: OS_COMPOSITE },
|
||||
{ id: "cpu", labelKey: "rig.cpu", type: "text", placeholder: "Intel i9-14900K / AMD Ryzen 9 7950X" },
|
||||
{ id: "gpu", labelKey: "rig.gpu", type: "text", placeholder: "NVIDIA RTX 4090 / AMD RX 7900 XTX" },
|
||||
{ id: "ram", labelKey: "rig.ram", type: "text", placeholder: "32GB DDR5-6000" },
|
||||
{
|
||||
id: "gpu",
|
||||
labelKey: "rig.gpu",
|
||||
type: "cascading_dropdown",
|
||||
catalog: GPU_CATALOG,
|
||||
},
|
||||
{
|
||||
id: "ram",
|
||||
labelKey: "rig.ram",
|
||||
type: "composite_dropdown",
|
||||
composite: RAM_COMPOSITE,
|
||||
},
|
||||
{ id: "storage", labelKey: "rig.storage", type: "text", placeholder: "2TB Samsung 990 PRO NVMe" },
|
||||
{ id: "monitor", labelKey: "rig.monitor", type: "text", placeholder: "LG 27GP950 27\" 4K 144Hz" },
|
||||
{ id: "capture", labelKey: "rig.capture", type: "text", placeholder: "OBS Studio 30.x" },
|
||||
@@ -63,29 +371,121 @@ export const RIG_FIELDS: readonly RigField[] = [
|
||||
},
|
||||
];
|
||||
|
||||
export type RigFieldId = (typeof RIG_FIELDS)[number]["id"];
|
||||
/**
|
||||
* Parse a cascading-dropdown stored value into its three segments.
|
||||
* Empty segments stay as empty strings. Pipeless legacy values are
|
||||
* returned as `["", "", raw]` so the caller can render them under the
|
||||
* Custom brand without losing the original text.
|
||||
*/
|
||||
export function parseCascadingValue(raw: string): {
|
||||
brand: string;
|
||||
series: string;
|
||||
model: string;
|
||||
isLegacy: boolean;
|
||||
} {
|
||||
if (!raw) return { brand: "", series: "", model: "", isLegacy: false };
|
||||
if (!raw.includes("|")) {
|
||||
// Pre-v0.13 free-text. Treat as Custom + verbatim model.
|
||||
return { brand: GPU_CUSTOM_BRAND_ID, series: "", model: raw, isLegacy: true };
|
||||
}
|
||||
const [brand = "", series = "", model = ""] = raw.split("|");
|
||||
return { brand, series, model, isLegacy: false };
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a composite-dropdown stored value into its segments. The order
|
||||
* matches the parts declared on the field's {@link CompositeFieldSpec}.
|
||||
* Pipeless legacy values are returned as a single-element tuple so the
|
||||
* caller can render them as a fallback string.
|
||||
*/
|
||||
export function parseCompositeValue(raw: string): {
|
||||
parts: readonly string[];
|
||||
isLegacy: boolean;
|
||||
} {
|
||||
if (!raw) return { parts: [], isLegacy: false };
|
||||
if (!raw.includes("|")) return { parts: [raw], isLegacy: true };
|
||||
return { parts: raw.split("|"), isLegacy: false };
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a stored rig value for display in the description output.
|
||||
* For dropdown_with_version fields, this turns `"davinci_resolve_studio|19.1"`
|
||||
* into `"DaVinci Resolve Studio 19.1"`. Other values pass through.
|
||||
*
|
||||
* - `dropdown_with_version` ("davinci_resolve_studio|19.1") →
|
||||
* `"DaVinci Resolve Studio 19.1"`.
|
||||
* - `cascading_dropdown` ("nvidia|rtx_40|RTX 4090") →
|
||||
* `"NVIDIA RTX 4090"` (series label dropped — the model string is
|
||||
* already verbose enough). Custom brand returns the verbatim model.
|
||||
* Legacy pipeless values pass through unchanged.
|
||||
* - `composite_dropdown` ("16|DDR5", "custom:48|DDR5") →
|
||||
* `"16 GB DDR5"` / `"48 GB DDR5"` via the field's
|
||||
* {@link CompositeFieldSpec.format}.
|
||||
* - All other field types pass the raw value through.
|
||||
*/
|
||||
export function formatRigValue(fieldId: string, raw: string): string {
|
||||
const field = RIG_FIELDS.find((f) => f.id === fieldId);
|
||||
if (!field || field.type !== "dropdown_with_version") return raw;
|
||||
if (!field) return raw;
|
||||
|
||||
const [value = "", version = ""] = raw.split("|");
|
||||
const trimmedVersion = version.trim();
|
||||
if (!value && !trimmedVersion) return "";
|
||||
if (field.type === "dropdown_with_version") {
|
||||
const [value = "", version = ""] = raw.split("|");
|
||||
const trimmedVersion = version.trim();
|
||||
if (!value && !trimmedVersion) return "";
|
||||
|
||||
// The empty-value sentinel option renders as "—" in the dropdown but
|
||||
// should act as "no selection" in the output.
|
||||
let label = "";
|
||||
if (value) {
|
||||
const option = field.options?.find((o) => o.value === value);
|
||||
label = option?.label ?? value;
|
||||
let label = "";
|
||||
if (value) {
|
||||
const option = field.options?.find((o) => o.value === value);
|
||||
label = option?.label ?? value;
|
||||
}
|
||||
|
||||
if (!label) return trimmedVersion;
|
||||
return trimmedVersion ? `${label} ${trimmedVersion}` : label;
|
||||
}
|
||||
|
||||
if (!label) return trimmedVersion;
|
||||
return trimmedVersion ? `${label} ${trimmedVersion}` : label;
|
||||
if (field.type === "cascading_dropdown") {
|
||||
const { brand, model, isLegacy } = parseCascadingValue(raw);
|
||||
if (isLegacy) return raw;
|
||||
if (!brand && !model) return "";
|
||||
if (brand === GPU_CUSTOM_BRAND_ID) return model.trim();
|
||||
const brandLabel = findGpuBrand(brand)?.label ?? brand;
|
||||
if (!model.trim()) return brandLabel;
|
||||
return `${brandLabel} ${model.trim()}`;
|
||||
}
|
||||
|
||||
if (field.type === "composite_dropdown" && field.composite) {
|
||||
const { parts, isLegacy } = parseCompositeValue(raw);
|
||||
if (isLegacy) return raw;
|
||||
if (parts.length === 0) return "";
|
||||
|
||||
// Resolve each declared part. v0.23.0: parts may declare a dynamic
|
||||
// option resolver and/or a `hiddenWhen` predicate (used by the OS
|
||||
// composite where macOS has no third slot). We walk parts in order
|
||||
// so each resolver sees the previously-stored values, and we skip
|
||||
// hidden parts entirely so they don't leak an empty token into the
|
||||
// `composite.format` join. `custom:<value>` segments still collapse
|
||||
// to the free-text payload (without the `custom:` prefix).
|
||||
const previousStored: string[] = [];
|
||||
const resolved = field.composite.parts.map((spec, i) => {
|
||||
const stored = (parts[i] ?? "").trim();
|
||||
if (spec.hiddenWhen?.(previousStored)) {
|
||||
previousStored.push("");
|
||||
return "";
|
||||
}
|
||||
if (!stored) {
|
||||
previousStored.push("");
|
||||
return "";
|
||||
}
|
||||
if (spec.allowCustom && stored.startsWith("custom:")) {
|
||||
const txt = stored.slice("custom:".length).trim();
|
||||
previousStored.push(stored);
|
||||
return txt ? `${txt}${spec.customSuffix ?? ""}` : "";
|
||||
}
|
||||
const opts = resolveCompositeOptions(spec.options, previousStored);
|
||||
const opt = opts.find((o) => o.value === stored);
|
||||
previousStored.push(stored);
|
||||
return opt?.label ?? stored;
|
||||
});
|
||||
|
||||
return field.composite.format(resolved);
|
||||
}
|
||||
|
||||
return raw;
|
||||
}
|
||||
@@ -17,8 +17,6 @@ export const SOCIAL_FIELDS = [
|
||||
{ id: "facebook", label: "Facebook", labelKey: "social.facebook", urlPrefix: "https://facebook.com/", category: "social" },
|
||||
{ id: "fb_page", label: "Facebook Page", labelKey: "social.fb_page", urlPrefix: "https://facebook.com/", category: "social" },
|
||||
{ id: "fb_group", label: "Facebook Group", labelKey: "social.fb_group", urlPrefix: "https://facebook.com/groups/", category: "social" },
|
||||
{ id: "telegram", label: "Telegram", labelKey: "social.telegram", urlPrefix: "https://t.me/", category: "social" },
|
||||
{ id: "website", label: "Website", labelKey: "social.website", urlPrefix: "", category: "social" },
|
||||
] as const;
|
||||
|
||||
export type SocialFieldId = (typeof SOCIAL_FIELDS)[number]["id"];
|
||||
export type SocialCategory = "donate" | "social";
|
||||
@@ -0,0 +1,74 @@
|
||||
import { Music2, Instagram, Facebook, type LucideIcon } from "lucide-react";
|
||||
|
||||
/**
|
||||
* A short-form platform the cross-post generator targets (v0.24.0). Each
|
||||
* one re-packages the same YouTube source (title, rig, content warnings,
|
||||
* copyright, thanks, hashtags) under its own character ceiling and a
|
||||
* curated set of platform-popular hashtags.
|
||||
*
|
||||
* Add a platform here and the Social page + bulk loop pick it up
|
||||
* automatically — same data-driven pattern as `@config/platforms` and
|
||||
* `@config/social-fields`.
|
||||
*/
|
||||
export interface SocialPlatform {
|
||||
readonly id: "tiktok" | "instagram_reels" | "facebook_reels";
|
||||
/** i18n key under `socialPost.platforms.<id>`. */
|
||||
readonly labelKey: string;
|
||||
/** Caption character ceiling enforced by the platform. */
|
||||
readonly charLimit: number;
|
||||
readonly icon: LucideIcon;
|
||||
/**
|
||||
* Platform-popular hashtags appended after the game / genre hashtags.
|
||||
* Stored with the leading `#`; deduped case-insensitively against the
|
||||
* derived hashtags at build time.
|
||||
*/
|
||||
readonly popularHashtags: readonly string[];
|
||||
}
|
||||
|
||||
export const SOCIAL_PLATFORMS: readonly SocialPlatform[] = [
|
||||
{
|
||||
id: "tiktok",
|
||||
labelKey: "socialPost.platforms.tiktok",
|
||||
charLimit: 4000,
|
||||
icon: Music2, // lucide has no TikTok glyph; Music2 is the established stand-in
|
||||
popularHashtags: [
|
||||
"#fyp",
|
||||
"#foryou",
|
||||
"#foryoupage",
|
||||
"#gaming",
|
||||
"#gamingtiktok",
|
||||
"#gameplay",
|
||||
"#gamer",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "instagram_reels",
|
||||
labelKey: "socialPost.platforms.instagram_reels",
|
||||
charLimit: 2200,
|
||||
icon: Instagram,
|
||||
popularHashtags: [
|
||||
"#reels",
|
||||
"#reelsinstagram",
|
||||
"#gaming",
|
||||
"#gamingreels",
|
||||
"#gamer",
|
||||
"#instagaming",
|
||||
"#videogames",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "facebook_reels",
|
||||
labelKey: "socialPost.platforms.facebook_reels",
|
||||
charLimit: 2200,
|
||||
icon: Facebook,
|
||||
popularHashtags: [
|
||||
"#reels",
|
||||
"#facebookreels",
|
||||
"#fbreels",
|
||||
"#gaming",
|
||||
"#gameplay",
|
||||
"#gamingcommunity",
|
||||
"#videogames",
|
||||
],
|
||||
},
|
||||
] as const;
|
||||
@@ -0,0 +1,77 @@
|
||||
import type { TechNote } from "@engine/types";
|
||||
|
||||
/**
|
||||
* UI grouping for the Tech Notes checklist (v0.12). Mirrors the shape
|
||||
* of {@link CONTENT_WARNING_GROUPS} — flat array on the engine side,
|
||||
* grouped here so 24+ items stay scannable in a collapsible UI.
|
||||
*
|
||||
* Add a new tech note by:
|
||||
* 1. Appending the id to {@link TECH_NOTES} in `@engine/types`.
|
||||
* 2. Adding it to one of these groups (UI placement only — engine
|
||||
* renders bullets in the order the user picked them).
|
||||
* 3. Translating `description.techNotes.items.{id}` in all locales
|
||||
* + the editor's `editor.techNoteOptions.{id}` short label.
|
||||
*/
|
||||
export interface TechNoteGroup {
|
||||
id: string;
|
||||
/** i18n key for the group heading shown in the editor. */
|
||||
labelKey: string;
|
||||
items: TechNote[];
|
||||
}
|
||||
|
||||
export const TECH_NOTE_GROUPS: readonly TechNoteGroup[] = [
|
||||
{
|
||||
id: "audio",
|
||||
labelKey: "editor.techNoteGroups.audio",
|
||||
items: [
|
||||
"copyright_muted_sections",
|
||||
"volume_reduced_copyright",
|
||||
"music_replaced_copyright",
|
||||
"cutscene_audio_muted_only",
|
||||
"original_audio_kept",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "video_quality",
|
||||
labelKey: "editor.techNoteGroups.video_quality",
|
||||
items: [
|
||||
"low_resolution_hardware",
|
||||
"low_graphics_performance",
|
||||
"fps_drops_hardware",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "recording_issues",
|
||||
labelKey: "editor.techNoteGroups.recording_issues",
|
||||
items: [
|
||||
"bug_from_game",
|
||||
"crash_kept_transparency",
|
||||
"loading_cut",
|
||||
"obs_artifacts_possible",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "playstyle",
|
||||
labelKey: "editor.techNoteGroups.playstyle",
|
||||
items: [
|
||||
"not_no_hit_run",
|
||||
"not_clean_walkthrough",
|
||||
"casual_no_commentary",
|
||||
"many_deaths_patience",
|
||||
"slow_exploration",
|
||||
"puzzle_stuck_possible",
|
||||
"grinding_cut",
|
||||
"not_speedrun_relaxed",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "production",
|
||||
labelKey: "editor.techNoteGroups.production",
|
||||
items: [
|
||||
"exploration_focus_skip_combat",
|
||||
"edited_for_pacing",
|
||||
"support_developers",
|
||||
"online_connectivity_issues",
|
||||
],
|
||||
},
|
||||
] as const;
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Video-style era options (v0.22.0). When the user picks an era from the
|
||||
* editor's Video Style dropdown, the description renderer emits a single
|
||||
* line composed from the chosen era label and the user's `rig.video_editor`
|
||||
* field — e.g. `"Edited in 1990s VHS style using DaVinci Resolve 19.1"`.
|
||||
*
|
||||
* Empty string `""` is the sentinel for "off" — no parallel boolean toggle.
|
||||
* This mirrors the existing per-video opt-in shape used by `artStyle`,
|
||||
* `playthroughStatus`, `difficulty`, etc.
|
||||
*
|
||||
* Adding a new era: append the id below, add the editor short label to
|
||||
* `editor.videoStyleOptions.{id}` in all 6 locales, and the description
|
||||
* long label to `description.videoSettings.eraOptions.{id}` in
|
||||
* `templates.json`. The engine + form pick the new entry up automatically.
|
||||
*/
|
||||
export const VIDEO_STYLE_ERAS = [
|
||||
"",
|
||||
"1980s",
|
||||
"1990s",
|
||||
"2000s",
|
||||
"2010s",
|
||||
"2020s",
|
||||
"modern",
|
||||
"cinematic",
|
||||
"retro",
|
||||
"vhs",
|
||||
"film_noir",
|
||||
"anime_mv",
|
||||
"documentary",
|
||||
] as const;
|
||||
|
||||
export type VideoStyleEra = (typeof VIDEO_STYLE_ERAS)[number];
|
||||
|
||||
/** Subset minus the empty sentinel — used by the form to render options. */
|
||||
export const VIDEO_STYLE_ERA_IDS = VIDEO_STYLE_ERAS.filter(
|
||||
(id) => id !== "",
|
||||
) as ReadonlyArray<Exclude<VideoStyleEra, "">>;
|
||||
|
||||
/**
|
||||
* Type guard so the engine + migration can coerce unrecognised values
|
||||
* (hand-edited blob, downgrade from a future version that added more
|
||||
* eras) back to the empty sentinel without crashing.
|
||||
*/
|
||||
export function isVideoStyleEra(value: unknown): value is VideoStyleEra {
|
||||
return (
|
||||
typeof value === "string" &&
|
||||
(VIDEO_STYLE_ERAS as readonly string[]).includes(value)
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Vietnamese banks dropdown options for the donate / Vietnam-specific
|
||||
* bank field. Sourced from the State Bank of Vietnam's published list
|
||||
* (sbv.gov.vn) of operating credit institutions as of 2026: Big 4
|
||||
* state-owned commercial banks, top 22 joint-stock commercial banks
|
||||
* (TMCP) by retail presence, and the four most-recognised 100%
|
||||
* foreign-owned banks operating in Vietnam.
|
||||
*
|
||||
* Order is intentional, not alphabetical: Big 4 first (highest brand
|
||||
* recognition for retail transfers), then the dominant private TMCP
|
||||
* banks roughly by retail footprint, then the foreign banks. A
|
||||
* sentinel `__other__` option is appended by the editor component
|
||||
* itself so the renderer can surface a fall-through text input for
|
||||
* banks the creator's audience uses that aren't on the list (e.g.
|
||||
* regional / digital-only banks).
|
||||
*
|
||||
* Values double as labels — the bank's common Vietnamese display name
|
||||
* is what gets persisted into the editor draft and rendered into the
|
||||
* Vietnamese donate block. Keep the string spellings stable: changing
|
||||
* one would silently turn a previously-saved profile into a "custom"
|
||||
* entry on next render. If a bank rebrands (e.g. LienVietPostBank →
|
||||
* LPBank in 2024), add the new name and keep the old as an alias in
|
||||
* a separate constant rather than mutating in place.
|
||||
*/
|
||||
export const VIETNAMESE_BANKS = [
|
||||
// Big 4 state-owned commercial banks
|
||||
"Vietcombank",
|
||||
"BIDV",
|
||||
"VietinBank",
|
||||
"Agribank",
|
||||
// Top joint-stock commercial banks (TMCP), roughly by retail presence
|
||||
"Techcombank",
|
||||
"MB Bank",
|
||||
"ACB",
|
||||
"VPBank",
|
||||
"TPBank",
|
||||
"Sacombank",
|
||||
"HDBank",
|
||||
"VIB",
|
||||
"SHB",
|
||||
"Eximbank",
|
||||
"OCB",
|
||||
"MSB",
|
||||
"LPBank",
|
||||
"SeABank",
|
||||
"ABBank",
|
||||
"BAC A Bank",
|
||||
"PVcomBank",
|
||||
"NCB",
|
||||
"Nam A Bank",
|
||||
"KienlongBank",
|
||||
"Saigonbank",
|
||||
"VietABank",
|
||||
"Vietbank",
|
||||
"BVBank",
|
||||
// 100% foreign-owned banks with the strongest retail presence in VN
|
||||
"HSBC Vietnam",
|
||||
"Standard Chartered",
|
||||
"Shinhan Bank",
|
||||
"UOB Vietnam",
|
||||
] as const;
|
||||
|
||||
/** Sentinel select-option value the editor uses to surface a fall-through
|
||||
* text input. Kept as a non-bank-name string so a real bank could
|
||||
* never collide with it. */
|
||||
export const VIETNAMESE_BANK_OTHER = "__other__" as const;
|
||||
|
||||
/**
|
||||
* True when `value` is a non-empty string that doesn't match any preset
|
||||
* bank — i.e. the editor should render the custom text input below the
|
||||
* select. Pure helper so the conditional logic in
|
||||
* `VietnameseDonateEditor` stays declarative.
|
||||
*/
|
||||
export function isCustomVietnameseBank(value: string): boolean {
|
||||
if (!value) return false;
|
||||
return !(VIETNAMESE_BANKS as readonly string[]).includes(value);
|
||||
}
|
||||
@@ -4,7 +4,9 @@ import { PLATFORMS } from "@config/platforms";
|
||||
import { SOCIAL_FIELDS } from "@config/social-fields";
|
||||
import { formatRigValue } from "@config/rig-fields";
|
||||
import { DEFAULT_GACHA_QUEST_TYPE } from "@config/gacha-quest-types";
|
||||
import { ordinalSuffix } from "./title-builder";
|
||||
import { parseTimeline, renderTimeline } from "./timeline-parser";
|
||||
import { formatEndingEntry, sliceEndingsForVideo } from "./endings-format";
|
||||
import { sanitizeHashtag } from "@utils/sanitize";
|
||||
|
||||
const SOCIAL_ICONS: Record<string, string> = {
|
||||
@@ -24,9 +26,27 @@ const SOCIAL_ICONS: Record<string, string> = {
|
||||
facebook: "👤",
|
||||
fb_page: "📄",
|
||||
fb_group: "👥",
|
||||
telegram: "✈️",
|
||||
website: "🌐",
|
||||
};
|
||||
|
||||
/**
|
||||
* Output languages whose descriptions are human-reviewed — the
|
||||
* AI-translation notice is skipped for them (v0.24.0). Typed as
|
||||
* `readonly string[]` so `.includes(input.language)` accepts any
|
||||
* SupportedLanguage without a cast.
|
||||
*/
|
||||
const TRANSLATION_TRUSTED: readonly string[] = ["vi", "en"];
|
||||
|
||||
/** Caveat bullet ids for the Translation Quality section, resolved against
|
||||
* `description.translationQuality.items.<id>` (v0.24.0). */
|
||||
const TRANSLATION_QUALITY_ITEMS = [
|
||||
"accuracy",
|
||||
"phrasing",
|
||||
"localStyle",
|
||||
"corrections",
|
||||
] as const;
|
||||
|
||||
function hasEntries(obj: Partial<Record<string, string>>): boolean {
|
||||
return Object.values(obj).some((v) => v && v.trim() !== "");
|
||||
}
|
||||
@@ -178,6 +198,38 @@ function composeGraphicsPart(input: GeneratorInput, t: TranslationFn): string {
|
||||
return `${presetLabel}${middle}${rtClause}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compose the v0.22.0 "Video Style" line — combines the chosen era from
|
||||
* `input.videoStyleEra` with the rig's `video_editor` field to produce a
|
||||
* single line like `"Edited in 1990s VHS style using DaVinci Resolve 19.1"`.
|
||||
*
|
||||
* Returns an empty string when:
|
||||
* - `videoStyleEra` is empty / unrecognised
|
||||
* - The era's i18n label can't be resolved (defensive — locale missing
|
||||
* the key shouldn't leak the snake_case id into the description)
|
||||
*
|
||||
* Picks one of two templates depending on whether the rig's video editor
|
||||
* is filled in. The two-template approach keeps localisations natural —
|
||||
* each locale can phrase the with/without-editor variants differently.
|
||||
*/
|
||||
function composeVideoStyleLine(input: GeneratorInput, t: TranslationFn): string {
|
||||
const era = (input.videoStyleEra ?? "").trim();
|
||||
if (!era) return "";
|
||||
const eraKey = `description.videoSettings.eraOptions.${era}`;
|
||||
const eraLabel = t(eraKey);
|
||||
if (!eraLabel || eraLabel === eraKey) return "";
|
||||
|
||||
const editor = formatRigValue(
|
||||
"video_editor",
|
||||
input.rig?.video_editor ?? "",
|
||||
).trim();
|
||||
|
||||
if (editor) {
|
||||
return t("description.videoSettings.styleLine", { era: eraLabel, editor });
|
||||
}
|
||||
return t("description.videoSettings.styleLineNoEditor", { era: eraLabel });
|
||||
}
|
||||
|
||||
export interface BuildDescriptionOptions {
|
||||
hashtagCount?: number;
|
||||
/** When true and channelName is non-empty, appends an auto-generated
|
||||
@@ -186,12 +238,23 @@ export interface BuildDescriptionOptions {
|
||||
/** When true, appends a localised usage-policy block after the
|
||||
* copyright line. */
|
||||
showUsagePolicy?: boolean;
|
||||
/** When true and `input.pubDevName` is non-empty, emits a single-line
|
||||
* `© {publisher}. All rights reserved.` block right after the Store
|
||||
* Links section. Used when the game's dev/publisher contractually
|
||||
* requires a copyright credit in the description (v0.21.0). Decoupled
|
||||
* from `storeLinks.publisher` — renders even if the publisher URL is
|
||||
* blank, since the obligation is to credit the IP holder by name. */
|
||||
showGameCopyright?: boolean;
|
||||
/** When true and both `sponsorName` and `sponsorPlatform` are set,
|
||||
* emits a "🎁 Thanks to …" credit line above the music section. */
|
||||
showSponsorCredit?: boolean;
|
||||
/** When true and the active profile's `thirdPartyAdText` is non-empty,
|
||||
* emits a "🤝 SPONSORS & PARTNERS" block (v0.11). */
|
||||
showThirdPartyAds?: boolean;
|
||||
/** When true, appends an AI-translation disclaimer block for output
|
||||
* languages outside the trusted set ({@link TRANSLATION_TRUSTED} —
|
||||
* English / Vietnamese, which are human-reviewed). v0.24.0. */
|
||||
showTranslationQuality?: boolean;
|
||||
/** Optional English-fixed translation function used by the unified
|
||||
* content-warnings block (v0.11) to render bilingual lines
|
||||
* `EN · output-language`. When omitted, the warnings block falls
|
||||
@@ -210,6 +273,8 @@ export function buildDescription(
|
||||
showUsagePolicy = false,
|
||||
showSponsorCredit = false,
|
||||
showThirdPartyAds = false,
|
||||
showGameCopyright = false,
|
||||
showTranslationQuality = false,
|
||||
tEn,
|
||||
} = options;
|
||||
const sections: string[] = [];
|
||||
@@ -226,6 +291,9 @@ export function buildDescription(
|
||||
const questType = input.gachaQuestType ?? DEFAULT_GACHA_QUEST_TYPE;
|
||||
introKey = `description.intro.gacha_quest_${questType}`;
|
||||
}
|
||||
const versionLabel = input.gachaVersion?.trim()
|
||||
? ` (${t("description.intro.versionInline", { v: input.gachaVersion.trim() })})`
|
||||
: "";
|
||||
const intro = t(introKey, {
|
||||
gameName,
|
||||
channelName: input.channelName,
|
||||
@@ -236,6 +304,12 @@ export function buildDescription(
|
||||
modName: input.modName ?? "",
|
||||
chapterName: input.chapterName ?? "",
|
||||
questName: input.questName ?? "",
|
||||
characterName: input.characterName ?? "",
|
||||
anniversaryYear: input.anniversaryYear != null ? String(input.anniversaryYear) : "",
|
||||
ordinalSuffix:
|
||||
input.anniversaryYear != null ? ordinalSuffix(input.anniversaryYear) : "",
|
||||
gachaVersion: input.gachaVersion ?? "",
|
||||
versionLabel,
|
||||
});
|
||||
sections.push(intro);
|
||||
|
||||
@@ -257,13 +331,16 @@ export function buildDescription(
|
||||
if (lines.length > 0) sections.push(lines.join("\n"));
|
||||
}
|
||||
|
||||
// 1.5 Playthrough status — surfaces "is this a blind run / NG+ / …"
|
||||
// right after the intro because that context frames how viewers read
|
||||
// everything below. Skipped when creator hasn't picked a value.
|
||||
if (input.playthroughStatus && input.playthroughStatus !== "none") {
|
||||
const label = t(`description.playthrough.${input.playthroughStatus}`);
|
||||
sections.push(t("description.sections.playthrough", { value: label }));
|
||||
}
|
||||
// 1.5 Playthrough Notes — v0.12 unified block that consolidates the
|
||||
// pre-v0.12 standalone "🎯 Playthrough" line and the standalone
|
||||
// "🎮 DIFFICULTY" block, plus three new bullets (endings shown,
|
||||
// language patch, game version). Sits right after the intro because
|
||||
// these facts frame how viewers read everything below. Empty bullets
|
||||
// are skipped; if every bullet is empty the whole block is skipped.
|
||||
// Bilingual when `tEn` is provided AND output language ≠ English —
|
||||
// pattern mirrors the v0.11 content-warnings block.
|
||||
const pnBlock = buildPlaythroughNotesSection(input, t, tEn);
|
||||
if (pnBlock) sections.push(pnBlock);
|
||||
|
||||
// 2. No Commentary tagline
|
||||
sections.push(t("description.noCommentaryLine"));
|
||||
@@ -313,6 +390,19 @@ export function buildDescription(
|
||||
}
|
||||
}
|
||||
|
||||
// 4.5 Game copyright — opt-in line crediting the dev/publisher right
|
||||
// under the store links (v0.21.0). Decoupled from any specific
|
||||
// store-link URL: as long as `pubDevName` is set AND the toggle is
|
||||
// on, the credit renders. Used by creators who cover games whose
|
||||
// publishers contractually require attribution in the description.
|
||||
if (showGameCopyright && input.pubDevName && input.pubDevName.trim()) {
|
||||
sections.push(
|
||||
t("description.sections.gameCopyright", {
|
||||
publisher: input.pubDevName.trim(),
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
// 5. Video Settings — skipped entirely for 2D / pixel-art / no-in-game-
|
||||
// settings games (the user toggles that explicitly; v0.8 phase 2 also
|
||||
// auto-suggests it on certain genres but the toggle is the source of
|
||||
@@ -323,6 +413,14 @@ export function buildDescription(
|
||||
// the key-value-per-line shape of the rig and timestamps blocks.
|
||||
// Lines with no value are dropped; if every line is dropped, the
|
||||
// whole section is dropped.
|
||||
//
|
||||
// v0.22.0 polish: the optional Video Style line (era + video_editor)
|
||||
// renders inside this section when `skipGraphicsSettings` is off, AND
|
||||
// as a tiny standalone section when it's on — 2D / pixel-art creators
|
||||
// still edit their footage, so the style credit shouldn't disappear
|
||||
// with the graphics block.
|
||||
const styleLine = composeVideoStyleLine(input, t);
|
||||
|
||||
if (!input.skipGraphicsSettings) {
|
||||
const lines: string[] = [];
|
||||
|
||||
@@ -354,25 +452,23 @@ export function buildDescription(
|
||||
lines.push(`${t("description.graphics.versionLabel")}: ${input.versionInfo.trim()}`);
|
||||
}
|
||||
|
||||
// v0.22.0 video-style era line — appended last so it reads like a
|
||||
// production credit after the technical fields.
|
||||
if (styleLine) lines.push(styleLine);
|
||||
|
||||
if (lines.length > 0) {
|
||||
sections.push(`${t("description.sections.videoSettings")}\n${lines.join("\n")}`);
|
||||
}
|
||||
} else if (styleLine) {
|
||||
// 2D / pixel-art path: the graphics block is suppressed but the
|
||||
// creator still set a style era, so emit a single-line standalone
|
||||
// section under the same header.
|
||||
sections.push(`${t("description.sections.videoSettings")}\n${styleLine}`);
|
||||
}
|
||||
|
||||
// 5.5 Difficulty — sits with Video Settings because a difficulty
|
||||
// choice is another gameplay setting, not a content warning. For
|
||||
// `"custom"`, the user's free-form label is used verbatim (not
|
||||
// translated — intentional: lets creators use game-specific names
|
||||
// like "Lethal" without per-locale fallback friction).
|
||||
if (input.difficulty && input.difficulty !== "none") {
|
||||
const value =
|
||||
input.difficulty === "custom"
|
||||
? (input.difficultyCustomLabel ?? "").trim()
|
||||
: t(`description.difficulty.${input.difficulty}`);
|
||||
if (value) {
|
||||
sections.push(`${t("description.sections.difficulty")}\n${value}`);
|
||||
}
|
||||
}
|
||||
// 5.5 Difficulty — moved into the unified Playthrough Notes block
|
||||
// above (slot 1.5) in v0.12. Kept here as a no-op placeholder so the
|
||||
// numbering of subsequent comments stays stable.
|
||||
|
||||
// 6. Rig
|
||||
if (hasEntries(input.rig)) {
|
||||
@@ -401,43 +497,48 @@ export function buildDescription(
|
||||
);
|
||||
}
|
||||
|
||||
// 7. Content warnings — unified bilingual checklist (v0.11). Replaces
|
||||
// the v0.7 trio of separate spoiler / generic-content-warnings /
|
||||
// mature blocks. Renders header + intro + bulleted list. When the
|
||||
// output language is not English, each piece is paired with its
|
||||
// English equivalent: header `EN / LOCAL`, intro on two lines,
|
||||
// bullets `• EN · LOCAL` (separator is U+00B7 MIDDLE DOT). When
|
||||
// `tEn` is omitted (e.g. legacy callers / unit tests that haven't
|
||||
// migrated), falls back to single-language output via `t` — degraded
|
||||
// but never broken.
|
||||
const cw = input.contentWarnings ?? [];
|
||||
if (cw.length > 0) {
|
||||
const isEn = input.language === "en";
|
||||
const renderBilingual = !isEn && Boolean(tEn);
|
||||
const tEnUse: TranslationFn = tEn ?? t;
|
||||
// 7. Content warnings — unified bilingual checklist (v0.11). Header +
|
||||
// intro + `• EN · LOCAL` bullets (separator U+00B7 MIDDLE DOT);
|
||||
// degrades to single-language when the output is English or `tEn` is
|
||||
// omitted. The shared shape was extracted to buildBilingualBulletSection
|
||||
// (v0.24.0) and is reused by Tech Notes, the Translation Quality notice,
|
||||
// and the social-post builder.
|
||||
const cwSection = buildBilingualBulletSection(
|
||||
input.contentWarnings ?? [],
|
||||
"description.contentWarnings",
|
||||
input.language,
|
||||
t,
|
||||
tEn,
|
||||
);
|
||||
if (cwSection) sections.push(cwSection);
|
||||
|
||||
const headerEn = tEnUse("description.contentWarnings.header");
|
||||
const headerLocal = t("description.contentWarnings.header");
|
||||
const introEn = tEnUse("description.contentWarnings.intro");
|
||||
const introLocal = t("description.contentWarnings.intro");
|
||||
// 7.5 Tech Notes — v0.12 production / playstyle disclaimer checklist.
|
||||
// Sits next to Content Warnings because both are transparency blocks;
|
||||
// grouping them keeps disclaimers visually together. Same bilingual
|
||||
// checklist shape.
|
||||
const tnSection = buildBilingualBulletSection(
|
||||
input.techNotes ?? [],
|
||||
"description.techNotes",
|
||||
input.language,
|
||||
t,
|
||||
tEn,
|
||||
);
|
||||
if (tnSection) sections.push(tnSection);
|
||||
|
||||
const headerLine = renderBilingual ? `${headerEn} / ${headerLocal}` : headerEn;
|
||||
const introLines = renderBilingual ? `${introEn}\n${introLocal}` : introEn;
|
||||
|
||||
const bullets = cw
|
||||
.map((id) => {
|
||||
const key = `description.contentWarnings.items.${id}`;
|
||||
const enLabel = tEnUse(key);
|
||||
const localLabel = t(key);
|
||||
if (!enLabel || enLabel === key || !enLabel.trim()) return null;
|
||||
return renderBilingual ? `• ${enLabel} · ${localLabel}` : `• ${enLabel}`;
|
||||
})
|
||||
.filter((line): line is string => Boolean(line))
|
||||
.join("\n");
|
||||
|
||||
if (bullets) {
|
||||
sections.push(`${headerLine}\n${introLines}\n\n${bullets}`);
|
||||
}
|
||||
// 7.6 Translation Quality — opt-in AI-translation disclaimer (v0.24.0).
|
||||
// Shown only for output languages outside the trusted set (EN / VI are
|
||||
// human-reviewed, so they don't need the caveat). Self-contained:
|
||||
// header + intro naming the trusted languages + caveat bullets, in the
|
||||
// same bilingual checklist shape as the blocks above.
|
||||
if (showTranslationQuality && !TRANSLATION_TRUSTED.includes(input.language)) {
|
||||
const tqSection = buildBilingualBulletSection(
|
||||
TRANSLATION_QUALITY_ITEMS,
|
||||
"description.translationQuality",
|
||||
input.language,
|
||||
t,
|
||||
tEn,
|
||||
);
|
||||
if (tqSection) sections.push(tqSection);
|
||||
}
|
||||
|
||||
// 8.3. Sponsor credit — appears above the music / donate block so the
|
||||
@@ -576,6 +677,275 @@ export function buildDescription(
|
||||
return sections.join("\n\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the unified `▸ 🎮 PLAYTHROUGH NOTES` block (v0.12). Combines
|
||||
* five bullets (run type, difficulty, endings, language patch, game
|
||||
* version) into one section. Each bullet's value is resolved through
|
||||
* `t` (localised) plus `tEn` (English fallback) so the rendered line
|
||||
* can be bilingual `EN · LOCAL` when the output language ≠ English.
|
||||
*
|
||||
* Returns "" when every bullet is empty / skipped — caller drops the
|
||||
* section entirely instead of emitting a header with no body.
|
||||
*
|
||||
* Custom string slots (`difficultyCustomLabel`, `languagePatchCustom`,
|
||||
* `gameVersionCustom`) are intentionally NOT translated: a creator who
|
||||
* types "Lethal" or "Steam Next Fest backer build" wants that label
|
||||
* preserved verbatim across locale switches, not run through a
|
||||
* non-existent translation key.
|
||||
*/
|
||||
function buildPlaythroughNotesSection(
|
||||
input: GeneratorInput,
|
||||
t: TranslationFn,
|
||||
tEn?: TranslationFn,
|
||||
): string {
|
||||
const isEn = input.language === "en";
|
||||
const renderBilingual = !isEn && Boolean(tEn);
|
||||
const tEnUse: TranslationFn = tEn ?? t;
|
||||
|
||||
/**
|
||||
* Resolve a key against both `t` and `tEnUse`, returning a single bullet
|
||||
* line. Bullets are formatted as `Label · NhãnLocal: ValueEn · ValueLocal`
|
||||
* in bilingual mode and `Label: Value` otherwise. Returns null when the
|
||||
* value is empty (caller filters these out).
|
||||
*/
|
||||
function bullet(
|
||||
labelKey: string,
|
||||
valueEn: string,
|
||||
valueLocal: string,
|
||||
): string | null {
|
||||
const trimmedEn = valueEn.trim();
|
||||
const trimmedLocal = valueLocal.trim();
|
||||
if (!trimmedEn && !trimmedLocal) return null;
|
||||
const labelEn = tEnUse(labelKey);
|
||||
const labelLocal = t(labelKey);
|
||||
const labelLine = renderBilingual
|
||||
? `${labelEn} · ${labelLocal}`
|
||||
: labelEn;
|
||||
const valueLine = renderBilingual
|
||||
? `${trimmedEn || trimmedLocal} · ${trimmedLocal || trimmedEn}`
|
||||
: trimmedEn || trimmedLocal;
|
||||
return `• ${labelLine}: ${valueLine}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve an enum value through i18n. Returns ["", ""] for the
|
||||
* skip-sentinel value (caller drops the bullet). Falls back to the raw
|
||||
* id if a locale hasn't translated the key — degraded but never
|
||||
* "[object Object]".
|
||||
*/
|
||||
function resolveEnum(
|
||||
namespace: string,
|
||||
value: string,
|
||||
skipSentinel: string,
|
||||
): { en: string; local: string } {
|
||||
if (!value || value === skipSentinel) return { en: "", local: "" };
|
||||
const key = `description.playthroughNotes.${namespace}.${value}`;
|
||||
const en = tEnUse(key);
|
||||
const local = t(key);
|
||||
return {
|
||||
en: en === key ? value : en,
|
||||
local: local === key ? value : local,
|
||||
};
|
||||
}
|
||||
|
||||
const bullets: string[] = [];
|
||||
|
||||
// Run type — reads from `playthroughStatus`, looks up the existing
|
||||
// v0.7 `description.playthrough.<status>` keys (kept in templates so
|
||||
// the migration stays purely about render shape, not value labels).
|
||||
if (input.playthroughStatus && input.playthroughStatus !== "none") {
|
||||
const key = `description.playthrough.${input.playthroughStatus}`;
|
||||
const valueEn = tEnUse(key);
|
||||
const valueLocal = t(key);
|
||||
const b = bullet(
|
||||
"description.playthroughNotes.labels.runType",
|
||||
valueEn === key ? input.playthroughStatus : valueEn,
|
||||
valueLocal === key ? input.playthroughStatus : valueLocal,
|
||||
);
|
||||
if (b) bullets.push(b);
|
||||
}
|
||||
|
||||
// Difficulty — reads from `difficulty`, with custom slot for
|
||||
// free-form labels. Custom labels are passed through verbatim
|
||||
// (no translation) on both sides of the bilingual separator.
|
||||
if (input.difficulty && input.difficulty !== "none") {
|
||||
let valueEn: string;
|
||||
let valueLocal: string;
|
||||
if (input.difficulty === "custom") {
|
||||
const custom = (input.difficultyCustomLabel ?? "").trim();
|
||||
valueEn = custom;
|
||||
valueLocal = custom;
|
||||
} else {
|
||||
const key = `description.difficulty.${input.difficulty}`;
|
||||
const en = tEnUse(key);
|
||||
const local = t(key);
|
||||
valueEn = en === key ? input.difficulty : en;
|
||||
valueLocal = local === key ? input.difficulty : local;
|
||||
}
|
||||
const b = bullet(
|
||||
"description.playthroughNotes.labels.difficulty",
|
||||
valueEn,
|
||||
valueLocal,
|
||||
);
|
||||
if (b) bullets.push(b);
|
||||
}
|
||||
|
||||
// Endings shown — v0.16.0 reads from the structured `endings[]` array
|
||||
// first; falls back to the legacy `endingsShown` freeform when the
|
||||
// array is empty (covers migrated drafts that still carry the legacy
|
||||
// string). The structured renderer collapses 1-row "name only"
|
||||
// entries to the bare name so the v0.12-era output ("True Ending")
|
||||
// is preserved byte-for-byte for single-ending creators.
|
||||
//
|
||||
// Multi-video slicing: when `endingVideoIndex` is set AND the
|
||||
// matching range covers a sub-slice of `endings[]`, only that slice
|
||||
// is rendered. Used by the per-video generator pass in Output (one
|
||||
// pass per video, each producing its own slice's bullet). When the
|
||||
// index is missing / out-of-range, the union of all endings renders
|
||||
// — covers case A (single ending) and case B (multi-ending single
|
||||
// video) without a special branch.
|
||||
const structured = Array.isArray(input.endings) ? input.endings : [];
|
||||
const sliced = sliceEndingsForVideo(structured, input);
|
||||
if (sliced.length > 0) {
|
||||
const formatted = sliced
|
||||
.map(formatEndingEntry)
|
||||
.filter((s): s is string => !!s);
|
||||
if (formatted.length > 0) {
|
||||
const joined = formatted.join(", ");
|
||||
const b = bullet(
|
||||
"description.playthroughNotes.labels.endings",
|
||||
joined,
|
||||
joined,
|
||||
);
|
||||
if (b) bullets.push(b);
|
||||
}
|
||||
} else {
|
||||
const legacy = (input.endingsShown ?? "").trim();
|
||||
if (legacy) {
|
||||
const b = bullet(
|
||||
"description.playthroughNotes.labels.endings",
|
||||
legacy,
|
||||
legacy,
|
||||
);
|
||||
if (b) bullets.push(b);
|
||||
}
|
||||
}
|
||||
|
||||
// Language patch — enum + custom slot. `official_other` and `custom`
|
||||
// both pull their value from `languagePatchCustom`; the enum-resolved
|
||||
// label is used otherwise. `none` is the skip sentinel.
|
||||
if (input.languagePatch && input.languagePatch !== "none") {
|
||||
let valueEn: string;
|
||||
let valueLocal: string;
|
||||
if (input.languagePatch === "official_other" || input.languagePatch === "custom") {
|
||||
const custom = (input.languagePatchCustom ?? "").trim();
|
||||
valueEn = custom;
|
||||
valueLocal = custom;
|
||||
} else {
|
||||
const resolved = resolveEnum("languagePatchOptions", input.languagePatch, "none");
|
||||
valueEn = resolved.en;
|
||||
valueLocal = resolved.local;
|
||||
}
|
||||
const b = bullet(
|
||||
"description.playthroughNotes.labels.languagePatch",
|
||||
valueEn,
|
||||
valueLocal,
|
||||
);
|
||||
if (b) bullets.push(b);
|
||||
}
|
||||
|
||||
// Game version — `full_release` is the implicit default and skips
|
||||
// the bullet entirely (no need to announce "this is the full game").
|
||||
if (input.gameVersion && input.gameVersion !== "full_release") {
|
||||
let valueEn: string;
|
||||
let valueLocal: string;
|
||||
if (input.gameVersion === "custom") {
|
||||
const custom = (input.gameVersionCustom ?? "").trim();
|
||||
valueEn = custom;
|
||||
valueLocal = custom;
|
||||
} else {
|
||||
const resolved = resolveEnum(
|
||||
"gameVersionOptions",
|
||||
input.gameVersion,
|
||||
"full_release",
|
||||
);
|
||||
valueEn = resolved.en;
|
||||
valueLocal = resolved.local;
|
||||
}
|
||||
const b = bullet(
|
||||
"description.playthroughNotes.labels.gameVersion",
|
||||
valueEn,
|
||||
valueLocal,
|
||||
);
|
||||
if (b) bullets.push(b);
|
||||
}
|
||||
|
||||
if (bullets.length === 0) return "";
|
||||
|
||||
const headerEn = tEnUse("description.playthroughNotes.header");
|
||||
const headerLocal = t("description.playthroughNotes.header");
|
||||
const introEn = tEnUse("description.playthroughNotes.intro");
|
||||
const introLocal = t("description.playthroughNotes.intro");
|
||||
|
||||
const headerLine = renderBilingual ? `${headerEn} / ${headerLocal}` : headerEn;
|
||||
const introLines = renderBilingual ? `${introEn}\n${introLocal}` : introEn;
|
||||
|
||||
return `${headerLine}\n${introLines}\n\n${bullets.join("\n")}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a bilingual checklist section — header + intro + `• EN · LOCAL`
|
||||
* bullets — from a list of item ids resolved against
|
||||
* `${namespace}.items.<id>` (plus `${namespace}.header` / `.intro`).
|
||||
*
|
||||
* This is the shared shape behind Content Warnings (v0.11), Tech Notes
|
||||
* (v0.12), and the Translation Quality notice (v0.24.0). When the output
|
||||
* language is English (or `tEn` is omitted) it degrades to single-language
|
||||
* output; otherwise each piece is paired with its English equivalent
|
||||
* (header `EN / LOCAL`, intro on two lines, bullets `• EN · LOCAL` with a
|
||||
* U+00B7 MIDDLE DOT separator). Items whose key doesn't resolve are
|
||||
* dropped; returns `null` when nothing renders so the caller skips the
|
||||
* section instead of emitting a header with no body.
|
||||
*
|
||||
* Pure — exported for reuse by the social-post builder.
|
||||
*/
|
||||
export function buildBilingualBulletSection(
|
||||
itemIds: readonly string[],
|
||||
namespace: string,
|
||||
language: string,
|
||||
t: TranslationFn,
|
||||
tEn?: TranslationFn,
|
||||
): string | null {
|
||||
if (itemIds.length === 0) return null;
|
||||
|
||||
const isEn = language === "en";
|
||||
const renderBilingual = !isEn && Boolean(tEn);
|
||||
const tEnUse: TranslationFn = tEn ?? t;
|
||||
|
||||
const headerEn = tEnUse(`${namespace}.header`);
|
||||
const headerLocal = t(`${namespace}.header`);
|
||||
const introEn = tEnUse(`${namespace}.intro`);
|
||||
const introLocal = t(`${namespace}.intro`);
|
||||
|
||||
const headerLine = renderBilingual ? `${headerEn} / ${headerLocal}` : headerEn;
|
||||
const introLines = renderBilingual ? `${introEn}\n${introLocal}` : introEn;
|
||||
|
||||
const bullets = itemIds
|
||||
.map((id) => {
|
||||
const key = `${namespace}.items.${id}`;
|
||||
const enLabel = tEnUse(key);
|
||||
const localLabel = t(key);
|
||||
if (!enLabel || enLabel === key || !enLabel.trim()) return null;
|
||||
return renderBilingual ? `• ${enLabel} · ${localLabel}` : `• ${enLabel}`;
|
||||
})
|
||||
.filter((line): line is string => Boolean(line))
|
||||
.join("\n");
|
||||
|
||||
if (!bullets) return null;
|
||||
|
||||
return `${headerLine}\n${introLines}\n\n${bullets}`;
|
||||
}
|
||||
|
||||
export function checkDescriptionWarning(description: string): CharLimitWarning | null {
|
||||
if (description.length > YT_LIMITS.DESCRIPTION_MAX) {
|
||||
return {
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
import type { EndingEntry, EndingVideoRange, GeneratorInput } from "./types";
|
||||
|
||||
/**
|
||||
* Render a single {@link EndingEntry} into its display string.
|
||||
*
|
||||
* - both number + name → `"Ending {{number}}: {{name}}"`
|
||||
* - number only → `"Ending {{number}}"`
|
||||
* - name only → `"{{name}}"`
|
||||
* - neither → `null` (entry should be dropped)
|
||||
*
|
||||
* The English literal "Ending" is hard-coded here intentionally: the
|
||||
* label feeds into both the description bullet *and* the
|
||||
* preview-in-editor live formatter, where localising "Ending" would
|
||||
* require routing through i18next from a pure module. Templates can
|
||||
* still override the surrounding bullet label via
|
||||
* `description.playthroughNotes.labels.endings` — only the per-entry
|
||||
* "Ending N" prefix stays in English.
|
||||
*
|
||||
* Pure — exported for unit tests + direct use from React components.
|
||||
*/
|
||||
export function formatEndingEntry(entry: EndingEntry): string | null {
|
||||
const num = typeof entry.number === "number" && Number.isFinite(entry.number)
|
||||
? entry.number
|
||||
: null;
|
||||
const name = (entry.name ?? "").trim();
|
||||
if (num !== null && name) return `Ending ${num}: ${name}`;
|
||||
if (num !== null) return `Ending ${num}`;
|
||||
if (name) return name;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the slice of an `endings[]` array that should render for a
|
||||
* given video index. Used by description-builder + title-builder when
|
||||
* a multi-video playthrough is being generated.
|
||||
*
|
||||
* - `endingVideoCount` undefined / ≤ 1 → whole array (case A / B).
|
||||
* - `endingVideoIndex` undefined / out-of-range → whole array. Lets
|
||||
* a caller request the "union" view without knowing whether the
|
||||
* creator is in single- or multi-video mode.
|
||||
* - Otherwise pull the matching {@link EndingVideoRange} (1-indexed,
|
||||
* inclusive) and slice. Missing range → fall through to "whole
|
||||
* array" so a half-migrated draft still renders something.
|
||||
*
|
||||
* Pure — exported for unit tests.
|
||||
*/
|
||||
export function sliceEndingsForVideo(
|
||||
endings: EndingEntry[],
|
||||
input: Pick<GeneratorInput, "endingVideoCount" | "endingVideoIndex" | "endingVideoRanges">,
|
||||
): EndingEntry[] {
|
||||
if (endings.length === 0) return [];
|
||||
const videoCount = input.endingVideoCount ?? 1;
|
||||
const index = input.endingVideoIndex;
|
||||
if (videoCount <= 1 || typeof index !== "number" || index < 1 || index > videoCount) {
|
||||
return endings;
|
||||
}
|
||||
const ranges = input.endingVideoRanges ?? [];
|
||||
const range = ranges[index - 1];
|
||||
if (!range) return endings;
|
||||
const { from, to } = clampRange(range, endings.length);
|
||||
return endings.slice(from - 1, to);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamp a possibly-stale {@link EndingVideoRange} to `[1, length]` so
|
||||
* a creator who shrank `endings[]` without re-deriving ranges still
|
||||
* gets a sane slice instead of an empty / over-shot one. Pure.
|
||||
*/
|
||||
export function clampRange(
|
||||
range: EndingVideoRange,
|
||||
length: number,
|
||||
): EndingVideoRange {
|
||||
const from = Math.max(1, Math.min(range.from, length));
|
||||
const to = Math.max(from, Math.min(range.to, length));
|
||||
return { from, to };
|
||||
}
|
||||
@@ -23,11 +23,6 @@ export interface PlaylistInput {
|
||||
playlistNote?: string;
|
||||
}
|
||||
|
||||
export interface PlaylistOutput {
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export function buildPlaylistTitle(input: PlaylistInput, t: TranslationFn): string {
|
||||
const statusText = t(`playlist.status.${input.status}`);
|
||||
return t("playlist.titleFormat", {
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
import type { GeneratorInput, TranslationFn } from "./types";
|
||||
import type { SocialPlatform } from "@config/social-platforms";
|
||||
import { buildTitle } from "./title-builder";
|
||||
import { buildBilingualBulletSection } from "./description-builder";
|
||||
import { formatRigValue } from "@config/rig-fields";
|
||||
import { sanitizeHashtag } from "@utils/sanitize";
|
||||
|
||||
/**
|
||||
* Cross-post caption builder (v0.24.0). Re-packages the same
|
||||
* {@link GeneratorInput} that drives the YouTube description into a
|
||||
* short-form caption for TikTok / Instagram Reels / Facebook Reels.
|
||||
*
|
||||
* Reuses leaf engine pieces rather than the full description renderer:
|
||||
* {@link buildTitle} (badge suppressed), {@link formatRigValue}, the
|
||||
* shared {@link buildBilingualBulletSection} (content warnings), the
|
||||
* `description.sections.*` copyright / sponsor templates, and
|
||||
* {@link sanitizeHashtag}. The YouTube description output is therefore
|
||||
* untouched — captions are a parallel renderer, not a fork of it.
|
||||
*/
|
||||
|
||||
export interface SocialPostOptions {
|
||||
/** Platform character ceiling. The caption never silently exceeds it;
|
||||
* optional blocks are dropped first, then `isOver` flags any residual
|
||||
* overflow for the UI. */
|
||||
charLimit: number;
|
||||
/** Platform-popular hashtags appended after the derived game / genre
|
||||
* hashtags (deduped case-insensitively). */
|
||||
popularHashtags: readonly string[];
|
||||
/** Append the `© year channel` line (mirrors the description toggle). */
|
||||
showCopyright?: boolean;
|
||||
/** Append the `🎁 Thanks to …` line when both sponsor fields are set. */
|
||||
showSponsorCredit?: boolean;
|
||||
/** English-fixed `t` for the bilingual content-warnings block. */
|
||||
tEn?: TranslationFn;
|
||||
}
|
||||
|
||||
export interface SocialPostOutput {
|
||||
text: string;
|
||||
charCount: number;
|
||||
isOver: boolean;
|
||||
/** Ids of optional blocks dropped to fit the limit, in the order
|
||||
* dropped (empty when everything fit). */
|
||||
droppedBlocks: string[];
|
||||
}
|
||||
|
||||
/** Optional blocks listed in display order (Title is always first,
|
||||
* hashtags always last — neither is in this list). */
|
||||
const DISPLAY_ORDER = ["rig", "warnings", "thanks", "copyright"] as const;
|
||||
type BlockId = (typeof DISPLAY_ORDER)[number];
|
||||
|
||||
/** Drop priority when the caption overflows: warnings go first (longest,
|
||||
* least essential for a short clip), the rig credit goes last. */
|
||||
const DROP_ORDER: readonly BlockId[] = ["warnings", "copyright", "thanks", "rig"];
|
||||
|
||||
function buildRigBlock(input: GeneratorInput, t: TranslationFn): string {
|
||||
// Mirrors the description-builder rig block: id → formatted value,
|
||||
// skipping empties, `KEY: value` per line under the localized header.
|
||||
const rigLines = Object.entries(input.rig ?? {})
|
||||
.map(([k, v]) => [k, formatRigValue(k, v ?? "")] as const)
|
||||
.filter(([, v]) => v && v.trim() !== "")
|
||||
.map(([k, v]) => `${k.replace(/_/g, " ").toUpperCase()}: ${v}`)
|
||||
.join("\n");
|
||||
return rigLines ? `${t("description.sections.rig")}\n${rigLines}` : "";
|
||||
}
|
||||
|
||||
function dedupeHashtags(tags: readonly string[]): string[] {
|
||||
const seen = new Set<string>();
|
||||
const out: string[] = [];
|
||||
for (const tag of tags) {
|
||||
const key = tag.toLowerCase();
|
||||
if (!tag || seen.has(key)) continue;
|
||||
seen.add(key);
|
||||
out.push(tag);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function buildHashtagLine(
|
||||
input: GeneratorInput,
|
||||
popular: readonly string[],
|
||||
): string {
|
||||
const gameName = input.gameNameLocalized?.[input.language] ?? input.gameName;
|
||||
const primaryGenre = input.genres[0];
|
||||
const derived = [
|
||||
`#${sanitizeHashtag(gameName)}`,
|
||||
"#GameplayNoCommentary",
|
||||
...(primaryGenre ? [`#${sanitizeHashtag(primaryGenre)}`] : []),
|
||||
];
|
||||
return dedupeHashtags([...derived, ...popular]).join(" ");
|
||||
}
|
||||
|
||||
export function buildSocialPost(
|
||||
input: GeneratorInput,
|
||||
t: TranslationFn,
|
||||
options: SocialPostOptions,
|
||||
): SocialPostOutput {
|
||||
const { charLimit, popularHashtags, showCopyright, showSponsorCredit, tEn } =
|
||||
options;
|
||||
|
||||
// Title — short-form, so the `[2K 60FPS]` badge is suppressed.
|
||||
const title = buildTitle(input, t, { showQualityBadge: false });
|
||||
|
||||
const blocks: Record<BlockId, string> = {
|
||||
rig: buildRigBlock(input, t),
|
||||
warnings:
|
||||
buildBilingualBulletSection(
|
||||
input.contentWarnings ?? [],
|
||||
"description.contentWarnings",
|
||||
input.language,
|
||||
t,
|
||||
tEn,
|
||||
) ?? "",
|
||||
thanks:
|
||||
showSponsorCredit &&
|
||||
input.sponsorName?.trim() &&
|
||||
input.sponsorPlatform?.trim()
|
||||
? t("description.sections.sponsorCredit", {
|
||||
sponsor: input.sponsorName.trim(),
|
||||
platform: input.sponsorPlatform.trim(),
|
||||
})
|
||||
: "",
|
||||
copyright:
|
||||
showCopyright && input.channelName.trim()
|
||||
? t("description.sections.copyright", {
|
||||
year: String(new Date().getFullYear()),
|
||||
channelName: input.channelName.trim(),
|
||||
})
|
||||
: "",
|
||||
};
|
||||
|
||||
const hashtags = buildHashtagLine(input, popularHashtags);
|
||||
|
||||
// Track which optional blocks are still present; drop in priority order
|
||||
// until the caption fits. Title + hashtags are always kept.
|
||||
const present = new Set<BlockId>(
|
||||
DISPLAY_ORDER.filter((id) => blocks[id].trim() !== ""),
|
||||
);
|
||||
|
||||
const assemble = (): string => {
|
||||
const parts: string[] = [title];
|
||||
for (const id of DISPLAY_ORDER) {
|
||||
if (present.has(id)) parts.push(blocks[id]);
|
||||
}
|
||||
if (hashtags) parts.push(hashtags);
|
||||
return parts.filter((p) => p.trim() !== "").join("\n\n");
|
||||
};
|
||||
|
||||
const droppedBlocks: string[] = [];
|
||||
let text = assemble();
|
||||
for (const id of DROP_ORDER) {
|
||||
if (text.length <= charLimit) break;
|
||||
if (present.has(id)) {
|
||||
present.delete(id);
|
||||
droppedBlocks.push(id);
|
||||
text = assemble();
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
text,
|
||||
charCount: text.length,
|
||||
isOver: text.length > charLimit,
|
||||
droppedBlocks,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a caption for every platform in `platforms`, keyed by platform id.
|
||||
* `shared` carries the description-level toggles + the English-fixed `t`
|
||||
* so each platform renders consistently.
|
||||
*/
|
||||
export function buildAllSocialPosts(
|
||||
input: GeneratorInput,
|
||||
t: TranslationFn,
|
||||
platforms: readonly SocialPlatform[],
|
||||
shared: {
|
||||
showCopyright?: boolean;
|
||||
showSponsorCredit?: boolean;
|
||||
tEn?: TranslationFn;
|
||||
},
|
||||
): Record<string, SocialPostOutput> {
|
||||
const out: Record<string, SocialPostOutput> = {};
|
||||
for (const p of platforms) {
|
||||
out[p.id] = buildSocialPost(input, t, {
|
||||
charLimit: p.charLimit,
|
||||
popularHashtags: p.popularHashtags,
|
||||
showCopyright: shared.showCopyright,
|
||||
showSponsorCredit: shared.showSponsorCredit,
|
||||
tEn: shared.tEn,
|
||||
});
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -14,18 +14,35 @@ const COMPOSITE_NAME_BUDGET = YT_LIMITS.SINGLE_TAG_MAX - 9;
|
||||
const QUALIFIER_SUFFIX_RE =
|
||||
/[:\s]+(?:Definitive|Complete|Collector'?s?|Deluxe|Game\s+of\s+the\s+Year|GOTY|Ultimate|Special|Anniversary|Remastered|Remake|Enhanced|HD)(?:\s+(?:Edition|Cut|Version))?\s*$/i;
|
||||
|
||||
/**
|
||||
* Strips characters that YouTube treats as tag delimiters (`,` `;` `|`) plus
|
||||
* trademark marks, then collapses whitespace. Game names containing these
|
||||
* delimiters (e.g. "Hello, World") would otherwise produce composite tags
|
||||
* like "Hello, World gameplay" that YouTube splits at the comma.
|
||||
*
|
||||
* Pure — exported for testing.
|
||||
*/
|
||||
export function sanitizeForTag(name: string): string {
|
||||
return name
|
||||
.replace(/[™®©]/g, "")
|
||||
.replace(/[,;|]/g, " ")
|
||||
.replace(/\s+/g, " ")
|
||||
.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a shortened, tag-friendly form of `name` whose length is ≤ `budget`.
|
||||
*
|
||||
* Strips trademark marks, then iteratively peels off common edition
|
||||
* qualifiers ("Definitive Edition", "Remastered", "GOTY", …). If the result
|
||||
* is still over budget, drops everything after the first colon. Falls back
|
||||
* to picking leading whole words that fit.
|
||||
* Sanitizes via {@link sanitizeForTag} (trademark + tag-delimiter strip),
|
||||
* then iteratively peels off common edition qualifiers ("Definitive Edition",
|
||||
* "Remastered", "GOTY", …). If the result is still over budget, drops
|
||||
* everything after the first colon. Falls back to picking leading whole
|
||||
* words that fit.
|
||||
*
|
||||
* Pure — exported for testing.
|
||||
*/
|
||||
export function tagFriendlyGameName(name: string, budget: number): string {
|
||||
let n = name.replace(/[™®©]/g, "").trim();
|
||||
let n = sanitizeForTag(name);
|
||||
let prev: string;
|
||||
do {
|
||||
prev = n;
|
||||
@@ -355,7 +372,9 @@ export interface TagOptions {
|
||||
|
||||
export function generateTags(input: GeneratorInput, options?: TagOptions): string[] {
|
||||
const { includeMultilingualTags = true, includeTrendingTags = true } = options ?? {};
|
||||
const rawName = input.gameNameLocalized?.[input.language] ?? input.gameName;
|
||||
const rawName = sanitizeForTag(
|
||||
input.gameNameLocalized?.[input.language] ?? input.gameName,
|
||||
);
|
||||
|
||||
// Two friendly forms of the game name:
|
||||
// • bareNameTag — fits the per-tag 30-char limit; always added so the
|
||||
|
||||
@@ -47,6 +47,19 @@ export interface RenderOptions extends TagOptions {
|
||||
* music section (v0.11).
|
||||
*/
|
||||
showThirdPartyAds?: boolean;
|
||||
/**
|
||||
* When true and the editor's `pubDevName` is non-empty, the description
|
||||
* emits a `© {publisher}. All rights reserved.` line right after the
|
||||
* Store Links block (v0.21.0). Opt-in — meant for games whose
|
||||
* dev/publisher contractually requires attribution in the description.
|
||||
*/
|
||||
showGameCopyright?: boolean;
|
||||
/**
|
||||
* When true, the description appends an AI-translation disclaimer block
|
||||
* for output languages outside the trusted set (English / Vietnamese).
|
||||
* v0.24.0.
|
||||
*/
|
||||
showTranslationQuality?: boolean;
|
||||
/**
|
||||
* Optional English-fixed translation function. Used by the v0.11
|
||||
* unified content-warnings block to render bilingual lines
|
||||
@@ -73,6 +86,8 @@ export function renderAll(
|
||||
showUsagePolicy: options?.showUsagePolicy,
|
||||
showSponsorCredit: options?.showSponsorCredit,
|
||||
showThirdPartyAds: options?.showThirdPartyAds,
|
||||
showGameCopyright: options?.showGameCopyright,
|
||||
showTranslationQuality: options?.showTranslationQuality,
|
||||
tEn: options?.tEn,
|
||||
});
|
||||
const tags = generateTags(input, options);
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { SupportedLanguage, TranslationFn } from "./types";
|
||||
* Canonical keyword IDs recognized by the parser. Each corresponds to a
|
||||
* translation key under `timeline.keywords.*` in templates.json.
|
||||
*/
|
||||
export type TimelineKeyword =
|
||||
type TimelineKeyword =
|
||||
| "chapter"
|
||||
| "part"
|
||||
| "boss"
|
||||
@@ -69,11 +69,15 @@ const KEYWORD_PATTERNS: KeywordPattern[] = [
|
||||
keyword: "intro",
|
||||
hasNumber: false,
|
||||
},
|
||||
// Ending
|
||||
// Ending — v0.16.0 now captures an optional ordinal so timeline
|
||||
// entries like "Ending 1" / "Ending 3: Best End" can be matched
|
||||
// back to the structured `endings[]` array in the editor. The "rest"
|
||||
// tail keeps any trailing label so the renderer still emits the
|
||||
// creator's exact text on round-trip.
|
||||
{
|
||||
re: /^(ending|kết\s+thúc|ket\s+thuc|エンディング|final|엔딩|结局|结尾)(.*)$/i,
|
||||
re: /^(?:ending|kết\s+thúc|ket\s+thuc|エンディング|final|엔딩|结局|结尾)\s*(\d+)?(.*)$/i,
|
||||
keyword: "ending",
|
||||
hasNumber: false,
|
||||
hasNumber: true,
|
||||
},
|
||||
// Tutorial
|
||||
{
|
||||
@@ -172,7 +176,13 @@ export function renderTimeline(
|
||||
}
|
||||
|
||||
const numberVar = entry.number != null ? String(entry.number) : "";
|
||||
const translated = t(`timeline.keywords.${entry.keyword}`, { n: numberVar });
|
||||
// v0.16.0: collapse the trailing whitespace that creeps in when a
|
||||
// numbered keyword pattern (`"Boss {{n}}"`) interpolates with an
|
||||
// empty `n` (e.g. a bare "boss" line with no ordinal). Without
|
||||
// this, the renderer emits "0:42 Boss rest" with a double space.
|
||||
const translated = t(`timeline.keywords.${entry.keyword}`, { n: numberVar })
|
||||
.replace(/\s+$/u, "")
|
||||
.replace(/\s{2,}/gu, " ");
|
||||
const withRest = entry.rest ? `${translated} ${entry.rest}` : translated;
|
||||
rendered.push(`${entry.time} ${withRest}`);
|
||||
}
|
||||
|
||||
+133
-7
@@ -12,6 +12,8 @@ import {
|
||||
GACHA_PART_SUFFIX_STYLES,
|
||||
type GachaQuestType,
|
||||
} from "@config/gacha-quest-types";
|
||||
import { formatEndingEntry, sliceEndingsForVideo } from "./endings-format";
|
||||
import type { EndingEntry } from "./types";
|
||||
|
||||
/**
|
||||
* Compact "[2K 60FPS]" badge appended to the video-type segment when the
|
||||
@@ -125,6 +127,29 @@ function composeTitle(args: ComposeArgs): string {
|
||||
return parts.join(separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* English ordinal suffix for an integer (1 → "st", 2 → "nd", 11 → "th",
|
||||
* 21 → "st", etc.). Used by the Anniversary template to render
|
||||
* `"{{anniversaryYear}}{{ordinalSuffix}} Anniversary"` as e.g.
|
||||
* `"2nd Anniversary"`. Non-English locales pass an empty string so the
|
||||
* native form ("第2周年", "주년") doesn't pick up an English suffix.
|
||||
*/
|
||||
export function ordinalSuffix(n: number): string {
|
||||
const abs = Math.abs(Math.trunc(n));
|
||||
const lastTwo = abs % 100;
|
||||
if (lastTwo >= 11 && lastTwo <= 13) return "th";
|
||||
switch (abs % 10) {
|
||||
case 1:
|
||||
return "st";
|
||||
case 2:
|
||||
return "nd";
|
||||
case 3:
|
||||
return "rd";
|
||||
default:
|
||||
return "th";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the per-quest-type partNumber suffix for a gacha title — e.g.
|
||||
* `" - Part 5"`, `" - Day 3"`, `" - Floor 12"`. Driven by the
|
||||
@@ -146,6 +171,91 @@ export function buildGachaPartSuffix(
|
||||
return resolved && resolved !== key ? resolved : "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the video-type segment of the title when `videoType === "ending"`
|
||||
* AND the creator has filled at least one structured {@link EndingEntry}
|
||||
* (v0.17.0). Three tiers, picked by what's available:
|
||||
*
|
||||
* 1. Single entry → `formatEndingEntry()` (e.g. `"Ending 3: Best End"`,
|
||||
* `"Ending 3"`, or `"Best End"`).
|
||||
* 2. Multiple entries, every entry has a non-empty `name` → comma-join
|
||||
* the names. Plays well with multi-route VN-style endings where
|
||||
* the creator cares more about the named routes than the ordinals.
|
||||
* 3. Multiple entries, every entry has a `number` AND they form a
|
||||
* contiguous run → `"Endings {from}–{to}"` via locale key
|
||||
* `title.endingLabel.range`. Tightest visible label for batched
|
||||
* ending playthroughs ("Endings 1–3" / "Kết thúc 1–3").
|
||||
* 4. Mixed / non-contiguous fallback → `"{count} Endings"` via
|
||||
* `title.endingLabel.count`.
|
||||
*
|
||||
* Returns `null` when no structured data is usable, signalling the
|
||||
* caller to fall back to the legacy locale-string label
|
||||
* (`title.videoType.ending` = "Ending"). This keeps existing single-
|
||||
* ending creators byte-identical post-migration.
|
||||
*
|
||||
* Slicing: respects `endingVideoIndex` + `endingVideoRanges` so a
|
||||
* per-video title for case C renders only that video's slice of
|
||||
* endings. The Output page passes the index when looping over
|
||||
* `endingVideoCount`; bare generation (no index) sees the union.
|
||||
*/
|
||||
function buildStructuredEndingLabel(
|
||||
input: GeneratorInput,
|
||||
t: TranslationFn,
|
||||
): string | null {
|
||||
const endings: EndingEntry[] = input.endings ?? [];
|
||||
if (endings.length === 0) return null;
|
||||
|
||||
const sliced = sliceEndingsForVideo(endings, input);
|
||||
// Drop entries that have neither number nor a non-empty name — they
|
||||
// produce no visible label and would dilute the comma-join / count.
|
||||
const usable = sliced.filter((e) => {
|
||||
const hasNumber =
|
||||
typeof e.number === "number" && Number.isFinite(e.number);
|
||||
const hasName = (e.name ?? "").trim().length > 0;
|
||||
return hasNumber || hasName;
|
||||
});
|
||||
if (usable.length === 0) return null;
|
||||
|
||||
if (usable.length === 1) {
|
||||
const only = usable[0];
|
||||
return only ? formatEndingEntry(only) : null;
|
||||
}
|
||||
|
||||
// Multi-entry: prefer named comma-join when every entry has a name.
|
||||
const allHaveNames = usable.every((e) => (e.name ?? "").trim().length > 0);
|
||||
if (allHaveNames) {
|
||||
return usable.map((e) => e.name.trim()).join(", ");
|
||||
}
|
||||
|
||||
// Numbered + contiguous → range form. Sort + scan adjacent diffs to
|
||||
// detect contiguity so an out-of-order entry list ([3, 1, 2]) still
|
||||
// collapses to "Endings 1–3".
|
||||
const numbers = usable
|
||||
.map((e) => e.number)
|
||||
.filter((n): n is number => typeof n === "number" && Number.isFinite(n));
|
||||
if (numbers.length === usable.length) {
|
||||
const sorted = [...numbers].sort((a, b) => a - b);
|
||||
const isContiguous = sorted.every(
|
||||
(n, i) => i === 0 || n === (sorted[i - 1] as number) + 1,
|
||||
);
|
||||
if (isContiguous) {
|
||||
const from = sorted[0] as number;
|
||||
const to = sorted[sorted.length - 1] as number;
|
||||
const key = "title.endingLabel.range";
|
||||
const resolved = t(key, { from: String(from), to: String(to) });
|
||||
if (resolved && resolved !== key) return resolved;
|
||||
// Fallback if the locale hasn't migrated yet — keep behaviour sane.
|
||||
return `Endings ${from}–${to}`;
|
||||
}
|
||||
}
|
||||
|
||||
// Mixed / non-contiguous: report count.
|
||||
const key = "title.endingLabel.count";
|
||||
const resolved = t(key, { count: String(usable.length) });
|
||||
if (resolved && resolved !== key) return resolved;
|
||||
return `${usable.length} Endings`;
|
||||
}
|
||||
|
||||
export function buildTitle(
|
||||
input: GeneratorInput,
|
||||
t: TranslationFn,
|
||||
@@ -180,6 +290,10 @@ export function buildTitle(
|
||||
gameName,
|
||||
chapterName: input.chapterName ?? "",
|
||||
questName: input.questName ?? "",
|
||||
characterName: input.characterName ?? "",
|
||||
anniversaryYear: input.anniversaryYear != null ? String(input.anniversaryYear) : "",
|
||||
ordinalSuffix: input.anniversaryYear != null ? ordinalSuffix(input.anniversaryYear) : "",
|
||||
gachaVersion: input.gachaVersion ?? "",
|
||||
partSuffix,
|
||||
});
|
||||
|
||||
@@ -193,13 +307,25 @@ export function buildTitle(
|
||||
});
|
||||
}
|
||||
|
||||
const videoTypeLabel = t(`title.videoType.${input.videoType}`, {
|
||||
partNumber: input.partNumber ?? "",
|
||||
bossName: input.bossName ?? "",
|
||||
dlcName: input.dlcName ?? "",
|
||||
challengeName: input.challengeName ?? "",
|
||||
modName: input.modName ?? "",
|
||||
});
|
||||
// v0.17.0: when the creator has filled structured endings, replace
|
||||
// the static "Ending" label with a context-aware one (single entry
|
||||
// surfaces the ending's name, multi-entry collapses to a name list /
|
||||
// contiguous range / count). Falls back to the locale string when no
|
||||
// structured data is usable, so the legacy single-ending creators
|
||||
// who haven't migrated see byte-identical output.
|
||||
let videoTypeLabel: string;
|
||||
if (input.videoType === "ending") {
|
||||
const structured = buildStructuredEndingLabel(input, t);
|
||||
videoTypeLabel = structured ?? t("title.videoType.ending");
|
||||
} else {
|
||||
videoTypeLabel = t(`title.videoType.${input.videoType}`, {
|
||||
partNumber: input.partNumber ?? "",
|
||||
bossName: input.bossName ?? "",
|
||||
dlcName: input.dlcName ?? "",
|
||||
challengeName: input.challengeName ?? "",
|
||||
modName: input.modName ?? "",
|
||||
});
|
||||
}
|
||||
|
||||
return composeTitle({
|
||||
gameName,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { GeneratorInput, TranslationFn } from "./types";
|
||||
import { buildQualityBadge } from "./title-builder";
|
||||
|
||||
export type TitleVariantId = "default" | "typeFirst" | "qualityFirst";
|
||||
type TitleVariantId = "default" | "typeFirst" | "qualityFirst";
|
||||
|
||||
export interface TitleVariant {
|
||||
id: TitleVariantId;
|
||||
|
||||
Loaded 100 of 160 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user