Compare commits

...
62 Commits
Author SHA1 Message Date
poli0981 df92c80bcf Merge pull request #240 from poli0981/chore/release-1.5.1
chore(release): v1.5.1
2026-11-09 20:22:41 +07:00
poli0981andClaude Opus 5.5 5fd28e336c chore(release): v1.5.1
Accessibility (#238, #239): AA contrast, generated text marked with its
language, page names read out after a navigation, the single-key
shortcut switch, desktop zoom hotkeys, and ACCESSIBILITY.md in the repo,
the Legal Center and on the website.

- CHANGELOG v1.5.1, ROADMAP entry and status
- docs: ARCHITECTURE (RouteAnnouncer, settings, capabilities), TECH-SPEC
  (singleKeyShortcuts, contrast test, test count), PACKAGING (zoom
  hotkeys and permission), FEATURES
- version references: DISCLAIMER + Vietnamese, the bug-report template
- six manifests 1.5.0 -> 1.5.1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 20:19:21 +07:00
poli0981 754b669f4d Merge pull request #239 from poli0981/docs/accessibility-statement
feat(legal): accessibility statement — ACCESSIBILITY.md, Legal Center page, issue form
2026-11-09 20:19:16 +07:00
poli0981andClaude Opus 5.5 a45a06fad7 feat(legal): accessibility statement — ACCESSIBILITY.md, Legal Center page, issue form
- ACCESSIBILITY.md (+ docs/i18n/vi): goal (WCAG 2.2 AA, not a conformance
  claim), what works with a keyboard, screen readers, zoom, motion and touch,
  how it is checked, supported environments, known limitations, how to
  report a barrier (severity, response), and a checklist for contributors.
- In the Legal Center (consent: false, English + Vietnamese) and as
  /legal/accessibility on the website; the Turnstile page's footer links it
  in all eight languages.
- .github: Accessibility barrier issue form (label `accessibility`), an
  Accessibility option in the feature request scope, an accessibility
  checklist in the PR template.
- README, CONTRIBUTING, DEVELOPMENT (+vi), FEATURES and CLAUDE.md point to
  it; SECURITY.md's supported versions move from 1.3.x to 1.5.x.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 20:12:25 +07:00
poli0981 806201721c Merge pull request #238 from poli0981/feat/accessibility-pass
feat(a11y): contrast to AA, output language, page announcements, single-key shortcut switch, desktop zoom
2026-11-09 20:10:35 +07:00
poli0981andClaude Opus 5.5 68dc48ea53 feat(a11y): AA contrast, output language, page announcements, single-key shortcut switch, desktop zoom
- Colour tokens reach WCAG AA: lighter muted text and accent in the dark
  theme, darker muted/success/warning/danger/donate in the light theme, and
  new accent-solid / danger-solid fills for buttons with white text.
  tests/styles/contrast.test.ts checks every text token on every surface.
- Generated text carries its language (lang) on Output, the YouTube and
  quick previews, History, Batch, Social and Playlist, so screen readers read
  Japanese output with a Japanese voice.
- RouteAnnouncer reads the new page's name after a navigation; focus stays.
- Toast region and close button are translated; Alt+T is in the shortcut list.
- Endings table inputs and the custom bank name get accessible names; the
  From/To headers are translated.
- Settings > Editor > Single-key shortcuts turns the bare ? off (WCAG 2.1.4).
- Text inputs use outline-hidden so the focus outline shows in Windows High
  Contrast; the genre remove button is 24px, small close/dismiss buttons
  grow on touch screens.
- Desktop: zoomHotkeysEnabled (Ctrl/Cmd + = / -), with the
  set-webview-zoom permission for the macOS/Linux polyfill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 20:02:37 +07:00
poli0981 d6cfea8449 Merge pull request #236 from poli0981/chore/release-1.5.0
chore(release): v1.5.0
2026-11-08 00:44:38 +07:00
poli0981andClaude Opus 5.5 8628991390 chore(release): v1.5.0
Upscaled video (#235): "Upscaled from" in Video settings, the
[4K Upscaled] title badge, the Upscale line in VIDEO SETTINGS and an
automatic tech note about upscaled detail.

- CHANGELOG v1.5.0, ROADMAP entry and status
- docs: FEATURES, CONTENT-INVENTORY (+ Vietnamese), ARCHITECTURE and
  TECH-SPEC (upscale.ts, store v21, test count), CLAUDE.md
- version references: PACKAGING, DISCLAIMER + Vietnamese, the
  bug-report template
- six manifests 1.4.0 -> 1.5.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 00:41:56 +07:00
poli0981 06e0d9ae3d Merge pull request #235 from poli0981/feat/upscaled-video
feat(editor): upscaled video — [4K Upscaled] badge, upscale line and warning
2026-11-08 00:41:47 +07:00
poli0981andClaude Opus 5.5 941a1fad4f feat(editor): upscaled video — [4K Upscaled] badge, upscale line and warning
Video settings gain "Upscaled from" next to Resolution: footage recorded
at 1440p and exported at 4K in the video editor is now declared as such.

- Title: the quality badge reads "[4K Upscaled]" ("[2K Upscaled]",
  "[4K Upscaled 120FPS]"), with the word in the output language; badge
  position, case and the "Show quality badge" setting apply as before.
  1080p 60fps keeps no badge, upscaled or not.
- Description, VIDEO SETTINGS: "Upscale: 1440p → 4K (DaVinci Resolve
  Studio 21.2)" right under the Video line, the editor taken from My Rig.
  It stays when the graphics settings are hidden.
- Description, TECH NOTES: an automatic bilingual note that upscaling
  reconstructs fine detail, so text, textures and edges may look slightly
  different from the original image. It is not in the checklist and
  goes away with the upscale.
- The Select lists only resolutions below the video's; lowering the
  resolution to or below the source ends the upscale. The collapsed
  section reads "1440p → 4K · 60 FPS". Saved with the channel profile.
- Editor store v20 → v21 (back-fills "" and drops unknown values);
  backups and applied items read an unknown value as not upscaled.
  `validUpscaleSource` in src/engine/upscale.ts is the one rule the
  title, description and form share. AUTO_TECH_NOTES holds the engine's
  own notes; their bullets share description.techNotes.items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 00:38:08 +07:00
poli0981 8cc9a46167 Merge pull request #233 from poli0981/ci/macos-15-runner
ci(release): build the macOS app on macos-15
2026-11-06 22:51:53 +07:00
poli0981andClaude Opus 5.5 cf9934e25f ci(release): build the macOS app on macos-15
GitHub retired the macOS 14 runner image on 2026-11-02. The v1.4.0 tag's
Release Desktop run had its macOS job cancelled before any step ran
("The configuration 'macos-14-arm64-us-default' is not supported"); the
Windows and Linux builds went through. macos-15 is the direct Apple
silicon successor.

The macOS .app.tar.gz for v1.4.0 will come from the workflow's manual
`workflow_dispatch` re-run with tag v1.4.0, which takes the job matrix
from main and checks out the tag's code. PACKAGING's runner table and
the v1.4.0 CHANGELOG entry say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 22:44:25 +07:00
poli0981 09f50362a2 Merge pull request #232 from poli0981/chore/release-1.4.0
docs: v1.4.0 — LUT field, boss name tag; bump to 1.4.0
2026-11-06 22:28:33 +07:00
poli0981andClaude Opus 5.5 d2519ccaef chore(release): v1.4.0
A LUT field in My Rig (#230), the boss's name as a tag in boss videos
(#231), and this week's dependency updates (#228, #229).

- CHANGELOG v1.4.0, ROADMAP entry and status
- version references: ARCHITECTURE, TECH-SPEC (+ test count), PACKAGING,
  FEATURES, DISCLAIMER + Vietnamese, the bug-report template
- six manifests 1.3.2 -> 1.4.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 22:26:22 +07:00
poli0981 b216d71591 Merge pull request #231 from poli0981/feat/boss-name-tag
feat(tags): the boss name as a tag in boss videos
2026-11-06 22:25:08 +07:00
poli0981 b7d357ce4c Merge pull request #230 from poli0981/feat/rig-lut
feat(rig): add a LUT field under the video editor
2026-11-06 22:23:13 +07:00
poli0981andClaude Opus 5.5 0789a11a39 feat(tags): the boss name as a tag in boss videos
Boss Fight and Boss No Hit videos get the boss's name as a tag of its
own, right after the game's name, so fitting the list to 500 characters
never drops it.

bossNameTag cleans the Boss Name field the way a search term reads:
- NFC first; everything but letters (any script), marks, digits,
  whitespace and in-word ' ' - becomes a space: , : ; ! ? quotes,
  brackets, &, the CJK brackets and dots, (TM), emoji.
- A dot stays between digits ("Phase 2.0"), goes between initials
  ("S.T.A.L.K.E.R." -> "STALKER") and is a space anywhere else
  ("Mr.X" -> "Mr X"). Done per word in code: a lookbehind would be a
  syntax error in the macOS 11-13 webview and stop the chunk loading.
- Over 30 characters, the name before its title ("Loretta, Knight of
  the Haligtree" -> "Loretta"), else the leading words that fit; the
  word fit is now a helper shared with tagFriendlyGameName (same result
  there).

Only the video types whose extraFields include bossName add it, so a
boss name left in the draft after switching to Full Gameplay is not
tagged. Docs: FEATURES, ARCHITECTURE 2.3, TECH-SPEC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 22:22:33 +07:00
poli0981andClaude Opus 5.5 d799c52112 feat(rig): add a LUT field under the video editor
A new My Rig field for the LUT graded in the video editor. The
description and the social captions print it on its own line right
under the editor ("LUT: Arri Alexa LogC to Rec709"); left empty, there
is no line.

- Typing offers the LUTs that come with DaVinci Resolve, named the way
  its LUT menu shows them (from Resolve 21's own LUT folder); any other
  name is printed as typed.
- cleanLutName tidies a pasted file name or path: Explorer's "Copy as
  path" or a macOS path keeps only the file name, and a .cube / .dat /
  .3dl / .csp / .ilut / .olut / .look extension goes. Dots inside a
  name ("SLog3SGamut3.CineToLC-709") stay.
- RigField gets `clean` (CPU and LUT) and `wide`. The cleaner runs when
  the field loses focus and again in formatRigValue, so Ctrl/Cmd+Shift+C
  or Ctrl/Cmd+S pressed with the cursor still in the field prints the
  tidy name too; the LUT field spans both columns, under the editor row.
- `rig.lut` and `description.rigLabels.lut` ("LUT") in all eight
  locales and _schema.json; a test now holds both label sets to
  RIG_FIELDS.

No store migration: the rig is a flat string map in the channel
profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 22:17:44 +07:00
poli0981 c14698c704 Merge pull request #229 from poli0981/chore/deps-2026-11-06
chore(deps): fold this week's Dependabot updates
2026-11-06 22:14:05 +07:00
poli0981andClaude Opus 5.5 78abb6f354 chore(deps): fold this week's Dependabot updates
Folds #223-#227 into one change. Each of them failed the required
`check` job the same way: a new version makes THIRD_PARTY_NOTICES.md
stale, and merged one by one they would conflict with each other in
package-lock.json and the notices.

- i18next 26.5.3 -> 26.5.11, react-i18next 17.1.0 -> 17.1.9
- lucide-react 1.59.0 -> 1.64.0, zustand 5.0.15 -> 5.0.16
- knip 6.42.1 -> 6.44.0
- wrangler 4.151.2 -> 4.152.0 (miniflare 5.20261019.2-beta)
- @tauri-apps/cli 2.12.3 -> 2.12.4 (matches the tauri 2.12.4 crate)

Installed with `npm install --before=2026-10-30`, the same 7-day
cooldown Dependabot uses; lucide-react and knip land on the newest
releases past it (1.64.0, 6.44.0) rather than Dependabot's 1.61.0 and
6.43.0. The undici override stays: miniflare 5.20261019.2-beta still
pins undici 7.29.1. THIRD_PARTY_NOTICES regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 22:09:22 +07:00
poli0981 842b9d2a36 Merge pull request #228 from poli0981/dependabot/github_actions/actions-d480c5930a
ci: bump the actions group with 2 updates
2026-11-06 22:03:37 +07:00
dependabot[bot] 931d7d8f8e ci: bump the actions group with 2 updates
Bumps the actions group with 2 updates: [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) and [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `Swatinem/rust-cache` from 2.9.2 to 2.9.3
- [Release notes](https://github.com/swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/swatinem/rust-cache/compare/6323deb102c322ba6fcbdcafc7e3dddab59af2b6...d1527c8f67ef9af357290475d4af4b0fab8f12e0)

Updates `zizmorcore/zizmor-action` from 0.7.1 to 0.8.0
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](https://github.com/zizmorcore/zizmor-action/compare/85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e...53290badfa369cb0bf7ad16342cb62c2fa47ac7b)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-version: 2.9.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-02 13:47:23 +00:00
poli0981 a40044e8e3 Merge pull request #221 from poli0981/chore/release-1.3.2
docs: v1.3.2 — rate limiting for the website; bump to 1.3.2
2026-10-27 06:36:51 +07:00
poli0981andClaude Opus 5.5 f102f1a6ba chore(release): v1.3.2
Rate limiting for the website: Workers Rate Limiting bindings in front
of the gate, behind a WAF rate limiting rule at the zone (#220).

- CHANGELOG v1.3.2, ROADMAP entry and status
- version references: ARCHITECTURE, TECH-SPEC (+ test count), PACKAGING,
  FEATURES, DISCLAIMER + Vietnamese, the bug-report template
- six manifests 1.3.1 -> 1.3.2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 06:34:21 +07:00
poli0981 5a10739c07 Merge pull request #220 from poli0981/feat/worker-rate-limit
feat(worker): rate-limit every client before the gate
2026-10-27 06:31:08 +07:00
poli0981andClaude Opus 5.5 bdaf15d835 feat(worker): rate-limit every client before the gate
Two Workers Rate Limiting bindings in wrangler.jsonc, checked first in
the router so a flood costs no siteverify call, HMAC check or asset
fetch:

- RATE_LIMIT: 120 requests a minute for everything the Worker handles
  (gate page, app shell, legal pages, /__gate/*, any method).
- VERIFY_RATE_LIMIT: 10 a minute for POST /__gate/verify on top.

Clients are keyed by IPv4 address or IPv6 /64. Over the limit: 429 with
Retry-After: 60 (plain text, or JSON for the verify call). Like the
gate, it fails open when a binding is missing or limit() throws, and
logs that once per isolate. A test keeps wrangler.jsonc's bindings and
period in step with the code.

HOSTING documents both layers and the zone's WAF rate limiting rule
(Free plan: one rule, per IP, 10 s) as the first one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 06:28:19 +07:00
poli0981 5da7ff0e0f Merge pull request #218 from poli0981/chore/release-1.3.1
docs: v1.3.1 — changelog and version references; bump to 1.3.1
2026-10-26 12:58:52 +07:00
poli0981andClaude Opus 5.5 a403e2fc89 chore(release): v1.3.1
Tauri 2.12.4, the desktop's Save / Open dialogs off the async workers
(#216), SonarCloud in CI (#215) and this week's dependency updates with
alert #49 closed (#217).

- CHANGELOG v1.3.1, ROADMAP entry and status
- version references: ARCHITECTURE, TECH-SPEC, PACKAGING, FEATURES,
  DISCLAIMER + Vietnamese, the bug-report template
- six manifests 1.3.0 -> 1.3.1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:51:41 +07:00
poli0981 dae48b591a Merge pull request #217 from poli0981/chore/deps-2026-10-26
chore(deps): fold this week's updates; override undici for alert #49
2026-10-26 12:51:31 +07:00
poli0981andClaude Opus 5.5 f3cad7c1d9 chore(deps): fold this week's updates; override undici for alert #49
- undici 7.30.1 through `overrides` (alert #49, GHSA-xjj6-f33q-929c,
  dev only): miniflare pins undici exactly, so Dependabot's security
  job fails with security_update_not_possible. The note in
  dependabot.yml says when to drop the override.
- npm, newest releases at least seven days old (the Dependabot
  cooldown): react + react-dom 19.3.1, i18next 26.5.3,
  react-i18next 17.1.0, lucide-react 1.59.0, simple-icons 16.35.0,
  eslint 10.13.0, typescript-eslint 8.72.0, knip 6.42.1,
  postcss 8.5.31, @types/node 26.6.5, wrangler 4.151.2
- tauri crates to match @tauri-apps/api 2.12.4: tauri 2.12.4,
  tauri-build 2.7.3, tauri-plugin-dialog 2.8.3, -opener 2.7.2,
  -single-instance 2.5.4, -fs 2.7.1
- THIRD_PARTY_NOTICES regenerated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:44:50 +07:00
poli0981 49ff940b72 Merge pull request #216 from poli0981/fix/rust-blocking-dialog-io
fix(desktop): run the file dialogs and their file I/O on the blocking pool
2026-10-24 09:11:03 +07:00
poli0981andClaude Opus 5.5 2cecc20fac docs: blocking work in async Tauri commands goes through spawn_blocking
PACKAGING (the dialog commands, the unit tests) and CLAUDE.md's design decision on paths say how the dialog commands run, so the next command doesn't bring rust:S7493 back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:08:14 +07:00
poli0981andClaude Opus 5.5 e8cd1aabca fix(desktop): run the file dialogs and their file I/O on the blocking pool
SonarCloud's first CI analysis of main, the first one that reads Rust,
flagged rust:S7493 in export_text_file: a blocking fs::write inside an
async command holds one of the async runtime's worker threads. Waiting
for the native Save / Open dialog blocks the same way, for as long as
the user takes to choose.

Both commands now validate the filter first, then run the dialog and the
file I/O through tauri::async_runtime::spawn_blocking. Writing the
picked file moves into write_picked, next to read_picked, with a test.
The dialogs' blocking API only needs to stay off the main thread, which
the blocking pool is, as the runtime's workers were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:04:21 +07:00
poli0981 fd06bcd916 Merge pull request #215 from poli0981/ci/sonarcloud-ci-analysis
ci(sonarcloud): switch to CI-based analysis with Vitest coverage
2026-10-24 08:52:20 +07:00
poli0981andClaude Opus 5.5 42bc2d31dc docs(development): keep the coverage row short so the command table keeps its width
The coverage scope is spelled out in TECH-SPEC, vitest.config.ts and sonar-project.properties; the table row only says what the command does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:49:09 +07:00
poli0981andClaude Opus 5.5 191e8cf89a docs(tech-spec): binary files are left out of the SonarCloud analysis
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:46:43 +07:00
poli0981andClaude Opus 5.5 adc2426507 ci(sonarcloud): leave binary files out of the analysis
The scanner indexed every PNG, ICO, ICNS and the Gradle wrapper's jar and warned about each one it read as UTF-8 text (about seventy warnings per run). There is nothing in them to analyse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:45:41 +07:00
poli0981andClaude Opus 5.5 d7a86d581e ci(sonarcloud): switch to CI-based analysis with Vitest coverage
SonarCloud's Automatic Analysis is off. The new `sonarcloud` job in
ci.yml runs SonarSource/sonarqube-scan-action v8.3.0 after `check`, with
the LCOV report that `check` now uploads; it never installs npm packages,
so SONAR_TOKEN never shares a job with them, and it fails with the
quality gate. Fork and Dependabot PRs skip it (no repository secrets).

sonar-project.properties analyses the tests as tests, imports the
coverage and excludes from it everything Vitest does not measure. Vitest
now also measures src/config, src/store and src/utils, next to the
engine, the Worker and the build plugins. The job passes package.json's
version as sonar.projectVersion, so the "previous version" new-code
period starts again at every release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:38:24 +07:00
poli0981 1858df90e5 Merge pull request #213 from poli0981/docs/v1.3.0
docs: v1.3.0 — toolchain docs and changelog; bump to 1.3.0
2026-10-22 15:12:32 +07:00
poli0981andClaude Opus 5.5 f472c1e760 docs: v1.3.0 — toolchain docs and changelog; bump to 1.3.0
- CHANGELOG v1.3.0; ROADMAP (v1.3.0 shipped, ES2026 next)
- DEVELOPMENT + vi: Node 26 / npm 11, TypeScript 7 with the 6.0 API alias,
  and the IDE setting that follows from it
- TECH-SPEC: package.json, tsconfig, the Vite target, toolchain notes
  (TypeScript aliases, Node 26 web storage, npm ci --ignore-scripts)
- PACKAGING: supported WebViews, Android cloud backups off, Node 26, the
  tauri.conf.json excerpt
- HOSTING, ARCHITECTURE, README (node >= 26, TypeScript 7), FEATURES, I18N,
  CONTENT-INVENTORY + vi, DISCLAIMER + vi, SECURITY (1.3.x), the bug-report
  template, CLAUDE.md (TypeScript 7, the browser-floor lib, linear regexes,
  SonarCloud, npm aliases)
- Six manifests bumped 1.2.0 -> 1.3.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:11:17 +07:00
poli0981 e33462b462 Merge pull request #212 from poli0981/fix/sonarcloud
fix(quality): clear the 44 open SonarCloud issues
2026-10-22 15:09:24 +07:00
poli0981andClaude Opus 5.5 886d25b588 fix(quality): clear the 44 open SonarCloud issues
Regexes with super-linear backtracking (S8786 x16) are rewritten to stay
linear on long runs; each new pattern gives the same results as the old one
on 150k-450k fuzzed inputs (except where noted) and finishes adversarial
50k-character inputs in under 3 ms:
- tag-generator QUALIFIER_SUFFIX_RE starts just before a `:`/space run
  (`(^|[^:\s])…` + "$1"), never inside one
- timeline-parser matches `line.trimEnd()` with a greedy label, and renders
  with trimEnd(); cleanCpuName collapses whitespace before the patterns
- editor-store endings, Google Play urlPattern (lookahead for `id=`),
  channel-phrase punctuation, SPDX OR/AND split, legal-docs slug and link
  stripping (link text/URL may not contain `[`), base64url padding, and a
  loop for trailing slashes in the worker router

Others:
- S2871: sorts take the shared code-unit comparator (same order as before;
  THIRD_PARTY_NOTICES is unchanged)
- S4822: ErrorBoundary catches the logger import with .catch(), which a
  try/catch never could
- S3516: migrateProfilesState returns a new object
- S7773: Number.parseInt (x10)
- S9379: Modal takes an initialFocusRef (Radix onOpenAutoFocus), so the
  shortcut search box gets focus without an autoFocus attribute
- S2245: generateId drops the Math.random fallback; getRandomValues exists
  everywhere the app runs, and a non-random ID is worse than an error
- S4036: NOSONAR on the dev script's `git` call (PATH lookup by design)
- S6505/S8543: every workflow installs with `npm ci --ignore-scripts`, and CI
  runs `npm run cf:check` instead of `npx wrangler …`
- S6358: Android sets allowBackup="false" — app data is no longer copied to
  Google Drive backups; Backup & Restore moves it to a new phone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:05:16 +07:00
poli0981 abfcd96eb5 Merge pull request #211 from poli0981/refactor/react-19-refs
refactor(ui): take refs as a prop instead of forwardRef
2026-10-22 15:05:08 +07:00
poli0981andClaude Opus 5.5 52fc677ce5 refactor(ui): take refs as a prop instead of forwardRef
React 19 passes `ref` to function components as an ordinary prop, and the
React team has said forwardRef will be deprecated in a future release.
Button, IconButton, Input, Select and Textarea become plain function
components whose props extend ComponentProps<"button" | "input" | …>,
which already carries `ref`; each passes it on (Button to both Slot.Root
and <button>; IconButton through its props to Button). Their displayName
lines go too: the function names show in DevTools.

IconButton and RigEditor import the ReactNode type instead of reaching for
the global `React` namespace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:03:13 +07:00
poli0981 e3d86ea6cd Merge pull request #210 from poli0981/chore/deps-2026-10-22b
chore(deps): fold the newer Dependabot bumps; fix the @vitest/mocker alerts
2026-10-22 15:03:04 +07:00
poli0981andClaude Opus 5.5 1e3e20c6d4 chore(deps): fold the newer Dependabot bumps; fix the @vitest/mocker alerts
- vitest + @vitest/coverage-v8 4.1.12: @vitest/mocker 4.1.12 fixes alerts
  #44 and #45 (manual-mock code injection, Windows redirect traversal).
  Dependabot's security update could not land on its own: vitest 4.1.11
  pins @vitest/mocker 4.1.11.
- i18n: i18next 26.4.5
- tauri: @tauri-apps/api 2.12.4, plugin-opener 2.7.2, cli 2.12.3
- ui: lucide-react 1.57.0, radix-ui 1.8.1
- lint-and-format: typescript-eslint 8.71.2
- build-tooling: postcss 8.5.30
- actions: setup-java 6.1.0, zizmor-action 0.7.1
- THIRD_PARTY_NOTICES regenerated

Supersedes #197 #198 #199 #206 #207 #208.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:01:16 +07:00
poli0981 4019c2151e Merge pull request #209 from poli0981/chore/typescript-7
chore(typescript): move to TypeScript 7 with an ES2025 target
2026-10-22 15:01:08 +07:00
poli0981andClaude Opus 5.5 ad523ea0fb chore(typescript): move to TypeScript 7 with an ES2025 target
TypeScript 7.0 is the native compiler and ships no JavaScript API, which
typescript-eslint still needs. Install both, as Microsoft documents it:
- "@typescript/native": "npm:typescript@^7.0.2" gives `tsc` = 7.0
- "typescript": "npm:@typescript/typescript6@^6.0.2" gives the 6.0 API
  that typescript-eslint loads (its peer range stops below 6.1), and `tsc6`
CI fails if `tsc` ever resolves to TypeScript 6 (@typescript/old, pulled in
by the 6.0 package, ships a `tsc` too).

tsconfig.json (src):
- target ES2025: the newest year TypeScript 7.0, esbuild and Vite all know
- lib ES2022 + DOM: the browser floor (Vite's baseline-widely-available,
  Chrome 111 / Safari 16.4 / Firefox 114), because nothing polyfills
- baseUrl removed (gone in 7.0; paths were already relative), DOM.Iterable
  dropped (merged into DOM), `types: []` spelled out, erasableSyntaxOnly and
  verbatimModuleSyntax on (both clean)
tsconfig.check.json: lib ES2025 for tests, scripts, worker and build plugins.

Platform floor: the Tauri build no longer lowers to es2020; it shares the
web build's baseline (the stylesheet already needed Chromium 99+ /
Safari 15.4+). macOS minimumSystemVersion is 11.0 (the build is arm64).

Also: eslint.config.js uses ESLint's defineConfig (tseslint.config is
deprecated); THIRD_PARTY_NOTICES names the real package behind an npm
alias, sorted with a shared code-unit comparator (src/utils/sort.ts);
Dependabot groups typescript + @typescript/*; a test's typed-array
annotation follows TypeScript 7's lib.dom.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:48:21 +07:00
poli0981 706a9c89a2 Merge pull request #205 from poli0981/chore/node-26
chore(node): move the toolchain to Node 26
2026-10-22 14:47:28 +07:00
poli0981andClaude Opus 5.5 3c53fd4fe5 chore(node): move the toolchain to Node 26
- .node-version 22 -> 26 (CI, the release workflows and Workers Builds
  read it; Workers Builds also has NODE_VERSION=26 set)
- package.json engines: node >=26
- vitest: run workers with --no-experimental-webstorage. Node 25+ defines
  a global `localStorage` that is undefined without --localstorage-file;
  zustand's persist only falls back to memory when reading the storage
  throws, so every store `set` crashed on undefined.setItem (39 tests in
  4 files). Without Web Storage the stores fall back as they did on 22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:43:32 +07:00
poli0981 eb96954d21 Merge pull request #204 from poli0981/chore/deps-2026-10-22
chore(deps): fold the open Dependabot bumps; fix the vite launch-editor alerts
2026-10-22 14:43:19 +07:00
poli0981andClaude Opus 5.5 701b661a0d chore(deps): fold the open Dependabot bumps; fix the vite launch-editor alerts
- i18n: i18next 26.4.4
- tauri: @tauri-apps/api 2.12.3, plugin-opener 2.7.1, cli 2.12.2
  (crates stay on 2.12)
- ui: lucide-react 1.55.0, radix-ui 1.8.0
- lint-and-format: eslint 10.12.0, knip 6.41.0, prettier 3.9.10,
  typescript-eslint 8.71.1
- build-tooling: @vitejs/plugin-react 6.1.2, marked 18.1.1,
  postcss 8.5.29, vite 8.3.4 (alerts #41-#43: launch-editor, fixed in 8.3.3)
- actions: setup-node 7.1.0, rust-toolchain 683b588, upload-artifact 7.0.2,
  scorecard 2.5.0
- THIRD_PARTY_NOTICES regenerated

Supersedes #197 #198 #199 #200 #201 #202 #203.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:40:53 +07:00
poli0981andClaude Opus 5.5 9901ed844b chore(deps): fold the open Dependabot bumps into one update; fix sharp and source-map-js alerts (#196)
- ui: lucide-react 1.52.0, motion 13.5.1, radix-ui 1.7.0
- tauri: @tauri-apps/api + cli 2.12.1 (crates stay on 2.12)
- i18n: react-i18next 17.0.16
- wrangler 4.149.0, which brings sharp 0.35.5 (alert #40) and
  shares the top-level esbuild instead of nesting its own
- source-map-js 1.2.2 (alert #39)
- THIRD_PARTY_NOTICES regenerated

Supersedes #190 #191 #192 #193 #194.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:34:06 +07:00
poli0981 7f56a5f22a Merge pull request #195 from poli0981/dependabot/github_actions/actions-cfc9a39341
ci: bump dtolnay/rust-toolchain from 7e38f4b43b4db5c8dd498af069a4f6196df1d067 to e2a55d2ffb04f378e9626c28d38b36d230d1e12f in the actions group
2026-10-16 05:21:43 +07:00
dependabot[bot] 1aebe75501 ci: bump dtolnay/rust-toolchain
Bumps the actions group with 1 update: [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain).


Updates `dtolnay/rust-toolchain` from 7e38f4b43b4db5c8dd498af069a4f6196df1d067 to e2a55d2ffb04f378e9626c28d38b36d230d1e12f
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases)
- [Commits](https://github.com/dtolnay/rust-toolchain/compare/7e38f4b43b4db5c8dd498af069a4f6196df1d067...e2a55d2ffb04f378e9626c28d38b36d230d1e12f)

---
updated-dependencies:
- dependency-name: dtolnay/rust-toolchain
  dependency-version: e2a55d2ffb04f378e9626c28d38b36d230d1e12f
  dependency-type: direct:production
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-13 14:22:49 +00:00
poli0981 3c9e52b541 Merge pull request #188 from poli0981/docs/v1.2.0
docs: v1.2.0 — sync docs and templates, changelog; bump to 1.2.0
2026-10-12 22:14:55 +07:00
poli0981andClaude Opus 5.5 e50d324d0a docs(changelog): v1.2.0 — bilingual lines, cargo checks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 22:12:28 +07:00
poli0981andClaude Opus 5.5 bc27ce95d5 docs: v1.2.0 — sync docs and templates, changelog; bump to 1.2.0
Docs had drifted since 1.0.0: README missed the 1.1.0 features and
showed an Android step that overwrites the committed Gradle project;
ROADMAP, PACKAGING, ARCHITECTURE and TECH-SPEC still described 1.0.0;
CONTRIBUTING and the PR template listed half the gates; SECURITY named
1.0.x; CLAUDE.md's structure and gate list were out of date.
webapp/TAURI.md (Node 25, no .rpm) is folded into PACKAGING and removed.

Also: purpose-word validation documented in ARCHITECTURE, two stale code
comments (about.ts, vietnamese-banks.ts), .gitignore for the
maintainer's local note files, and the CHANGELOG entry.

Six manifests bumped 1.1.0 -> 1.2.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 22:10:58 +07:00
poli0981 f2e6e21555 Merge pull request #187 from poli0981/chore/legal-sync
chore(legal): sync notices, REUSE and privacy with the code
2026-10-12 22:06:40 +07:00
poli0981 eee07f9390 Merge pull request #186 from poli0981/feat/ai-content-warnings
feat(editor): warnings for AI-generated game content, plus three more disclosures
2026-10-12 22:03:23 +07:00
poli0981andClaude Opus 5.5 261457ae38 chore(legal): sync notices, REUSE and privacy with the code
- THIRD_PARTY_NOTICES said the app uses the operating system's fonts; it
  bundles Inter and JetBrains Mono (OFL-1.1). The Rust table claimed to
  list the direct dependencies of src-tauri but only took names starting
  with "tauri", so serde was missing. The generator now reads Cargo.toml's
  dependency tables and fails on a crate whose license it doesn't know.
- REUSE.toml credited the Gradle wrapper to the project; it is Gradle's
  ("the original author or authors", Apache-2.0).
- The Privacy Policy lists the session-only ytdescgen-chunk-reload flag
  next to the localStorage keys. Not a material change, so the terms
  version stays 2; the Effective date moves.
- DISCLAIMER (+ vi) pointed at a THIRD_PARTY_NOTICES section by an old
  heading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 22:00:02 +07:00
poli0981andClaude Opus 5.5 7a81690974 feat(editor): AI-generated content warnings and three more disclosures
A new content-warning group, AI-generated content (7): general, art /
visuals, voices, music / sound, text / dialogue, generated live while
playing, and disclosed by the developer. It follows Steam's AI
disclosure (made with AI during development vs generated live while the
game runs); machine translation stays the Language patch field.

Also simulated gambling and in-game purchases (ESRB / PEGI descriptors
with no warning so far), and a tech note for upscaling / frame-generation
artifacts (which upscaler was on is already the Video settings line).

A test now fails when a content warning or tech note has no editor label
or description bullet in _schema.json, and so in any locale; tech notes
get the group-parity test content warnings already had.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:56:53 +07:00
165 changed files with 6074 additions and 2566 deletions

No files matched your search

+123
View File
@@ -0,0 +1,123 @@
name: Accessibility barrier
description: Something stops or slows you down when you use a keyboard, a screen reader, zoom, high contrast, voice control or a touch screen.
title: "[A11y]: "
labels: ["accessibility", "triage"]
body:
- type: markdown
attributes:
value: |
Thanks for telling us. You don't need to know what causes the problem — describe what you tried and what happened.
Prefer not to post in public? Email **contact@poli0981.dev** with `[Accessibility]` at the start of the subject.
How reports are handled: [ACCESSIBILITY.md](https://github.com/poli0981/youtube-generator/blob/main/ACCESSIBILITY.md#reporting-a-barrier).
- type: textarea
id: barrier
attributes:
label: What happened?
description: What were you trying to do, and what got in the way?
placeholder: e.g. "With NVDA, the Copy Title button is announced only as 'button'."
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce
description: The page, then numbered steps — keys you pressed, gestures or voice commands.
placeholder: |
1. Open Output
2. Press Tab until the Copy Title button
3. Listen to what the screen reader says
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect?
validations:
required: true
- type: dropdown
id: assistive-tech
attributes:
label: Assistive technology or setting
description: Pick everything you were using.
multiple: true
options:
- Keyboard only
- Narrator (Windows)
- NVDA
- JAWS
- VoiceOver (macOS / iOS)
- TalkBack (Android)
- Orca (Linux)
- Screen magnifier / browser zoom
- Speech input / voice control
- High contrast / forced colours
- Reduce motion
- Switch access
- Other (say which below)
validations:
required: true
- type: input
id: assistive-tech-version
attributes:
label: Version of that tool (if you know it)
placeholder: e.g. NVDA 2026.3, VoiceOver on macOS 26
- type: dropdown
id: severity
attributes:
label: How much does it stop you?
description: The levels are explained in ACCESSIBILITY.md.
options:
- Critical — I can't finish a core task (write, generate, copy, save, get past the website check)
- High — I can finish it, but only with real difficulty or a workaround
- Medium — it works, but inconsistently or confusingly
- Low — a minor annoyance
validations:
required: true
- type: input
id: version
attributes:
label: App version
description: From the About page. Example `v1.5.1`.
placeholder: v1.5.1
validations:
required: true
- type: dropdown
id: surface
attributes:
label: Where are you running YTDescGen?
options:
- Web (ytgenerator.stream)
- Desktop — Windows (Tauri)
- Desktop — macOS (Tauri)
- Desktop — Linux (Tauri)
- Android (APK)
- Local dev (npm run dev)
validations:
required: true
- type: input
id: os
attributes:
label: Operating system and browser
description: e.g. Windows 11 25H2 + Edge 141, macOS 26 + Safari 26, Android 15. Leave the browser out for the desktop and Android apps.
validations:
required: true
- type: dropdown
id: language
attributes:
label: App language
options:
- English (en)
- Tiếng Việt (vi)
- 日本語 (ja)
- Español (es)
- 한국어 (ko)
- 简体中文 (zh)
- Português (BR) (pt-BR)
- Bahasa Indonesia (id)
validations:
required: true
- type: textarea
id: recording
attributes:
label: Screen recording, screenshot or screen reader output (optional)
description: Drag and drop files here, or paste what the screen reader said.
+2 -2
View File
@@ -12,8 +12,8 @@ body:
id: version
attributes:
label: App version
description: From the About page. Example `v1.0.0`.
placeholder: v1.0.0
description: From the About page. Example `v1.5.1`.
placeholder: v1.5.1
validations:
required: true
- type: dropdown
@@ -31,11 +31,19 @@ body:
options:
- Editor
- Output / preview
- Batch
- Social captions
- Playlist
- History
- Profiles / presets
- Templates (description, title, tags)
- Backup & restore
- i18n / locales
- Settings
- Accessibility (keyboard, screen readers, zoom, contrast)
- Web app (ytgenerator.stream)
- Desktop (Tauri)
- Android
- Documentation
validations:
required: true
+19 -2
View File
@@ -20,9 +20,12 @@
- [ ] `npm run typecheck` and `npm run typecheck:all` pass
- [ ] `npm run lint` and `npm run format:check` pass
- [ ] `npm run validate:locales` passes — new strings are in all 8 locales (en, vi, ja, es, ko, zh, pt-BR, id)
- [ ] `npm run test:run` passes, with tests for the change
- [ ] `npm run test:coverage` passes, with tests for the change
- [ ] `npm run knip` passes — no unused files, exports or dependencies
- [ ] `npm run check:version`, `check:tauri`, `check:licenses` and `check:copyright` pass
- [ ] `npm run build && npm run check:bundle` stay within budget
- [ ] Touched `src-tauri/`: `cargo fmt --check`, `cargo clippy -- -D warnings`, `cargo test`
- [ ] Touched `worker/` or `wrangler.jsonc`: `npm run cf:check`
- [ ] Touched `src-tauri/`: `cargo fmt --check`, `cargo clippy --all-targets --locked -- -D warnings`, `cargo test`
- [ ] No secrets, credentials, or PII committed
- [ ] No new runtime dependencies without prior discussion in an issue
- [ ] Commit messages follow `type(scope): message`
@@ -39,6 +42,20 @@ If this PR touches the UI, attach screenshots or short recordings at:
Otherwise delete this section.
-->
## Accessibility
<!--
If this PR touches the UI, check each item (see ACCESSIBILITY.md#for-contributors).
Otherwise delete this section.
-->
- [ ] Works with the keyboard alone: logical focus order, visible focus, Esc closes, no focus trap
- [ ] Every control has a name and every field a label (`Field`, `IconButton`); new `aria-label` text is in all 8 locales
- [ ] Errors and status changes are announced (alert banner, toast or live region)
- [ ] Colour is not the only signal; design tokens only, and the contrast test passes
- [ ] New animation respects reduced motion; targets are at least 24 × 24 px
- [ ] Checked once with a screen reader (Narrator, VoiceOver, NVDA or Orca)
## AI-Assisted Contribution
- [ ] Yes — AI tool used: <!-- e.g. Claude Code (Claude Opus 5.5), Cursor, GitHub Copilot -->
+19 -2
View File
@@ -21,6 +21,17 @@
# other long-standing one, left the tree in v1.0.0 when tauri 2.12 dropped
# kuchikiki.)
#
# The npm side has the opposite case, a fix Dependabot cannot reach: miniflare
# (under wrangler, dev only) pins `undici` to an exact version, so the security
# job fails with `security_update_not_possible` and `overrides` in package.json
# lifts it instead:
#
# undici 7.29.1 (fix: 7.30.1, alert #49) pinned by
# miniflare 5.x (every release up to 5.20261019.2-beta)
#
# Remove the override once a wrangler release brings undici >= 7.30.1 on its
# own (`npm view miniflare@<version> dependencies.undici`).
#
# Tauri moves in lockstep: the tauri CLI refuses to build when the
# @tauri-apps/* npm packages and the tauri crates differ in major.minor. When
# the `tauri` npm group arrives, run `cargo update -p tauri` (and the plugin
@@ -66,6 +77,12 @@ updates:
]
cloudflare:
patterns: ["wrangler", "@cloudflare/*"]
# TypeScript 7 (`tsc`) and the TypeScript 6 API that typescript-eslint
# still needs, installed side by side as npm aliases (see package.json).
# Dependabot may not resolve `npm:` aliases — if no PR shows up for a new
# 7.x, bump both by hand.
typescript:
patterns: ["typescript", "@typescript/*"]
lint-and-format:
patterns: ["eslint*", "@eslint/*", "typescript-eslint", "prettier*", "knip"]
build-tooling:
@@ -89,8 +106,8 @@ updates:
patterns: ["@types/*"]
ignore:
# Majors land in their own planned release because each one needs a real
# migration (TypeScript 7, Vitest 5 and lucide-react 1 are the current
# examples). Dependabot handles minor + patch.
# migration (Vitest 5 is the current example). Dependabot handles minor +
# patch.
- dependency-name: "*"
update-types: ["version-update:semver-major"]
+70 -5
View File
@@ -6,8 +6,9 @@ on:
pull_request:
branches: [main]
# Least privilege. The job only reads the repo — it publishes nothing, comments
# nowhere. Declaring it explicitly also silences CodeQL's
# Least privilege. The jobs only read the repo — they publish nothing on
# GitHub and comment nowhere (SonarCloud's own GitHub app reports on PRs, with
# its own permissions). Declaring it explicitly also silences CodeQL's
# `actions/missing-workflow-permissions`, which otherwise flags the implicit
# (and much wider) default token scope.
permissions:
@@ -31,11 +32,21 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
cache: npm
- run: npm ci
# No dependency lifecycle scripts, in every workflow. The only packages
# that have one (esbuild, workerd, fsevents) take their native binary
# from optionalDependencies; the script only double-checks it.
- run: npm ci --ignore-scripts
# `tsc` must be TypeScript 7 (@typescript/native). The `typescript` alias
# (@typescript/typescript6, the API typescript-eslint loads) pulls in
# TypeScript 6 as @typescript/old, which ships a `tsc` too — npm links the
# first one by path order. Fail loudly if that ever flips, instead of
# silently type-checking with 6.
- name: TypeScript 7 is the `tsc` on PATH
run: ./node_modules/.bin/tsc --version | grep -q '^Version 7\.'
# --- correctness ------------------------------------------------------
# `typecheck` covers src/ (what Vite builds); `typecheck:all` adds tests/,
@@ -51,6 +62,14 @@ jobs:
# Coverage thresholds for src/engine and worker live in vitest.config.ts.
- name: Test (with coverage thresholds)
run: npm run test:coverage
# The LCOV report the `sonarcloud` job hands to SonarCloud.
- name: Keep the coverage report for SonarCloud
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: coverage
path: coverage/lcov.info
if-no-files-found: error
retention-days: 1
# --- consistency ------------------------------------------------------
- name: Check formatting
@@ -93,4 +112,50 @@ jobs:
# Validates wrangler.jsonc and bundles the Worker exactly as Workers
# Builds will — without deploying anything.
- name: Dry-run the Cloudflare deploy
run: npx wrangler deploy --dry-run --outdir .wrangler/dry-run
run: npm run cf:check
# SonarCloud, CI-based: issues, duplication and the coverage from `check`,
# judged by the quality gate (settings in sonar-project.properties).
# Automatic Analysis is off in the project's settings, so this is the only
# analysis. A job of its own so that SONAR_TOKEN never shares a job with
# npm packages: it only checks out, takes the coverage report and runs the
# scanner.
#
# PRs from forks and from Dependabot get no repository secrets (Dependabot
# PRs get the Dependabot secrets, which hold no SONAR_TOKEN), so they skip
# it and main is analysed once they merge. The PR author, not
# `github.actor`, decides — the actor can be spoofed (zizmor: bot-conditions).
sonarcloud:
needs: check
if: >-
github.event_name == 'push' ||
(github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login != 'dependabot[bot]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Full history: SonarCloud tells new code from old by git blame.
fetch-depth: 0
persist-credentials: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: coverage
path: coverage
# New code is "since the previous version": each release starts a new
# period, and SonarCloud learns the version from here.
- name: Read the app version
id: version
run: |
version="$(jq -r .version package.json)"
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::package.json version \"$version\" is not X.Y.Z"
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: SonarCloud scan
uses: SonarSource/sonarqube-scan-action@d209202bc7d53ff1cc128f7f907dac145c9d6ae9 # v8.3.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: -Dsonar.projectVersion=${{ steps.version.outputs.version }}
+7 -8
View File
@@ -23,13 +23,13 @@ jobs:
with:
ref: ${{ github.event.inputs.tag || github.ref }}
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
# by any other workflow must not be able to feed into them.
package-manager-cache: false
- run: npm ci
- run: npm ci --ignore-scripts
- run: npm run typecheck
- run: npm run test:run
- run: npm run check:version
@@ -56,14 +56,14 @@ jobs:
persist-credentials: false
# No dependency caches in a release job (see release-desktop.yml).
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
# by any other workflow must not be able to feed into them.
package-manager-cache: false
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: temurin
java-version: "17"
@@ -74,13 +74,12 @@ jobs:
run: sdkmanager "ndk;27.3.13750724"
# A master commit, not the regenerated `stable` branch — see rust.yml.
- uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: stable
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
- run: npm ci
- run: npm ci --ignore-scripts
- name: Install Tauri CLI
run: cargo install tauri-cli --version "^2" --locked
@@ -112,7 +111,7 @@ jobs:
# Keep the APK regardless of whether the release upload works, so a
# broken upload never costs a 20-minute rebuild.
- name: Upload APK as workflow artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ytdescgen-android-apk
path: src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
+10 -6
View File
@@ -27,13 +27,13 @@ jobs:
with:
ref: ${{ github.event.inputs.tag || github.ref }}
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
# by any other workflow must not be able to feed into them.
package-manager-cache: false
- run: npm ci
- run: npm ci --ignore-scripts
- run: npm run typecheck
- run: npm run test:run
- run: npm run check:version
@@ -64,7 +64,11 @@ jobs:
target: x86_64-pc-windows-msvc
# Default Windows bundles: MSI + NSIS (.exe). Both ship.
bundleArgs: ""
- os: macos-14
# Apple silicon. GitHub retired the macOS 14 image on 2026-11-02
# (`macos-14` jobs are cancelled: "The configuration
# 'macos-14-arm64-us-default' is not supported"); macos-15 is
# its direct successor.
- os: macos-15
target: aarch64-apple-darwin
# macOS DMG bundling on hosted runners flakes inside
# `bundle_dmg.sh` (the AppleScript that sets icon
@@ -93,14 +97,14 @@ jobs:
persist-credentials: false
# No dependency caches in a release job: a poisoned cache entry written
# by any other workflow would otherwise flow straight into the binaries.
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
# by any other workflow must not be able to feed into them.
package-manager-cache: false
# A master commit, not the regenerated `stable` branch — see rust.yml.
- uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: stable
targets: ${{ matrix.target }}
@@ -114,7 +118,7 @@ jobs:
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf
- run: npm ci
- run: npm ci --ignore-scripts
- uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+4 -4
View File
@@ -39,20 +39,20 @@ jobs:
# Pinned to a commit on master, with the toolchain passed explicitly: the
# action's `stable` branch is regenerated from master, which orphans any
# SHA pinned there (zizmor: impostor-commit). Master keeps its history.
- uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: src-tauri
# tauri::generate_context!() embeds the frontend at compile time, so
# clippy and the tests need a built dist/.
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: npm ci --ignore-scripts
- run: npm run build
- name: rustfmt
working-directory: src-tauri
+2 -2
View File
@@ -48,7 +48,7 @@ jobs:
with:
args: -color
- name: zizmor
uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
uses: zizmorcore/zizmor-action@53290badfa369cb0bf7ad16342cb62c2fa47ac7b # v0.8.0
with:
# Report in the log and fail the job; no SARIF upload, so findings
# are fixed in the PR instead of piling up as code-scanning alerts.
@@ -69,7 +69,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
- uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
with:
results_file: scorecard.json
results_format: json
+5
View File
@@ -28,3 +28,8 @@ src-tauri/gen/android/app/build/
.dev.vars
.dev.vars.*
!.dev.vars.example
# Maintainer's local notes and Python caches — never committed (CLAUDE.md)
note.txt
warning.txt
__pycache__/
+1 -1
View File
@@ -1 +1 @@
22
26
+127
View File
@@ -0,0 +1,127 @@
# Accessibility
**Last updated:** 2026-11-09
YTDescGen should work for everyone who makes videos, including people who use a keyboard instead of a mouse, a screen reader, zoom or magnification, high-contrast modes, voice control or a touch screen. This statement says what works today, how it is checked, what doesn't work yet, and how to tell us about a barrier.
It covers the website at [ytgenerator.stream](https://ytgenerator.stream), the desktop apps (Windows, macOS, Linux) and the Android app. They share one interface, so what is said here applies to all of them unless a platform is named.
## Our goal
We aim for [WCAG 2.2](https://www.w3.org/TR/WCAG22/) level **AA**. That is a goal, not a claim of conformance: YTDescGen is a solo open-source project and has not had an independent audit. When we find something that falls short, it is fixed or listed under [Known limitations](#known-limitations).
## What works today
### Keyboard
- Every page, menu and dialog works with the keyboard alone. **Skip to content** is the first stop on the app's pages, and a visible outline shows where the focus is.
- Dialogs keep the focus inside while they are open, close with **Esc**, and give the focus back to the control that opened them.
- Shortcuts work on every page:
- **Ctrl/⌘ + K**: command palette (any page, copy, profiles, presets, templates, theme, languages).
- **Ctrl/⌘ + G** or **Ctrl/⌘ + Enter**: Output.
- **Ctrl/⌘ + Shift + C**: Copy All.
- **Ctrl/⌘ + S**: save to History.
- **Ctrl/⌘ + B**: sidebar.
- **Alt + T**: notifications.
- **Ctrl/⌘ + /** (or **?**): the full list.
- The single-key **?** shortcut can be turned off in **Settings › Editor › Single-key shortcuts**, for speech input and stray key presses.
### Screen readers
- Every control has a name, including icon-only buttons, and every field has a label. Hints and errors are tied to their field.
- Confirmations and errors are announced ("Copied!", "Saved to History", why something can't be copied), and so are Strict Mode problems.
- After you open another page, its name is read out. The focus stays on the link you used.
- Each page has its own title and a single main heading, and the page language follows the interface language you pick (eight languages).
- Generated titles, descriptions and tags are marked with the language they were written in, so a Japanese description is read with a Japanese voice even when the interface is in English.
### Vision
- Dark and light themes, both at WCAG AA contrast for text (4.5:1) on every background. A test keeps them there ([tests/styles/contrast.test.ts](tests/styles/contrast.test.ts)).
- The layout reflows from wide screens down to phone width, so zooming in moves content into one column instead of off the screen.
- The desktop apps zoom with **Ctrl/⌘ + =** and **Ctrl/⌘ + −** (Ctrl + mouse wheel works on Windows too). On Android, pinch to zoom.
- In Windows High Contrast (forced colours), the focus outline stays visible.
- **Settings › Appearance › Hide scrollbars** removes the scrollbars; scrolling still works with the keyboard, mouse wheel and touch.
### Motion
- With **Reduce motion** turned on in your operating system, animations and smooth scrolling are switched off.
### Touch
- On touch screens, buttons and fields grow to about 44 px, and so do small close and dismiss buttons.
### The website's check page
- The Cloudflare Turnstile check before the website usually finishes on its own. Its status ("Checking your browser…", errors) is announced, and it works with the keyboard. See [Known limitations](#known-limitations) if Cloudflare asks you to solve a challenge.
## How it is checked
- **By hand.** The maintainer uses YTDescGen with the keyboard alone (mouse unplugged) and with Windows Narrator, through the main flows: editor, output, copying, profiles, presets, templates, History, Settings and backups.
- **Automatically.** A unit test checks the contrast of every colour token in both themes.
- **Design rules.** Interface parts come from accessible building blocks (Radix primitives). An icon-only button can't be built without a name, and every field gets its label and error wiring from one shared component.
The app has **not** been tested yet with NVDA, JAWS, VoiceOver (macOS), TalkBack (Android) or Orca (Linux). Reports from people who use them are very welcome.
## Supported environments
| Platform | Runs on | Screen reader |
| --- | --- | --- |
| Windows: desktop app, or the website in Edge / Chrome | Windows 10 or 11 with WebView2; Chrome or Edge 111+ | Narrator: tested |
| Website on other browsers | Firefox 114+, Safari 16.4+ | Not tested yet |
| macOS desktop app | macOS 11 or later, Apple silicon | VoiceOver: not tested yet |
| Linux desktop app | WebKitGTK 2.40 or later | Orca: not tested yet |
| Android app | Android 11 or later, current Android System WebView | TalkBack: not tested yet |
## Known limitations
- **Cloudflare's challenge on the website.** If Turnstile asks you to solve a challenge instead of passing on its own, that challenge is Cloudflare's, and its accessibility is theirs to fix. If it stops you, the desktop and Android apps have no check page at all, or [email us](#reporting-a-barrier).
- **Field borders are faint.** The outline of an empty text field is about 1.2–1.3:1 against the page, under the 3:1 that WCAG asks for. Fields are still marked by their labels, and the focused field gets an accent border and ring.
- **The Continue button on the first-run screen** uses the brand gradient. White text on its lighter violet end is 3.96:1.
- **Character counters are not read out as you type.** That would interrupt every keystroke. When a field is over YouTube's limit, copying it is refused with a message that says why, and Strict Mode lists the problem in an announced banner.
- **No automated accessibility linting yet.** `eslint-plugin-jsx-a11y` does not support ESLint 10, which the project uses, and the unit tests run without a browser DOM. Checks are manual (see above) apart from the contrast test.
- **Translations.** Interface languages other than English and Vietnamese were translated with AI assistance (see the [Disclaimer](DISCLAIMER.md)). Some labels may sound unnatural when read aloud.
- **Emoji in descriptions.** Generated descriptions use a few emoji as section markers (for example 👍 and 🔔), and screen readers on YouTube read them out by name.
## Reporting a barrier
If something in YTDescGen gets in your way, please tell us. You don't need to know what causes it.
- **Preferred:** open an [accessibility issue](https://github.com/poli0981/youtube-generator/issues/new?template=accessibility.yml). The form asks for the platform, the assistive technology you use and what happened.
- **Not comfortable posting publicly?** Email **contact@poli0981.dev** with `[Accessibility]` at the start of the subject.
- **Quick question?** Ask on [Discord](https://discord.gg/kDM9GMu5vm).
### Severity
| Level | Meaning |
| --- | --- |
| **Critical** | You can't finish a core task: write, generate, copy, save, or get past the website's check. |
| **High** | You can finish it, but only with real difficulty or a workaround. |
| **Medium** | It works, but inconsistently or confusingly. |
| **Low** | A minor annoyance that doesn't stop you. |
### How we respond
- We reply within **7 days**, and we will take your report at face value.
- **Critical** barriers are fixed in the next patch release. Others are planned like any other bug, with the more severe first.
- If there is a workaround, we tell you while the fix is on its way.
- When the fix ships, we'll ask you to check it if you're willing.
This is a one-person project, so timelines are honest estimates, not guarantees. If one slips, we'll say so in the issue.
## For contributors
Changes to the interface should keep everything above true. Before opening a pull request that touches the UI:
- **Keyboard.** Everything works with the keyboard: the focus order makes sense, the focus outline is visible, **Esc** closes what you opened, and nothing traps the focus.
- **Names.** Use the shared `Field` (label, hint and error wiring) and `IconButton` (which can't be rendered without a `label`) components. `aria-label` text goes through `t()` like any other string, in all eight locales.
- **Errors and status.** They are announced: `Banner` with `alert`, a toast, or an existing live region.
- **Colour.** Colour is never the only signal. Use the design tokens only, and run `npm run test:run`. The contrast test fails if a token drops under AA, and white text belongs on the `*-solid` fills.
- **Motion.** New animation respects reduced motion. Motion's components do this already, and CSS animations are covered by the global rule in `globals.css`.
- **Targets.** Anything clickable is at least 24 × 24 px and grows on touch screens.
- **Screen reader.** Try the change once with a screen reader: Narrator (Win + Ctrl + Enter), VoiceOver (⌘ + F5), NVDA or Orca.
The pull request template has the same checklist.
## Feedback on this statement
Ideas for improving this statement or the way accessibility is handled are welcome in [GitHub Discussions](https://github.com/poli0981/youtube-generator/discussions). Please report barriers through the [reporting process](#reporting-a-barrier) so they can be tracked.
+198
View File
@@ -2,6 +2,204 @@
All notable changes to YTDescGen ship as tagged releases on `main`.
## v1.5.1 — 2026-11-09
An **accessibility** release. YTDescGen already worked with the keyboard alone and with Narrator; this release adds an accessibility statement and fixes what an audit against WCAG 2.2 AA turned up — colour contrast, the language of generated text, page changes a screen reader didn't hear, a single-key shortcut that couldn't be turned off, and zoom in the desktop app. Web, desktop and Android all ship as 1.5.1.
### Added
- **[ACCESSIBILITY.md](ACCESSIBILITY.md)** — what works with a keyboard, screen readers, zoom, reduced motion and touch, how it is checked, the supported environments, known limitations, how to report a barrier (severity levels, a reply within 7 days, Critical fixes in the next patch) and a checklist for contributors. Also in Vietnamese, in the app's **Legal Center**, at `ytgenerator.stream/legal/accessibility`, and linked from the website's check page in all eight languages.
- **Accessibility barrier** issue form on GitHub (assistive technology, severity, platform), an _Accessibility_ option in feature requests, and an accessibility checklist in the pull request template.
- **Settings › Editor › Single-key shortcuts** — on by default; turning it off stops the bare `?` from opening the shortcut list (for speech input and stray key presses), and Ctrl/⌘ + / still opens it. Travels with backups.
- **Zoom in the desktop app** — Ctrl/⌘ + = and Ctrl/⌘ + − (and Ctrl + mouse wheel on Windows).
- **The page's name is read out** after you open another page; the focus stays on the link you used.
- **Alt + T** (go to the notifications) in the shortcut list.
### Changed
- **Colours reach WCAG AA (4.5:1) for text** in both themes: secondary "muted" text (hints, placeholders, counters) is lighter in the dark theme and darker in the light theme; the dark theme's accent is a little lighter; filled buttons with white text use a deeper purple and red; the light theme's success, warning, danger and donate colours are darker. A test now checks every colour token against every background.
- Generated titles, descriptions, tags, captions and playlist text are marked with the **language they were written in**, so a screen reader reads Japanese output with a Japanese voice while the interface is in English or Vietnamese — on Output, the On YouTube and Quick previews, History, Batch, Social and Playlist.
- The Legal Center's intro mentions accessibility.
### Fixed
- The notifications area and its close button were announced in English ("Notifications alt+T", "Close toast") whatever the interface language.
- The Endings table's number and name fields and the per-video From / To fields had no accessible name, and the From / To column headers were always English; the bank name typed under _Other_ had only a placeholder.
- In Windows High Contrast, text fields showed no focus outline.
- The genre chips' remove button was 20 px (now 24 px); dialog close and banner dismiss buttons grow on touch screens.
- `SECURITY.md` still listed 1.3.x as the supported version.
### Under the hood
- New tokens `accent-solid`, `accent-solid-hover`, `danger-solid`, `danger-solid-hover`; `tests/styles/contrast.test.ts` reads both palettes from `globals.css` (text tokens on surface-0 to 2, muted also on surface-3, accent on its own tint, white on the solid fills, 3:1 for marks on `accent`). It found the light theme's donate colour at 4.26:1 on the first run.
- `RouteAnnouncer` listens for `ytdescgen:page-title`, which `useDocumentTitle` fires in a microtask after the commit's effects, so pages rendered in the same commit and lazy pages are both heard and a language switch stays silent.
- `singleKeyShortcuts` is an additive setting, healed (anything but a boolean → `true`) without a store version bump, like `hideScrollbars`.
- Text controls use Tailwind's `outline-hidden` instead of `outline-none`. `zoomHotkeysEnabled` on the main window, plus `core:webview:allow-set-webview-zoom` for Tauri's macOS / Linux zoom polyfill.
- Legal Center doc `accessibility` (`consent: false`, English + Vietnamese); `GateStrings.accessibility` in the Worker; the `accessibility` label on GitHub. New keys in all eight locales and `_schema.json`.
- **Docs**: ACCESSIBILITY.md (+ Vietnamese), README, CONTRIBUTING, DEVELOPMENT (+ Vietnamese), FEATURES (accessibility section, shortcuts, settings), ARCHITECTURE, TECH-SPEC, PACKAGING, ROADMAP, CLAUDE.md, SECURITY, version references.
- typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, check:tauri, check:licenses, check:copyright, **1131 tests** (was 1093), build, cf:check and `cargo fmt` / `clippy` / `test` all pass; initial load 279.0 of 280 KB gzip. Verified in the dev server: Settings → Output announces "Settings", then "Output", without moving the focus, and switching to Vietnamese doesn't announce; the notifications region reads "Thông báo (Alt+T)" in Vietnamese; Japanese output under a Vietnamese interface carries `lang="ja"`; with the switch off `?` does nothing and leaves the list while Ctrl + / still opens it; `/legal/accessibility` in both languages with every in-page link resolving. In the desktop app (`tauri dev`, WebView2): Ctrl + = zooms to 110 %, Ctrl + − back to 100 %.
- Six manifests bumped 1.5.0 → 1.5.1.
## v1.5.0 — 2026-11-08
A feature release for videos **upscaled in the editor**: recorded at 1440p, exported at 4K — the title says `[4K Upscaled]`, the description says what was upscaled to what and warns that fine detail may look different from the original image. Web, desktop and Android all ship as 1.5.0.
### Added
- **Upscaled from** (Video settings), next to Resolution — the resolution the footage was recorded at, when the video editor upscaled it to the video's resolution. Only lower resolutions are offered (none at 720p); lowering the resolution to or below the source sets it back to _Not upscaled_. Like resolution and FPS, it is saved with the channel profile. With it set:
- **Title** — the quality badge reads `[4K Upscaled]`, `[2K Upscaled]` (1440p), `[4K Upscaled 120FPS]`, the word in the output language (`Upscale` in Vietnamese, Portuguese and Indonesian, `アップスケール`, `업스케일`, `超分`, `Reescalado`). Badge position, case and _Show quality badge_ work as before; 1080p 60fps still has no badge, upscaled or not.
- **🖥 VIDEO SETTINGS** — a line right under the resolution, the editor taken from My Rig (left out when My Rig has none):
```
Video: 4K - 60 FPS
Upscale: 1440p → 4K (DaVinci Resolve Studio 21.2)
```
It stays when _This game has no in-game graphics settings_ is on, like the video-style line.
- **▸ 🛠 TECH NOTES** — a note of its own, after the ones you picked and bilingual like them: _Upscaled to a higher resolution in editing — fine detail is reconstructed, so text, textures and edges may look slightly different from the original image._ It isn't in the checklist, so it can't be forgotten, and it goes away with the upscale. The DLSS / FSR / XeSS note is unchanged.
- The collapsed Video settings section reads `1440p → 4K · 60 FPS`.
### Under the hood
- `src/engine/upscale.ts`: `validUpscaleSource` is the one rule the title, the description and the form share — anything other than a known resolution below the video's is ignored. `VIDEO_RESOLUTIONS`, `UPSCALED_FROM_OPTIONS` and `isUpscaledFrom` live in `src/config/graphics-settings.ts`.
- `AUTO_TECH_NOTES` (`editor_upscaled`) holds the engine's own notes: never stored in `techNotes`, their bullets share `description.techNotes.items`; the tech-note parity test checks the checklist and the bullets separately.
- Editor store v20 → v21: `upscaledFrom` back-fills to `""` and an unknown value becomes `""`; an applied profile or template and a restored backup read one the same way. `Profile.upscaledFrom` is optional, so the profile store stays at v3. New keys in all eight locales and `_schema.json`.
- **Docs**: FEATURES (upscaled video, the badge setting, the profile row), CONTENT-INVENTORY (+ Vietnamese: the automatic note), ARCHITECTURE and TECH-SPEC (`upscale.ts`, the field, store v21, test count), ROADMAP, CLAUDE.md, version references.
- typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, check:tauri, check:licenses, check:copyright, **1093 tests** (was 1065), build all pass; initial load 277.8 of 280 KB gzip. Verified in the dev server: Elden Ring at 4K upscaled from 1440p with DaVinci Resolve Studio 21.2 in My Rig gives `Elden Ring — [4K Upscaled] — Gameplay No Commentary`, the Upscale line under `Video: 4K - 60 FPS` and the note; Vietnamese output gives `[4K Upscale]` and the `EN · VI` note; 1080p sets the field back to _Not upscaled_, 720p disables it; hidden graphics settings keep the Upscale line; the four selects sit in one column at 375 px, 2 × 2 at 1024 px and in a row at 1440 px.
- Six manifests bumped 1.4.0 → 1.5.0.
## v1.4.0 — 2026-11-06
A feature release for the description and the tags: a **LUT** field in My Rig, printed on its own line under the video editor, and the **boss's name as a tag** in boss videos — plus this week's dependency updates. Web, desktop and Android all ship as 1.4.0.
### Added
- **LUT** (My Rig) — the LUT you grade with, on its own line right under the video editor, in the description and the social captions:
```
Video Editor: DaVinci Resolve Studio 21.2
LUT: Arri Alexa LogC to Rec709
```
Typing offers 14 LUTs that come with DaVinci Resolve, named the way its LUT menu shows them (Arri Alexa LogC to Rec709, the Rec709 Kodak 2383 and Fujifilm 3513DI film looks, HDR 1000 nits to Gamma 2.4, …); any other name is printed as typed. A pasted file name or path — Explorer's _Copy as path_ included — is cut down to the LUT's name: `"C:\…\Arri\Arri Alexa LogC to Rec709.dat"` → `Arri Alexa LogC to Rec709`. Like the rest of the rig, it is saved with the channel profile. Left empty, there is no line.
- **The boss's name as a tag** — Boss Fight and Boss No Hit videos get the Boss Name field as a tag of its own, right after the game's name, so fitting the tags to 500 characters never drops it. Marks that add nothing to a search are left out: "Gael, Slave Knight" → `Gael Slave Knight`, "Mr. X" → `Mr X`, "S.T.A.L.K.E.R." → `STALKER`, "「マレニア」" → `マレニア`; apostrophes and hyphens inside a word stay ("Mergo's Wet Nurse", "T-103"), and so does a dot between digits ("Phase 2.0"). Over 30 characters (YouTube's per-tag limit here), the name before its title is used: "Loretta, Knight of the Haligtree" → `Loretta`. A boss name left in the draft after switching to another video type is not tagged.
### Fixed
- A **CPU name pasted from Windows** ("Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz") is tidied in the output too, not only once you leave the field — Ctrl/⌘+Shift+C or Ctrl/⌘+S pressed with the cursor still in it copied or saved the raw name. The new LUT field works the same way.
### Under the hood
- **Dependencies**, the newest releases at least a week old (Dependabot's cooldown): i18next 26.5.11, react-i18next 17.1.9, lucide-react 1.64, zustand 5.0.16, knip 6.44, wrangler 4.152 (miniflare 5.20261019.2-beta), @tauri-apps/cli 2.12.4. Dependabot's five npm PRs (#223–#227) were folded into one change: each failed CI alone because it left THIRD_PARTY_NOTICES stale (regenerated), and they would have conflicted with each other. GitHub Actions: Swatinem/rust-cache 2.9.3, zizmor-action 0.8.0. The undici override stays — miniflare still pins undici 7.29.1.
- Dependabot alert #50 (minimatch, development tools only, through eslint and typescript-eslint) stays open for now: its fix is minimatch 11, a new matching engine outside eslint's `^10` range, and the issue needs attacker-controlled glob patterns, which lint never reads.
- `RigField` gains `clean` (CPU, LUT) and `wide`; `formatRigValue` runs a field's cleaner; a test now holds the `rig.*` and `description.rigLabels.*` keys of all eight locales to `RIG_FIELDS`. `bossNameTag` in `tag-generator.ts` uses linear regexes and no lookbehind (the macOS 11–13 desktop webview is older WebKit, which rejects one); its word fit is shared with `tagFriendlyGameName`.
- **Docs**: FEATURES (11 rig fields, the LUT, the boss name tag), ARCHITECTURE (tag priority), TECH-SPEC (rig block, tag order, test count), ROADMAP, version references.
- typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, check:tauri, check:licenses, check:copyright, **1065 tests** (was 1017), build, cf:check all pass; initial load 277.2 of 280 KB gzip. Verified in the dev server: the LUT field sits under Video Editor across both columns with its suggestions, a quoted Explorer path becomes the LUT's name when the field loses focus, and Quick Preview prints `LUT: Arri Alexa LogC to Rec709` right after `Video Editor: DaVinci Resolve Studio 21.2`; Boss Fight with "Gael, Slave Knight" puts `Gael Slave Knight` second in the tags, Full Gameplay drops it. `wrangler dev` on 4.152 serves the gate page.
- Six manifests bumped 1.3.2 → 1.4.0.
- **The macOS app is built on the `macos-15` runner.** GitHub retired the macOS 14 image on 2026-11-02, so the tag's first desktop run lost its macOS job ("The configuration 'macos-14-arm64-us-default' is not supported"); the Windows and Linux builds were unaffected. The macOS `.app.tar.gz` comes from a manual re-run of the desktop workflow for `v1.4.0`, which builds the tag's code.
## v1.3.2 — 2026-10-27
A hosting release: the website now **rate-limits** each visitor's address, so a script hammering ytgenerator.stream gets a cheap `429 Too Many Requests` instead of the gate, the app or a Turnstile check. Nothing a person does in normal use comes near the limits. The desktop and Android apps are unchanged apart from the version number. Web, desktop and Android all ship as 1.3.2.
### Added
- **Rate limiting for the website**, in two layers:
- **In the Worker** (Workers Rate Limiting bindings in `wrangler.jsonc`, checked before anything else): 120 requests a minute per address for everything the Worker serves — the gate page, the app shell, the legal pages, the gate's own endpoints — and 10 a minute for the gate's verification call, each of which costs a call to Cloudflare Turnstile. An IPv6 address counts by its /64, the block one connection usually holds. Over the limit: `429` with `Retry-After: 60`; the gate page shows its usual "try again" message.
- **At the zone**: a WAF rate limiting rule (60 requests per 10 seconds per address, build output and verified search-engine bots left out) stops a fast burst at Cloudflare's edge, before the Worker runs. It is set in the Cloudflare dashboard; [HOSTING.md](docs/HOSTING.md#waf-rate-limiting-rule-one-time) has the steps.
- Like the Turnstile gate, the Worker's limiter fails open: if it is missing or fails, the site stays reachable and the Worker logs it.
### Under the hood
- `worker/rate-limit.ts` (client key, the check, the `429`), wired in first in `worker/router.ts`; a test keeps the `ratelimits` bindings and their period in step with the code.
- **Docs**: HOSTING (both layers, the WAF rule step by step, changing a limit, burst checks against production), TECH-SPEC, ARCHITECTURE, CLAUDE.md, ROADMAP, version references.
- typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, check:tauri, check:licenses, check:copyright, **1017 tests** (was 984), build, cf:check all pass; initial load 276.3 of 280 KB gzip. Verified live with `wrangler dev` (10 verification calls then `429`, 120 requests a minute then `429`, back to normal a minute later) and on ytgenerator.stream after the deploy: page loads at four a second, under the WAF rule, got 121 × `200` then the Worker's `429` with `Retry-After: 60`; verification calls got 11 × `403` (foreign origin) then `429`; a fast burst was stopped by the WAF rule (Cloudflare's `429`, error 1015) within about a second.
- Six manifests bumped 1.3.1 → 1.3.2.
## v1.3.1 — 2026-10-26
A maintenance release: the desktop and Android apps move to **Tauri 2.12.4**, the desktop's Save and Open dialogs stop holding up the app's background work, and this week's dependency updates close the one open security alert. What the app generates does not change. Web, desktop and Android all ship as 1.3.1.
### Fixed
- **Desktop: saving and opening files.** The native Save / Open dialogs (exporting and importing text files, backups to a file) and their file read or write now run on Tauri's blocking pool. Before, each one held one of the async runtime's worker threads for as long as the dialog stayed open. Same dialogs, same results.
- **Tauri 2.12.0 → 2.12.4**, with upstream fixes that reach the app: no panic in the IPC and asset handlers on a request with an empty path; on Android, a plugin call that answers after its caller gave up no longer aborts the app; `Channel` messages keep arriving after a handler throws; a `once` event listener no longer panics when two events arrive together. Plugins: dialog 2.8.3, opener 2.7.2, single-instance 2.5.4, fs 2.7.1.
- **Security (development tools only — nothing here ships in the app):** undici 7.30.1 — alert #49 (denial of service through too many content encodings), used by `wrangler dev` through miniflare. miniflare pins undici exactly, so Dependabot's security update could not land; an npm `overrides` entry lifts it, and `.github/dependabot.yml` says when to remove it.
### Under the hood
- **SonarCloud runs in CI** instead of Automatic Analysis: the `sonarcloud` job reads the coverage report from `check`, counts tests as tests, and analyses the Rust code for the first time — which is how the dialog issue above was found. Quality gate green, 0 open issues.
- **Dependencies**, the newest releases at least a week old (the same cooldown Dependabot uses): react 19.3.1, i18next 26.5.3, react-i18next 17.1.0, lucide-react 1.59, simple-icons 16.35, eslint 10.13, typescript-eslint 8.72, knip 6.42.1, postcss 8.5.31, @types/node 26.6.5, wrangler 4.151.2; tauri 2.12.4, tauri-build 2.7.3. THIRD_PARTY_NOTICES regenerated.
- **Docs**: CLAUDE.md and PACKAGING (blocking work in an `async` Tauri command goes through `spawn_blocking`), DEVELOPMENT + Vietnamese, TECH-SPEC and CONTRIBUTING (the SonarCloud job and its coverage scope), ROADMAP, version references.
- typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, check:tauri, check:licenses, check:copyright, **984 tests**, build, cf:check and `cargo fmt` / `clippy` / `test` (15 tests) all pass; initial load 276.3 of 280 KB gzip. Verified live: `wrangler dev` serves the gate page on the new undici; the desktop app (`tauri dev` with a separate test identifier) answers its commands, writes, reads and deletes a backup, and opens and cancels the native Save dialog.
- Six manifests bumped 1.3.0 → 1.3.1.
## v1.3.0 — 2026-10-22
A toolchain release: **TypeScript 7**, **Node 26**, two rounds of dependency updates that close five security alerts, and every open **SonarCloud** issue fixed. What the app generates does not change. Web, desktop and Android all ship as 1.3.0.
### Changed
- **Android keeps your data out of cloud backups.** The app now sets `android:allowBackup="false"`, so Android's backup to Google Drive no longer copies your profiles, presets, templates, history and settings — they stay on the phone, as the Privacy Policy says. To move to a new phone, use **Settings › Backup & restore**: back up to a file, then restore it there.
- **Supported WebViews.** The desktop and Android apps are built for the same engines as the website — Chromium 111, Safari 16.4, Firefox 114 (Vite's `baseline-widely-available`) — instead of being lowered to ES2020. In practice: WebView2 on Windows (it updates itself), macOS 11 or later with current Safari updates, WebKitGTK 2.40+ on Linux, and on Android 11+ a System WebView kept current through Google Play. An older WebView already showed the app unstyled. The macOS app now states its minimum, macOS 11 (it is Apple silicon only).
- **Security policy**: 1.3.x is the supported version.
- **Docs**: DEVELOPMENT + Vietnamese (Node 26, TypeScript 7 and the IDE setting), TECH-SPEC (package.json, tsconfig, the toolchain notes), PACKAGING (supported WebViews, Android backups), HOSTING, ARCHITECTURE, ROADMAP, README, FEATURES, I18N, CONTENT-INVENTORY, DISCLAIMER + Vietnamese, CLAUDE.md, the bug-report template.
### Fixed
- **Security (development tools only — nothing here ships in the app):**
- vite 8.3.4 — `launch-editor` alerts #41, #42, #43 (command execution and Windows path checks in the dev server's open-in-editor).
- vitest 4.1.12 brings `@vitest/mocker` 4.1.12 — alerts #44, #45 (manual-mock code injection, Windows redirect traversal). Dependabot's own security update could not land: vitest 4.1.11 pins the old mocker.
- The error boundary now really falls back to the browser console when the in-app logger can't load — a `try/catch` around the asynchronous import never caught that.
- **SonarCloud: 44 open issues → 0** (the 45th, a Gradle lockfile for the Tauri-generated Android project, is accepted). Sixteen regular expressions could backtrack quadratically on long runs of spaces, colons or slashes (CPU names, timestamps, edition suffixes, endings, the Google Play link, license expressions, the Worker's cookie and paths); each is rewritten to run in linear time with the same results. Also: sorts with an explicit comparator, `Number.parseInt`, a profile migration that returns a new object, the shortcut dialog's search box focused through the dialog instead of `autoFocus`, and IDs that never fall back to `Math.random`.
### Under the hood
- **TypeScript 7.0** (the native compiler) type-checks the code — about six times faster. TypeScript 7.0 has no JavaScript API yet, so typescript-eslint keeps using TypeScript 6.0 through an npm alias (`typescript` → `@typescript/typescript6`, Microsoft's documented setup), and CI fails if `tsc` is ever anything but 7.x. Target **ES2025** (ES2026 comes with TypeScript 7.1); the app's `lib` stays at ES2022 — the browsers' floor, since Vite never polyfills — while tests, scripts, the Worker and the build plugins get ES2025. `baseUrl` is gone, and `erasableSyntaxOnly` / `verbatimModuleSyntax` are on.
- **Node 26** everywhere (`.node-version`, `engines`, Workers Builds). Vitest runs its workers with `--no-experimental-webstorage`: Node 25+ defines a `localStorage` that is `undefined`, which made 39 store tests crash.
- **React 19 refs**: Button, IconButton, Input, Select and Textarea take `ref` as an ordinary prop — no more `forwardRef`, which React plans to deprecate.
- **CI**: every workflow installs with `npm ci --ignore-scripts`; CI runs `npm run cf:check` instead of `npx wrangler`.
- **Dependencies**: eslint 10.12, typescript-eslint 8.71.2, knip 6.41, prettier 3.9.10, vite 8.3.4, @vitejs/plugin-react 6.1.2, vitest 4.1.12, marked 18.1.1, postcss 8.5.30, i18next 26.4.5, lucide-react 1.57, radix-ui 1.8.1, @tauri-apps/api 2.12.4 / plugin-opener 2.7.2 / cli 2.12.3; actions setup-node 7.1, setup-java 6.1, upload-artifact 7.0.2, scorecard 2.5, zizmor 0.7.1. THIRD_PARTY_NOTICES names the real package behind an npm alias.
- typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, check:tauri, check:licenses, check:copyright, **984 tests**, build and `cargo fmt` / `clippy` / `test` all pass; initial load 276.1 of 280 KB gzip. Verified live in the browser: tooltips, the History export popover (focus returns to its button), dialogs and the command palette after the ref change, and the shortcut dialog's focus.
- Six manifests bumped 1.2.0 → 1.3.0.
## v1.2.0 — 2026-10-12
Say when a game is **made with AI**: a new group of content warnings for AI-generated game content, three more disclosures, and the docs, notices and wiki brought back in line with the app. Web, desktop and Android all ship as 1.2.0.
### Added
- **AI-generated content** — a new content-warning group, the thirteenth, for games that are made or run with generative AI (a story _about_ AI is still "AI / artificial intelligence themes"):
- AI-generated content (general) · AI art / visuals · AI / synthetic voices · AI music / sound · AI-written text / dialogue
- **Generated live by AI while playing** — the game makes content as you play, so a viewer's own run may differ
- **AI use disclosed by the developer** — the store page says so (Steam shows an "AI Generated Content Disclosure"), so viewers know you aren't guessing
The split follows Steam's AI disclosure: content made with AI during development and shipped, and content an AI generates while the game runs. Machine translation stays a playthrough note (**Language patch → Machine translation**). YouTube doesn't ask for gameplay footage to be labelled as altered or synthetic — these lines are for viewers. In all eight output languages, next to the English line like every warning.
- **Simulated gambling** (Mature / Sensitive) and **In-game purchases** (Internet / Digital life, next to loot boxes) — the two ESRB / PEGI descriptors that had no warning.
- **Tech note: Upscaling / frame-gen artifacts** (Video quality) — "Possible upscaling / frame-generation artifacts (DLSS, FSR, XeSS)". Which upscaler and frame generation were on is already the 🖥 Video settings line; the note only warns about what they do to the footage.
257 content warnings in 13 groups, 25 tech notes — all listed in [docs/CONTENT-INVENTORY.md](docs/CONTENT-INVENTORY.md).
### Changed
- **Third-party notices** said the app uses the operating system's fonts; it bundles **Inter** and **JetBrains Mono** (OFL-1.1), and now says so. The Rust table lists every direct crate — `serde` was missing — and a crate with no known license stops the generator ([scripts/lib/third-party.ts](scripts/lib/third-party.ts)).
- **REUSE**: the Gradle wrapper under `src-tauri/gen/android/` is credited to Gradle's authors, not to the project.
- **Privacy Policy** (Effective 2026-10-12) lists the one `sessionStorage` flag, `ytdescgen-chunk-reload`, next to the `localStorage` keys. Not a material change: nobody is asked to accept the terms again.
- **Security policy**: 1.2.x is the supported version.
- **Docs**: README (contact emails by purpose, themes and scrollbars, installer sizes, the Android build step), ROADMAP (1.1.0 and 1.2.0; finished items checked off), PACKAGING (the installers' copyright, the yearly `update:copyright`, v1.1.0 sizes, `tauri info`), ARCHITECTURE and TECH-SPEC (purpose-word validation, versions, test count), FEATURES, I18N, CONTENT-INVENTORY + Vietnamese (now with the tech notes), CONTRIBUTING and the PR template (the full gate list), the issue templates, DISCLAIMER + Vietnamese, CLAUDE.md. `webapp/TAURI.md` (Node 25, no `.rpm`) is folded into PACKAGING and removed.
- **Wiki**: Home (1.2.0, what's new in 1.1 and 1.2), Field Reference (warnings and tech notes, the copyright / DMCA line and purpose words, Hide scrollbars), FAQ ("How do I say a game uses AI-generated content?"), Release Process (copyright years, the wiki step, the rust-toolchain pin).
### Under the hood
- No store version bump: the warning and tech-note lists only grow. The backup whitelist checks ids against them, so a 1.2.0 backup restores on 1.1.0 without the new ids.
- **A test fails when a content warning or tech note has no editor label or description line** in `_schema.json` — and so, through `validate:locales`, in any locale. Until now a missing key showed the raw key in the editor and silently dropped the line from the description. Tech notes also get the group-parity test content warnings already had.
- New strings in all eight locales (1,264 UI + 584 template keys each).
- typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, check:tauri, check:licenses, check:copyright, **984 tests**, build and `cargo fmt` / `clippy` / `test` all pass; initial load 275.2 of 280 KB gzip. Verified live in the browser: the new group and its search, pick order in the description, the bilingual English · Vietnamese lines and the tech note.
- `.gitignore` covers the maintainer's local `note.txt`, `warning.txt` and `__pycache__/`.
- Six manifests bumped 1.1.0 → 1.2.0.
## v1.1.0 — 2026-10-03
A small release: a **copyright email** and **purpose words** for the split contact block, an option to **hide scrollbars**, and copyright years that keep themselves current. Web, desktop and Android all ship as 1.1.0.
+48 -25
View File
@@ -11,18 +11,19 @@
## Tech Stack
| Layer | Technology |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| UI | React 19, TypeScript (strict), Radix primitives (`radix-ui`), Motion (LazyMotion), cmdk, sonner, lucide-react + simple-icons |
| Build | Vite 8 (Rolldown); config imports need `.ts` extensions |
| Styling | Tailwind CSS 4, CSS-first `@theme` tokens in `src/styles/globals.css` |
| State | Zustand 5 + `persist` (localStorage) — the only store on every platform |
| Routing | React Router 7 — `BrowserRouter` on the web, `HashRouter` in Tauri |
| i18n | i18next + react-i18next, 8 locales (en, vi, ja, es, ko, zh, pt-BR, id); `en` bundled, others lazy |
| Desktop / Android | Tauri 2 (Rust) — see `src-tauri/` |
| Web hosting | Cloudflare Workers (`worker/`, `wrangler.jsonc`), Turnstile, Web Analytics |
| Tests | Vitest (node environment; Worker tests included) |
| Quality | ESLint, Prettier, knip, coverage thresholds, bundle budget, licence allow-list, REUSE, actionlint/zizmor, cargo fmt/clippy/deny |
| Layer | Technology |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UI | React 19, TypeScript 7 (strict), Radix primitives (`radix-ui`), Motion (LazyMotion), cmdk, sonner, lucide-react + simple-icons |
| Build | Vite 8 (Rolldown); config imports need `.ts` extensions; Node 26 (`.node-version`) |
| Type checking | TypeScript 7 `tsc` (`@typescript/native`); `typescript` is an npm alias for `@typescript/typescript6`, the 6.0 API typescript-eslint loads |
| Styling | Tailwind CSS 4, CSS-first `@theme` tokens in `src/styles/globals.css` |
| State | Zustand 5 + `persist` (localStorage) — the only store on every platform |
| Routing | React Router 7 — `BrowserRouter` on the web, `HashRouter` in Tauri |
| i18n | i18next + react-i18next, 8 locales (en, vi, ja, es, ko, zh, pt-BR, id); `en` bundled, others lazy |
| Desktop / Android | Tauri 2 (Rust) — see `src-tauri/` |
| Web hosting | Cloudflare Workers (`worker/`, `wrangler.jsonc`), Turnstile, Web Analytics |
| Tests | Vitest (node environment; Worker tests included) |
| Quality | ESLint, Prettier, knip, coverage thresholds, bundle budget, licence allow-list, copyright years, REUSE, actionlint/zizmor, cargo fmt/clippy/deny, SonarCloud (CI-based) |
## Project Structure
@@ -37,16 +38,21 @@ src/
tag-generator.ts # tag pools, YouTube's tag length count, trimming
timeline-parser.ts # timestamps → chapters, YouTube's chapter rules
channel-phrase.ts # drops "on {{channel}}" when there is no channel name
rig-block.ts, limits.ts, social-post-builder.ts, pinned-comment-builder.ts, playlist-builder.ts, types.ts
types.ts # GeneratorInput, CONTENT_WARNINGS, TECH_NOTES, option lists
rig-block.ts, limits.ts, social-post-builder.ts, pinned-comment-builder.ts, playlist-builder.ts,
endings-format.ts, graphics-vendor.ts, upscale.ts (upscaled in the editor: one rule for title,
description and form)
config/ # static data: video types, genres, platforms (stores),
# social fields/platforms, GPU catalog, rig fields,
# content-warning-groups / tech-note-groups (editor groups),
# library-fields (profile/preset/per-video field lists),
# contact-emails (purpose words), brand (copyright years),
# legal, about, field limits, Vietnamese banks, …
store/ # Zustand stores; each exports its version + migrate fn
editor-store.ts # the draft (EditorData, migrateEditorState, editorDataOf)
profile-store.ts, preset-store.ts, template-store.ts, history-store.ts
settings-store.ts + settings-heal.ts # settings; healed on every load
log-store.ts
log-store.ts, pending-invalid-store.ts # typed-but-invalid values, for Strict Mode
utils/
backup/ # backup format v2, detect, sanitize, restore (+undo),
# collect, desktop auto-backups, start-up recovery
@@ -56,16 +62,21 @@ src/
file-ops.ts # save/open text files on every platform
validation.ts, url-extractors.ts, log-storage.ts, …
hooks/, components/, pages/, i18n/, styles/
worker/ # Cloudflare Worker: gate, cookies, headers, routing
worker/ # Cloudflare Worker: gate, cookies, headers, rate limits, routing
build-plugins/ # legal pages at build time; web-only extras
src-tauri/src/ # lib.rs (plugins, tray), storage.rs (name-only file
# commands), file_dialog.rs (native Save/Open)
migration-page/ # moving notice for the old GitHub Pages address (until 2026-11-29)
tests/ # engine, store, utils, worker, build, i18n, config
scripts/ # locale validation, version sync, bundle budget,
# licences/third-party notices, brand assets
tests/ # engine, store, utils, worker, build, i18n, config, hooks, scripts
scripts/ # locale validation + generator, version sync, Tauri versions,
# bundle budget, licences/third-party notices, copyright
# years, brand assets
docs/ # DEVELOPMENT, HOSTING, ARCHITECTURE, FEATURES, ROADMAP,
# TECH-SPEC, I18N, PACKAGING, CONTENT-INVENTORY (+ vi/)
# TECH-SPEC, I18N, PACKAGING, CONTENT-INVENTORY
i18n/vi/ # Vietnamese: DEVELOPMENT, CONTENT-INVENTORY, DISCLAIMER
assets/brand/ # logo sources: every icon and the link-preview card come from them
public/ # static web files (_headers, icons, manifest, 404, robots, sitemap)
LICENSES/ # license texts for REUSE
```
## Coding Conventions
@@ -74,6 +85,10 @@ docs/ # DEVELOPMENT, HOSTING, ARCHITECTURE, FEATURES, R
- Strict mode; no `any` — use `unknown` + type guards.
- Prefer `interface` for object shapes; `as const` for static config arrays.
- `src/` is typed against `lib` ES2022 — the browsers' floor (Chrome 111, Safari 16.4, Firefox 114), because Vite never polyfills. Don't reach for newer built-ins in the app without raising that floor; tests, scripts, worker and build plugins get ES2025 (`tsconfig.check.json`). `target` is ES2025 (ES2026 waits for TypeScript 7.1).
- Erasable syntax only (`erasableSyntaxOnly`, `verbatimModuleSyntax`): no enums, namespaces or parameter properties; `import type` for types.
- React 19: `ref` is an ordinary prop — no `forwardRef`.
- Regexes must stay linear (SonarCloud S8786): no unbounded quantifier that can restart inside its own run (`\s+$`, a leading `\s+` in an unanchored pattern, `\s*` next to `\s*`) — trim first, anchor, bound the run, or use a loop.
### React
@@ -88,7 +103,9 @@ docs/ # DEVELOPMENT, HOSTING, ARCHITECTURE, FEATURES, R
### Styling
- Tailwind utilities and the design tokens (`bg-surface-1`, `text-text-muted`, `accent`, …) — no hard-coded colours, no inline styles.
- Dark by default, light via class; touch targets grow on coarse pointers.
- Dark by default, light via class; touch targets grow on coarse pointers (`pointer-coarse:`), nothing clickable under 24 px.
- Contrast is WCAG AA in both themes and `tests/styles/contrast.test.ts` checks every token: text tokens on surfaces, white text only on the `*-solid` fills (`bg-accent-solid`, `bg-danger-solid`), never on `bg-accent`.
- Focus: the global `:focus-visible` outline; a control that swaps it for a ring uses `outline-hidden` (stays visible in forced colours), not `outline-none`.
- Watch Tailwind 4 specificity: a base `inline-flex` beats a plain `hidden` — wrap responsive visibility in an element.
### i18n
@@ -113,7 +130,7 @@ docs/ # DEVELOPMENT, HOSTING, ARCHITECTURE, FEATURES, R
3. **Profiles vs presets vs templates**: profile = channel (rarely changes), preset = game (reused across parts), template = the whole form. The field lists live in `src/config/library-fields.ts`.
4. **Tags are generated**, then trimmed to YouTube's own length count.
5. **Your data stays on your device.** localStorage is the only store; backups are files the user controls (plus automatic backups in the desktop app's data folder).
6. **The desktop webview never names a path**: Rust commands take file names under the app data folder or open the native dialog themselves.
6. **The desktop webview never names a path**: Rust commands take file names under the app data folder or open the native dialog themselves. Blocking work in an `async` command (a dialog, file I/O) goes through `tauri::async_runtime::spawn_blocking` — SonarCloud flags it otherwise (`rust:S7493`).
7. **The web app is gated** by Turnstile, verified server-side in the Worker; the gate fails open if its secret is missing.
## Development Commands
@@ -130,7 +147,7 @@ npm run lint && npm run format:check
npm run knip # unused files/exports/dependencies
npm run validate:locales
npm run check:bundle # after build: initial load / chunk budget
npm run check:licenses # licence allow-list + THIRD_PARTY_NOTICES in sync
npm run check:licenses # licence allow-list + THIRD_PARTY_NOTICES in sync (generate:third-party fixes)
npm run check:copyright # NOTICE, REUSE.toml, installer copyright = HEAD's year (update:copyright fixes)
npm run check:version # the six version fields agree
npm run check:tauri # @tauri-apps/* and tauri crates on the same major.minor
@@ -138,13 +155,15 @@ npm run cf:dev # wrangler dev (copy .dev.vars.example to .dev.vars
npm run cf:check # wrangler deploy --dry-run
npm run tauri:dev # desktop app against the dev server
npm run tauri:build # desktop installers
# src-tauri/: cargo fmt --check · cargo clippy --all-targets -- -D warnings · cargo test
npm run generate:locale # scaffold a new locale folder from en (-- --lang xx)
npm run generate:brand # favicon, PWA icons, link-preview card from assets/brand/
# src-tauri/: cargo fmt --check · cargo clippy --all-targets --locked -- -D warnings · cargo test
```
## Git Workflow
- `main` only: feature branches (`feat/…`, `fix/…`, `docs/…`, `chore/…`) → PR → `main`. Every merge to `main` deploys the web app.
- Commit and PR-title format: `type(scope): message` (`feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`) — CI checks PR titles.
- Commit and PR-title format: `type(scope): message` (`feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`) — CI checks PR titles, and the message must start with a lower-case letter (`feat(editor): warnings for AI…`, not `feat(editor): AI…`).
- Commits and release tags are GPG-signed; never bypass signing or hooks.
- Required checks: `check`, `dependency-review`, `workflow-lint`, `reuse`, `pr-title`.
@@ -155,11 +174,15 @@ npm run tauri:build # desktop installers
## Important Notes for Claude Code
- Run the gates before committing: `typecheck`, `typecheck:all`, `lint`, `format:check`, `test:run`, `knip`, `validate:locales`, `build` + `check:bundle`; `cargo fmt/clippy/test` when `src-tauri/` changes. In the first commit of a new year, `npm run update:copyright` (CI's `check:copyright` fails until then).
- Run the gates before committing: `typecheck`, `typecheck:all`, `lint`, `format:check`, `test:run`, `knip`, `validate:locales`, `check:version`, `check:tauri`, `check:licenses`, `check:copyright`, `build` + `check:bundle`; `cargo fmt/clippy/test` when `src-tauri/` changes. In the first commit of a new year, `npm run update:copyright` (CI's `check:copyright` fails until then). A dependency change can make `check:licenses` fail: `npm run generate:third-party` rewrites the notices, and a new direct crate in `src-tauri/Cargo.toml` that isn't Tauri's needs its license in `OTHER_CRATES` (`scripts/lib/third-party.ts`).
- New contact-email purpose words: `src/config/contact-emails.ts` (lower-case; a test keeps every locale's example address valid).
- New language: follow `docs/I18N.md` (register it, both namespaces, tag pools, `channel-phrase.ts` patterns, browser detection).
- New genre: `src/config/genres.ts` + its tag pool in `src/engine/tag-generator.ts` (a test keeps them in sync).
- New video type: `src/config/video-types.ts` + every `templates.json` (titles, intros, pinned-comment greetings).
- New content warning / tech note: the id in `CONTENT_WARNINGS` / `TECH_NOTES` (`src/engine/types.ts`), a group in `src/config/content-warning-groups.ts` / `tech-note-groups.ts`, the editor label (`ui.json`) and description line (`templates.json`) in all 8 locales and `_schema.json` — tests fail on any gap — and the row in `docs/CONTENT-INVENTORY.md` (+ vi). Don't repeat a fact that has its own field (language patch, game version, difficulty, the Video settings upscaler).
- New store platform: `src/config/platforms.ts` (URL pattern, `tagName`), optionally a name extractor in `src/utils/url-extractors.ts`.
- UI changes follow the accessibility checklist in `ACCESSIBILITY.md` (#for-contributors): keyboard, names via `Field` / `IconButton`, announced errors, tokens only, reduced motion, 24 px targets. Generated text gets `lang` (the output language); pages name themselves with `useDocumentTitle`, which `RouteAnnouncer` reads out. Update ACCESSIBILITY.md (+ `docs/i18n/vi/`) when what it promises changes.
- Never commit `note.txt`, `warning.txt` or `__pycache__/`; never put real secrets in files (`.dev.vars` holds Cloudflare's public Turnstile test keys only).
- SonarCloud (project `poli0981_youtube-generator`) is CI-based: the `sonarcloud` job in `ci.yml` scans every PR from this repository and every push to `main`, with the coverage from `check`; settings in `sonar-project.properties`; Automatic Analysis is off. Keep it at 0 open issues and the quality gate (Sonar way: A ratings, reviewed hotspots, ≤ 3 % duplication, ≥ 80 % coverage on new code) green — the job fails with the gate. Coverage covers what `coverage.include` in `vitest.config.ts` lists (the logic layers); everything else is in `sonar.coverage.exclusions`, because a file missing from the LCOV report counts as 0 % — a new source folder goes into one list or the other. The version passed to the scanner starts each release's new-code period. Fork and Dependabot PRs skip the scan (no `SONAR_TOKEN`). Check a PR with `https://sonarcloud.io/api/issues/search?componentKeys=poli0981_youtube-generator&pullRequest=<n>&resolved=false` and its gate with `https://sonarcloud.io/api/qualitygates/project_status?projectKey=poli0981_youtube-generator&pullRequest=<n>`. Workflows install with `npm ci --ignore-scripts` and call local binaries (`npm run …`), never `npx` for a package that isn't installed.
- TypeScript bumps may be manual: `@typescript/native` (`npm:typescript@^7`) and `typescript` (`npm:@typescript/typescript6@^6`) are npm aliases Dependabot may not follow. Stop the dev server before `npm ci` on Windows — it locks native modules (EPERM).
- The Cloudflare dashboard, publishing releases and repository settings are the maintainer's; ask before touching them.
+15 -6
View File
@@ -16,11 +16,14 @@ Participation is governed by the [Code of Conduct](./CODE_OF_CONDUCT.md). By con
npm run typecheck && npm run typecheck:all
npm run lint && npm run format:check
npm run validate:locales
npm run test:run
npm run test:coverage
npm run knip
npm run check:version && npm run check:tauri && npm run check:licenses
npm run check:copyright
npm run build && npm run check:bundle
npm run cf:check
```
Touched `src-tauri/`? Also `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings` and `cargo test` in `src-tauri/`. Touched `worker/` or `wrangler.jsonc`? `npm run cf:check` dry-runs the Cloudflare deploy.
`check:licenses` fails when `THIRD_PARTY_NOTICES.md` is stale — `npm run generate:third-party` rewrites it. `check:copyright` fails in the first commit of a new year — `npm run update:copyright` fixes it. Touched `src-tauri/`? Also `cargo fmt --check`, `cargo clippy --all-targets --locked -- -D warnings` and `cargo test` in `src-tauri/` (after `npm run build` — see the [Development Guide](./docs/DEVELOPMENT.md#rust-checks)).
## How to Contribute
@@ -30,16 +33,22 @@ 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.
- **Accessibility barrier** — anything that gets in the way with a keyboard, a screen reader, zoom, high contrast, voice control or touch. No reproduction on the latest release needed, and you don't need to know the cause. See [ACCESSIBILITY.md](./ACCESSIBILITY.md#reporting-a-barrier).
### Pull Requests
- Branch from `main` (`feat/…`, `fix/…`, `docs/…`) and open the PR against `main`. Every merge to `main` deploys the web app, so `main` stays releasable.
- Commit format and **PR title**: `type(scope): message` — e.g. `feat(engine): add Spanish template support`. Types: `feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`. CI checks the PR title.
- Required checks: `check`, `dependency-review`, `workflow-lint`, `reuse`, `pr-title` (plus `lint-and-test` and `cargo-deny` when `src-tauri/` changes). Commits on `main` are signed.
- Required checks: `check`, `dependency-review`, `workflow-lint`, `reuse`, `pr-title`. When `src-tauri/` changes, the Rust workflow's `lint-and-test` and `cargo-deny` run too, and GitHub's CodeQL code scanning runs on every PR. SonarCloud analyses PRs opened from this repository — its quality gate wants A ratings, reviewed security hotspots, at most 3 % duplication and at least 80 % test coverage on new code in the layers Vitest measures (PRs from forks get no secrets and skip it; the maintainer's merge runs it on `main`). Commits on `main` are signed.
- PR titles start with a lower-case letter after the colon (`feat(editor): add …`, not `feat(editor): Add …`).
- 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.
### Accessibility
UI changes keep YTDescGen usable with the keyboard alone and with screen readers. Run through the checklist in [ACCESSIBILITY.md](./ACCESSIBILITY.md#for-contributors) (the PR template repeats it); the contrast test (`tests/styles/contrast.test.ts`) fails if a colour token drops under WCAG AA.
### i18n Contributions
If your change adds or removes any user-facing string:
@@ -59,7 +68,7 @@ The following are closed without review and may result in a contributor ban —
- **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.**
- **Tests deleted or skipped to make CI pass.**
- **"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.
@@ -67,7 +76,7 @@ The following are closed without review and may result in a contributor ban —
- Bug fixes with a reproduction case and a regression test.
- Locale corrections from native speakers.
- New content-warning IDs with all 8 translations and a clear rationale (especially horror-genre vocabulary).
- New content-warning or tech-note IDs with all 8 translations and a clear rationale (especially horror-genre vocabulary) — the checks fail until every locale has its label and description line.
- 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.
@@ -81,7 +90,7 @@ The following are closed without review and may result in a contributor ban —
## Contact
Questions about contributing or conduct: `code@poli0981.dev`. Security issues go through [SECURITY.md](./SECURITY.md), never a public issue.
Questions about contributing or conduct: `code@poli0981.dev`. Security issues go through [SECURITY.md](./SECURITY.md), never a public issue. Accessibility barriers you'd rather not post publicly: `contact@poli0981.dev`, subject starting with `[Accessibility]`.
## License
+2 -2
View File
@@ -4,7 +4,7 @@
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 (Claude Opus models; v1.0.0 with Claude Opus 5.5)**. All commits, releases, and architectural decisions are reviewed and approved by the maintainer before merging.
Code, documentation, locale translations, and design decisions in this repository were **co-authored with the assistance of Anthropic's Claude Code (Claude Opus models; v1.0.0 through v1.5.1 with Claude Opus 5.5)**. All commits, releases, and architectural decisions are reviewed and approved by the maintainer before merging.
This disclosure applies to:
@@ -14,7 +14,7 @@ This disclosure applies to:
- CI/CD workflows in `.github/workflows/`.
- The Cloudflare Worker in `worker/` and the build plugins in `build-plugins/`.
See also: [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md) § "AI-Assisted Development Disclosure".
See also: [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md) § "AI-assisted development".
## Translation quality
+3 -1
View File
@@ -1,6 +1,6 @@
# Privacy Policy
**Effective:** 2026-09-30
**Effective:** 2026-10-12
This policy covers YTDescGen — the web app at **https://ytgenerator.stream** and the desktop (Windows, macOS, Linux) and Android apps built from the same source. It is maintained by **poli0981 (SkullMute)**, who is responsible for it. Questions and requests: **privacy@poli0981.dev**.
@@ -29,6 +29,8 @@ Your work is saved in your browser's **`localStorage`** for `ytgenerator.stream`
This data never leaves your browser unless **you** export it. Clearing site data, using a private window, or a "clear cookies and site data on exit" setting erases it.
One more value can appear in **`sessionStorage`**, for the open tab only: `ytdescgen-chunk-reload`, a flag written only when an update has replaced the files the app was about to load, so that it reloads itself once instead of over and over. It holds no data and disappears when the tab closes.
### Desktop and Android apps
The apps keep the same data in the app's own WebView storage and application-data folder (the event log and automatic backups live there too):
+10 -7
View File
@@ -2,12 +2,12 @@
**YouTube Gameplay Description Generator** — a template engine for Gameplay No Commentary YouTube channels.
**Use it at [ytgenerator.stream](https://ytgenerator.stream)**, or install the desktop app (Windows / macOS / Linux, 2–5 MB installers) or the Android app from [Releases](https://github.com/poli0981/youtube-generator/releases). One codebase: React + Tauri 2.
**Use it at [ytgenerator.stream](https://ytgenerator.stream)**, or install the desktop app (Windows / macOS / Linux, 3–6 MB installers) or the Android app from [Releases](https://github.com/poli0981/youtube-generator/releases). One codebase: React + Tauri 2.
Generate YouTube titles, descriptions and tags in eight languages. Save your channel as a profile and each game as a preset, and every new video is a few clicks.
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](./LICENSE)
[![Node](https://img.shields.io/badge/node-%E2%89%A522-brightgreen)](./docs/DEVELOPMENT.md)
[![Node](https://img.shields.io/badge/node-%E2%89%A526-brightgreen)](./docs/DEVELOPMENT.md)
[![Latest release](https://img.shields.io/github/v/release/poli0981/youtube-generator?include_prereleases)](https://github.com/poli0981/youtube-generator/releases)
[![Last commit](https://img.shields.io/github/last-commit/poli0981/youtube-generator)](https://github.com/poli0981/youtube-generator/commits)
@@ -27,7 +27,7 @@ Built for the gameplay no-commentary niche — especially horror / scary games
- **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.
- **8 languages** — English, Vietnamese, Japanese, Spanish, Korean, Chinese, Portuguese (Brazil), Indonesian — for the interface and the generated text. _(Vietnamese is native-reviewed; the others are AI-translated — see [DISCLAIMER.md](./DISCLAIMER.md).)_
- **40+ genres** and **248 content warnings** in 12 groups, so viewers know what to expect before they press play.
- **40+ genres** and **257 content warnings** in 13 groups — including whether the game uses **AI-generated** art, voices, music or text — so viewers know what to expect before they press play.
- **Quick start** — pick your channel profile and the game's preset at the top of the editor; **Next part**, **New video, same game** and **Start over** clear exactly what belonged to the last video.
- **Paste a store link anywhere** — it lands in the right store field and names the game (Steam, Epic, GOG, PlayStation, Xbox, Nintendo, itch.io, Humble, EA app, Ubisoft, Battle.net, Google Play, App Store, Meta Quest, Amazon Luna).
- **Live preview** beside the form and a **YouTube preview** (where search results cut the title, what shows above "…more").
@@ -37,7 +37,10 @@ Built for the gameplay no-commentary niche — especially horror / scary games
- **Batch mode** — every part of a series in one pass, in several languages.
- **Cross-post captions** — TikTok, YouTube Shorts, Instagram Reels, Facebook Reels, X, Threads and Bluesky, each within its own limit.
- **Command palette** (Ctrl/⌘ + K) and keyboard shortcuts.
- **Contact emails by purpose** — one contact line, or separate lines for contact, advertising, game keys & playtest and copyright / DMCA, each purpose address checked for a word that says what it is for (`sponsor@…`, `keys@…`, `dmca@…`).
- **Guardrails** — length caps on every field and an opt-in **Strict Mode** that blocks copy and export while a field has an error.
- **Dark and light themes** at WCAG AA contrast, larger controls on touch screens, and an option to hide every scrollbar.
- **Accessible** — works with the keyboard alone and with screen readers (generated text is marked with its language), respects reduce motion, zooms on desktop; see [ACCESSIBILITY.md](./ACCESSIBILITY.md).
- **Desktop app** — Windows, macOS & Linux via Tauri; **Android app** — Android 11+, sideloaded from [Releases](https://github.com/poli0981/youtube-generator/releases).
## Quick Start
@@ -63,8 +66,7 @@ npm run tauri:build
Android build (`.apk`) — requires the Android SDK + NDK + a JDK:
```bash
cargo tauri android init # one-time; generates src-tauri/gen/android
cargo tauri android build --apk
cargo tauri android build --apk # the Gradle project in src-tauri/gen/android is committed — don't re-run `init`
# Output: src-tauri/gen/android/app/build/outputs/apk/universal/release/
```
@@ -88,7 +90,7 @@ Full details: [PRIVACY.md](./PRIVACY.md), also at [ytgenerator.stream/legal/priv
## Tech Stack
React 19 · TypeScript (strict) · Vite 8 · Tailwind CSS 4 · Radix · Motion · Zustand 5 · i18next · Tauri 2 (Rust) · Cloudflare Workers.
React 19 · TypeScript 7 (strict) · Vite 8 · Tailwind CSS 4 · Radix · Motion · Zustand 5 · i18next · Tauri 2 (Rust) · Cloudflare Workers.
Architecture overview: [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md).
@@ -101,13 +103,14 @@ Architecture overview: [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md).
| [Hosting](./docs/HOSTING.md) | How ytgenerator.stream is built, deployed and protected. |
| [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).)_ |
| [Content Inventory](./docs/CONTENT-INVENTORY.md) | Every video type, genre, content warning and tech note the editor surfaces. _(Also: [Vietnamese](./docs/i18n/vi/CONTENT-INVENTORY.md).)_ |
| [Roadmap](./docs/ROADMAP.md) | What shipped and what's next. |
| [Tech Spec](./docs/TECH-SPEC.md) | Implementation details and configs. |
| [i18n Guide](./docs/I18N.md) | Adding new locales. |
| [Packaging](./docs/PACKAGING.md) | Tauri desktop + Android release builds and signing. |
| [Contributing](./CONTRIBUTING.md) | PR process, commit conventions, required checks. |
| [Security](./SECURITY.md) | Reporting vulnerabilities. |
| [Accessibility](./ACCESSIBILITY.md) | What works with a keyboard, screen readers and zoom, known gaps, how to report a barrier. _(Also: [Vietnamese](./docs/i18n/vi/ACCESSIBILITY.md).)_ |
| [Privacy](./PRIVACY.md) | What is stored where, and what Cloudflare processes. |
| [Terms of Use](./TERMS.md) | Acceptable use, license compliance, DMCA. |
| [Disclaimer](./DISCLAIMER.md) | AI-assistance and translation-quality disclosure. _(Also: [Vietnamese](./docs/i18n/vi/DISCLAIMER.md).)_ |
+13
View File
@@ -12,3 +12,16 @@ path = "**"
precedence = "aggregate"
SPDX-FileCopyrightText = "2026 poli0981 (SkullMute) and YTDescGen contributors"
SPDX-License-Identifier = "Apache-2.0"
# The Gradle wrapper that Tauri's Android template commits is Gradle's own
# code, not the project's: its headers read "Copyright 2015 the original
# author or authors" under Apache-2.0.
[[annotations]]
path = [
"src-tauri/gen/android/gradlew",
"src-tauri/gen/android/gradlew.bat",
"src-tauri/gen/android/gradle/wrapper/gradle-wrapper.jar",
]
precedence = "override"
SPDX-FileCopyrightText = "2015 the original author or authors"
SPDX-License-Identifier = "Apache-2.0"
+2 -2
View File
@@ -6,8 +6,8 @@ Only the latest released version of YTDescGen receives security updates, and the
| Version | Supported |
| ------- | --------- |
| 1.0.x | ✅ |
| < 1.0 | ❌ |
| 1.5.x | ✅ |
| < 1.5 | ❌ |
## Reporting a Vulnerability
+33 -31
View File
@@ -14,22 +14,22 @@ Bundled into the web app and the desktop / Android apps.
| --- | --- | --- | --- |
| `@fontsource-variable/inter` | 5.3.0 | OFL-1.1 | <https://github.com/fontsource/font-files> |
| `@fontsource-variable/jetbrains-mono` | 5.3.0 | OFL-1.1 | <https://github.com/fontsource/font-files> |
| `@tauri-apps/api` | 2.12.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `@tauri-apps/plugin-opener` | 2.7.0 | MIT OR Apache-2.0 | <https://github.com/tauri-apps/plugins-workspace> |
| `@tauri-apps/api` | 2.12.4 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `@tauri-apps/plugin-opener` | 2.7.2 | MIT OR Apache-2.0 | <https://github.com/tauri-apps/plugins-workspace> |
| `clsx` | 2.1.1 | MIT | <https://github.com/lukeed/clsx> |
| `cmdk` | 1.1.1 | MIT | <https://github.com/pacocoursey/cmdk> |
| `i18next` | 26.4.2 | MIT | <https://github.com/i18next/i18next> |
| `i18next` | 26.5.11 | MIT | <https://github.com/i18next/i18next> |
| `i18next-resources-to-backend` | 1.2.3 | MIT | <https://github.com/i18next/i18next-resources-to-backend> |
| `lucide-react` | 1.49.0 | ISC | <https://github.com/lucide-icons/lucide> |
| `motion` | 13.4.6 | MIT | <https://github.com/motiondivision/motion> |
| `radix-ui` | 1.6.7 | MIT | <https://github.com/radix-ui/primitives> |
| `react` | 19.3.0 | MIT | <https://github.com/react/react> |
| `react-dom` | 19.3.0 | MIT | <https://github.com/react/react> |
| `react-i18next` | 17.0.15 | MIT | <https://github.com/i18next/react-i18next> |
| `lucide-react` | 1.64.0 | ISC | <https://github.com/lucide-icons/lucide> |
| `motion` | 13.5.1 | MIT | <https://github.com/motiondivision/motion> |
| `radix-ui` | 1.8.1 | MIT | <https://github.com/radix-ui/primitives> |
| `react` | 19.3.1 | MIT | <https://github.com/react/react> |
| `react-dom` | 19.3.1 | MIT | <https://github.com/react/react> |
| `react-i18next` | 17.1.9 | MIT | <https://github.com/i18next/react-i18next> |
| `react-router-dom` | 7.18.4 | MIT | <https://github.com/remix-run/react-router> |
| `simple-icons` | 16.33.0 | CC0-1.0 | <https://simpleicons.org> |
| `simple-icons` | 16.35.0 | CC0-1.0 | <https://simpleicons.org> |
| `sonner` | 2.0.8 | MIT | <https://github.com/emilkowalski/sonner> |
| `zustand` | 5.0.15 | MIT | <https://github.com/pmndrs/zustand> |
| `zustand` | 5.0.16 | MIT | <https://github.com/pmndrs/zustand> |
## Build and development tools
@@ -40,29 +40,30 @@ Used to build, test and check YTDescGen. Not shipped to users.
| `@eslint/js` | 10.0.1 | MIT | <https://github.com/eslint/eslint> |
| `@resvg/resvg-js` | 2.6.2 | MPL-2.0 | — |
| `@tailwindcss/postcss` | 4.3.3 | MIT | <https://github.com/tailwindlabs/tailwindcss> |
| `@tauri-apps/cli` | 2.12.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `@tauri-apps/cli` | 2.12.4 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `@testing-library/jest-dom` | 7.0.1 | MIT | <https://github.com/testing-library/jest-dom> |
| `@testing-library/react` | 16.3.3 | MIT | <https://github.com/testing-library/react-testing-library> |
| `@types/node` | 26.6.3 | MIT | <https://github.com/DefinitelyTyped/DefinitelyTyped> |
| `@types/node` | 26.6.5 | MIT | <https://github.com/DefinitelyTyped/DefinitelyTyped> |
| `@types/react` | 19.3.0 | MIT | <https://github.com/DefinitelyTyped/DefinitelyTyped> |
| `@types/react-dom` | 19.3.0 | MIT | <https://github.com/DefinitelyTyped/DefinitelyTyped> |
| `@vitejs/plugin-react` | 6.1.1 | MIT | <https://github.com/vitejs/vite-plugin-react> |
| `@vitest/coverage-v8` | 4.1.11 | MIT | <https://github.com/vitest-dev/vitest> |
| `@typescript/typescript6` | 6.0.2 | Apache-2.0 | <https://github.com/microsoft/TypeScript> |
| `@vitejs/plugin-react` | 6.1.2 | MIT | <https://github.com/vitejs/vite-plugin-react> |
| `@vitest/coverage-v8` | 4.1.12 | MIT | <https://github.com/vitest-dev/vitest> |
| `autoprefixer` | 10.6.1 | MIT | <https://github.com/postcss/autoprefixer> |
| `eslint` | 10.11.0 | MIT | <https://github.com/eslint/eslint> |
| `eslint` | 10.13.0 | MIT | <https://github.com/eslint/eslint> |
| `eslint-plugin-react-hooks` | 7.1.1 | MIT | <https://github.com/facebook/react> |
| `knip` | 6.38.0 | ISC | <https://github.com/webpro-nl/knip> |
| `marked` | 18.0.14 | MIT | <https://github.com/markedjs/marked> |
| `postcss` | 8.5.28 | MIT | <https://github.com/postcss/postcss> |
| `prettier` | 3.9.9 | MIT | <https://github.com/prettier/prettier> |
| `knip` | 6.44.0 | ISC | <https://github.com/webpro-nl/knip> |
| `marked` | 18.1.1 | MIT | <https://github.com/markedjs/marked> |
| `postcss` | 8.5.31 | MIT | <https://github.com/postcss/postcss> |
| `prettier` | 3.9.10 | MIT | <https://github.com/prettier/prettier> |
| `prettier-plugin-tailwindcss` | 0.8.1 | MIT | <https://github.com/tailwindlabs/prettier-plugin-tailwindcss> |
| `tailwindcss` | 4.3.3 | MIT | <https://github.com/tailwindlabs/tailwindcss> |
| `tsx` | 4.23.15 | MIT | <https://github.com/privatenumber/tsx> |
| `typescript` | 5.9.3 | Apache-2.0 | <https://github.com/microsoft/TypeScript> |
| `typescript-eslint` | 8.71.0 | MIT | <https://github.com/typescript-eslint/typescript-eslint> |
| `vite` | 8.3.1 | MIT | <https://github.com/vitejs/vite> |
| `vitest` | 4.1.11 | MIT | <https://github.com/vitest-dev/vitest> |
| `wrangler` | 4.144.0 | MIT OR Apache-2.0 | <https://github.com/cloudflare/workers-sdk> |
| `typescript` | 7.0.2 | Apache-2.0 | <https://github.com/microsoft/TypeScript> |
| `typescript-eslint` | 8.72.0 | MIT | <https://github.com/typescript-eslint/typescript-eslint> |
| `vite` | 8.3.4 | MIT | <https://github.com/vitejs/vite> |
| `vitest` | 4.1.12 | MIT | <https://github.com/vitest-dev/vitest> |
| `wrangler` | 4.152.0 | MIT OR Apache-2.0 | <https://github.com/cloudflare/workers-sdk> |
## Desktop and Android shell (Rust crates)
@@ -70,16 +71,17 @@ Direct dependencies of `src-tauri/`. Transitive crates are checked in CI by `car
| Crate | Version | License | Project |
| --- | --- | --- | --- |
| `tauri` | 2.12.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `tauri-build` | 2.7.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `tauri-plugin-dialog` | 2.8.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
| `tauri-plugin-opener` | 2.7.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
| `tauri-plugin-single-instance` | 2.5.1 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
| `serde` | 1.0.228 | MIT OR Apache-2.0 | <https://github.com/serde-rs/serde> |
| `tauri` | 2.12.4 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `tauri-build` | 2.7.3 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `tauri-plugin-dialog` | 2.8.3 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
| `tauri-plugin-opener` | 2.7.2 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
| `tauri-plugin-single-instance` | 2.5.4 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
## Fonts and icons
- **Icons:** [Lucide](https://lucide.dev/) (`lucide-react`, ISC). Brand marks, where shown, come from [Simple Icons](https://simpleicons.org/) (CC0-1.0); the trademarks belong to their owners.
- **Fonts:** the app uses the operating system's fonts.
- **Fonts:** [Inter](https://rsms.me/inter/) and [JetBrains Mono](https://www.jetbrains.com/lp/mono/), bundled with the app from the `@fontsource-variable` packages above (SIL Open Font License 1.1, `OFL-1.1`).
## Services (web app only)
+20 -10
View File
@@ -79,17 +79,24 @@ export function rewriteHref(href: string, fromFile: string): string {
* hyphen, which also rules out any markup ending up in an attribute.
*/
function slugify(text: string): string {
return text
.toLowerCase()
.replace(/[^\p{L}\p{N}]+/gu, "-")
.replace(/^-+|-+$/g, "");
return (
text
.toLowerCase()
.replace(/[^\p{L}\p{N}]+/gu, "-")
// The line above leaves at most one hyphen in a row.
.replace(/^-|-$/g, "")
);
}
function stripInlineMarkdown(text: string): string {
return text
.replace(/[`*_~]/g, "")
.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1")
.trim();
return (
text
.replace(/[`*_~]/g, "")
// Neither part may contain `[`, so a failed match is never re-scanned
// from a later `[` inside it (linear even on unbalanced brackets).
.replace(/\[([^[\]]+)\]\([^)[]*\)/g, "$1")
.trim()
);
}
export function renderMarkdown(source: string, fromFile: string): { title: string; html: string } {
@@ -204,6 +211,8 @@ const DOC_SUMMARIES: Readonly<Record<LegalDocId, string>> = {
license: "The Apache License 2.0 the source code is released under.",
"third-party": "Open-source libraries, fonts and services YTDescGen relies on.",
security: "How to report a vulnerability privately, and what is in scope.",
accessibility:
"What works with a keyboard, screen readers and zoom, known gaps, and how to report a barrier.",
notice: "The Apache-2.0 NOTICE file with copyright and attribution.",
conduct: "Contributor Covenant rules for the project's community spaces.",
};
@@ -252,6 +261,7 @@ const TITLE_BY_ID: Record<LegalDocId, string> = {
license: "License (Apache-2.0)",
"third-party": "Third-Party Notices",
security: "Security Policy",
accessibility: "Accessibility",
notice: "NOTICE",
conduct: "Code of Conduct",
};
@@ -289,10 +299,10 @@ function indexPage(): string {
return pageShell({
title: "Legal",
canonicalPath: "/legal",
description: "Terms, privacy, licensing and security information for YTDescGen.",
description: "Terms, privacy, licensing, security and accessibility information for YTDescGen.",
activeId: null,
lang: "en",
body: `<article><h1>Legal</h1><p>Terms, privacy, licensing and security information for YTDescGen — the same documents the app shows in its Legal Center.</p><div class="cards">${cards}</div></article>`,
body: `<article><h1>Legal</h1><p>Terms, privacy, licensing, security and accessibility information for YTDescGen — the same documents the app shows in its Legal Center.</p><div class="cards">${cards}</div></article>`,
});
}
+24 -19
View File
@@ -2,7 +2,7 @@
## YTDescGen — Technical Architecture
Reflects **v1.0.0**. Implementation details (configs, interfaces, file formats, CI) are in [TECH-SPEC.md](TECH-SPEC.md); desktop and Android builds in [PACKAGING.md](PACKAGING.md); running the web deployment in [HOSTING.md](HOSTING.md).
Reflects **v1.5.1**. Implementation details (configs, interfaces, file formats, CI) are in [TECH-SPEC.md](TECH-SPEC.md); desktop and Android builds in [PACKAGING.md](PACKAGING.md); running the web deployment in [HOSTING.md](HOSTING.md).
---
@@ -32,7 +32,7 @@ Reflects **v1.0.0**. Implementation details (configs, interfaces, file formats,
│ ├─ description-builder ── rig-block · timeline-parser │
│ │ channel-phrase · endings-format │
│ └─ tag-generator │
│ Also: title-variants · limits · social-post-builder │
│ Also: title-variants · limits · social-post-builder · upscale │
│ pinned-comment-builder · playlist-builder · graphics-vendor │
├────────────────────────────────────────────────────────────────────┤
│ Infrastructure Layer │
@@ -53,7 +53,7 @@ The same source ships two ways:
│ Web — ytgenerator.stream │ │ Tauri 2 — desktop and Android │
│ BrowserRouter (real paths) │ │ HashRouter (asset protocol) │
│ Build adds: static /legal pages, │ │ Build (TAURI_ENV_PLATFORM set): │
│ security.txt, analytics beacon │ │ es2020 target, no analytics │
│ security.txt, analytics beacon │ │ no static pages or analytics │
│ Cloudflare Worker (worker/): │ │ Rust core (src-tauri/): │
│ Turnstile gate · headers · │ │ name-only file commands, │
│ /legal/* · static assets │ │ native dialogs, tray (desktop) │
@@ -66,7 +66,7 @@ The same source ships two ways:
**Route tree.** `/legal` and `/legal/:docId` (the Legal Center) sit outside the consent guard, so the consent screen can open each document. Everything else is inside `ConsentGuard`, a layout route that renders `ConsentGate` until the user has accepted the current terms version (`CURRENT_TERMS_VERSION` = 2 since v1.0.0). Inside it, `AppShell` holds the pages: the Editor (index route) stays in the entry bundle; Output, Profiles, History, Settings, Batch, Social, Playlist, Logs and About are `React.lazy` chunks, each wrapped in its own `ErrorBoundary` + `Suspense` so a crash on one page cannot blank the app. On the web, `/legal/<id>` loaded directly is the Worker's static page; navigated to inside the app, it is the Legal Center — the same URL either way.
**App shell.** `AppShell` combines a collapsible `Sidebar`, the `Header` top bar (output and interface languages, theme), `MobileNav` (a bottom bar on phones, with a "More" drawer), and three lazily loaded pieces: the ⌘/Ctrl + K `CommandPalette` (cmdk), the shortcut help and the backup `RestoreDialog`, mounted only while a restore is pending. UI primitives in `components/ui/` wrap Radix (Dialog, AlertDialog, Popover, Tooltip, Tabs, Switch, Checkbox, ToggleGroup); animation is Motion behind `LazyMotion` (its feature bundle loads after first paint, and `MotionConfig reducedMotion="user"` honours the OS setting); toasts are sonner.
**App shell.** `AppShell` combines a collapsible `Sidebar`, the `Header` top bar (output and interface languages, theme), `MobileNav` (a bottom bar on phones, with a "More" drawer), and three lazily loaded pieces: the ⌘/Ctrl + K `CommandPalette` (cmdk), the shortcut help and the backup `RestoreDialog`, mounted only while a restore is pending. UI primitives in `components/ui/` wrap Radix (Dialog, AlertDialog, Popover, Tooltip, Tabs, Switch, Checkbox, ToggleGroup); animation is Motion behind `LazyMotion` (its feature bundle loads after first paint, and `MotionConfig reducedMotion="user"` honours the OS setting); toasts are sonner, with translated region and close labels. `RouteAnnouncer` (v1.5.1) is a polite live region that reads out the new page's name after a navigation: every page names itself with `useDocumentTitle`, which fires `ytdescgen:page-title` once the commit's effects have run, and focus stays where it was. Accessibility as a whole: [ACCESSIBILITY.md](../ACCESSIBILITY.md).
**Error pages (v0.27).** `components/errors/` holds a reusable `ErrorPage` (404/403/419/500/offline/runtime) driven by the pure `config/error-pages.ts` map. The error routes (`/403`, `/419`, `/500`, `/offline`, catch-all `*`) are **siblings of the `AppShell` route group** inside the consent guard, so they render full-screen without the shell. `ErrorPage` is router-agnostic — Home is a plain location change (`/` on the web, `#/` in Tauri) and Back is `history.back()` — so the root `ErrorBoundary`, mounted in `main.tsx` outside the router, reuses it as its crash fallback.
@@ -93,6 +93,7 @@ The engine holds all generation logic with **zero framework dependency**: no Rea
| `channel-phrase.ts` | Drops "on {{channelName}}" (per language) when the channel name is empty |
| `rig-block.ts` | The rig as localised `Label: value` lines in a fixed order (description and social captions) |
| `endings-format.ts`, `graphics-vendor.ts` | Endings lists split across videos; valid upscaler / frame-generation options per vendor |
| `upscale.ts` | Upscaled in the editor (v1.5.0): `validUpscaleSource` — the one rule the title badge, the Upscale line and the automatic tech note share |
| `limits.ts` | Over-limit status per field, Copy All rules, `<` / `>` detection |
| `social-post-builder.ts` | Captions for TikTok, YouTube Shorts, Instagram Reels, Facebook Reels, X (weighted count), Threads, Bluesky |
| `pinned-comment-builder.ts`, `playlist-builder.ts` | Pinned comment; playlist title, description and comment |
@@ -139,8 +140,8 @@ interface GeneratorInput {
// Video-type specific: partNumber, bossName, dlcName, challengeName, modName, modList,
// liveUrl, scheduledTime, gacha quest fields …
// Video settings: resolution, fps, graphicsPreset, ray tracing, frame generation,
// upscaling, artStyle, videoStyleEra, versionInfo …
// Video settings: resolution, upscaledFrom, fps, graphicsPreset, ray tracing,
// frame generation, upscaling, artStyle, videoStyleEra, versionInfo …
// Content: timestamps, playlistLink, emails, music, sponsor, publisher, content warnings,
// tech notes, playthrough notes, endings, playtest, community links …
@@ -219,14 +220,15 @@ generateTags(input, { includeMultilingualTags, includeTrendingTags, year })
priority pool source
1 game name bare tag (≤ 30 chars) + a shorter form for composites
2 core CORE_TAGS_BY_LANG[language]
3 genre GENRE_TAG_REGISTRY[genre], for every selected genre
4 video type VIDEO_TYPE_TAGS[videoType]
5 platform PLATFORMS[].tagName ("Steam", "itch.io", …)
6 quality resolution / fps
7 multilingual MULTILINGUAL_TAGS[language] (setting)
8 trending year-based, first genre only (setting)
9 publisher/developer pubDevName, as a bare tag
2 boss name bossNameTag(bossName) — Boss Fight / Boss No Hit only
3 core CORE_TAGS_BY_LANG[language]
4 genre GENRE_TAG_REGISTRY[genre], for every selected genre
5 video type VIDEO_TYPE_TAGS[videoType]
6 platform PLATFORMS[].tagName ("Steam", "itch.io", …)
7 quality resolution / fps
8 multilingual MULTILINGUAL_TAGS[language] (setting)
9 trending year-based, first genre only (setting)
10 publisher/developer pubDevName, as a bare tag
│
▼
de-duplicate (case-insensitive) · drop tags over 30 characters
@@ -256,7 +258,7 @@ export const GENRE_TAG_REGISTRY: Record<string, (gameName: string) => string[]>
```
┌────────────────────────────────────────────────────────────────────┐
│ EditorStore — "ytdescgen-editor-draft", v20 │
│ EditorStore — "ytdescgen-editor-draft", v21 │
│ - the draft: every form field (EditorData) + setter actions │
│ - persists data only (editorDataOf); migrateEditorState │
├────────────────────────────────────────────────────────────────────┤
@@ -274,7 +276,8 @@ export const GENRE_TAG_REGISTRY: Record<string, (gameName: string) => string[]>
│ - capped by the History Limit setting (10–500, default 100) │
├────────────────────────────────────────────────────────────────────┤
│ SettingsStore — "ytdescgen-settings", v12 │
│ - theme · hideScrollbars · appLanguage · titleFormat │
│ - theme · hideScrollbars · singleKeyShortcuts · appLanguage │
│ - titleFormat │
│ - description toggles · strictMode · copyAllIncludesTags · … │
│ - healSettings on every load; consent and UI state never exported │
├────────────────────────────────────────────────────────────────────┤
@@ -296,7 +299,7 @@ Every persisted store uses Zustand `persist` with `createJSONStorage(() => local
`src/config/library-fields.ts` is the one list of which editor fields each kind of library item carries — the save forms, Apply, backups and imports all read it:
- **Profile** = the channel: `PROFILE_FIELDS` (channel name, emails, social, rig, resolution / fps / graphics preset, ad text, Vietnamese donate fields, community links).
- **Profile** = the channel: `PROFILE_FIELDS` (channel name, emails, social, rig, resolution (+ upscaled from) / fps / graphics preset, ad text, Vietnamese donate fields, community links).
- **Preset** = the game: `PRESET_FIELDS` (names, genres, platform, store links and their types, publisher, content warnings, language patch, game version, art style, the skip-graphics-settings switch, playlist link).
- **Template** = the whole form (every field since v1.0.0).
- `PER_VIDEO_FIELDS` is what belongs to one video only (boss, chapter, timestamps, pinned comment, endings, …).
@@ -325,6 +328,8 @@ Two sources, unioned by `useStrictBlock`, because neither alone is sufficient:
Both are filtered through `isRelevantIssueId`, so a field that isn't currently shown (`adEmail` / `gameKeyEmail` / `copyrightEmail` with split-email off, `zaloGroupLink` outside Vietnamese output) can never block on a value with no visible input to fix it. Strict Mode is opt-in; with it off, no gate blocks.
The three purpose emails (v1.1.0) go through one validator in both places: `validatePurposeEmails` (`src/utils/validation.ts`) is `validateEmails` plus a rule that the part before `@` of every address contains one of the field's words from `PURPOSE_EMAIL_KEYWORDS` (`src/config/contact-emails.ts`). `ContactEmailEditor` uses it to refuse the value and lists the words in each field's help text; `collectEditorIssues` uses it on saved values, so an older address without a word shows up for Strict Mode rather than being rewritten.
The first implementation registered issues from the inputs themselves and cleared on unmount. It typechecked and had passing tests, and did nothing: the fields live on the Editor page while the gates live on Batch / Social / Output, so navigating away cleared every issue. Deriving from state removes the mount coupling entirely.
## 4. i18n Architecture
@@ -386,7 +391,7 @@ Export: `ExportBackupDialog` → `collectBackup(chosen sections)` → `saveTextF
## 6. Web Delivery
The web build is served at <https://ytgenerator.stream> by a Cloudflare Worker (`worker/`, configured by `wrangler.jsonc`) that Cloudflare Workers Builds deploys from `main`. The Worker puts a Turnstile check in front of the app (verified server-side; a signed `HttpOnly` `__Host-ytg_gate` cookie remembers the pass for 24 hours), serves the prerendered legal pages at `/legal/*` to everyone, and sets the security headers (a CSP per page type). Agreeing to the terms on the gate page sets the `ytg_terms` cookie, which the app reads so a web visitor meets one blocking screen, not two. Build-time extras for the web only — static legal pages, `/.well-known/security.txt`, the cookieless Web Analytics beacon — come from `build-plugins/`. The desktop and Android builds use none of this and contain no analytics. Request flow, cookies, headers and operations: [HOSTING.md](HOSTING.md).
The web build is served at <https://ytgenerator.stream> by a Cloudflare Worker (`worker/`, configured by `wrangler.jsonc`) that Cloudflare Workers Builds deploys from `main`. The Worker puts a Turnstile check in front of the app (verified server-side; a signed `HttpOnly` `__Host-ytg_gate` cookie remembers the pass for 24 hours), serves the prerendered legal pages at `/legal/*` to everyone, sets the security headers (a CSP per page type), and answers `429` to a client that sends too many requests (Workers Rate Limiting bindings, behind a WAF rate limiting rule at the zone). Agreeing to the terms on the gate page sets the `ytg_terms` cookie, which the app reads so a web visitor meets one blocking screen, not two. Build-time extras for the web only — static legal pages, `/.well-known/security.txt`, the cookieless Web Analytics beacon — come from `build-plugins/`. The desktop and Android builds use none of this and contain no analytics. Request flow, cookies, headers and operations: [HOSTING.md](HOSTING.md).
## 7. Desktop Packaging (Tauri)
@@ -417,7 +422,7 @@ React app (src/), built with TAURI_ENV_PLATFORM set
- Android: universal .apk
```
**The webview never names a path.** Since v1.0.0 the Rust side exposes only name-only commands for its own files (`backup_*` and `log_*` under the app data directory, `recover_legacy_data`) and two commands that open the native Save / Open dialog themselves (`export_text_file`, `import_text_file`: text formats only, imports capped at 20 MB). The capability file grants the webview only `core:default` and `opener:default`; the fs and shell plugins are gone. The JavaScript bridge is `src/utils/native.ts`, used by `file-ops.ts` (exports and imports on every platform), `log-storage.ts` and `utils/backup/`. Details: [PACKAGING.md](PACKAGING.md).
**The webview never names a path.** Since v1.0.0 the Rust side exposes only name-only commands for its own files (`backup_*` and `log_*` under the app data directory, `recover_legacy_data`) and two commands that open the native Save / Open dialog themselves (`export_text_file`, `import_text_file`: text formats only, imports capped at 20 MB). The capability file grants the webview only `core:default`, `opener:default` and (v1.5.1, for the zoom hotkeys' macOS/Linux polyfill) `core:webview:allow-set-webview-zoom`; the fs and shell plugins are gone. The JavaScript bridge is `src/utils/native.ts`, used by `file-ops.ts` (exports and imports on every platform), `log-storage.ts` and `utils/backup/`. Details: [PACKAGING.md](PACKAGING.md).
Tauri advantages over Electron:
+52 -16
View File
@@ -1,6 +1,6 @@
# Content Inventory
A static manifest of every video type, game genre, content warning, store, link field and cross-post platform surfaced in YTDescGen's editor (as of v1.0.0). Maintained manually — when adding a new option to one of the source files below, **add a row here too** in the same PR.
A static manifest of every video type, game genre, content warning, tech note, store, link field and cross-post platform surfaced in YTDescGen's editor (as of v1.3.0). 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.
@@ -11,6 +11,7 @@ This file exists for **transparency** — anyone curious about what the editor c
- 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)
- Tech notes: [`src/config/tech-note-groups.ts`](../src/config/tech-note-groups.ts)
- Stores: [`src/config/platforms.ts`](../src/config/platforms.ts)
- Social & donate links: [`src/config/social-fields.ts`](../src/config/social-fields.ts)
- Community links: [`src/components/editor/CommunityEditor.tsx`](../src/components/editor/CommunityEditor.tsx)
@@ -101,7 +102,7 @@ Bulk-select groups available in the editor: **All RPGs** (rpg + jrpg + action_rp
---
## 3. Content warnings (248, grouped)
## 3. Content warnings (257, grouped)
Selected warnings are rendered in a `▸ ⚠️ CONTENT WARNINGS` block in the description, after the rig block (and the mod list, for Modded Gameplay). Each group is collapsible in the editor; warnings render in description order = user's selection order.
@@ -133,13 +134,13 @@ Anxiety-inducing scenes · Depression themes · Eating disorders · Substance us
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 · Body shaming / appearance mockery · Unrealistic beauty standards
### Internet / Digital life (18)
### Internet / Digital life (19)
Cyberbullying / online harassment · Doxxing / privacy exposure · Trolling / griefing · Cancel culture / public shaming · Social media addiction · Doomscrolling · FOMO (fear of missing out) · Fake news / misinformation · Online scams / phishing · Catfishing / fake identity · Deepfakes / synthetic media · Cyberstalking · Dangerous viral challenges · Influencer culture / clout chasing · Online radicalization / echo chambers · Loot boxes / gacha mechanics · AI / artificial intelligence themes · Data privacy / mass surveillance
Cyberbullying / online harassment · Doxxing / privacy exposure · Trolling / griefing · Cancel culture / public shaming · Social media addiction · Doomscrolling · FOMO (fear of missing out) · Fake news / misinformation · Online scams / phishing · Catfishing / fake identity · Deepfakes / synthetic media · Cyberstalking · Dangerous viral challenges · Influencer culture / clout chasing · Online radicalization / echo chambers · Loot boxes / gacha mechanics · In-game purchases · AI / artificial intelligence themes · Data privacy / mass surveillance
### Mature / Sensitive content (66)
### Mature / Sensitive content (67)
Blood and gore · Mature 18+ · Revealing / skimpy outfits · Partial nudity · Sexualized character designs · Fan service / ecchi · Suggestive poses / camera angles · 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)
Blood and gore · Mature 18+ · Revealing / skimpy outfits · Partial nudity · Sexualized character designs · Fan service / ecchi · Suggestive poses / camera angles · Disturbing imagery · Animal cruelty · Violence against minors · Domestic violence · Sexual assault references · Torture · Religious themes · War violence · Discrimination · State / police violence · Smoking / drinking · Simulated gambling · 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)
@@ -153,9 +154,43 @@ Blind playthrough · No spoilers in chat · Casual / story mode · Hardcore / ma
Mods used · Cheats / debug · Glitches used · Guide-assisted · Educational / PSA purpose
### AI-generated content (7)
AI-generated content (general) · AI art / visuals · AI / synthetic voices · AI music / sound · AI-written text / dialogue · Generated live by AI while playing · AI use disclosed by the developer
The game itself is made or run with generative AI — a story _about_ AI is "AI / artificial intelligence themes" above. The split follows Steam's AI disclosure: content made with AI during development and shipped in the game, and content an AI generates live while you play. Machine translation is the **Language patch** field in Playthrough notes, so it has no warning here. YouTube doesn't ask for gameplay footage to be labelled as altered or synthetic; these lines are for viewers.
---
## 4. Stores (15 + publisher site)
## 4. Tech notes (25, grouped)
Selected notes are rendered in a `▸ 🛠 TECH NOTES` block right after the content warnings, in the order you picked them. They describe the recording, not the game. Facts that have their own field — difficulty, endings shown, language patch, game version, the upscaler and frame generation in Video settings — are not repeated here.
When **Upscaled from** is set in Video settings (v1.5.0), one more note is added on its own, after yours: _Upscaled to a higher resolution in editing — fine detail is reconstructed, so text, textures and edges may look slightly different from the original image._ It is not in the checklist below; the Upscale line in Video settings says what was upscaled to what.
### Audio (5)
Some sections muted (copyright) · Volume reduced (copyright) · Game music replaced (copyright) · Cutscene audio muted only · Original audio kept (claim risk)
### Video quality (4)
Low resolution (hardware) · Lower graphics (performance) · FPS drops (hardware) · Upscaling / frame-gen artifacts
### Recording issues (4)
Bugs are from the game · Crash kept (transparency) · Loading screens cut · Possible OBS artifacts
### Playstyle disclaimers (8)
NOT a no-hit run · Not a clean walkthrough · Casual, no commentary · Many deaths · Slow exploration · May get stuck on puzzles · Grinding cut · Not a speedrun
### Production & attribution (4)
Exploration-focused (skip combat) · Edited for pacing · Support the developers · Online connectivity issues
---
## 5. Stores (15 + publisher site)
Each store has a link field. A store link pasted anywhere in the editor lands in the right field; the first one also sets the video's platform, whose search name is used in the tags. Each link is marked paid, free or demo.
@@ -180,7 +215,7 @@ Each store has a link field. A store link pasted anywhere in the editor lands in
---
## 5. Social, donate & community links
## 6. Social, donate & community links
### Donate (5)
@@ -205,7 +240,7 @@ For the Donate (Vietnam) block — bank transfer, MoMo and ZaloPay — which ren
---
## 6. Cross-post platforms (7)
## 7. Cross-post platforms (7)
The Social tab turns the same editor data into short-form captions. When a caption runs over the platform's limit, optional blocks are dropped (content warnings first); hashtags are capped per platform.
@@ -221,17 +256,18 @@ The Social tab turns the same editor data into short-form captions. When a capti
---
## 7. Maintenance
## 8. 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) (plus its title, intro and pinned-comment greeting in every `templates.json`) AND add a row in section 1 above.
2. **Genres** → append to [`src/config/genres.ts`](../src/config/genres.ts) (plus its tag pool and search term in `src/engine/tag-generator.ts` — a test keeps them in sync) 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. **Stores** → add to [`src/config/platforms.ts`](../src/config/platforms.ts) (URL pattern and `tagName`; optionally a game-name extractor in `src/utils/url-extractors.ts`) AND add a row in section 4.
5. **Social / donate links** → add to [`src/config/social-fields.ts`](../src/config/social-fields.ts) (plus its `social.<id>` label in every `ui.json`) AND add it to section 5.
6. **Vietnamese banks** → add to [`src/config/vietnamese-banks.ts`](../src/config/vietnamese-banks.ts) — for a renamed bank, add the new name and map the old one in `VIETNAMESE_BANK_RENAMES` — AND update section 5.
7. **Cross-post platforms** → add to [`src/config/social-platforms.ts`](../src/config/social-platforms.ts) (plus its `socialPost.platforms.<id>` label in every `ui.json`) AND add a row in section 6.
8. Update the Vietnamese mirror at [`docs/i18n/vi/CONTENT-INVENTORY.md`](./i18n/vi/CONTENT-INVENTORY.md) in the same PR.
3. **Content warnings** → append the id to `CONTENT_WARNINGS` in `src/engine/types.ts` and to the relevant group in [`src/config/content-warning-groups.ts`](../src/config/content-warning-groups.ts), plus its editor label and description bullet in every locale and `_schema.json` (a test fails without them), AND add the label to the right group in section 3 — keep the counts in the headings accurate.
4. **Tech notes** → the same in `TECH_NOTES` and [`src/config/tech-note-groups.ts`](../src/config/tech-note-groups.ts) AND section 4.
5. **Stores** → add to [`src/config/platforms.ts`](../src/config/platforms.ts) (URL pattern and `tagName`; optionally a game-name extractor in `src/utils/url-extractors.ts`) AND add a row in section 5.
6. **Social / donate links** → add to [`src/config/social-fields.ts`](../src/config/social-fields.ts) (plus its `social.<id>` label in every `ui.json`) AND add it to section 6.
7. **Vietnamese banks** → add to [`src/config/vietnamese-banks.ts`](../src/config/vietnamese-banks.ts) — for a renamed bank, add the new name and map the old one in `VIETNAMESE_BANK_RENAMES` — AND update section 6.
8. **Cross-post platforms** → add to [`src/config/social-platforms.ts`](../src/config/social-platforms.ts) (plus its `socialPost.platforms.<id>` label in every `ui.json`) AND add a row in section 7.
9. 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.
+11 -9
View File
@@ -21,13 +21,13 @@ macOS and Linux work for development. Tauri release builds are cross-compiled or
Install in this order:
| Tool | Version | Why |
| ----------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Node.js** | **22** — the version in `.node-version` | CI, the release workflows and Cloudflare Workers Builds all read `.node-version`. Vite 8 needs Node `^20.19` or `>= 22.12` and wrangler needs `>= 22`, so use 22.12 or newer. Use [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) (fnm reads `.node-version`). |
| **npm** | bundled with Node 22 | The project uses npm; `pnpm` and `yarn` are not tested. |
| **Rust** | stable, `>= 1.90` | Required for the Tauri desktop and Android builds (Tauri 2.12 needs Rust 1.90). Install via [rustup](https://rustup.rs/); its default profile includes `rustfmt` and `clippy`. |
| **Python** | `3.12` | Optional — only needed for some Tauri platform tooling on Windows. |
| **Tauri prerequisites** | per OS | See <https://v2.tauri.app/start/prerequisites/>. |
| Tool | Version | Why |
| ----------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Node.js** | **26** — the version in `.node-version` | CI, the release workflows and Cloudflare Workers Builds all read `.node-version`, and `package.json` declares `engines.node >= 26`. Use [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) (fnm reads `.node-version`). |
| **npm** | 11, bundled with Node 26 | The project uses npm; `pnpm` and `yarn` are not tested. |
| **Rust** | stable, `>= 1.90` | Required for the Tauri desktop and Android builds (Tauri 2.12 needs Rust 1.90). Install via [rustup](https://rustup.rs/); its default profile includes `rustfmt` and `clippy`. |
| **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
@@ -51,7 +51,7 @@ The reference workflow uses **JetBrains 2026.x** IDEs (WebStorm or RustRover) as
- 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 → Languages → TypeScript → keep the IDE's bundled TypeScript service. `node_modules/typescript` is not the compiler: it is an npm alias for `@typescript/typescript6`, the TypeScript 6.0 API that typescript-eslint loads. The project type-checks with TypeScript 7 (`tsc`, from `@typescript/native`) — `npm run typecheck` is the source of truth.
- Settings → Code Style → Prettier → Run on save (`{src,tests,scripts,worker,build-plugins}/**/*.{ts,tsx,css}` — the same files `npm run format` covers).
### VS Code
@@ -86,6 +86,7 @@ The dev server is the app alone: no Turnstile gate and no analytics. To run the
- Branch from `main` (`feat/…`, `fix/…`, `docs/…`, `chore/…`) and open the pull request against `main`. There is no other long-lived branch, and every merge to `main` deploys the web app.
- PR titles use the commit format `type(scope): message`; CI checks them.
- Every PR runs the `check` job (below), `dependency-review`, `workflow-lint`, `reuse` and `pr-title`; the Rust jobs `lint-and-test` and `cargo-deny` run when `src-tauri/` changes.
- After `check`, the `sonarcloud` job sends the code and the coverage report to [SonarCloud](https://sonarcloud.io/project/overview?id=poli0981_youtube-generator) (settings in `sonar-project.properties`) and fails when its quality gate does: new code needs A ratings, reviewed security hotspots, at most 3 % duplication and at least 80 % coverage. PRs from forks and from Dependabot skip it — they get no `SONAR_TOKEN` — and `main` is analysed after every merge.
Full rules: [CONTRIBUTING.md](../CONTRIBUTING.md).
@@ -115,7 +116,7 @@ Full rules: [CONTRIBUTING.md](../CONTRIBUTING.md).
| `npm run validate:locales` | Enforces all 8 locales match `_schema.json` exactly. **Must pass before any locale-touching PR merges.** |
| `npm run test` | Vitest watch mode. |
| `npm run test:run` | Vitest single-run. |
| `npm run test:coverage` | Single run with a coverage report into `coverage/`; fails below the thresholds for `src/engine/` and `worker/` set in `vitest.config.ts`. This is what CI runs. |
| `npm run test:coverage` | Single run with a coverage report into `coverage/` — the logic layers, and `lcov.info` goes to SonarCloud; fails below the thresholds for `src/engine/` and `worker/` set in `vitest.config.ts`. This is what CI runs. |
| `npm run check:version` | Asserts all **six** version fields agree (`package.json`, both `package-lock.json` entries, `tauri.conf.json`, `Cargo.toml`, `Cargo.lock`). The only thing that notices a missed one. |
| `npm run check:tauri` | The `@tauri-apps/*` npm packages and the Tauri crates must share major.minor. The Tauri CLI refuses to build otherwise, and CI never runs a Tauri build. |
| `npm run check:licenses` | Every bundled package has an allowed license, and `THIRD_PARTY_NOTICES.md` matches what is installed. |
@@ -245,3 +246,4 @@ docs/I18N.md). The restart advice above still applies to all of them.
- [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.
- [Top-level ACCESSIBILITY.md](../ACCESSIBILITY.md) — what works with assistive technology, and the checklist for UI changes.
+95 -35
View File
@@ -1,6 +1,6 @@
# Complete Feature List
## YTDescGen — All Features (v1.0.0 + Planned)
## YTDescGen — All Features (v1.5.1 + Planned)
---
@@ -142,7 +142,7 @@ is now "X (Twitter)" (same `twitter` id, so saved links still load).
Bank, Cake by VPBank and Timo; a profile saved with OceanBank, CBBank or
DongA Bank is offered the new name in one click.
## 💻 Rig Fields (10 fields)
## 💻 Rig Fields (11 fields)
Printed in this order, with labels in the output language.
@@ -158,6 +158,13 @@ Printed in this order, with labels in the output language.
| `capture` | Capture Software | Text | OBS Studio 31 |
| `controller` | Controller | Text | DualSense / Xbox Wireless Controller |
| `video_editor` | Video Editor | Dropdown + version | DaVinci Resolve Studio 19.1 |
| `lut` | LUT | Text with suggestions (DaVinci Resolve's own LUTs) — v1.4.0 | Arri Alexa LogC to Rec709 |
**LUT (v1.4.0)** — the LUT you grade with, on its own line right under the
video editor. The suggestions are LUTs that come with DaVinci Resolve, named
the way its LUT menu shows them; any other name is printed as typed. A pasted
file name or path (Explorer's _Copy as path_) is cut down to the LUT's name:
`"C:\…\Arri\Arri Alexa LogC to Rec709.dat"` → `Arri Alexa LogC to Rec709`.
**GPU catalog (v1.0.0)** — 198 models in 29 groups: NVIDIA GeForce (desktop
and laptop), AMD Radeon (including integrated), Intel Arc and integrated,
@@ -179,11 +186,11 @@ Every block is optional and skipped when empty. In order:
6. 🎮 Store links (heading depends on paid vs. free / demo links)
7. © Game copyright line (opt-in)
8. 🧪 Playtest / early access (when a playtest link is set)
9. 🖥 Video settings (skipped for games without graphics settings)
9. 🖥 Video settings (games without graphics settings keep only the upscale and video-style lines)
10. 💻 My rig
11. 🧩 Mod list (Modded Gameplay only)
12. ⚠️ Content warnings (248 IDs across 12 groups)
13. Tech notes
12. ⚠️ Content warnings (257 IDs across 13 groups, incl. AI-generated content — v1.2.0)
13. 🛠 Tech notes (25 IDs across 5 groups, plus an automatic note for an upscaled video — v1.5.0)
14. Translation-quality note (opt-in; not for English or Vietnamese)
15. 🎁 Sponsor credit (opt-in)
16. 🤝 Sponsors & partners (opt-in)
@@ -201,6 +208,25 @@ Every block is optional and skipped when empty. In order:
27. Hashtags (1–3, auto-generated)
```
**Upscaled video (v1.5.0)** — Video settings › **Upscaled from** is for
footage recorded at a lower resolution and upscaled in the video editor
(1440p → 4K, say). The title badge reads `[4K Upscaled]` (`[2K Upscaled]`,
`[4K Upscaled 120FPS]`; the word in the output language), the Video settings
block gets a line under the resolution — the editor taken from My Rig:
```
Video: 4K - 60 FPS
Upscale: 1440p → 4K (DaVinci Resolve Studio 21.2)
```
and Tech notes gets a note of its own: _Upscaled to a higher resolution in
editing — fine detail is reconstructed, so text, textures and edges may look
slightly different from the original image._ It isn't in the checklist and
goes away with the upscale. Only resolutions below the video's are offered;
lowering the resolution to or below the source ends the upscale. 1080p 60fps
still has no badge, and the Upscale line stays when the graphics settings are
hidden. Saved with the channel profile.
With one output language selected, the Output page shows content warnings,
tech notes and playthrough notes bilingually (English · output language)
unless the output is English; with several languages selected, each tab —
@@ -254,6 +280,7 @@ per platform).
| Pool | Triggered By | Sample Output |
| ------------ | --------------------------------- | ------------------------------------------------------------------------ |
| Game name | Always | `[game]` (shortened to fit 30 characters) |
| Boss name | Boss Fight / Boss No Hit (v1.4.0) | `[boss]` — the Boss Name field, without punctuation |
| Core | Always, in the output language | `[game] gameplay`, `[game] no commentary`, `gameplay no commentary` |
| Genre | Each selected genre | `horror game no commentary`, `RPG gameplay no commentary` |
| VideoType | Video type | `[game] boss fight`, `[game] speedrun`, `[game] all endings` |
@@ -276,6 +303,17 @@ per platform).
Game names are cleaned of characters YouTube splits tags on (`,` `;` `|`) and
of ™ / ® / ©.
**Boss name tag (v1.4.0)** — Boss Fight and Boss No Hit videos get the boss's
name as a tag of its own, right after the game's name, so fitting the list to
500 characters never drops it. Marks that add nothing to a search go: `,` `:`
`;` `!` `?` quotes, brackets, `&`, `「」` `・` `、`, ™, emoji. A dot is kept
between digits ("Phase 2.0"), dropped between initials ("S.T.A.L.K.E.R." →
`STALKER`) and a space anywhere else ("Mr. X" / "Mr.X" → `Mr X`); apostrophes
and hyphens stay inside a word ("Mergo's Wet Nurse", "T-103"). "Gael, Slave
Knight" → `Gael Slave Knight`. Over 30 characters, the name before its title is
used ("Loretta, Knight of the Haligtree" → `Loretta`), otherwise the leading
words that fit.
## ⚡ Faster Data Entry (v1.0.0)
- **Quick start** — at the top of the editor, pick a **channel profile** and
@@ -329,19 +367,39 @@ a pasted store link can each be undone from the toast they show.
- Dark and light themes; scrollbars can be hidden (v1.1.0); animated icons
follow the system's _reduce motion_; controls grow on touch screens.
### ♿ Accessibility (v1.5.1)
The statement is [ACCESSIBILITY.md](../ACCESSIBILITY.md) (also in the Legal
Center, in English and Vietnamese). In short:
- **Keyboard** — everything works without a mouse: skip link, visible focus,
dialogs that keep and return focus, the shortcuts below; the bare `?` can
be turned off (Settings › Editor › Single-key shortcuts, WCAG 2.1.4).
- **Screen readers** — named controls and labelled fields, announced
confirmations and errors, the new page's name read out after a navigation
(`RouteAnnouncer`), translated toast labels, and generated text marked with
its language (`lang`) so it is read with the right voice.
- **Vision** — both themes at WCAG AA text contrast, checked by
`tests/styles/contrast.test.ts`; white text sits on the darker
`accent-solid` / `danger-solid` fills; focus stays visible in Windows High
Contrast; desktop zoom with Ctrl/⌘ + = / − (`zoomHotkeysEnabled`).
- **Reporting** — the _Accessibility barrier_ issue form
(`.github/ISSUE_TEMPLATE/accessibility.yml`), or `contact@` with
`[Accessibility]`.
## 💾 Data Persistence
Everything stays on the device: the browser's storage for
`ytgenerator.stream` on the web, the app's own storage on desktop and
Android. There is no account and no server-side copy.
| Item | What it holds | Where |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| **Profile** — the channel | Channel name; contact emails (general, advertising, game keys, copyright); social and donate links; community links; Vietnamese bank / MoMo / ZaloPay details; rig; resolution, FPS and graphics preset; sponsors & partners text | Profiles › Profiles |
| **Game preset** — the game | Game name (+ per-language names); genres; platform; store links and their type (paid / free / demo); publisher / developer; content warnings; language patch; game version; art style; "no graphics settings"; series playlist | Profiles › Game presets |
| **Template** — the whole form | Every editor field | Profiles › Templates |
| **History** | One entry per video — game, video type, language, genres, title, description, tags. Saving the same video again updates its entry (v1.0.0) | History |
| **Draft** | The editor form, saved as you type | — |
| Item | What it holds | Where |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| **Profile** — the channel | Channel name; contact emails (general, advertising, game keys, copyright); social and donate links; community links; Vietnamese bank / MoMo / ZaloPay details; rig; resolution (and what it was upscaled from), FPS and graphics preset; sponsors & partners text | Profiles › Profiles |
| **Game preset** — the game | Game name (+ per-language names); genres; platform; store links and their type (paid / free / demo); publisher / developer; content warnings; language patch; game version; art style; "no graphics settings"; series playlist | Profiles › Game presets |
| **Template** — the whole form | Every editor field | Profiles › Templates |
| **History** | One entry per video — game, video type, language, genres, title, description, tags. Saving the same video again updates its entry (v1.0.0) | History |
| **Draft** | The editor form, saved as you type | — |
The field lists live in `src/config/library-fields.ts`. Profiles, presets and
templates export and import as JSON; History exports as **CSV** or JSON.
@@ -378,32 +436,35 @@ In **Settings › Backup & restore**:
| `Ctrl/⌘+Shift+C` | Copy All — same limits and Strict Mode rules as the Output page |
| `Ctrl/⌘+S` | Save the current output to History |
| `Ctrl/⌘+B` | Collapse / expand the sidebar |
| `Ctrl/⌘+/` or `?` | Show keyboard shortcuts (`?` only outside text fields) |
| `Alt+T` | Go to the notifications (while any are on screen) |
| `Ctrl/⌘+/` or `?` | Show keyboard shortcuts (`?` only outside text fields, while Settings › Editor › Single-key shortcuts is on) |
| `Ctrl/⌘+=` / `Ctrl/⌘+−` | Zoom in / out — desktop app (v1.5.1) |
| `Escape` | Close modal |
## 🔧 Settings
| Setting | Type | Default | Description |
| -------------------------- | ------------------------------- | ---------------- | ---------------------------------------------------------------------------------- |
| Theme | dark / light | dark | App color theme |
| Hide scrollbars | boolean | false | v1.1.0. No scrollbar anywhere in the app; wheel, touch and keyboard still scroll |
| App Language | SupportedLanguage | browser-detected | Language of the interface |
| Default Output Language | SupportedLanguage | browser-detected | Language a new draft starts in (first run, Start over) |
| Show Character Count | boolean | true | Display char counters on output. **Does not** affect copy blocking |
| Compact Tag Display | boolean | false | Tags as comma list vs chip display |
| Copy All includes the tags | boolean | false | v1.0.0. Copy All copies title, description, then tags |
| **Strict Mode** | boolean | **false** | v0.35.0. Blocks Generate / Copy / Export while any field has a hard error |
| Show quality badge | boolean | true | `[2K 60FPS]`-style badge in the title when resolution or FPS is above the defaults |
| Title order | game first / video first | game first | v1.0.0. "Hades — Part 3" or "Part 3 — Hades" |
| Quality badge position | prefix / middle / suffix | middle | Where the badge sits in the title |
| Segment separator | em dash / hyphen / colon / pipe | em dash | Characters come from each locale |
| Badge case | upper / lower | upper | "2K" or "2k" |
| Include Multilingual Tags | boolean | true | Add tags in the output language |
| Include Trending Tags | boolean | true | Add year-based trending tags |
| Hashtag Count | 1-3 | 3 | Number of hashtags to generate |
| Genre Playlists | map | `{}` | One playlist URL per genre (42), collapsed by default |
| History Limit | 10–500 | 100 | Max history entries to keep |
| Log Retention | 1–90 days | 7 | Log files older than this are deleted at boot |
| Setting | Type | Default | Description |
| -------------------------- | ------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Theme | dark / light | dark | App color theme |
| Hide scrollbars | boolean | false | v1.1.0. No scrollbar anywhere in the app; wheel, touch and keyboard still scroll |
| App Language | SupportedLanguage | browser-detected | Language of the interface |
| Default Output Language | SupportedLanguage | browser-detected | Language a new draft starts in (first run, Start over) |
| Show Character Count | boolean | true | Display char counters on output. **Does not** affect copy blocking |
| Compact Tag Display | boolean | false | Tags as comma list vs chip display |
| Copy All includes the tags | boolean | false | v1.0.0. Copy All copies title, description, then tags |
| Single-key shortcuts | boolean | true | v1.5.1. `?` opens the shortcut list outside text fields; off leaves Ctrl/⌘ + / only (speech input, stray key presses) |
| **Strict Mode** | boolean | **false** | v0.35.0. Blocks Generate / Copy / Export while any field has a hard error |
| Show quality badge | boolean | true | `[2K 60FPS]`-style badge in the title when resolution or FPS is above the defaults; `[4K Upscaled]` for an upscaled video (v1.5.0) |
| Title order | game first / video first | game first | v1.0.0. "Hades — Part 3" or "Part 3 — Hades" |
| Quality badge position | prefix / middle / suffix | middle | Where the badge sits in the title |
| Segment separator | em dash / hyphen / colon / pipe | em dash | Characters come from each locale |
| Badge case | upper / lower | upper | "2K" or "2k" |
| Include Multilingual Tags | boolean | true | Add tags in the output language |
| Include Trending Tags | boolean | true | Add year-based trending tags |
| Hashtag Count | 1-3 | 3 | Number of hashtags to generate |
| Genre Playlists | map | `{}` | One playlist URL per genre (42), collapsed by default |
| History Limit | 10–500 | 100 | Max history entries to keep |
| Log Retention | 1–90 days | 7 | Log files older than this are deleted at boot |
"Browser-detected" means the browser's language when it is one of the eight,
otherwise English. `Default Genre` and `Auto-save Draft` were removed in
@@ -523,4 +584,3 @@ See [ROADMAP.md](./ROADMAP.md) for the post-1.0 backlog.
| Template Marketplace | Share/import community templates | Medium |
| AI Tag Suggestions | Use game name to suggest trending tags | Medium |
| Thumbnail Text | Generate text overlay suggestions for thumbnails | Low |
| Multi-channel | Support multiple YouTube channels per profile | Low |
+57 -6
View File
@@ -49,13 +49,52 @@ If `TURNSTILE_SECRET` is missing the gate **fails open** (the site stays up and
- **`/.well-known/security.txt`** (RFC 9116) is regenerated on every build, so `Expires` is always about six months ahead.
- **Legal pages** are rendered from the repository's Markdown at build time, to static `/legal/*.html` and to a lazy chunk for the in-app Legal Center.
## Rate limiting
Two layers, cheapest first. Both count per client IP — before the gate there is no other identity — so the limits are generous enough for several people behind one shared address (mobile carrier NAT, an office, a school).
| Layer | Configured in | Counts | Limit | Over the limit |
| ----------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------ |
| 1. WAF rate limiting rule | Cloudflare dashboard, [by hand](#waf-rate-limiting-rule-one-time) | Every request at the edge except `/assets/*`, per IP; verified bots (search engines) excluded | 60 / 10 s | Cloudflare's own `429` page (error 1015) for 10 s. The Worker never runs, so a blocked flood costs nothing |
| 2. Worker `RATE_LIMIT` | `wrangler.jsonc` › `ratelimits`, checked first in [`worker/rate-limit.ts`](../worker/rate-limit.ts) | Every request the Worker handles — the gate page, the app shell, legal pages, `/__gate/*`, any method — per IPv4 address or IPv6 /64 | 120 / 60 s | `429` plain text, `Retry-After: 60`, `Cache-Control: no-store`, the baseline headers; nothing else runs |
| 2. Worker `VERIFY_RATE_LIMIT` | `wrangler.jsonc` › `ratelimits` | `POST /__gate/verify`, on top of `RATE_LIMIT` | 10 / 60 s | `429` JSON `{"ok":false,"error":"rate-limited"}` before any siteverify call; the gate page shows its "try again" message |
- **Approximate, per location.** The Workers Rate Limiting API keeps its counters per Cloudflare location and updates them asynchronously, so a burst can pass the limit by a little. It turns a flood from one client into cheap `429`s; it is not a quota. Many addresses at once (a botnet) are the job of the WAF, Bot Fight Mode and the Turnstile gate itself.
- **IPv6 by /64.** One connection usually holds a whole /64, so counting single addresses would let a client rotate past the limit.
- **Fails open**, like the gate: a missing binding or a failing `limit()` call lets the request through and logs once per isolate.
- **Not counted by the Worker**: `/assets/*` and the public files that skip the Worker (see [Request flow](#request-flow)). Static-asset requests are free and are not Worker invocations; only the WAF rule sees them.
- **Changing a limit**: edit `limit` in `wrangler.jsonc` and merge. `period` may only be 10 or 60 and must equal `RATE_LIMIT_PERIOD_SECONDS` in [`worker/env.ts`](../worker/env.ts) (it is the `Retry-After`); `namespace_id` must be unique in the Cloudflare account, and changing it starts the counters from zero. `tests/worker/rate-limit.test.ts` checks the bindings against the code.
- **Seeing it work**: the bindings don't appear in the dashboard. The Worker's `429`s are in its logs (Observability); the WAF's blocks are under Security › Events.
### WAF rate limiting rule (one-time)
The zone is on the Free plan, which allows **one** rate limiting rule: counted by IP, over 10 seconds, blocking for 10 seconds, with Cloudflare's default response (a custom response needs Pro). It runs at the edge before the Worker, so it is the first layer.
1. Cloudflare dashboard › `ytgenerator.stream` › **Security** › **Security rules** › **Create rule** › **Rate limiting rules**.
2. **Rule name**: `Flood guard`.
3. **If incoming requests match** › **Edit expression**:
```txt
(not http.request.uri.path contains "/assets/" and not cf.bot_management.verified_bot)
```
In the builder that is _URI Path_ · _does not contain_ · `/assets/` **And** _Verified Bot_ · _equals_ · Off. Content-hashed build output is left out because a first visit fetches dozens of those files at once and a returning browser caches them for a year; verified bots so that search engines are never blocked.
4. **With the same characteristics**: IP (the only choice on Free).
5. **When rate exceeds**: **Requests** `60`, **Period** 10 seconds. A page load is about five counted requests (the page, `theme-init.js`, favicon, manifest, an icon), so 60 is a dozen reloads in ten seconds.
6. **Then take action**: **Block**; **Duration** 10 seconds.
7. **Deploy**.
If the dashboard refuses the expression, match all incoming requests instead and raise **Requests** to `100` — a first visit with an empty cache is about 40 requests once the build output counts (measured on the v1.3.2 build: the page, `theme-init.js` and 33 files under `/assets/`, plus favicon and manifest).
## Configuration and secrets
| Name | Kind | Where |
| -------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `TURNSTILE_SITE_KEY` | public var | `wrangler.jsonc` |
| `GATE_TTL_SECONDS` | public var | `wrangler.jsonc` |
| `TURNSTILE_SECRET` | **Secret** | Cloudflare dashboard (Worker › Settings › Variables and Secrets) or `npx wrangler secret put TURNSTILE_SECRET`. Never committed |
| Name | Kind | Where |
| --------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `TURNSTILE_SITE_KEY` | public var | `wrangler.jsonc` |
| `GATE_TTL_SECONDS` | public var | `wrangler.jsonc` |
| `TURNSTILE_SECRET` | **Secret** | Cloudflare dashboard (Worker › Settings › Variables and Secrets) or `npx wrangler secret put TURNSTILE_SECRET`. Never committed |
| `RATE_LIMIT`, `VERIFY_RATE_LIMIT` | rate limit bindings | `wrangler.jsonc` › `ratelimits` (see [Rate limiting](#rate-limiting)) |
It must be a **Secret**, not a plain-text variable: `wrangler deploy` removes plain-text variables that `wrangler.jsonc` doesn't declare, and keeps secrets.
@@ -65,11 +104,12 @@ The custom domain is declared in `routes` because `wrangler deploy` detaches any
These live in Cloudflare, not in the repository:
1. **Workers Builds** — build command empty (`wrangler.jsonc` runs `npm run build`), deploy command `npx wrangler deploy`, non-production deploy command `npx wrangler versions upload`. Root directory `/`; Node comes from `.node-version`.
1. **Workers Builds** — build command empty (`wrangler.jsonc` runs `npm run build`), deploy command `npx wrangler deploy`, non-production deploy command `npx wrangler versions upload`. Root directory `/`; Node 26 comes from `.node-version`, and the build variable `NODE_VERSION=26` says the same.
2. **Turnstile widget** — hostname `ytgenerator.stream` (add the `workers.dev` subdomain if preview URLs should pass the gate).
3. **Web Analytics** — the manual beacon is used; turn off _automatic setup_ for the hostname so visits aren't counted twice.
4. **Redirect rule** — `www.ytgenerator.stream/*` → `concat("https://ytgenerator.stream", http.request.uri.path)`, 301, preserving the query string.
5. **HSTS** — enabled at the zone with `includeSubDomains` and `preload`.
6. **WAF rate limiting rule** — `Flood guard`, 60 requests per 10 s per IP outside `/assets/`; see [WAF rate limiting rule](#waf-rate-limiting-rule-one-time).
## Local development
@@ -98,3 +138,14 @@ curl -s https://ytgenerator.stream/.well-known/security.txt
curl -sI https://ytgenerator.stream/legal/privacy # public, script-free CSP
curl -sI https://www.ytgenerator.stream/x?y=1 # 301 to https://ytgenerator.stream/x?y=1
```
Rate limits: a burst from one address should turn into `429`s. This locks that address out of the site for up to a minute.
```bash
# Worker layer: about 120 × 200, then 429 with Retry-After: 60
for i in $(seq 1 130); do curl -s -o /dev/null -w "%{http_code}\n" https://ytgenerator.stream/; done | sort | uniq -c
# verify: 403 (foreign Origin) ten times, then 429 — no siteverify call is made
for i in $(seq 1 12); do curl -s -o /dev/null -w "%{http_code}\n" -X POST -H "Origin: https://example.com" -H "Content-Type: application/json" -d "{}" https://ytgenerator.stream/__gate/verify; done | sort | uniq -c
```
With the WAF rule in place, a fast enough burst (more than 60 in 10 s) is stopped at the edge first: Cloudflare's `429` (error 1015) instead of the Worker's.
+6 -6
View File
@@ -341,15 +341,15 @@ npm run typecheck && npm run typecheck:all
## Locale Validation Script
The `scripts/validate-locales.ts` script checks every locale folder against
`_schema.json`. At v1.1.0 (1,253 UI + 574 template keys per locale):
`_schema.json`. At v1.3.0 (1,264 UI + 584 template keys per locale):
```
✓ en/ui.json — 1253/1253 keys
✓ en/templates.json — 574/574 keys
✓ es/ui.json — 1253/1253 keys
✓ es/templates.json — 574/574 keys
✓ en/ui.json — 1264/1264 keys
✓ en/templates.json — 584/584 keys
✓ es/ui.json — 1264/1264 keys
✓ es/templates.json — 584/584 keys
…
✓ zh/templates.json — 574/574 keys
✓ zh/templates.json — 584/584 keys
All locale files are complete!
```
+43 -20
View File
@@ -2,7 +2,7 @@
## YTDescGen — Tauri 2 Desktop and Android Apps
Reflects **v1.0.0**: Windows, macOS (Apple silicon) and Linux desktop apps plus an Android APK, all built from the same Tauri 2 project in `src-tauri/`. The web app is deployed separately — see [HOSTING.md](HOSTING.md).
Reflects **v1.5.1**: Windows, macOS (Apple silicon) and Linux desktop apps plus an Android APK, all built from the same Tauri 2 project in `src-tauri/`. The web app is deployed separately — see [HOSTING.md](HOSTING.md).
---
@@ -10,7 +10,7 @@ Reflects **v1.0.0**: Windows, macOS (Apple silicon) and Linux desktop apps plus
| Feature | Tauri 2 | Electron |
| ---------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| Download size | 3–6 MB installers (v0.38.0: MSI 4.6 MB, NSIS 3.2 MB, `.deb` 5.9 MB); the AppImage, which bundles its libraries, 80 MB | ~150 MB |
| Download size | 3–6 MB installers (v1.1.0: MSI 4.1 MB, NSIS 3.1 MB, `.deb` 5.3 MB); the AppImage, which bundles its libraries, 80 MB | ~150 MB |
| Memory usage | Lower — no second browser engine | Higher — bundled Chromium + Node.js |
| Bundled runtime | System WebView | Chromium |
| Backend language | Rust | Node.js |
@@ -22,7 +22,7 @@ The maintainer already knew Rust from the Tauri / build-tooling ecosystem; the s
## Prerequisites
- **Rust** (stable) via [rustup](https://rustup.rs/).
- **Node.js 22** (`.node-version`) and npm.
- **Node.js 26** (`.node-version`) and npm 11.
- **Tauri CLI** — the npm package `@tauri-apps/cli` is a pinned dev dependency, so `npm run tauri …` (or `npm run tauri:dev` / `npm run tauri:build`) needs nothing else. The cargo CLI (`cargo install tauri-cli --version "^2" --locked`, then `cargo tauri …`) works the same way; the Android release job uses it.
- **Platform tools**:
- Windows: Microsoft C++ Build Tools. WebView2 ships with Windows 10/11; the installers bootstrap it where it is missing (`webviewInstallMode: downloadBootstrapper`).
@@ -30,6 +30,8 @@ The maintainer already knew Rust from the Tauri / build-tooling ecosystem; the s
- Linux: `libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf` (what CI installs).
- **Android**: see [Android (.apk) Packaging](#android-apk-packaging).
`npm run tauri info` prints the Rust toolchain, WebView, Node and bundler versions it finds, and the bundle targets — run it first when a build fails; most "Tauri won't build" problems are a version mismatch.
`npm run check:tauri` fails when the `@tauri-apps/*` npm packages and the `tauri` crates differ in major.minor — `tauri build` refuses to run in that state, and no workflow runs `tauri build` before a release tag does.
## Project Setup
@@ -60,7 +62,7 @@ The icons come from the one brand logo: `npx tauri icon assets/brand/logo.svg` r
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
"productName": "YTDescGen",
"version": "1.0.0",
"version": "1.5.1",
"identifier": "com.skullmute.ytdescgen",
"build": {
"beforeBuildCommand": "npm run build",
@@ -79,7 +81,8 @@ The icons come from the one brand logo: `npx tauri icon assets/brand/logo.svg` r
"resizable": true,
"maximizable": true,
"fullscreen": false,
"center": true
"center": true,
"zoomHotkeysEnabled": true
}
],
"security": {
@@ -88,6 +91,7 @@ The icons come from the one brand logo: `npx tauri icon assets/brand/logo.svg` r
},
"bundle": {
"active": true,
"copyright": "Copyright 2026 poli0981 (SkullMute)",
"licenseFile": "installer-license.txt",
"icon": [
"icons/32x32.png",
@@ -100,6 +104,9 @@ The icons come from the one brand logo: `npx tauri icon assets/brand/logo.svg` r
"android": {
"minSdkVersion": 30
},
"macOS": {
"minimumSystemVersion": "11.0"
},
"windows": {
"webviewInstallMode": {
"type": "downloadBootstrapper"
@@ -116,6 +123,7 @@ Notes:
- There is **no `trayIcon` entry**: the tray icon is built in code (`lib.rs`), with the app icon — a `trayIcon` entry would add a second one.
- There is **no `updater` configuration** — see [Updates](#updates).
- `targets: "all"` builds every bundle the platform supports (MSI + NSIS on Windows, `.app` + `.dmg` on macOS, `.deb` + `.rpm` + AppImage on Linux); the release workflow narrows macOS to `.app`.
- `bundle.copyright` (v1.1.0) is the installers' copyright string — the Windows file properties, the macOS `Info.plist` and the Linux packages. `npm run check:copyright` (in CI) holds its year to the year of the newest commit, together with NOTICE and REUSE.toml, and `npm run update:copyright` rewrites all three: the first commit of a new year needs it.
> **Installer license page (v0.28).** The real `src-tauri/tauri.conf.json`
> sets `bundle.licenseFile: "installer-license.txt"` (path relative to
@@ -131,12 +139,14 @@ Notes:
```json
{
"identifier": "default",
"description": "Default capabilities for YTDescGen. File access goes through the app's own name-only commands and native dialogs run from Rust, so the webview gets no dialog, fs or shell permissions.",
"description": "Default capabilities for YTDescGen. File access goes through the app's own name-only commands and native dialogs run from Rust, so the webview gets no dialog, fs or shell permissions. set-webview-zoom backs the Ctrl/Cmd +/- zoom polyfill Tauri injects on macOS and Linux (zoomHotkeysEnabled).",
"windows": ["main"],
"permissions": ["core:default", "opener:default"]
"permissions": ["core:default", "core:webview:allow-set-webview-zoom", "opener:default"]
}
```
`zoomHotkeysEnabled` (v1.5.1) lets the desktop app zoom with Ctrl/⌘ + = and Ctrl/⌘ + − (WebView2's own zoom control on Windows, which also takes Ctrl + mouse wheel; a polyfill on macOS and Linux that calls `set_webview_zoom`, hence the permission). Android has no zoom hotkeys; pinch zoom works there.
The webview can call Tauri's core APIs, the opener plugin (external links open in the system browser, mail client or dialler) and the app's own commands — nothing else. v1.0.0 removed the `fs` and `shell` plugins and their permissions. `tauri-plugin-dialog` is still a dependency, but only Rust uses it: the webview has no dialog permission and no dialog JavaScript package. (`tauri-plugin-fs` still appears in `Cargo.lock` as a dependency of the dialog plugin; the app does not register it.)
### 3. Rust Backend (src-tauri/src)
@@ -201,10 +211,10 @@ The commands:
What makes them safe:
- **Names, not paths.** `storage.rs` builds every path itself, under Tauri's `app_data_dir()`, from a name that must match `ytdescgen-<lowercase letters, digits, hyphens>.json` (at most 100 bytes) for backups or `ytdescgen-YYYYMMDD.jsonl` for logs. Anything else — `..`, separators, other extensions — is rejected before a path exists.
- **Dialogs run in Rust.** `file_dialog.rs` accepts only the extensions `json`, `jsonl`, `txt`, `csv` and `md`; reduces a suggested name to its file name (`../../x/backup.json` → `backup.json`); makes a saved file end in an allowed extension (`backup` → `backup.json`, `backup.exe` → `backup.exe.json`); and refuses imports over 20 MB or that are not UTF-8 (a byte-order mark is stripped). The chosen path never passes through JavaScript. On desktop the dialog is attached to the app window.
- **Dialogs run in Rust.** `file_dialog.rs` accepts only the extensions `json`, `jsonl`, `txt`, `csv` and `md`; reduces a suggested name to its file name (`../../x/backup.json` → `backup.json`); makes a saved file end in an allowed extension (`backup` → `backup.json`, `backup.exe` → `backup.exe.json`); and refuses imports over 20 MB or that are not UTF-8 (a byte-order mark is stripped). The chosen path never passes through JavaScript. On desktop the dialog is attached to the app window. Both commands are `async` and run the dialog and the file I/O through `tauri::async_runtime::spawn_blocking`: the dialogs' blocking API must stay off the main thread, and blocking work must not hold one of the async runtime's workers (SonarCloud `rust:S7493`).
- **Removed in v1.0.0**: the five commands that read, wrote, appended to, listed and deleted any path the webview sent (`save_to_file`, `read_from_file`, `append_to_file`, `list_dir`, `delete_file`), and the fs and shell plugins.
Both modules have unit tests (`cargo test` in `src-tauri/`): the name rules, path rejection, backup pruning, legacy recovery, dialog filters and the import checks.
Both modules have unit tests (`cargo test` in `src-tauri/`): the name rules, path rejection, backup pruning, legacy recovery, dialog filters, writing the picked file and the import checks.
### 4. Frontend Tauri Integration
@@ -265,6 +275,8 @@ A release bumps the version in **six places**, and `npm run check:version` (in C
`npm version --no-git-tag-version <version>` covers the first three; the Rust / Tauri files are edited by hand (cargo also rewrites the `Cargo.lock` entry on the next non-`--locked` build or check in `src-tauri/`). Add the `CHANGELOG.md` entry in the same change.
The copyright year is not part of the version, but the first release of a new year needs `npm run update:copyright` first — `check:copyright` fails until then (see the `bundle.copyright` note above).
## Build & Release
### Development
@@ -287,19 +299,21 @@ npm run build
npm run tauri:build
```
The Tauri CLI runs `npm run build` first (`beforeBuildCommand`) with `TAURI_ENV_PLATFORM` set, which switches Vite to the Tauri build: `es2020` target, the Legal Center content only, and no static legal pages, `security.txt` or analytics beacon.
The Tauri CLI runs `npm run build` first (`beforeBuildCommand`) with `TAURI_ENV_PLATFORM` set, which switches Vite to the Tauri build: the Legal Center content only, and no static legal pages, `security.txt` or analytics beacon.
Output file names, with the v0.38.0 release sizes:
**Supported WebViews.** Since v1.3.0 both builds use Vite's default target, `baseline-widely-available` — the same engines the website supports: Chromium 111, Safari 16.4, Firefox 114 (Tauri builds were lowered to `es2020` before; the stylesheet's cascade layers already needed Chromium 99+ / Safari 15.4+, so an older WebView showed the app unstyled anyway). In practice: WebView2 on Windows (it updates itself), macOS 11 or later with current Safari updates (the app is Apple silicon only, and `bundle.macOS.minimumSystemVersion` says 11.0), WebKitGTK 2.40 or later on Linux, and on Android 11+ an Android System WebView kept current through Google Play. TypeScript keeps the app's code to the same floor: `lib` in `tsconfig.json` is ES2022, since Vite lowers syntax but never polyfills built-ins.
Output file names, with the v1.1.0 release sizes:
| Platform | Bundle | File | Size |
| --------------------- | -------------------------------- | ---------------------------------------- | ------ |
| Windows | MSI | `YTDescGen_<version>_x64_en-US.msi` | 4.6 MB |
| Windows | NSIS | `YTDescGen_<version>_x64-setup.exe` | 3.2 MB |
| macOS (Apple silicon) | `.app`, archived by tauri-action | `YTDescGen_<version>_aarch64.app.tar.gz` | 4.4 MB |
| Linux | Debian | `YTDescGen_<version>_amd64.deb` | 5.9 MB |
| Linux | RPM | `YTDescGen-<version>-1.x86_64.rpm` | 5.9 MB |
| Windows | MSI | `YTDescGen_<version>_x64_en-US.msi` | 4.1 MB |
| Windows | NSIS | `YTDescGen_<version>_x64-setup.exe` | 3.1 MB |
| macOS (Apple silicon) | `.app`, archived by tauri-action | `YTDescGen_<version>_aarch64.app.tar.gz` | 4.1 MB |
| Linux | Debian | `YTDescGen_<version>_amd64.deb` | 5.3 MB |
| Linux | RPM | `YTDescGen-<version>-1.x86_64.rpm` | 5.3 MB |
| Linux | AppImage | `YTDescGen_<version>_amd64.AppImage` | 80 MB |
| Android | Universal APK | `app-universal-release.apk` | 57 MB |
| Android | Universal APK | `app-universal-release.apk` | 44 MB |
### GitHub Actions Release
@@ -321,7 +335,7 @@ The desktop build is a three-platform matrix; `tauri-apps/tauri-action` builds e
| Runner | Target | Output |
| ---------------- | -------------------------- | --------------------------- |
| `windows-latest` | `x86_64-pc-windows-msvc` | `.msi`, `.exe` (NSIS) |
| `macos-14` | `aarch64-apple-darwin` | `.app.tar.gz` |
| `macos-15` | `aarch64-apple-darwin` | `.app.tar.gz` |
| `ubuntu-latest` | `x86_64-unknown-linux-gnu` | `.AppImage`, `.deb`, `.rpm` |
Linux runners install `libwebkit2gtk-4.1-dev`, `libgtk-3-dev`, `libayatana-appindicator3-dev`, `librsvg2-dev` and `patchelf` before building — Tauri's webview and AppImage tooling need them. AppImage bundling runs with `APPIMAGE_EXTRACT_AND_RUN=1` (linuxdeploy needs FUSE, which hosted runners don't reliably provide) and `NO_STRIP=true`.
@@ -331,7 +345,7 @@ Linux runners install `libwebkit2gtk-4.1-dev`, `libgtk-3-dev`, `libayatana-appin
**macOS notes (v0.9.1+):**
- **DMG bundling is skipped** (`--bundles app`). Tauri's DMG bundler runs an AppleScript that flakes intermittently on hosted macOS runners (the headless display can't load Finder fast enough for `osascript` to position icons), so we ship a `.app.tar.gz` instead. Users expand the archive and drag the `.app` into `/Applications`.
- **Intel macOS (`macos-13`) is NOT built.** GitHub started deprecating the `macos-13` free runner pool in 2025; jobs queue indefinitely. If Intel support becomes a priority, switch the macos-14 entry's target to `universal-apple-darwin` (Tauri builds both archs and lipos them into one universal binary) — the runner already has the toolchain capacity.
- **Intel macOS (`macos-13`) is NOT built.** GitHub started deprecating the `macos-13` free runner pool in 2025; jobs queue indefinitely. If Intel support becomes a priority, switch the macos-15 entry's target to `universal-apple-darwin` (Tauri builds both archs and lipos them into one universal binary) — the runner already has the toolchain capacity.
**Code signing is intentionally skipped** for both Windows and macOS — this is an open-source personal tool, and signing certificates carry recurring cost. End users will see the standard "unverified publisher" / "unidentified developer" prompts on first launch. Document the bypass steps in the release notes if needed. (The Android APK is signed — see below.)
@@ -359,6 +373,13 @@ is gated behind `#[cfg(desktop)]` so the library compiles for Android.
| **Architectures** | Universal APK — `arm64-v8a`, `armeabi-v7a`, `x86`, `x86_64`. |
| **Tested** | **Android 11 → 16.** The v0.29.0 build was verified on Android emulators across this range **and on a real device running Android 12** (the maintainer's phone). |
**No cloud backup of app data.** `AndroidManifest.xml` sets
`android:allowBackup="false"` (since v1.3.0): Android's backup to Google Drive
never copies the app's data — profiles, presets, templates, history and
settings in the WebView's `localStorage` — so it stays on the device, as the
Privacy Policy says. To move to a new phone, use **Settings › Backup &
restore**: back up to a file, then restore it on the new phone.
Where the value lives: `bundle.android.minSdkVersion` in
[`src-tauri/tauri.conf.json`](../src-tauri/tauri.conf.json) is the source of
truth used by `tauri android init`; the generated
@@ -376,7 +397,9 @@ directly if you change the floor without re-running `init`.
the **real-device test on Android 12 worked**, while a _stale_ Android-12
emulator stuck on WebView 91 showed a black screen (the `crypto.randomUUID`
boot crash) — that class of bug is fixed in v0.29.0 and is moot on an
up-to-date WebView.
up-to-date WebView. Since v1.3.0 the app needs a WebView at least as new as
Chromium 111, the same floor as the website, so a WebView that has never
been updated cannot run it.
- **Security upkeep.** Even though Google's _OS-level_ monthly security bulletins
for Android 11–13 have ended (Android 12 in 2025, Android 13 in early 2026),
Android 11+ keeps receiving security updates for the components that matter to a
+71 -5
View File
@@ -2,7 +2,7 @@
## YTDescGen — Phased Development Plan
> **Status (2026-09-30): v1.0.0 has shipped.** Phases 1–4 are the original
> **Status (2026-11-09): v1.5.1 is the current release.** Phases 1–4 are the original
> plan, kept as a record; notes added beside or under an item say what has
> changed since. Every release is listed in [CHANGELOG.md](../CHANGELOG.md).
> What's next: Phase 5 and the backlog at the end of this page.
@@ -69,7 +69,8 @@
1.8 Testing
- [x] Vitest config
- [x] Engine unit tests (title, description, tags) — 42 tests
- [ ] Smoke tests for main pages (deferred to Phase 3)
- [ ] Smoke tests for main pages (deferred to Phase 3; still open — the
suite runs in Node without a DOM, see the backlog)
1.9 CI/CD
- [x] GitHub Actions: lint + typecheck + test
@@ -260,7 +261,8 @@
### Definition of Done
- [x] Windows installer < 15MB (4.1MB MSI), installs and runs
- [ ] macOS .app < 15MB (CI-only, not locally testable)
- [x] macOS .app < 15MB (CI-only, not locally testable; 4.1 MB `.app.tar.gz`
in v1.1.0)
- [ ] Auto-update from GitHub Releases (deferred — needs signing)
- [x] All web features work identically in desktop
- [x] Offline mode fully functional
@@ -305,6 +307,67 @@ and Android all ship as 1.0.0 — the full list is in
---
## v1.1.0 — Contacts ✅ SHIPPED 2026-10-03
A copyright / DMCA email and purpose words for the split contact block, an
option to hide scrollbars, and copyright years checked in CI —
[CHANGELOG.md](../CHANGELOG.md#v110--2026-10-03).
## v1.2.0 — AI disclosure ✅ SHIPPED 2026-10-12
Content warnings for games made with generative AI (a new group of seven),
simulated gambling, in-game purchases and a tech note for upscaling /
frame-generation artifacts; a test that every warning and tech note is
translated; third-party notices, REUSE and the docs brought in line with the
code — [CHANGELOG.md](../CHANGELOG.md#v120--2026-10-12).
## v1.3.0 — Toolchain ✅ SHIPPED 2026-10-22
TypeScript 7 (target ES2025), Node 26, React 19 refs, two rounds of
dependency updates with five security alerts closed, SonarCloud at 0 open
issues, Android app data kept out of cloud backups —
[CHANGELOG.md](../CHANGELOG.md#v130--2026-10-22). Next for the toolchain:
ES2026 once TypeScript 7.1 is stable.
## v1.3.1 — Maintenance ✅ SHIPPED 2026-10-26
Tauri 2.12.4, the desktop's Save / Open dialogs off the async workers,
SonarCloud in CI with coverage, and this week's dependency updates with the
one open security alert closed —
[CHANGELOG.md](../CHANGELOG.md#v131--2026-10-26).
## v1.3.2 — Rate limiting ✅ SHIPPED 2026-10-27
The website answers floods with `429`: per-client limits in the Cloudflare
Worker (Workers Rate Limiting bindings), behind a WAF rate limiting rule at
the zone —
[CHANGELOG.md](../CHANGELOG.md#v132--2026-10-27).
## v1.4.0 — LUT field, boss name tag ✅ SHIPPED 2026-11-06
A **LUT** field in My Rig, printed on its own line under the video editor
(DaVinci Resolve's own LUTs offered while typing), the **boss's name as a
tag** in Boss Fight and Boss No Hit videos, and this week's dependency
updates — [CHANGELOG.md](../CHANGELOG.md#v140--2026-11-06).
## v1.5.0 — Upscaled video ✅ SHIPPED 2026-11-08
**Upscaled from** in Video settings, for footage upscaled in the video
editor: a `[4K Upscaled]` title badge, an `Upscale: 1440p → 4K (…)` line in
Video settings and an automatic tech note that fine detail may differ from
the original image — [CHANGELOG.md](../CHANGELOG.md#v150--2026-11-08).
## v1.5.1 — Accessibility ✅ SHIPPED 2026-11-09
An accessibility statement ([ACCESSIBILITY.md](../ACCESSIBILITY.md), also in
the Legal Center) and the fixes an audit against WCAG 2.2 AA turned up: AA
contrast in both themes, generated text marked with its language, the page's
name read out after a navigation, a switch for the single-key `?` shortcut,
and zoom hotkeys in the desktop app —
[CHANGELOG.md](../CHANGELOG.md#v151--2026-11-09).
---
## Phase 5 — Extensions & Ecosystem (Priority: P2-P3)
**Goal**: IDE extension, CLI, community features.
@@ -345,7 +408,8 @@ and Android all ship as 1.0.0 — the full list is in
5.5 Quality of life
- [ ] YouTube API integration (auto-apply description)
- [ ] Tag trend analysis (what's trending for the genre)
- [ ] Multi-channel profile support
- [x] Multi-channel profile support — one profile per channel, as many
as you like; Quick start picks one per video (v1.0.0)
```
---
@@ -362,6 +426,8 @@ Ideas carried over from the v1.0.0 planning — not scheduled.
- [ ] PWA offline for the web — conflicts with the Turnstile gate in front of
the app
- [ ] PGP signature for security.txt
- [ ] Smoke tests for the main pages — needs a DOM test environment (the
suite runs in Node)
```
---
@@ -377,4 +443,4 @@ Ideas carried over from the v1.0.0 planning — not scheduled.
| Phase 5 | Extensions | Ongoing | — |
**MVP usable after Phase 1** (~3-4 days). Full-featured after Phase 3 (~7-10 days).
**v1.0.0 shipped on 2026-09-30.**
**v1.0.0 shipped on 2026-09-30; the current release is v1.5.1 (2026-11-09).**
+87 -47
View File
@@ -2,7 +2,7 @@
## YTDescGen — Implementation Details
Reflects **v1.0.0**. The module map and data flow are in [ARCHITECTURE.md](ARCHITECTURE.md), the desktop and Android builds in [PACKAGING.md](PACKAGING.md), and running the web deployment (Cloudflare Worker, Turnstile, secrets, rollback) in [HOSTING.md](HOSTING.md).
Reflects **v1.5.1**. The module map and data flow are in [ARCHITECTURE.md](ARCHITECTURE.md), the desktop and Android builds in [PACKAGING.md](PACKAGING.md), and running the web deployment (Cloudflare Worker, Turnstile, secrets, rollback) in [HOSTING.md](HOSTING.md).
---
@@ -13,10 +13,13 @@ Reflects **v1.0.0**. The module map and data flow are in [ARCHITECTURE.md](ARCHI
```json
{
"name": "yt-desc-gen",
"version": "1.0.0",
"version": "1.5.1",
"private": true,
"license": "Apache-2.0",
"type": "module",
"engines": {
"node": ">=26"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
@@ -50,18 +53,18 @@ Reflects **v1.0.0**. The module map and data flow are in [ARCHITECTURE.md](ARCHI
"dependencies": {
"@fontsource-variable/inter": "^5.3.0",
"@fontsource-variable/jetbrains-mono": "^5.3.0",
"@tauri-apps/api": "^2.12.0",
"@tauri-apps/plugin-opener": "^2.7.0",
"@tauri-apps/api": "^2.12.4",
"@tauri-apps/plugin-opener": "^2.7.2",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"i18next": "^26.4.2",
"i18next": "^26.4.5",
"i18next-resources-to-backend": "^1.2.3",
"lucide-react": "^1.49.0",
"motion": "^13.4.6",
"radix-ui": "^1.6.7",
"lucide-react": "^1.57.0",
"motion": "^13.5.1",
"radix-ui": "^1.8.1",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"react-i18next": "^17.0.15",
"react-i18next": "^17.0.16",
"react-router-dom": "^7.18.4",
"simple-icons": "^16.33.0",
"sonner": "^2.0.8",
@@ -71,29 +74,30 @@ Reflects **v1.0.0**. The module map and data flow are in [ARCHITECTURE.md](ARCHI
"@eslint/js": "^10.0.1",
"@resvg/resvg-js": "2.6.2",
"@tailwindcss/postcss": "^4.3.3",
"@tauri-apps/cli": "2.12.0",
"@tauri-apps/cli": "2.12.3",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@types/node": "^26.6.3",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.1",
"@vitest/coverage-v8": "^4.1.11",
"@typescript/native": "npm:typescript@^7.0.2",
"@vitejs/plugin-react": "^6.1.2",
"@vitest/coverage-v8": "^4.1.12",
"autoprefixer": "^10.6.1",
"eslint": "^10.11.0",
"eslint": "^10.12.0",
"eslint-plugin-react-hooks": "^7.1.1",
"knip": "^6.38.0",
"marked": "18.0.14",
"postcss": "^8.5.28",
"prettier": "^3.9.9",
"knip": "^6.41.0",
"marked": "18.1.1",
"postcss": "^8.5.30",
"prettier": "^3.9.10",
"prettier-plugin-tailwindcss": "^0.8.1",
"tailwindcss": "^4.3.3",
"tsx": "^4.23.15",
"typescript": "^5.9.3",
"typescript-eslint": "^8.71.0",
"vite": "^8.3.1",
"vitest": "^4.1.11",
"wrangler": "4.144.0"
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-eslint": "^8.71.2",
"vite": "^8.3.4",
"vitest": "^4.1.12",
"wrangler": "4.149.0"
}
}
```
@@ -104,20 +108,35 @@ Notes:
- **Tauri on the JavaScript side** is only `@tauri-apps/api` (for `invoke`) and `@tauri-apps/plugin-opener`. There are no dialog, fs or shell plugin packages: file access goes through the app's own Rust commands (see [PACKAGING.md](PACKAGING.md)). `@tauri-apps/cli` is pinned exactly, and `npm run check:tauri` keeps the npm packages on the same major.minor as the crates.
- **Build-time only**: `marked` renders the legal documents and `@resvg/resvg-js` rasterises the brand assets; neither ships in the app. `wrangler` is pinned exactly for `cf:dev` / `cf:check`.
- **Fonts** are self-hosted: `@fontsource-variable/inter` and `@fontsource-variable/jetbrains-mono` are imported in `src/main.tsx`, and each subset (latin, latin-ext, vietnamese, …) is fetched only when a page uses it.
- **Node 22** comes from `.node-version`, which CI, the release workflows and Cloudflare Workers Builds all read.
- **TypeScript 7** checks types: `@typescript/native` is an npm alias for `typescript@7`, the native compiler, and supplies `tsc`. TypeScript 7.0 ships no JavaScript API, so `typescript` is an alias for `@typescript/typescript6` — the TypeScript 6.0 API that typescript-eslint loads (its peer range stops below 6.1), plus `tsc6`. Both are Microsoft's documented side-by-side setup. `@typescript/typescript6` pulls TypeScript 6 in as `@typescript/old`, which ships a `tsc` too; CI fails if the `tsc` on `PATH` is not 7.x. Dependabot may not follow `npm:` aliases, so TypeScript bumps can be manual.
- **Node 26** comes from `.node-version`, which CI, the release workflows and Cloudflare Workers Builds all read; `engines.node` says `>=26`. Vitest runs its workers with `--no-experimental-webstorage`: Node 25+ defines a `localStorage` global that is `undefined` without `--localstorage-file`, and zustand's `persist` crashes on it instead of falling back to memory.
- **Installs skip lifecycle scripts** in every workflow (`npm ci --ignore-scripts`). The three packages that have one — esbuild, workerd, fsevents — take their native binary from `optionalDependencies`.
### tsconfig.json
```json
```jsonc
{
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
// The newest ECMAScript year that TypeScript 7.0, esbuild (tsx, wrangler)
// and Vite all understand. ES2026 arrives with TypeScript 7.1.
"target": "ES2025",
// `lib` is the runtime floor, not the syntax target. Vite lowers syntax but
// never polyfills, so a built-in typed here must exist in every engine the
// app supports: Vite's `baseline-widely-available` — Chrome 111, Safari
// 16.4, Firefox 114 (ES2023's copy-array methods need Firefox 115). Raise it
// when that floor moves. Code that runs on Node or workerd gets the newer
// lib in tsconfig.check.json.
"lib": ["ES2022", "DOM"],
// TypeScript 6+ no longer loads every installed @types package. The app
// needs none: `vite/client` comes in through src/vite-env.d.ts.
"types": [],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"erasableSyntaxOnly": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
@@ -128,7 +147,6 @@ Notes:
"noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@config/*": ["./src/config/*"],
@@ -138,14 +156,14 @@ Notes:
"@components/*": ["./src/components/*"],
"@pages/*": ["./src/pages/*"],
"@utils/*": ["./src/utils/*"],
"@i18n/*": ["./src/i18n/*"]
}
"@i18n/*": ["./src/i18n/*"],
},
},
"include": ["src"]
"include": ["src"],
}
```
`tsconfig.json` covers only `src/` — what `vite build` compiles. `tsconfig.check.json` extends it for `npm run typecheck:all`: it adds `tests`, `scripts`, `worker` and `build-plugins`, plus the `vitest/globals` and `node` types those need.
`tsconfig.json` covers only `src/` — what `vite build` compiles. `tsconfig.check.json` extends it for `npm run typecheck:all`: it adds `tests`, `scripts`, `worker` and `build-plugins`, the `vitest/globals` and `node` types those need, and `lib: ["ES2025", "DOM"]` — they run on Node 26 or workerd, not in the app's browsers. There is no `baseUrl` (TypeScript 7 dropped it); `paths` are relative. `erasableSyntaxOnly` keeps out the TypeScript syntax that only TypeScript can emit (enums, namespaces, parameter properties), which Oxc, esbuild and Node's type stripping all rely on.
### vite.config.ts
@@ -189,8 +207,9 @@ export default defineConfig({
watch: { ignored: ["**/src-tauri/**", "**/.wrangler/**"] },
},
build: {
// Old Android System WebViews choke on Vite's modern default target.
target: isTauri ? "es2020" : undefined,
// No `target`: both builds use Vite's default, `baseline-widely-available`
// (Chrome 111, Safari 16.4, Firefox 114) — the floor tsconfig's `lib` holds.
//
// The Tauri CSP allows only 'self' for images and fonts: no data: URIs.
assetsInlineLimit: 0,
// Full license texts of the bundled packages, linked from the
@@ -223,7 +242,7 @@ What differs between the two builds:
| Legal documents | `virtual:legal-docs` (lazy chunk for the Legal Center) **and** static `dist/legal/<id>.html` (+ `<id>.vi.html`, `index.html`) | `virtual:legal-docs` only |
| `/.well-known/security.txt` | Generated on every build (RFC 9116, `Expires` 180 days ahead) | — |
| Cloudflare Web Analytics beacon | Injected before `</body>` of `index.html` (build only, never in `npm run dev`) | — |
| JS target | Vite default | `es2020` |
| JS target | Vite default (`baseline-widely-available`) | the same (before v1.3.0: `es2020`) |
`build-plugins/legal-docs.ts` renders the repository's legal files (`TERMS.md`, `PRIVACY.md`, `DISCLAIMER.md` + `docs/i18n/vi/DISCLAIMER.md`, `LICENSE`, `THIRD_PARTY_NOTICES.md`, `SECURITY.md`, `NOTICE`, `CODE_OF_CONDUCT.md`; list in `src/config/legal.ts`) with `marked` at build time. `build-plugins/web-only.ts` holds the analytics snippet and the `security.txt` generator.
@@ -288,6 +307,10 @@ The only Cloudflare file in the repository; Workers Builds runs `npx wrangler de
"!/404.html"
]
},
"ratelimits": [
{ "name": "RATE_LIMIT", "namespace_id": "1001", "simple": { "limit": 120, "period": 60 } },
{ "name": "VERIFY_RATE_LIMIT", "namespace_id": "1002", "simple": { "limit": 10, "period": 60 } }
],
"vars": {
"TURNSTILE_SITE_KEY": "0x4AAAAAAFKFAMUx9rQ5H6bQ",
"GATE_TTL_SECONDS": "86400"
@@ -296,9 +319,9 @@ The only Cloudflare file in the repository; Workers Builds runs `npx wrangler de
}
```
Every request goes through the Worker first except content-hashed build output and the public files browsers and crawlers fetch without cookies. `not_found_handling` is `404-page`, not the SPA fallback, so no path can reach `index.html` without passing the gate. `TURNSTILE_SECRET` is a dashboard Secret, never committed. Request flow, cookies, headers and operations: [HOSTING.md](HOSTING.md).
Every request goes through the Worker first except content-hashed build output and the public files browsers and crawlers fetch without cookies. `not_found_handling` is `404-page`, not the SPA fallback, so no path can reach `index.html` without passing the gate. `TURNSTILE_SECRET` is a dashboard Secret, never committed. The two `ratelimits` bindings (Workers Rate Limiting API, v1.3.2) cap each client — an IPv4 address or an IPv6 /64 — at 120 Worker requests and 10 verify calls a minute, behind the zone's WAF rate limiting rule. Request flow, cookies, headers, rate limits and operations: [HOSTING.md](HOSTING.md).
The Worker (`worker/`): `index.ts` (entry; injects the clock, `fetch` and random ids), `router.ts` (routing), `env.ts` (bindings, constants, the gate lifetime clamped to 5 min – 30 days), `turnstile.ts` (siteverify call and verdict: success, hostname, action `enter`, token age ≤ 300 s), `cookie.ts` (the HMAC-signed `__Host-ytg_gate` cookie, key derived from the Turnstile secret, bound to a User-Agent hash), `headers.ts` (CSP per page type and the baseline security headers), `gate-page.ts` + `gate-i18n.ts` (the gate page in the app's eight languages). It uses only standard Web APIs, so it type-checks against the DOM lib and runs under Vitest in Node.
The Worker (`worker/`): `index.ts` (entry; injects the clock, `fetch` and random ids), `router.ts` (routing), `rate-limit.ts` (the per-client limit checked before anything else: client key, fail-open check, the `429`), `env.ts` (bindings, constants, the gate lifetime clamped to 5 min – 30 days), `turnstile.ts` (siteverify call and verdict: success, hostname, action `enter`, token age ≤ 300 s), `cookie.ts` (the HMAC-signed `__Host-ytg_gate` cookie, key derived from the Turnstile secret, bound to a User-Agent hash), `headers.ts` (CSP per page type and the baseline security headers), `gate-page.ts` + `gate-i18n.ts` (the gate page in the app's eight languages). It uses only standard Web APIs, so it type-checks against the DOM lib and runs under Vitest in Node.
## 2. Core Engine Interfaces
@@ -322,7 +345,7 @@ export interface GeneratorInput {
// Video-type specific: partNumber, bossName, dlcName, challengeName, modName, modList,
// liveUrl, scheduledTime, gachaQuestType, chapterName, questName, characterName,
// anniversaryYear, gachaVersion.
// Video settings: resolution, fps, graphicsPreset (+ graphicsPresetCustom),
// Video settings: resolution, upscaledFrom (v1.5.0), fps, graphicsPreset (+ graphicsPresetCustom),
// skipGraphicsSettings, rayTracingModes, frameGenVendor, frameGenMultiplier,
// upscaleQuality, artStyle, videoStyleEra, versionInfo.
// Content: timestamps, playlistLink, contactEmail, adEmail, gameKeyEmail,
@@ -391,12 +414,12 @@ export interface TitleFormatConfig {
**Tag length, counted the way YouTube counts it** (`tag-generator.ts`):
- `youtubeTagsLength(tags)` = the sum of each tag's length, plus 2 for the quotes YouTube puts around any tag containing whitespace, plus one comma between tags. The old measure (length of the `", "`-joined string) ignored the quotes; 15 of 51 real tag sets were over 500 by YouTube's count while showing as under.
- `generateTags` collects, in priority order: the game name (bare, and a shortened form for composites), core tags for the output language, genre tags for every selected genre, video-type tags, platform tags, quality tags, the output language's multilingual tags (setting), trending tags for the first genre (setting), and the publisher/developer name. It then de-duplicates case-insensitively, drops tags over 30 characters, and `trimToCharLimit(tags, 500)` keeps tags in priority order while they fit — a tag that doesn't fit is skipped and the shorter ones after it are still tried.
- `generateTags` collects, in priority order: the game name (bare, and a shortened form for composites), the boss name for the video types whose `extraFields` include `bossName` (v1.4.0 — `bossNameTag`: NFC, every mark but in-word `'` `’` `-` and digit-to-digit `.` removed, dots between initials dropped, the name before its title or the leading words when over 30 characters), core tags for the output language, genre tags for every selected genre, video-type tags, platform tags, quality tags, the output language's multilingual tags (setting), trending tags for the first genre (setting), and the publisher/developer name. It then de-duplicates case-insensitively, drops tags over 30 characters, and `trimToCharLimit(tags, 500)` keeps tags in priority order while they fit — a tag that doesn't fit is skipped and the shorter ones after it are still tried.
- Platform tags use `PlatformConfig.tagName` ("Steam", "Epic Games", "itch.io"), not the id; the publisher's own site has no tag name and adds no platform tags.
**Empty channel name** (`channel-phrase.ts`, used by the description, pinned comment and playlist builders): templates render with `CHANNEL_SLOT` (`@@CHANNEL@@`) in place of an empty channel name. `withoutEmptyChannel(text, language)` then removes the words that go with the channel name in that language ("trên kênh", "による", "en", "no", "di", …) and the English "on" (for English, and for locales that still carry English sentences for newer video types), replaces any slot left over with a neutral fallback ("this channel", "kênh", …) and tidies the spacing before punctuation. "…of Hades on ." no longer happens in any of the eight languages.
**Rig block** (`rig-block.ts`): `buildRigLines(rig, t)` returns `Label: value` lines, shared by the description and the social captions. Labels come from `description.rigLabels.<field>` in the output language, the order is `RIG_FIELDS` (CPU, GPU, RAM, motherboard, storage, OS, monitor, capture, controller, video editor), and values go through `formatRigValue` (`gpu:nvidia-rtx-5080` → "NVIDIA GeForce RTX 5080"). Keys that are no longer rig fields are still printed, after the known ones.
**Rig block** (`rig-block.ts`): `buildRigLines(rig, t)` returns `Label: value` lines, shared by the description and the social captions. Labels come from `description.rigLabels.<field>` in the output language, the order is `RIG_FIELDS` (CPU, GPU, RAM, motherboard, storage, OS, monitor, capture, controller, video editor, LUT), and values go through `formatRigValue` (`gpu:nvidia-rtx-5080` → "NVIDIA GeForce RTX 5080"; a text field's `clean` — `cleanCpuName`, and since v1.4.0 `cleanLutName`, which cuts a pasted path or `.cube` / `.dat` file name down to the LUT's name — runs there as well as when the editor field loses focus). Keys that are no longer rig fields are still printed, after the known ones.
**Chapters** (`timeline-parser.ts`):
@@ -450,7 +473,7 @@ interface EditorActions {
}
/** Bump together with a new step in migrateEditorState. */
export const EDITOR_STORE_VERSION = 20;
export const EDITOR_STORE_VERSION = 21;
export const useEditorStore = create<EditorData & EditorActions>()(
persist(
@@ -484,7 +507,7 @@ export function migrateEditorState(persistedState: unknown, version: number): Ed
| Store | localStorage key | Version | Migration (exported) |
| ------------------ | ------------------------ | ----------------------------- | ---------------------------------------------------------------------------------------------- |
| `useEditorStore` | `ytdescgen-editor-draft` | `EDITOR_STORE_VERSION` = 20 | `migrateEditorState` |
| `useEditorStore` | `ytdescgen-editor-draft` | `EDITOR_STORE_VERSION` = 21 | `migrateEditorState` |
| `useProfileStore` | `ytdescgen-profiles` | `PROFILE_STORE_VERSION` = 3 | `migrateProfilesState` |
| `usePresetStore` | `ytdescgen-presets` | `PRESET_STORE_VERSION` = 2 | `migratePresetsState` |
| `useTemplateStore` | `ytdescgen-templates` | `TEMPLATE_STORE_VERSION` = 2 | `migrateTemplatesState` |
@@ -495,6 +518,12 @@ v1.0.0 migration steps: editor v19, profiles v3 and templates v2 move the GPU to
v1.1.0: editor v20 back-fills `copyrightEmail` (the fourth split contact line) with `""`. `Profile.copyrightEmail` is optional, like the v1.0.0 additions, so the profile store stays at v3. The settings gain `hideScrollbars` without a version bump: `healSettings` back-fills and coerces it on every load, and the unchanged version keeps a 1.1.0 settings backup restorable on 1.0.0.
v1.2.0: nine content-warning ids and one tech note, and no version bump anywhere — the lists only widen. The backup whitelist (`choiceList` in `src/utils/backup/sanitize.ts`) checks against `CONTENT_WARNINGS` / `TECH_NOTES`, so a 1.1.0 build restoring a 1.2.0 backup keeps everything except the ids it doesn't know.
v1.5.0: editor v21 back-fills `upscaledFrom` (recorded at a lower resolution, upscaled to `resolution` in the video editor) with `""` and turns an unknown value into `""`; `normalizeEditorPatch` does the same for an applied profile or template, and the backup whitelist checks it against `UPSCALED_FROM_OPTIONS`. `Profile.upscaledFrom` is optional, so the profile store stays at v3. The engine's own tech note (`AUTO_TECH_NOTES`, `editor_upscaled`) is never stored, so `techNotes` and its whitelist don't change.
v1.5.1: the settings gain `singleKeyShortcuts` (default `true`: the bare `?` opens the shortcut list) without a version bump, like `hideScrollbars` — `healSettings` back-fills it and turns anything but a boolean into `true`.
Rules:
- **localStorage is the only store**, on the web, desktop and Android. The desktop "mirror" file of earlier versions (`storage-adapter.ts`, `saveSettings`, `checkDataFileHealth`) was removed in v1.0.0; it was written next to the data folder and never read back. [PACKAGING.md](PACKAGING.md) covers how the leftover file is recovered.
@@ -561,7 +590,7 @@ An unknown version is read as 0: every migration step is idempotent, so running
| Workflow | Runs on | Jobs |
| ------------------------------------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ci.yml` (CI) | PRs to and pushes on `main` | `check` — the required status on `main` |
| `ci.yml` (CI) | PRs to and pushes on `main` | `check` — the required status on `main`; `sonarcloud` — the SonarCloud scan with `check`'s coverage (pushes on `main`, PRs from this repository except Dependabot's) |
| `security.yml` (Security) | PRs, pushes on `main`, weekly, manual | `dependency-review` (PRs: fails on a newly added high/critical advisory), `workflow-lint` (actionlint + zizmor, `.github/zizmor.yml`), `scorecard` (OpenSSF Scorecard, informational; not on PRs) |
| `compliance.yml` (Compliance) | PRs, pushes on `main` | `reuse` (REUSE licensing via `REUSE.toml`), `pr-title` (Conventional-Commit PR titles with a lower-case subject) |
| `rust.yml` (Rust) | Changes under `src-tauri/`, weekly, manual | `lint-and-test` (`cargo fmt --all -- --check`, `cargo clippy --all-targets --locked -- -D warnings`, `cargo test --locked`, after `npm run build` because `generate_context!` embeds `dist/`), `cargo-deny` (`check advisories licenses sources`, `src-tauri/deny.toml`) |
@@ -573,13 +602,14 @@ An unknown version is read as 0: every migration step is idempotent, so running
The `check` job, in order:
```yaml
- run: npm ci
- run: npm ci --ignore-scripts
# correctness
- run: npm run typecheck # src/
- run: npm run typecheck:all # + tests/, scripts/, worker/, build-plugins/
- run: npm run lint
- run: npm run validate:locales
- run: npm run test:coverage # thresholds in vitest.config.ts
- uses: actions/upload-artifact # coverage/lcov.info, for the sonarcloud job
# consistency
- run: npm run format:check
- run: npm run knip
@@ -594,13 +624,23 @@ The `check` job, in order:
# build
- run: npm run build
- run: npm run check:bundle # initial load ≤ 280 KB gzip, no JS chunk > 500 KB raw
- run: npx wrangler deploy --dry-run --outdir .wrangler/dry-run
- run: npm run cf:check # wrangler deploy --dry-run
```
Then `sonarcloud` (after `check` succeeds):
```yaml
- uses: actions/checkout # fetch-depth: 0 — new code is told from old by git blame
- uses: actions/download-artifact # the coverage report from check
- run: jq -r .version package.json # → sonar.projectVersion
- uses: SonarSource/sonarqube-scan-action # SONAR_TOKEN, sonar-project.properties
```
- **Bundle budget** (`scripts/check-bundle-size.ts`): the initial load is every script, modulepreload and stylesheet `dist/index.html` references, summed gzip — lazy chunks (pages, locales, legal documents) are excluded. The result is printed as a table and added to the job summary.
- **Licences** (`scripts/lib/third-party.ts`): every package bundled into the app must carry an allowed licence (MIT, ISC, Apache-2.0, BSD-2/3-Clause, 0BSD, CC0-1.0, Unlicense, BlueOak-1.0.0, OFL-1.1, Zlib, MPL-2.0), and `THIRD_PARTY_NOTICES.md` is generated (`npm run generate:third-party`) and checked, not hand-written.
- **Copyright years** (`scripts/lib/copyright.ts`, v1.1.0): NOTICE, REUSE.toml and `bundle.copyright` in `tauri.conf.json` must state `copyrightYears(<year of HEAD's commit>)` from `src/config/brand.ts` — "2026", then "2026-2027" from the first commit of 2027. The commit year rather than the clock keeps old commits green; `npm run update:copyright` rewrites the three files. The `/legal` pages' footer uses the same helper at build time.
- **Wrangler dry run** validates `wrangler.jsonc` and bundles the Worker exactly as Workers Builds will, without deploying.
- **SonarCloud** (CI-based; Automatic Analysis is off in the project's settings): `sonar-project.properties` makes the whole repository main code except the tests (`tests/**` and any `src/**/*.test.ts(x)`, analysed as tests) and the binary files (icons, the Gradle wrapper's jar), imports `coverage/lcov.info` and excludes from coverage everything Vitest does not measure (see [Testing Strategy](#6-testing-strategy)). The scan waits for the quality gate — Sonar way: A security, reliability and maintainability ratings, every security hotspot reviewed, ≤ 3 % duplication and ≥ 80 % coverage on new code — and fails the job when it fails. New code is "since the previous version": the job reads `package.json`'s version into `sonar.projectVersion`, so every release starts a new period. The scan runs in a job of its own so that `SONAR_TOKEN` never shares a job with npm packages. PRs from forks and from Dependabot get no repository secrets and skip it; the condition checks the PR author, not `github.actor` (zizmor's `bot-conditions`).
- Every workflow declares least-privilege `permissions`, checks out with `persist-credentials: false`, and pins actions by commit SHA (Dependabot keeps the SHAs and version comments current). The exceptions are the actionlint Docker image (pinned by version tag) and the maintainer's own `poli0981/.github` reusable workflows (tracked at `main`, allowed in `.github/zizmor.yml`). CI, Security, Compliance and Rust cancel superseded runs through a `concurrency` group, except on `main`, where each commit's result is a record the release process reads back.
**Web deployment is not a GitHub workflow.** Cloudflare Workers Builds builds and deploys the Worker and `dist/` on every push to `main` (preview versions for other branches). The old `deploy-web.yml` (GitHub Pages) is gone; `pages-migration.yml` only serves the moving notice, which hands visitors the data their browser saved on the old address as a `_format: 2` backup file. See [HOSTING.md](HOSTING.md).
@@ -609,7 +649,7 @@ The `check` job, in order:
## 6. Testing Strategy
Vitest runs `tests/**/*.test.{ts,tsx}` and `src/**/*.test.{ts,tsx}` in the **node** environment, with `globals: true`: 930 tests in 48 files at v1.0.0. Directories: `tests/engine`, `store`, `utils` (backup detect / sanitize / restore, quick entry, validation, the migration page), `worker` (router, cookie, Turnstile verdicts, headers, gate language), `build` (legal pages, web-only plugins), `config`, `hooks`, `i18n`, `scripts`. No test renders components: React Testing Library is installed but jsdom is not, so a rendering test would need both jsdom and a `// @vitest-environment jsdom` docblock.
Vitest runs `tests/**/*.test.{ts,tsx}` and `src/**/*.test.{ts,tsx}` in the **node** environment, with `globals: true`: 1131 tests in 54 files at v1.5.1. Directories: `tests/engine`, `store`, `styles` (WCAG AA contrast of the colour tokens), `utils` (backup detect / sanitize / restore, quick entry, validation, the migration page), `worker` (router, rate limits, cookie, Turnstile verdicts, headers, gate language), `build` (legal pages, web-only plugins), `config`, `hooks`, `i18n`, `scripts`. No test renders components: React Testing Library is installed but jsdom is not, so a rendering test would need both jsdom and a `// @vitest-environment jsdom` docblock.
Engine tests build a full `GeneratorInput` and pass a mock translator (`tests/helpers/mock-t.ts`) that reads the real `templates.json` files (en, vi, ja):
@@ -651,14 +691,14 @@ describe("buildTitle", () => {
});
```
`npm run test:coverage` (what CI runs) measures `src/engine/**`, `worker/**` and `build-plugins/**` with V8 and fails below these thresholds — the engine is what the whole app trusts, the Worker is what guards the site:
`npm run test:coverage` (what CI runs) measures the logic layers with V8 — `src/engine/**`, `src/config/**`, `src/store/**`, `src/utils/**`, `worker/**` (except `worker/index.ts`, the runtime wiring) and `build-plugins/**` — and writes `coverage/lcov.info` for SonarCloud. Components, pages and hooks are checked in the running app, `src/i18n` is i18next set-up and `scripts/` is tooling; SonarCloud would count a file missing from the report as 0 % covered, so `sonar.coverage.exclusions` lists all of them, and a new source folder goes into one list or the other. The run fails below these thresholds — the engine is what the whole app trusts, the Worker is what guards the site:
| Scope | Statements | Branches | Functions | Lines |
| ----------------------------------------- | ---------- | -------- | --------- | ----- |
| `src/engine/**` | 88 % | 85 % | 60 % | 88 % |
| `worker/**` (excluding `worker/index.ts`) | 95 % | 85 % | 95 % | 95 % |
Guard tests worth knowing: `tests/hooks/render-options-parity.test.ts` (settings → engine options), `tests/hooks/generator-input-mapping.test.ts` (editor → engine input), `tests/i18n/locale-registration.test.ts` (language registration in both directions), the genre/tag-pool sync in `tests/engine/tag-generator.test.ts`, and `tests/worker/headers.test.ts` (keeps the Worker's baseline headers in step with `public/_headers`). The Rust side has its own `cargo test` suite (name validation, path rejection, pruning, legacy recovery, dialog filters).
Guard tests worth knowing: `tests/hooks/render-options-parity.test.ts` (settings → engine options), `tests/hooks/generator-input-mapping.test.ts` (editor → engine input), `tests/i18n/locale-registration.test.ts` (language registration in both directions), `tests/config/content-warning-groups.test.ts` and `tech-note-groups.test.ts` (every id in exactly one group, with an editor label and a description line in `_schema.json` — v1.2.0), the genre/tag-pool sync in `tests/engine/tag-generator.test.ts`, `tests/worker/headers.test.ts` (keeps the Worker's baseline headers in step with `public/_headers`), and `tests/styles/contrast.test.ts` (v1.5.1: every text token reaches 4.5:1 on the surfaces in both themes, white text on the `*-solid` fills, 3:1 for marks on `accent`). The Rust side has its own `cargo test` suite (name validation, path rejection, pruning, legacy recovery, dialog filters).
## 7. YouTube Character Limits Reference
+129
View File
@@ -0,0 +1,129 @@
# Khả năng tiếp cận
> **Lưu ý dịch thuật:** Tiếng Anh là phiên bản chính ([`ACCESSIBILITY.md` ở root](../../../ACCESSIBILITY.md)). Bản tiếng Việt này có thể chậm cập nhật một vài commit.
**Cập nhật lần cuối:** 2026-11-09
YTDescGen hướng tới việc ai làm video cũng dùng được, kể cả người dùng bàn phím thay chuột, trình đọc màn hình, phóng to hoặc kính lúp, chế độ tương phản cao, điều khiển bằng giọng nói hay màn hình cảm ứng. Văn bản này nói rõ những gì đang hoạt động, cách kiểm tra, những gì chưa ổn, và cách báo cho chúng tôi khi bạn gặp rào cản.
Văn bản áp dụng cho trang web [ytgenerator.stream](https://ytgenerator.stream), ứng dụng desktop (Windows, macOS, Linux) và ứng dụng Android. Các bản này dùng chung một giao diện, nên mọi điều dưới đây áp dụng cho tất cả, trừ khi có nêu tên nền tảng.
## Mục tiêu
Chúng tôi hướng tới [WCAG 2.2](https://www.w3.org/TR/WCAG22/) mức **AA**. Đây là mục tiêu, không phải tuyên bố đã đạt chuẩn: YTDescGen là dự án mã nguồn mở do một người duy trì và chưa được kiểm định độc lập. Khi phát hiện chỗ chưa đạt, chỗ đó sẽ được sửa hoặc ghi vào mục [Hạn chế đã biết](#hạn-chế-đã-biết).
## Những gì đang hoạt động
### Bàn phím
- Mọi trang, menu và hộp thoại đều dùng được chỉ bằng bàn phím. **Chuyển đến nội dung** là điểm dừng đầu tiên trên các trang của ứng dụng, và một đường viền hiện rõ vị trí đang được focus.
- Hộp thoại giữ focus bên trong khi đang mở, đóng bằng **Esc**, rồi trả focus về đúng nút đã mở nó.
- Phím tắt dùng được trên mọi trang:
- **Ctrl/⌘ + K**: command palette (mở trang bất kỳ, sao chép, profile, preset, template, đổi theme và ngôn ngữ).
- **Ctrl/⌘ + G** hoặc **Ctrl/⌘ + Enter**: sang trang Kết quả.
- **Ctrl/⌘ + Shift + C**: Sao chép tất cả.
- **Ctrl/⌘ + S**: lưu vào Lịch sử.
- **Ctrl/⌘ + B**: thu gọn/mở thanh bên.
- **Alt + T**: tới vùng thông báo.
- **Ctrl/⌘ + /** (hoặc **?**): danh sách đầy đủ.
- Phím tắt một phím **?** có thể tắt ở **Cài đặt › Trình soạn › Phím tắt một phím**, dành cho người nhập bằng giọng nói hoặc hay bấm nhầm phím.
### Trình đọc màn hình
- Mọi nút đều có tên, kể cả nút chỉ có biểu tượng, và mọi ô nhập đều có nhãn. Gợi ý và thông báo lỗi được gắn với đúng ô của nó.
- Các xác nhận và lỗi đều được đọc lên ("Đã sao chép!", "Đã lưu vào lịch sử", lý do không sao chép được), các vấn đề của Strict Mode cũng vậy.
- Khi bạn mở trang khác, tên trang được đọc lên. Focus vẫn ở liên kết bạn vừa dùng.
- Mỗi trang có tiêu đề riêng và một tiêu đề chính duy nhất. Ngôn ngữ của trang theo ngôn ngữ giao diện bạn chọn (tám ngôn ngữ).
- Tiêu đề, mô tả và tag được tạo ra đều gắn ngôn ngữ mà chúng được viết, nên mô tả tiếng Nhật được đọc bằng giọng tiếng Nhật kể cả khi giao diện đang là tiếng Việt.
### Thị giác
- Có theme tối và theme sáng, cả hai đều đạt độ tương phản WCAG AA cho chữ (4.5:1) trên mọi nền. Một test giữ cho điều này không bị phá ([tests/styles/contrast.test.ts](../../../tests/styles/contrast.test.ts)).
- Bố cục co giãn từ màn hình rộng xuống bề rộng điện thoại, nên khi phóng to, nội dung dồn thành một cột thay vì tràn ra ngoài màn hình.
- Ứng dụng desktop phóng to/thu nhỏ bằng **Ctrl/⌘ + =** và **Ctrl/⌘ + −** (trên Windows dùng được cả Ctrl + con lăn chuột). Trên Android, dùng hai ngón tay để phóng to.
- Ở chế độ High Contrast của Windows (forced colours), đường viền focus vẫn hiện.
- **Cài đặt › Giao diện › Ẩn thanh cuộn** bỏ các thanh cuộn; vẫn cuộn được bằng bàn phím, con lăn chuột và cảm ứng.
### Chuyển động
- Khi bật **Giảm chuyển động** (Reduce motion) trong hệ điều hành, các hiệu ứng động và cuộn mượt được tắt.
### Cảm ứng
- Trên màn hình cảm ứng, nút và ô nhập lớn lên khoảng 44 px, các nút đóng/bỏ qua nhỏ cũng vậy.
### Trang kiểm tra của website
- Bước kiểm tra Cloudflare Turnstile trước khi vào website thường tự xong. Trạng thái của nó ("Đang kiểm tra trình duyệt…", lỗi) được đọc lên, và dùng được bằng bàn phím. Xem [Hạn chế đã biết](#hạn-chế-đã-biết) nếu Cloudflare yêu cầu bạn giải thử thách.
## Cách kiểm tra
- **Thủ công.** Người duy trì dùng YTDescGen chỉ bằng bàn phím (rút chuột) và bằng Windows Narrator, qua các luồng chính: trình soạn, kết quả, sao chép, profile, preset, template, Lịch sử, Cài đặt và sao lưu.
- **Tự động.** Một unit test kiểm tra độ tương phản của mọi token màu ở cả hai theme.
- **Quy tắc thiết kế.** Các thành phần giao diện dựng từ những khối có sẵn khả năng tiếp cận (Radix primitives). Nút chỉ có biểu tượng không thể tạo ra mà thiếu tên, và mọi ô nhập lấy nhãn và phần nối lỗi từ cùng một component dùng chung.
Ứng dụng **chưa** được thử với NVDA, JAWS, VoiceOver (macOS), TalkBack (Android) hay Orca (Linux). Rất mong nhận được phản hồi từ những ai đang dùng các công cụ này.
## Môi trường hỗ trợ
| Nền tảng | Chạy trên | Trình đọc màn hình |
| --- | --- | --- |
| Windows: ứng dụng desktop, hoặc website trên Edge / Chrome | Windows 10 hoặc 11 với WebView2; Chrome hoặc Edge 111+ | Narrator: đã thử |
| Website trên trình duyệt khác | Firefox 114+, Safari 16.4+ | Chưa thử |
| Ứng dụng desktop macOS | macOS 11 trở lên, Apple silicon | VoiceOver: chưa thử |
| Ứng dụng desktop Linux | WebKitGTK 2.40 trở lên | Orca: chưa thử |
| Ứng dụng Android | Android 11 trở lên, Android System WebView bản mới | TalkBack: chưa thử |
## Hạn chế đã biết
- **Thử thách của Cloudflare trên website.** Nếu Turnstile bắt bạn giải thử thách thay vì tự qua, thử thách đó do Cloudflare quản lý và khả năng tiếp cận của nó do họ sửa. Nếu nó chặn bạn, hãy dùng ứng dụng desktop hoặc Android (không có trang kiểm tra), hoặc [gửi email cho chúng tôi](#báo-một-rào-cản).
- **Viền ô nhập mờ.** Viền của ô nhập trống chỉ khoảng 1.2–1.3:1 so với nền, dưới mức 3:1 mà WCAG yêu cầu. Ô nhập vẫn được nhận biết qua nhãn, và ô đang focus có viền và vầng màu nhấn.
- **Nút Tiếp tục ở màn hình chạy lần đầu** dùng gradient của thương hiệu. Chữ trắng trên đầu màu tím nhạt hơn của gradient chỉ đạt 3.96:1.
- **Bộ đếm ký tự không được đọc lên khi bạn gõ**, vì như vậy sẽ chen ngang mỗi lần gõ phím. Khi một trường vượt giới hạn của YouTube, việc sao chép bị từ chối kèm thông báo lý do, và Strict Mode liệt kê vấn đề trong một banner được đọc lên.
- **Chưa có lint khả năng tiếp cận tự động.** `eslint-plugin-jsx-a11y` chưa hỗ trợ ESLint 10 mà dự án đang dùng, và unit test chạy không có DOM của trình duyệt. Ngoài test độ tương phản, việc kiểm tra là thủ công (xem ở trên).
- **Bản dịch.** Các ngôn ngữ giao diện ngoài tiếng Anh và tiếng Việt được dịch với sự hỗ trợ của AI (xem [Tuyên bố miễn trừ](DISCLAIMER.md)). Một số nhãn có thể nghe không tự nhiên khi được đọc lên.
- **Emoji trong mô tả.** Mô tả được tạo dùng vài emoji làm dấu mục (ví dụ 👍 và 🔔), và trình đọc màn hình trên YouTube sẽ đọc tên của chúng.
## Báo một rào cản
Nếu có điều gì trong YTDescGen cản trở bạn, hãy cho chúng tôi biết. Bạn không cần biết nguyên nhân kỹ thuật.
- **Nên dùng:** mở một [issue về khả năng tiếp cận](https://github.com/poli0981/youtube-generator/issues/new?template=accessibility.yml). Biểu mẫu sẽ hỏi nền tảng, công nghệ hỗ trợ bạn dùng và chuyện gì đã xảy ra.
- **Không muốn đăng công khai?** Gửi email tới **contact@poli0981.dev**, tiêu đề bắt đầu bằng `[Accessibility]`.
- **Câu hỏi nhanh?** Hỏi trên [Discord](https://discord.gg/kDM9GMu5vm).
### Mức độ nghiêm trọng
| Mức | Ý nghĩa |
| --- | --- |
| **Critical** | Bạn không làm xong được việc chính: soạn, tạo, sao chép, lưu, hoặc qua được bước kiểm tra của website. |
| **High** | Bạn làm xong được, nhưng rất vất vả hoặc phải dùng cách vòng. |
| **Medium** | Vẫn dùng được, nhưng thất thường hoặc khó hiểu. |
| **Low** | Phiền nhỏ, không cản bạn. |
### Cách chúng tôi phản hồi
- Chúng tôi trả lời trong vòng **7 ngày** và tin vào những gì bạn báo.
- Rào cản **Critical** được sửa trong bản vá kế tiếp. Các mức khác được lên kế hoạch như mọi lỗi khác, mức nặng hơn làm trước.
- Nếu có cách tạm thời, chúng tôi sẽ cho bạn biết trong lúc chờ bản sửa.
- Khi bản sửa ra, chúng tôi sẽ nhờ bạn kiểm tra lại nếu bạn sẵn lòng.
Đây là dự án một người làm, nên các mốc thời gian là ước tính thật lòng, không phải cam kết. Nếu trễ, chúng tôi sẽ nói rõ trong issue.
## Dành cho người đóng góp
Thay đổi giao diện cần giữ đúng mọi điều ở trên. Trước khi mở pull request có đụng tới UI:
- **Bàn phím.** Mọi thứ dùng được bằng bàn phím: thứ tự focus hợp lý, đường viền focus hiện rõ, **Esc** đóng thứ bạn vừa mở, và không có chỗ nào giữ chặt focus.
- **Tên gọi.** Dùng các component dùng chung `Field` (nối nhãn, gợi ý và lỗi) và `IconButton` (không thể render nếu thiếu `label`). Chữ trong `aria-label` đi qua `t()` như mọi chuỗi khác, đủ tám locale.
- **Lỗi và trạng thái.** Phải được đọc lên: `Banner` với `alert`, một toast, hoặc một live region có sẵn.
- **Màu sắc.** Màu không bao giờ là tín hiệu duy nhất. Chỉ dùng token thiết kế, và chạy `npm run test:run`. Test độ tương phản sẽ báo lỗi nếu một token tụt dưới AA, và chữ trắng phải nằm trên các nền `*-solid`.
- **Chuyển động.** Hiệu ứng mới phải tôn trọng giảm chuyển động. Các component của Motion đã làm sẵn, và animation CSS được quy tắc chung trong `globals.css` xử lý.
- **Kích thước.** Mọi thứ bấm được tối thiểu 24 × 24 px và lớn lên trên màn hình cảm ứng.
- **Trình đọc màn hình.** Thử thay đổi một lần bằng trình đọc màn hình: Narrator (Win + Ctrl + Enter), VoiceOver (⌘ + F5), NVDA hoặc Orca.
Mẫu pull request có cùng danh sách kiểm tra này.
## Góp ý cho văn bản này
Mọi ý tưởng để cải thiện văn bản này hay cách xử lý khả năng tiếp cận đều được hoan nghênh trên [GitHub Discussions](https://github.com/poli0981/youtube-generator/discussions). Còn rào cản thì hãy báo qua [quy trình báo lỗi](#báo-một-rào-cản) để được theo dõi.
+52 -16
View File
@@ -1,6 +1,6 @@
# Danh mục Nội dung
Bản kê khai tĩnh cho mọi loại video, thể loại game, cảnh báo nội dung, cửa hàng, trường link và nền tảng đăng chéo trong editor của YTDescGen (tính đến v1.0.0). 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.
Bản kê khai tĩnh cho mọi loại video, thể loại game, cảnh báo nội dung, ghi chú kỹ thuật, cửa hàng, trường link và nền tảng đăng chéo trong editor của YTDescGen (tính đến v1.3.0). 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.
@@ -11,6 +11,7 @@ File này tồn tại để **minh bạch** — bất kỳ ai tò mò về việ
- 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)
- Ghi chú kỹ thuật: [`src/config/tech-note-groups.ts`](../../../src/config/tech-note-groups.ts)
- Cửa hàng: [`src/config/platforms.ts`](../../../src/config/platforms.ts)
- Link mạng xã hội & donate: [`src/config/social-fields.ts`](../../../src/config/social-fields.ts)
- Link cộng đồng: [`src/components/editor/CommunityEditor.tsx`](../../../src/components/editor/CommunityEditor.tsx)
@@ -101,7 +102,7 @@ Các nhóm bulk-select trong editor: **All RPGs** (rpg + jrpg + action_rpg + crp
---
## 3. Cảnh báo nội dung (248, chia nhóm)
## 3. Cảnh báo nội dung (257, chia nhóm)
Cảnh báo được chọn sẽ hiển thị trong khối cảnh báo nội dung của description (`▸ ⚠️ CẢNH BÁO NỘI DUNG` khi output là tiếng Việt), ngay sau khối cấu hình máy (và danh sách mod, với loại Chơi với Mod). 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.
@@ -133,13 +134,13 @@ Cảnh gây lo âu · Trầm cảm · Rối loạn ăn uống · Sử dụng ch
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 · Miệt thị ngoại hình (body shaming) · Chuẩn mực ngoại hình phi thực tế
### Internet / Đời sống số (18)
### Internet / Đời sống số (19)
Bắt nạt / quấy rối qua mạng · Doxxing / phơi bày thông tin cá nhân · Trolling / phá game · Văn hóa tẩy chay / bêu rếu công khai · Nghiện mạng xã hội · Lướt tin tiêu cực vô độ (doomscrolling) · Hội chứng sợ bỏ lỡ (FOMO) · Tin giả / thông tin sai lệch · Lừa đảo trực tuyến / phishing · Giả mạo danh tính trên mạng (catfishing) · Deepfake / nội dung giả mạo bằng AI · Theo dõi / rình rập qua mạng · Trào lưu / thử thách nguy hiểm trên mạng · Văn hóa influencer / câu tương tác · Cực đoan hóa qua mạng / buồng vang thông tin · Loot box / cơ chế gacha · Chủ đề AI / trí tuệ nhân tạo · Riêng tư dữ liệu / giám sát diện rộng
Bắt nạt / quấy rối qua mạng · Doxxing / phơi bày thông tin cá nhân · Trolling / phá game · Văn hóa tẩy chay / bêu rếu công khai · Nghiện mạng xã hội · Lướt tin tiêu cực vô độ (doomscrolling) · Hội chứng sợ bỏ lỡ (FOMO) · Tin giả / thông tin sai lệch · Lừa đảo trực tuyến / phishing · Giả mạo danh tính trên mạng (catfishing) · Deepfake / nội dung giả mạo bằng AI · Theo dõi / rình rập qua mạng · Trào lưu / thử thách nguy hiểm trên mạng · Văn hóa influencer / câu tương tác · Cực đoan hóa qua mạng / buồng vang thông tin · Loot box / cơ chế gacha · Mua vật phẩm trong game · Chủ đề AI / trí tuệ nhân tạo · Riêng tư dữ liệu / giám sát diện rộng
### Nội dung nhạy cảm / 18+ (66)
### Nội dung nhạy cảm / 18+ (67)
Máu me · 18+ · Trang phục hở hang · Kh*a th*n một phần · Tạo hình nhân vật bị t*nh d*c hóa · Yếu tố fan service · Tư thế / góc quay gợi cảm · 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
Máu me · 18+ · Trang phục hở hang · Kh*a th*n một phần · Tạo hình nhân vật bị t*nh d*c hóa · Yếu tố fan service · Tư thế / góc quay gợi cảm · 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 · Cờ bạc mô phỏng · 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)
@@ -153,9 +154,43 @@ Lần đầu chơi (blind) · Không spoiler trong chat · Chế độ easy / st
Dùng mod · Bật cheat / debug · Dùng glitch · Có guide hỗ trợ · Game mục đích giáo dục / tuyên truyền
### Nội dung do AI tạo (7)
Nội dung do AI tạo (chung) · Hình ảnh / đồ họa AI · Giọng nói AI / tổng hợp · Nhạc / âm thanh AI · Văn bản / thoại do AI viết · AI tạo nội dung trực tiếp khi chơi · Nhà phát triển có công bố dùng AI
Bản thân game được làm hoặc chạy bằng AI tạo sinh — còn game có cốt truyện _về_ AI là "Chủ đề AI / trí tuệ nhân tạo" ở trên. Cách chia theo phần công bố AI của Steam: nội dung làm bằng AI trong quá trình phát triển rồi đưa vào game, và nội dung AI tạo trực tiếp khi đang chơi. Dịch máy là trường **Language patch** trong Ghi chú lượt chơi nên không có cảnh báo riêng ở đây. YouTube không yêu cầu gắn nhãn nội dung chỉnh sửa / tổng hợp cho video gameplay; các dòng này là để người xem biết.
---
## 4. Cửa hàng (15 + trang nhà phát hành)
## 4. Ghi chú kỹ thuật (25, chia nhóm)
Ghi chú được chọn hiển thị trong khối `▸ 🛠 TECH NOTES` (`▸ 🛠 GHI CHÚ KỸ THUẬT` khi output là tiếng Việt) ngay sau cảnh báo nội dung, theo thứ tự người dùng chọn. Chúng nói về bản quay, không phải về game. Những thông tin đã có trường riêng — độ khó, ending đã chiếu, language patch, phiên bản game, upscaler và frame generation trong Video settings — không lặp lại ở đây.
Khi chọn **Upscaled from** trong Video settings (v1.5.0), một ghi chú nữa tự thêm vào sau các ghi chú bạn chọn: _Đã upscale lên độ phân giải cao hơn khi dựng — chi tiết nhỏ được tái tạo, nên chữ, texture và đường viền có thể hơi khác so với hình gốc._ Ghi chú này không có trong danh sách bên dưới; dòng Upscale trong Video settings cho biết upscale từ đâu lên đâu.
### Âm thanh (5)
Tắt tiếng (bản quyền) · Giảm volume (bản quyền) · Thay nhạc (bản quyền) · Chỉ tắt cutscene · Giữ audio gốc (rủi ro claim)
### Chất lượng video (4)
Độ phân giải thấp (phần cứng) · Hạ đồ họa (hiệu năng) · Sụt FPS (phần cứng) · Lỗi hình do upscaling / frame gen
### Lỗi quay (4)
Bug là từ game · Giữ crash (minh bạch) · Cắt loading screen · Có thể có lỗi OBS
### Ghi chú cách chơi (8)
KHÔNG phải no-hit run · Không phải walkthrough mượt · Giải trí, không bình luận · Nhiều lần chết · Khám phá chậm · Có thể bí ở puzzle · Cắt phần cày · Không phải speedrun
### Sản xuất & ghi nhận (4)
Khám phá (skip combat) · Edit cho hợp nhịp · Ủng hộ nhà phát triển · Lỗi kết nối online
---
## 5. Cửa hàng (15 + trang nhà phát hành)
Mỗi cửa hàng có một ô link riêng. Dán link cửa hàng vào bất kỳ đâu trong editor, link sẽ tự vào đúng ô; link đầu tiên còn đặt luôn nền tảng của video, và tên tìm kiếm của nền tảng đó được dùng trong tag. Mỗi link được đánh dấu là trả phí, miễn phí hoặc demo.
@@ -180,7 +215,7 @@ Mỗi cửa hàng có một ô link riêng. Dán link cửa hàng vào bất k
---
## 5. Link mạng xã hội, donate & cộng đồng
## 6. Link mạng xã hội, donate & cộng đồng
### Donate (5)
@@ -205,7 +240,7 @@ Dùng cho khối Donate (Việt Nam) — chuyển khoản ngân hàng, MoMo và
---
## 6. Nền tảng đăng chéo (7)
## 7. Nền tảng đăng chéo (7)
Tab Mạng xã hội dùng lại chính dữ liệu trong editor để tạo caption video ngắn. Khi caption vượt giới hạn của nền tảng, các khối tùy chọn sẽ bị bỏ bớt (cảnh báo nội dung bị bỏ trước); số hashtag được giới hạn theo từng nền tảng.
@@ -221,17 +256,18 @@ Tab Mạng xã hội dùng lại chính dữ liệu trong editor để tạo cap
---
## 7. Bảo trì
## 8. 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) (kèm title, câu mở đầu và lời chào pinned comment trong mọi file `templates.json`) 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) (kèm tag pool và từ khóa tìm kiếm trong `src/engine/tag-generator.ts` — có test giữ hai bên khớp nhau) 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ửa hàng** → thêm vào [`src/config/platforms.ts`](../../../src/config/platforms.ts) (URL pattern và `tagName`; có thể thêm hàm đọc tên game trong `src/utils/url-extractors.ts`) VÀ thêm dòng vào mục 4.
5. **Link mạng xã hội / donate** → thêm vào [`src/config/social-fields.ts`](../../../src/config/social-fields.ts) (kèm label `social.<id>` trong mọi file `ui.json`) VÀ thêm vào mục 5.
6. **Ngân hàng Việt Nam** → thêm vào [`src/config/vietnamese-banks.ts`](../../../src/config/vietnamese-banks.ts) — ngân hàng đổi tên thì thêm tên mới và ánh xạ tên cũ trong `VIETNAMESE_BANK_RENAMES` — VÀ cập nhật mục 5.
7. **Nền tảng đăng chéo** → thêm vào [`src/config/social-platforms.ts`](../../../src/config/social-platforms.ts) (kèm label `socialPost.platforms.<id>` trong mọi file `ui.json`) VÀ thêm dòng vào mục 6.
8. Cập nhật cả bản gốc EN tại [`docs/CONTENT-INVENTORY.md`](../../CONTENT-INVENTORY.md) trong cùng PR.
3. **Cảnh báo nội dung** → thêm id vào `CONTENT_WARNINGS` trong `src/engine/types.ts` và vào nhóm phù hợp ở [`src/config/content-warning-groups.ts`](../../../src/config/content-warning-groups.ts), kèm label trong editor và dòng description ở mọi locale và `_schema.json` (thiếu là test báo lỗi), VÀ thêm label vào đúng nhóm ở mục 3 — giữ số đếm trong tiêu đề chính xác.
4. **Ghi chú kỹ thuật** → tương tự với `TECH_NOTES` và [`src/config/tech-note-groups.ts`](../../../src/config/tech-note-groups.ts) VÀ mục 4.
5. **Cửa hàng** → thêm vào [`src/config/platforms.ts`](../../../src/config/platforms.ts) (URL pattern và `tagName`; có thể thêm hàm đọc tên game trong `src/utils/url-extractors.ts`) VÀ thêm dòng vào mục 5.
6. **Link mạng xã hội / donate** → thêm vào [`src/config/social-fields.ts`](../../../src/config/social-fields.ts) (kèm label `social.<id>` trong mọi file `ui.json`) VÀ thêm vào mục 6.
7. **Ngân hàng Việt Nam** → thêm vào [`src/config/vietnamese-banks.ts`](../../../src/config/vietnamese-banks.ts) — ngân hàng đổi tên thì thêm tên mới và ánh xạ tên cũ trong `VIETNAMESE_BANK_RENAMES` — VÀ cập nhật mục 6.
8. **Nền tảng đăng chéo** → thêm vào [`src/config/social-platforms.ts`](../../../src/config/social-platforms.ts) (kèm label `socialPost.platforms.<id>` trong mọi file `ui.json`) VÀ thêm dòng vào mục 7.
9. 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.
+11 -9
View File
@@ -23,13 +23,13 @@ macOS và Linux đều dùng được để phát triển. Build release Tauri
Cài theo thứ tự:
| Công cụ | Phiên bản | Lý do |
| ----------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Node.js** | **22** — đúng phiên bản trong `.node-version` | CI, các workflow release và Cloudflare Workers Builds đều đọc `.node-version`. Vite 8 cần Node `^20.19` hoặc `>= 22.12`, còn wrangler cần `>= 22`, nên hãy dùng 22.12 trở lên. Dùng [nvm](https://github.com/nvm-sh/nvm) hoặc [fnm](https://github.com/Schniz/fnm) (fnm đọc được `.node-version`). |
| **npm** | đi kèm Node 22 | Dự án dùng npm; `pnpm` và `yarn` chưa test. |
| **Rust** | stable, `>= 1.90` | Bắt buộc cho bản build Tauri desktop và Android (Tauri 2.12 cần Rust 1.90). Cài qua [rustup](https://rustup.rs/); profile mặc định đã có sẵn `rustfmt` và `clippy`. |
| **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/>. |
| Công cụ | Phiên bản | Lý do |
| ----------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Node.js** | **26** — đúng phiên bản trong `.node-version` | CI, các workflow release và Cloudflare Workers Builds đều đọc `.node-version`, và `package.json` khai báo `engines.node >= 26`. Dùng [nvm](https://github.com/nvm-sh/nvm) hoặc [fnm](https://github.com/Schniz/fnm) (fnm đọc được `.node-version`). |
| **npm** | 11, đi kèm Node 26 | Dự án dùng npm; `pnpm` và `yarn` chưa test. |
| **Rust** | stable, `>= 1.90` | Bắt buộc cho bản build Tauri desktop và Android (Tauri 2.12 cần Rust 1.90). Cài qua [rustup](https://rustup.rs/); profile mặc định đã có sẵn `rustfmt` và `clippy`. |
| **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
@@ -53,7 +53,7 @@ Quy trình tham chiếu dùng **JetBrains 2026.x** (WebStorm hoặc RustRover) l
- 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 → Languages → TypeScript → giữ TypeScript service đi kèm IDE. `node_modules/typescript` không phải trình biên dịch: đó là npm alias của `@typescript/typescript6`, tức API TypeScript 6.0 mà typescript-eslint dùng. Dự án typecheck bằng TypeScript 7 (`tsc`, từ `@typescript/native`) — `npm run typecheck` là chuẩn.
- Settings → Code Style → Prettier → Run on save (`{src,tests,scripts,worker,build-plugins}/**/*.{ts,tsx,css}` — đúng các file mà `npm run format` xử lý).
### VS Code
@@ -88,6 +88,7 @@ Dev server chỉ chạy riêng app: không có cổng Turnstile, không có anal
- Tạo nhánh từ `main` (`feat/…`, `fix/…`, `docs/…`, `chore/…`) và mở pull request vào `main`. Không có nhánh dài hạn nào khác, và mỗi lần merge vào `main` đều deploy bản web.
- Tiêu đề PR theo định dạng commit `type(scope): message`; CI có kiểm tra.
- Mỗi PR đều chạy job `check` (xem bên dưới), `dependency-review`, `workflow-lint`, `reuse` và `pr-title`; hai job Rust `lint-and-test` và `cargo-deny` chạy khi có thay đổi trong `src-tauri/`.
- Sau `check`, job `sonarcloud` gửi mã nguồn và báo cáo coverage lên [SonarCloud](https://sonarcloud.io/project/overview?id=poli0981_youtube-generator) (cấu hình trong `sonar-project.properties`) và fail khi quality gate fail: code mới phải đạt hạng A, mọi security hotspot đã được review, trùng lặp tối đa 3 % và coverage tối thiểu 80 %. PR từ fork và từ Dependabot bỏ qua job này — chúng không có `SONAR_TOKEN` — còn `main` được phân tích sau mỗi lần merge.
Quy định đầy đủ: [CONTRIBUTING.md](../../../CONTRIBUTING.md).
@@ -117,7 +118,7 @@ Quy định đầy đủ: [CONTRIBUTING.md](../../../CONTRIBUTING.md).
| `npm run validate:locales` | Bắt buộc cả 8 locale khớp chính xác với `_schema.json`. **Phải pass trước khi merge PR động đến locale.** |
| `npm run test` | Vitest chế độ watch. |
| `npm run test:run` | Vitest chạy một lần. |
| `npm run test:coverage` | Chạy một lần kèm báo cáo coverage vào `coverage/`; fail nếu thấp hơn ngưỡng đặt cho `src/engine/` và `worker/` trong `vitest.config.ts`. CI chạy lệnh này. |
| `npm run test:coverage` | Chạy một lần kèm báo cáo coverage vào `coverage/` — các tầng logic, SonarCloud đọc `lcov.info`; fail nếu thấp hơn ngưỡng đặt cho `src/engine/` và `worker/` trong `vitest.config.ts`. CI chạy lệnh này. |
| `npm run check:version` | Kiểm tra cả **sáu** trường version khớp nhau (`package.json`, hai chỗ trong `package-lock.json`, `tauri.conf.json`, `Cargo.toml`, `Cargo.lock`). Đây là thứ duy nhất phát hiện khi bỏ sót một chỗ. |
| `npm run check:tauri` | Các package npm `@tauri-apps/*` và các crate Tauri phải cùng major.minor. Tauri CLI sẽ từ chối build nếu lệch, mà CI thì không chạy build Tauri. |
| `npm run check:licenses` | Mọi package được bundle đều có license nằm trong danh sách cho phép, và `THIRD_PARTY_NOTICES.md` khớp với những gì đang cài. |
@@ -247,3 +248,4 @@ docs/I18N.md). Lời khuyên restart ở trên vẫn áp dụng cho tất 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.
- [ACCESSIBILITY.md ở root](../../../ACCESSIBILITY.md) — những gì dùng được với công nghệ hỗ trợ, và checklist cho thay đổi UI (bản tiếng Việt: [ACCESSIBILITY.md](./ACCESSIBILITY.md)).
+2 -2
View File
@@ -6,7 +6,7 @@
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 (các model Claude Opus; bản v1.0.0 dùng Claude Opus 5.5)**. 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.
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 (các model Claude Opus; từ bản v1.0.0 đến v1.5.1 dùng Claude Opus 5.5)**. 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:
@@ -16,7 +16,7 @@ Tuyên bố này áp dụng cho:
- Workflow CI/CD trong `.github/workflows/`.
- Cloudflare Worker trong `worker/` và các build plugin trong `build-plugins/`.
Xem thêm: [`THIRD_PARTY_NOTICES.md`](../../../THIRD_PARTY_NOTICES.md) § "AI-Assisted Development Disclosure".
Xem thêm: [`THIRD_PARTY_NOTICES.md`](../../../THIRD_PARTY_NOTICES.md) § "AI-assisted development".
## Chất lượng bản dịch
+2 -1
View File
@@ -1,8 +1,9 @@
import js from "@eslint/js";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";
import reactHooks from "eslint-plugin-react-hooks";
export default tseslint.config(
export default defineConfig(
js.configs.recommended,
...tseslint.configs.strict,
{
+1502 -1595
View File
File diff suppressed because it is too large. Load diff
+33 -26
View File
@@ -1,9 +1,12 @@
{
"name": "yt-desc-gen",
"version": "1.1.0",
"version": "1.5.1",
"private": true,
"license": "Apache-2.0",
"type": "module",
"engines": {
"node": ">=26"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
@@ -37,49 +40,53 @@
"dependencies": {
"@fontsource-variable/inter": "^5.3.0",
"@fontsource-variable/jetbrains-mono": "^5.3.0",
"@tauri-apps/api": "^2.12.0",
"@tauri-apps/plugin-opener": "^2.7.0",
"@tauri-apps/api": "^2.12.4",
"@tauri-apps/plugin-opener": "^2.7.2",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"i18next": "^26.4.2",
"i18next": "^26.5.11",
"i18next-resources-to-backend": "^1.2.3",
"lucide-react": "^1.49.0",
"motion": "^13.4.6",
"radix-ui": "^1.6.7",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"react-i18next": "^17.0.15",
"lucide-react": "^1.64.0",
"motion": "^13.5.1",
"radix-ui": "^1.8.1",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"react-i18next": "^17.1.9",
"react-router-dom": "^7.18.4",
"simple-icons": "^16.33.0",
"simple-icons": "^16.35.0",
"sonner": "^2.0.8",
"zustand": "^5.0.15"
"zustand": "^5.0.16"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@resvg/resvg-js": "2.6.2",
"@tailwindcss/postcss": "^4.3.3",
"@tauri-apps/cli": "2.12.0",
"@tauri-apps/cli": "2.12.4",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@types/node": "^26.6.3",
"@types/node": "^26.6.5",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.1",
"@vitest/coverage-v8": "^4.1.11",
"@typescript/native": "npm:typescript@^7.0.2",
"@vitejs/plugin-react": "^6.1.2",
"@vitest/coverage-v8": "^4.1.12",
"autoprefixer": "^10.6.1",
"eslint": "^10.11.0",
"eslint": "^10.13.0",
"eslint-plugin-react-hooks": "^7.1.1",
"knip": "^6.38.0",
"marked": "18.0.14",
"postcss": "^8.5.28",
"prettier": "^3.9.9",
"knip": "^6.44.0",
"marked": "18.1.1",
"postcss": "^8.5.31",
"prettier": "^3.9.10",
"prettier-plugin-tailwindcss": "^0.8.1",
"tailwindcss": "^4.3.3",
"tsx": "^4.23.15",
"typescript": "^5.9.3",
"typescript-eslint": "^8.71.0",
"vite": "^8.3.1",
"vitest": "^4.1.11",
"wrangler": "4.144.0"
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-eslint": "^8.72.0",
"vite": "^8.3.4",
"vitest": "^4.1.12",
"wrangler": "4.152.0"
},
"overrides": {
"undici": "^7.30.1"
}
}
+4 -4
View File
@@ -58,10 +58,10 @@ function readRepoFile(file: string): string {
/** The year HEAD was committed, or this UTC year when git is unavailable. */
export function headCommitYear(): number {
try {
const iso = execFileSync("git", ["log", "-1", "--format=%cI"], {
cwd: ROOT,
encoding: "utf8",
});
const options = { cwd: ROOT, encoding: "utf8" } as const;
// A dev/CI script: `git` is whichever one the developer's PATH or the CI
// image provides, by design — there is no fixed install path to pin.
const iso = execFileSync("git", ["log", "-1", "--format=%cI"], options); // NOSONAR
const year = Number(iso.trim().slice(0, 4));
if (Number.isInteger(year) && year >= 2000) return year;
} catch {
+69 -22
View File
@@ -14,6 +14,7 @@
*/
import { readFileSync, writeFileSync } from "fs";
import { resolve } from "path";
import { compareCodeUnits } from "../../src/utils/sort.ts";
const ROOT = resolve(import.meta.dirname, "../..");
const NOTICES = resolve(ROOT, "THIRD_PARTY_NOTICES.md");
@@ -37,12 +38,14 @@ const ALLOWED = new Set([
/** SPDX expression → allowed? `OR` needs one side, `AND` needs both. */
export function licenseAllowed(expression: string): boolean {
const expr = expression.trim().replace(/^\((.*)\)$/, "$1");
if (/\sOR\s/i.test(expr)) return expr.split(/\s+OR\s+/i).some(licenseAllowed);
if (/\sAND\s/i.test(expr)) return expr.split(/\s+AND\s+/i).every(licenseAllowed);
// Split on the bare operator; each part is trimmed by the recursive call.
if (/\sOR\s/i.test(expr)) return expr.split(/\sOR\s/i).some(licenseAllowed);
if (/\sAND\s/i.test(expr)) return expr.split(/\sAND\s/i).every(licenseAllowed);
return ALLOWED.has(expr);
}
interface PackageJson {
name?: string;
version?: string;
license?: string;
homepage?: string;
@@ -74,32 +77,76 @@ interface Row {
url: string;
}
function npmRows(names: string[]): Row[] {
return names.sort().map((name) => {
const pkg = readJson<PackageJson>(resolve(ROOT, "node_modules", name, "package.json"));
return {
name,
version: pkg.version ?? "?",
license: pkg.license ?? "UNKNOWN",
url: projectUrl(pkg),
};
});
function npmRows(keys: string[]): Row[] {
return keys
.map((key) => {
const pkg = readJson<PackageJson>(resolve(ROOT, "node_modules", key, "package.json"));
return {
// An npm alias installs under its key: `"typescript":
// "npm:@typescript/typescript6@…"` puts @typescript/typescript6 in
// node_modules/typescript. Name the package that is really there.
name: pkg.name ?? key,
version: pkg.version ?? "?",
license: pkg.license ?? "UNKNOWN",
url: projectUrl(pkg),
};
})
.sort((a, b) => compareCodeUnits(a.name, b.name));
}
/**
* Crates `src-tauri/Cargo.toml` depends on directly — the `[dependencies]`,
* `[build-dependencies]` and `[target.….dependencies]` tables. Dev-only
* dependencies don't ship and are left out.
*/
export function directCrates(toml: string): string[] {
const names = new Set<string>();
let inDependencies = false;
for (const raw of toml.replace(/\r\n/g, "\n").split("\n")) {
const line = raw.trim();
if (line.startsWith("[")) {
inDependencies = /^\[(?:target\..+\.)?(?:build-)?dependencies\]$/.test(line);
continue;
}
const name = inDependencies ? /^([A-Za-z0-9_-]+)\s*=/.exec(line)?.[1] : undefined;
if (name) names.add(name);
}
return [...names].sort(compareCodeUnits);
}
/**
* License and project page of the direct crates that aren't Tauri's own.
* Cargo.lock carries no license, so a new dependency fails the generator
* until it is added here; `cargo deny` vets the transitive tree.
*/
const OTHER_CRATES: Record<string, { license: string; url: string }> = {
serde: { license: "MIT OR Apache-2.0", url: "https://github.com/serde-rs/serde" },
};
function crateInfo(name: string): { license: string; url: string } {
if (name.startsWith("tauri-plugin")) {
return { license: "Apache-2.0 OR MIT", url: "https://github.com/tauri-apps/plugins-workspace" };
}
if (name.startsWith("tauri")) {
return { license: "Apache-2.0 OR MIT", url: "https://github.com/tauri-apps/tauri" };
}
const info = OTHER_CRATES[name];
if (!info) {
throw new Error(
`src-tauri depends on "${name}": add its license and project page to OTHER_CRATES in scripts/lib/third-party.ts`,
);
}
return info;
}
function crateRows(): Row[] {
const toml = readFileSync(resolve(ROOT, "src-tauri/Cargo.toml"), "utf8").replace(/\r\n/g, "\n");
const toml = readFileSync(resolve(ROOT, "src-tauri/Cargo.toml"), "utf8");
const lock = readFileSync(resolve(ROOT, "src-tauri/Cargo.lock"), "utf8").replace(/\r\n/g, "\n");
const names = [...toml.matchAll(/^([a-z][a-z0-9_-]*)\s*=\s*(?:"|\{)/gm)]
.map((m) => m[1] ?? "")
.filter((n) => n.startsWith("tauri"));
return [...new Set(names)].sort().map((name) => {
return directCrates(toml).map((name) => {
const version =
new RegExp(`\\[\\[package\\]\\]\\nname = "${name}"\\nversion = "([^"]+)"`).exec(lock)?.[1] ??
"?";
const url = name.startsWith("tauri-plugin")
? "https://github.com/tauri-apps/plugins-workspace"
: "https://github.com/tauri-apps/tauri";
return { name, version, license: "Apache-2.0 OR MIT", url };
return { name, version, ...crateInfo(name) };
});
}
@@ -147,7 +194,7 @@ ${table(crateRows(), "Crate")}
## Fonts and icons
- **Icons:** [Lucide](https://lucide.dev/) (\`lucide-react\`, ISC). Brand marks, where shown, come from [Simple Icons](https://simpleicons.org/) (CC0-1.0); the trademarks belong to their owners.
- **Fonts:** the app uses the operating system's fonts.
- **Fonts:** [Inter](https://rsms.me/inter/) and [JetBrains Mono](https://www.jetbrains.com/lp/mono/), bundled with the app from the \`@fontsource-variable\` packages above (SIL Open Font License 1.1, \`OFL-1.1\`).
## Services (web app only)
+50
View File
@@ -0,0 +1,50 @@
# SonarCloud, CI-based analysis. Automatic Analysis is off in the project's
# settings: the scanner runs in the `sonarcloud` job of
# .github/workflows/ci.yml, on every PR and every push to main, and reads this
# file. The version (package.json) is passed on the command line there.
sonar.organization=poli0981
sonar.projectKey=poli0981_youtube-generator
sonar.sourceEncoding=UTF-8
# Main code is the whole repository: the app, the Worker, the build plugins,
# the scripts, the Tauri shell (Rust, and the Android project, which is
# committed and edited), the migration page and the workflows. The tests are
# analysed as tests: the same files Vitest runs (vitest.config.ts) plus
# tests/helpers. Files git ignores are left out on their own; binary files
# (the icons, the Gradle wrapper's jar) are left out here — there is nothing
# in them to analyse, and the scanner warns about each one it reads as text.
sonar.sources=.
sonar.exclusions=tests/**,src/**/*.test.ts,src/**/*.test.tsx,**/*.png,**/*.ico,**/*.icns,**/*.jar
sonar.tests=.
sonar.test.inclusions=tests/**,src/**/*.test.ts,src/**/*.test.tsx
# Coverage is Vitest's LCOV report (`npm run test:coverage` in the `check`
# job), which measures the logic layers: src/engine, src/config, src/store,
# src/utils, worker/ and build-plugins/. SonarCloud would count a file missing
# from the report as 0 % covered, so everything else is excluded here. Keep
# this list in step with `coverage.include` in vitest.config.ts.
# - No test renders a component or page (there is no DOM environment); the
# hooks and i18n are React and i18next glue, checked in the running app.
# - worker/index.ts only wires the router to the Workers runtime.
# - scripts/ and the config files are tooling; the migration page and
# public/theme-init.js are static pages' scripts.
# - The Rust and Android code have no coverage tooling.
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.coverage.exclusions=\
src/App.tsx,\
src/main.tsx,\
src/components/**,\
src/pages/**,\
src/hooks/**,\
src/i18n/**,\
worker/index.ts,\
scripts/**,\
*.config.js,\
*.config.ts,\
migration-page/**,\
public/**,\
src-tauri/**
# The scan waits for the quality gate and fails the job when it fails, so the
# result is in CI as well as in SonarCloud's own check on the PR.
sonar.qualitygate.wait=true
+70 -93
View File
@@ -225,6 +225,12 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "base64"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
[[package]]
name = "bit-set"
version = "0.8.0"
@@ -463,7 +469,7 @@ dependencies = [
"iana-time-zone",
"num-traits",
"serde",
"windows-link 0.2.1",
"windows-link",
]
[[package]]
@@ -711,7 +717,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -882,7 +888,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -1527,7 +1533,7 @@ dependencies = [
"js-sys",
"log",
"wasm-bindgen",
"windows-core 0.61.2",
"windows-core",
]
[[package]]
@@ -2368,7 +2374,7 @@ dependencies = [
"libc",
"redox_syscall",
"smallvec",
"windows-link 0.2.1",
"windows-link",
]
[[package]]
@@ -2793,7 +2799,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -3170,6 +3176,12 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
[[package]]
name = "static_vcruntime"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff7589a1859b09232522bb9edf076ca7fcf14ded96685d3fa629db73023ffbb7"
[[package]]
name = "string_cache"
version = "0.9.0"
@@ -3202,9 +3214,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "swift-rs"
version = "1.0.8"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e45c444e496845d3f2a351146bff59aae4975b2280238df1dfaa0c7d1846f38e"
checksum = "cefd87076fd385308ee4aff597256c902f1fbb4d031de1558efc12f8ffefadd9"
dependencies = [
"base64 0.21.7",
"serde",
@@ -3300,7 +3312,7 @@ dependencies = [
"unicode-segmentation",
"url",
"windows",
"windows-core 0.62.2",
"windows-core",
"windows-version",
"x11-dl",
]
@@ -3324,9 +3336,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "tauri"
version = "2.12.0"
version = "2.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb20ef8e6f97d6fe03039666cd82861f09a38b56291fa2f0f9fe140023f61c1a"
checksum = "f316751027fc2644221d1a448564d519efb07067fda584879d9cda966391d212"
dependencies = [
"anyhow",
"bytes",
@@ -3375,9 +3387,9 @@ dependencies = [
[[package]]
name = "tauri-build"
version = "2.7.0"
version = "2.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b5ae674f48836f5dd2eeaf9e221c095bd3e78a8d0439c77ca93b48740a1b644"
checksum = "641dd5fd297c99ab92717b0428cca5b9c6f960b2ac96ca131b3eebc9d70b8ddc"
dependencies = [
"anyhow",
"cargo_toml",
@@ -3389,6 +3401,8 @@ dependencies = [
"semver",
"serde",
"serde_json",
"static_vcruntime",
"strsim",
"tauri-utils",
"tauri-winres",
"walkdir",
@@ -3396,11 +3410,11 @@ dependencies = [
[[package]]
name = "tauri-codegen"
version = "2.7.0"
version = "2.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3926b73ac01df7c14f19ff872cd56e67213a87acc0000ea37ddb300f3d11a3e3"
checksum = "a6585c5b536c00f039d12ce70a9755172d5423bbcfd3969863baa70314c3e02f"
dependencies = [
"base64 0.22.1",
"base64 0.23.1",
"brotli",
"ico",
"json-patch",
@@ -3423,9 +3437,9 @@ dependencies = [
[[package]]
name = "tauri-macros"
version = "2.7.0"
version = "2.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d21d0fa2c0529972ea6ecaf7404fcf40efac098eda0beb06ca682f41e33a6aa5"
checksum = "e2e83a0cfa1bae376e8fbbdc0b1692707aed50cd6072ce85cae4789af5d6c19f"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -3437,9 +3451,9 @@ dependencies = [
[[package]]
name = "tauri-plugin"
version = "2.7.0"
version = "2.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9ff3ebb9fda56ceb93d46f6cbb126bae82951bf43498543a5163dde5def49a1"
checksum = "67fb21a77e8f94e8beb3325e583102488659365af0a3948b7ea244c5b779c291"
dependencies = [
"anyhow",
"glob",
@@ -3453,9 +3467,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.8.0"
version = "2.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7527c5fd1678032d116c1a82e5d609c67370e56f858ae6cfd376bbca37fe0490"
checksum = "b7461aaacf1901915ea7b9f5cd74f8224a351ed96af0a62c07fce934003cb34b"
dependencies = [
"log",
"raw-window-handle",
@@ -3471,9 +3485,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-fs"
version = "2.6.0"
version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "466eb32466fe5021b6728b06862f9ff14a9f7e1af890047654e03a96d7c0e1bb"
checksum = "5d58eb1d4984e535f47a642ffec09a2da6f5c18a12b5902d12126cb7626d628b"
dependencies = [
"anyhow",
"dunce",
@@ -3495,9 +3509,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-opener"
version = "2.7.0"
version = "2.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d39404b2572927e0d3ed30a7ca226037f7508d22e79c96ee6ef0d42b6a4b3345"
checksum = "53810be1b4fed22bb6ac3f4cab5a2b80d9391d1af436bda145607532bc0bb219"
dependencies = [
"dunce",
"glob",
@@ -3517,9 +3531,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-single-instance"
version = "2.5.1"
version = "2.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91baf4f5db4b008fc2bcada0f7d3a49b45d911f94575ac236f225ed67554f5c0"
checksum = "561cd99484561bc39c954768e7b41a66cebbe1ac3d9d081c34361f740c489e2c"
dependencies = [
"serde",
"serde_json",
@@ -3533,9 +3547,9 @@ dependencies = [
[[package]]
name = "tauri-runtime"
version = "2.12.0"
version = "2.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9e6d5ef76985b32ff012a43b58df205d25a285e400ca878afcacddc5d5f3238"
checksum = "7c55766d99cea69055904d1735b93c2049302b2e09effd462120deb5581d78e9"
dependencies = [
"cookie",
"dpi",
@@ -3558,9 +3572,9 @@ dependencies = [
[[package]]
name = "tauri-runtime-wry"
version = "2.12.0"
version = "2.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa829eb69860cf1fb0bedb21d2d5f1effce3527d054a68ca1cd7355c654400a3"
checksum = "8d61892587aea2a85245bcaec98c6fe46268874c0a0deae5535fb71ca7b93eae"
dependencies = [
"gtk",
"http",
@@ -3584,9 +3598,9 @@ dependencies = [
[[package]]
name = "tauri-utils"
version = "2.10.0"
version = "2.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dd257082deff79550de3409ed146104aeaf86fe38649615b04a304144939677"
checksum = "362ab21cd4cc713f2a02b1a9b5688198b1541cfb6907c4281e9190e0f0ef4aa3"
dependencies = [
"anyhow",
"brotli",
@@ -3638,10 +3652,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [
"fastrand",
"getrandom 0.4.2",
"getrandom 0.3.4",
"once_cell",
"rustix",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -4353,7 +4367,7 @@ dependencies = [
"webview2-com-macros",
"webview2-com-sys",
"windows",
"windows-core 0.62.2",
"windows-core",
]
[[package]]
@@ -4375,7 +4389,7 @@ checksum = "b3a07132775117d6065853d9d1178157b8c90e228de47129d6bce2c7edebedfb"
dependencies = [
"thiserror 2.0.18",
"windows",
"windows-core 0.62.2",
"windows-core",
]
[[package]]
@@ -4400,7 +4414,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -4432,7 +4446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
dependencies = [
"windows-collections",
"windows-core 0.62.2",
"windows-core",
"windows-future",
"windows-numerics",
]
@@ -4443,20 +4457,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
dependencies = [
"windows-core 0.62.2",
]
[[package]]
name = "windows-core"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
dependencies = [
"windows-implement",
"windows-interface",
"windows-link 0.1.3",
"windows-result 0.3.4",
"windows-strings 0.4.2",
"windows-core",
]
[[package]]
@@ -4467,9 +4468,9 @@ checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
dependencies = [
"windows-implement",
"windows-interface",
"windows-link 0.2.1",
"windows-result 0.4.1",
"windows-strings 0.5.1",
"windows-link",
"windows-result",
"windows-strings",
]
[[package]]
@@ -4478,8 +4479,8 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
dependencies = [
"windows-core 0.62.2",
"windows-link 0.2.1",
"windows-core",
"windows-link",
"windows-threading",
]
@@ -4505,12 +4506,6 @@ dependencies = [
"syn 2.0.117",
]
[[package]]
name = "windows-link"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
[[package]]
name = "windows-link"
version = "0.2.1"
@@ -4523,17 +4518,8 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
dependencies = [
"windows-core 0.62.2",
"windows-link 0.2.1",
]
[[package]]
name = "windows-result"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
dependencies = [
"windows-link 0.1.3",
"windows-core",
"windows-link",
]
[[package]]
@@ -4542,16 +4528,7 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
dependencies = [
"windows-link 0.2.1",
]
[[package]]
name = "windows-strings"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
dependencies = [
"windows-link 0.1.3",
"windows-link",
]
[[package]]
@@ -4560,7 +4537,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
dependencies = [
"windows-link 0.2.1",
"windows-link",
]
[[package]]
@@ -4596,7 +4573,7 @@ version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
"windows-link 0.2.1",
"windows-link",
]
[[package]]
@@ -4636,7 +4613,7 @@ version = "0.53.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
dependencies = [
"windows-link 0.2.1",
"windows-link",
"windows_aarch64_gnullvm 0.53.1",
"windows_aarch64_msvc 0.53.1",
"windows_i686_gnu 0.53.1",
@@ -4653,7 +4630,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"
dependencies = [
"windows-link 0.2.1",
"windows-link",
]
[[package]]
@@ -4662,7 +4639,7 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631"
dependencies = [
"windows-link 0.2.1",
"windows-link",
]
[[package]]
@@ -4973,7 +4950,7 @@ dependencies = [
"webkit2gtk-sys",
"webview2-com",
"windows",
"windows-core 0.62.2",
"windows-core",
"windows-version",
"x11-dl",
]
@@ -5024,7 +5001,7 @@ dependencies = [
[[package]]
name = "yt-desc-gen"
version = "1.1.0"
version = "1.5.1"
dependencies = [
"serde",
"tauri",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "yt-desc-gen"
version = "1.1.0"
version = "1.5.1"
description = "YouTube Gameplay Description Generator"
authors = ["poli0981"]
edition = "2021"
+2 -1
View File
@@ -1,11 +1,12 @@
{
"identifier": "default",
"description": "Default capabilities for YTDescGen. File access goes through the app's own name-only commands and native dialogs run from Rust, so the webview gets no dialog, fs or shell permissions.",
"description": "Default capabilities for YTDescGen. File access goes through the app's own name-only commands and native dialogs run from Rust, so the webview gets no dialog, fs or shell permissions. set-webview-zoom backs the Ctrl/Cmd +/- zoom polyfill Tauri injects on macOS and Linux (zoomHotkeysEnabled).",
"windows": [
"main"
],
"permissions": [
"core:default",
"core:webview:allow-set-webview-zoom",
"opener:default"
]
}
@@ -5,7 +5,11 @@
<!-- AndroidTV support -->
<uses-feature android:name="android.software.leanback" android:required="false" />
<!-- allowBackup="false": the app's data (localStorage in the WebView) stays
on the device and is never copied to Google Drive backups. Users move
it to a new phone with the app's own Backup & Restore file. -->
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.yt_desc_gen"
+1 -1
View File
@@ -1 +1 @@
{"default":{"identifier":"default","description":"Default capabilities for YTDescGen. File access goes through the app's own name-only commands and native dialogs run from Rust, so the webview gets no dialog, fs or shell permissions.","local":true,"windows":["main"],"permissions":["core:default","opener:default"]}}
{"default":{"identifier":"default","description":"Default capabilities for YTDescGen. File access goes through the app's own name-only commands and native dialogs run from Rust, so the webview gets no dialog, fs or shell permissions. set-webview-zoom backs the Ctrl/Cmd +/- zoom polyfill Tauri injects on macOS and Linux (zoomHotkeysEnabled).","local":true,"windows":["main"],"permissions":["core:default","core:webview:allow-set-webview-zoom","opener:default"]}}
+55 -17
View File
@@ -85,6 +85,9 @@ fn dialog(
/// Ask where to save, then write `content` there. Returns the file name that
/// was written, or `None` when the user cancelled.
///
/// Waiting for the dialog and writing the file both block, so they run on the
/// blocking thread pool instead of holding one of the async runtime's workers.
#[tauri::command]
pub async fn export_text_file(
app: AppHandle,
@@ -96,15 +99,29 @@ pub async fn export_text_file(
title: Option<String>,
) -> Result<Option<String>, String> {
let filter = allowed_filter(&extensions)?;
let refs: Vec<&str> = filter.iter().map(String::as_str).collect();
let picked = dialog(&app, &window, title)
.set_file_name(suggested_file_name(&suggested_name))
.add_filter(filter_name, &refs)
.blocking_save_file();
let Some(picked) = picked else {
return Ok(None);
};
let path = with_allowed_extension(picked_path(picked)?, &filter[0]);
tauri::async_runtime::spawn_blocking(move || {
let refs: Vec<&str> = filter.iter().map(String::as_str).collect();
let picked = dialog(&app, &window, title)
.set_file_name(suggested_file_name(&suggested_name))
.add_filter(filter_name, &refs)
.blocking_save_file();
match picked {
None => Ok(None),
Some(picked) => write_picked(picked, &filter[0], &content),
}
})
.await
.map_err(|e| e.to_string())?
}
/// Write `content` where the user chose, ending in an allowed extension, and
/// return the file name that was written.
fn write_picked(
picked: FilePath,
default_ext: &str,
content: &str,
) -> Result<Option<String>, String> {
let path = with_allowed_extension(picked_path(picked)?, default_ext);
fs::write(&path, content).map_err(|e| e.to_string())?;
Ok(path.file_name().map(|n| n.to_string_lossy().into_owned()))
}
@@ -141,6 +158,7 @@ fn read_picked(path: &Path, filter: &[String]) -> Result<PickedFile, String> {
}
/// Ask for a file, then return its name and text. `None` when cancelled.
/// Runs on the blocking thread pool, like `export_text_file`.
#[tauri::command]
pub async fn import_text_file(
app: AppHandle,
@@ -150,14 +168,18 @@ pub async fn import_text_file(
title: Option<String>,
) -> Result<Option<PickedFile>, String> {
let filter = allowed_filter(&extensions)?;
let refs: Vec<&str> = filter.iter().map(String::as_str).collect();
let picked = dialog(&app, &window, title)
.add_filter(filter_name, &refs)
.blocking_pick_file();
match picked {
None => Ok(None),
Some(picked) => read_picked(&picked_path(picked)?, &filter).map(Some),
}
tauri::async_runtime::spawn_blocking(move || {
let refs: Vec<&str> = filter.iter().map(String::as_str).collect();
let picked = dialog(&app, &window, title)
.add_filter(filter_name, &refs)
.blocking_pick_file();
match picked {
None => Ok(None),
Some(picked) => read_picked(&picked_path(picked)?, &filter).map(Some),
}
})
.await
.map_err(|e| e.to_string())?
}
#[cfg(test)]
@@ -204,6 +226,22 @@ mod tests {
);
}
#[test]
fn writing_keeps_the_name_and_adds_an_allowed_extension() {
let dir = std::env::temp_dir().join(format!("ytdescgen-export-{}", std::process::id()));
fs::create_dir_all(&dir).unwrap();
let name = write_picked(FilePath::Path(dir.join("backup")), "json", "{}").unwrap();
assert_eq!(name.as_deref(), Some("backup.json"));
assert_eq!(fs::read_to_string(dir.join("backup.json")).unwrap(), "{}");
let name = write_picked(FilePath::Path(dir.join("notes.MD")), "json", "# x").unwrap();
assert_eq!(name.as_deref(), Some("notes.MD"));
assert_eq!(fs::read_to_string(dir.join("notes.MD")).unwrap(), "# x");
let _ = fs::remove_dir_all(&dir);
}
#[test]
fn reading_checks_type_size_and_encoding() {
let dir = std::env::temp_dir().join(format!("ytdescgen-dialog-{}", std::process::id()));
+6 -2
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
"productName": "YTDescGen",
"version": "1.1.0",
"version": "1.5.1",
"identifier": "com.skullmute.ytdescgen",
"build": {
"beforeBuildCommand": "npm run build",
@@ -20,7 +20,8 @@
"resizable": true,
"maximizable": true,
"fullscreen": false,
"center": true
"center": true,
"zoomHotkeysEnabled": true
}
],
"security": {
@@ -42,6 +43,9 @@
"android": {
"minSdkVersion": 30
},
"macOS": {
"minimumSystemVersion": "11.0"
},
"windows": {
"webviewInstallMode": {
"type": "downloadBootstrapper"
+11 -9
View File
@@ -55,21 +55,23 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
// 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 }) => {
// fall back to the browser console. (A try/catch could not catch
// that: the import rejects asynchronously.)
//
// 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);
});
} catch {
console.error("ErrorBoundary caught:", error, info);
}
this.props.onError?.(error, info);
}
@@ -7,7 +7,7 @@ import { GroupedChecklist } from "./GroupedChecklist";
const optionKey = (id: ContentWarning) => `editor.contentWarningOptions.${id}`;
/**
* The ~40 content warnings, grouped and searchable. Each maps to an entry in
* The 250+ content warnings, grouped and searchable. Each maps to an entry in
* the editor's `contentWarnings` array; selection order is preserved so the
* description lists them in the order they were picked. Spoilers — the group
* most videos need — starts open.
+6 -2
View File
@@ -265,6 +265,7 @@ export function EndingsEditor() {
type="number"
min={1}
max={MAX_ENDINGS}
aria-label={t("editor.endings.rowNumberAria", { row: i + 1 })}
value={entry.number?.toString() ?? ""}
onChange={(e) => {
const v = e.target.value.trim();
@@ -275,6 +276,7 @@ export function EndingsEditor() {
<td className="px-2 py-1.5">
<Input
placeholder={t("editor.endings.namePlaceholder")}
aria-label={t("editor.endings.rowNameAria", { row: i + 1 })}
value={entry.name}
onChange={(e) => updateEnding(i, { name: e.target.value })}
/>
@@ -322,8 +324,8 @@ export function EndingsEditor() {
<thead className="bg-surface-2 text-text-muted text-xs uppercase">
<tr>
<th className="px-2 py-1.5 text-left">{t("editor.endings.videoLabel")}</th>
<th className="px-2 py-1.5 text-left">From</th>
<th className="px-2 py-1.5 text-left">To</th>
<th className="px-2 py-1.5 text-left">{t("editor.endings.fromLabel")}</th>
<th className="px-2 py-1.5 text-left">{t("editor.endings.toLabel")}</th>
</tr>
</thead>
<tbody>
@@ -335,6 +337,7 @@ export function EndingsEditor() {
type="number"
min={1}
max={count}
aria-label={t("editor.endings.rangeFromAria", { video: i + 1 })}
value={String(r.from)}
onChange={(e) => updateRange(i, { from: Number(e.target.value) || 1 })}
/>
@@ -344,6 +347,7 @@ export function EndingsEditor() {
type="number"
min={1}
max={count}
aria-label={t("editor.endings.rangeToAria", { video: i + 1 })}
value={String(r.to)}
onChange={(e) => updateRange(i, { to: Number(e.target.value) || 1 })}
/>
+1 -1
View File
@@ -39,7 +39,7 @@ export default function GenreList({
<Command.Input
autoFocus
placeholder={t("editor.genreSearchPlaceholder")}
className="text-text-primary placeholder:text-text-muted h-10 w-full bg-transparent text-sm outline-none"
className="text-text-primary placeholder:text-text-muted h-10 w-full bg-transparent text-sm outline-hidden"
/>
</div>
<Command.List className="max-h-72 scrollbar-thin overflow-y-auto p-1">
+2 -2
View File
@@ -77,14 +77,14 @@ export function GenreSelector() {
{genres.map((id) => (
<span
key={id}
className="bg-accent-muted text-accent inline-flex h-7 items-center gap-1 rounded-full pr-1 pl-2.5 text-xs font-medium"
className="bg-accent-muted text-accent inline-flex h-7 items-center gap-1 rounded-full pr-0.5 pl-2.5 text-xs font-medium"
>
{labelOf(id)}
<button
type="button"
onClick={() => toggle(id)}
aria-label={t("editor.genreRemove", { genre: labelOf(id) })}
className="hover:bg-accent/20 flex size-5 cursor-pointer items-center justify-center rounded-full"
className="hover:bg-accent/20 flex size-6 cursor-pointer items-center justify-center rounded-full pointer-coarse:size-7"
>
<X className="size-3" aria-hidden="true" />
</button>
+1 -1
View File
@@ -55,7 +55,7 @@ export default function GpuList({
<Command.Input
autoFocus
placeholder={t("editor.gpuSearch")}
className="text-text-primary placeholder:text-text-muted h-10 w-full bg-transparent text-sm outline-none"
className="text-text-primary placeholder:text-text-muted h-10 w-full bg-transparent text-sm outline-hidden"
/>
</div>
<Command.List className="max-h-80 scrollbar-thin overflow-y-auto p-1">
+7 -3
View File
@@ -33,6 +33,7 @@ export function LivePreview({
// Without a game name the engine still renders "— Gameplay No Commentary";
// show the prompt instead so nothing half-built can be copied.
const hasGame = useEditorStore((s) => s.gameName.trim() !== "");
const lang = useEditorStore((s) => s.language);
const output = hasGame ? generated : EMPTY_GENERATOR_OUTPUT;
const [tab, setTab] = useState<PreviewTab>("title");
@@ -73,7 +74,7 @@ export function LivePreview({
>
<TabPanel value="title" className="p-4">
{output.title ? (
<p className="text-text-primary text-[0.9375rem] leading-snug font-medium">
<p lang={lang} className="text-text-primary text-[0.9375rem] leading-snug font-medium">
{output.title}
</p>
) : (
@@ -82,7 +83,10 @@ export function LivePreview({
</TabPanel>
<TabPanel value="description" className="p-4">
{output.description ? (
<pre className="text-text-secondary max-h-[min(52dvh,32rem)] scrollbar-thin overflow-y-auto font-sans text-xs leading-relaxed whitespace-pre-wrap">
<pre
lang={lang}
className="text-text-secondary max-h-[min(52dvh,32rem)] scrollbar-thin overflow-y-auto font-sans text-xs leading-relaxed whitespace-pre-wrap"
>
{output.description}
</pre>
) : (
@@ -91,7 +95,7 @@ export function LivePreview({
</TabPanel>
<TabPanel value="tags" className="p-4">
{output.tags.length > 0 ? (
<div className="flex flex-wrap gap-1">
<div lang={lang} className="flex flex-wrap gap-1">
{output.tags.map((tag, i) => (
<span
key={i}
+17 -12
View File
@@ -1,4 +1,4 @@
import { lazy, Suspense, useId, useState } from "react";
import { lazy, Suspense, useId, useState, type ReactNode } from "react";
import { useTranslation } from "react-i18next";
import { AlertTriangle, ChevronsUpDown } from "lucide-react";
import clsx from "clsx";
@@ -9,7 +9,6 @@ import { PopoverContent, PopoverRoot, PopoverTrigger } from "@components/ui/Popo
import { Spinner } from "@components/icons/animated";
import {
RIG_FIELDS,
cleanCpuName,
parseCompositeValue,
resolveCompositeOptions,
resolveCompositeLabelKey,
@@ -117,7 +116,7 @@ function GpuPicker({
);
}
/** CPU (and any other suggested text field): type freely or pick a suggestion. */
/** CPU, LUT (any suggested text field): type freely or pick a suggestion. */
function SuggestedTextField({
field,
value,
@@ -139,10 +138,11 @@ function SuggestedTextField({
list={listId}
autoComplete="off"
onChange={(e) => onChange(e.target.value)}
// "Intel(R) Core(TM) i7-12700K CPU @ 3.60GHz", as Windows shows it,
// becomes "Intel Core i7-12700K" once the user leaves the field.
// The field's own tidy-up once the user leaves it: Windows' "Intel(R)
// Core(TM) i7-12700K CPU @ 3.60GHz" becomes "Intel Core i7-12700K",
// a pasted "Rec709 Kodak 2383 D65.cube" loses its extension.
onBlur={(e) => {
const cleaned = field.id === "cpu" ? cleanCpuName(e.target.value) : e.target.value.trim();
const cleaned = field.clean ? field.clean(e.target.value) : e.target.value.trim();
if (cleaned !== e.target.value) onChange(cleaned);
}}
/>
@@ -230,7 +230,7 @@ export function RigEditor() {
// before it, so cascading option lists, dynamic labels and hidden-when
// predicates line up.
const previousValues: string[] = [];
const renderedParts: React.ReactNode[] = [];
const renderedParts: ReactNode[] = [];
composite.parts.forEach((part, index) => {
const stored = partValues[index] ?? "";
if (!part.hiddenWhen?.(previousValues)) {
@@ -293,12 +293,10 @@ export function RigEditor() {
}
if (field.type === "composite_dropdown") return renderComposite(field);
if (field.type === "dropdown_with_version") return renderDropdownWithVersion(field);
if (field.suggestions) {
return <SuggestedTextField key={field.id} field={field} value={value} onChange={set} />;
}
return (
const input = field.suggestions ? (
<SuggestedTextField field={field} value={value} onChange={set} />
) : (
<Input
key={field.id}
label={t(field.labelKey)}
maxLength={FIELD_LIMITS.SHORT_NAME}
placeholder={field.placeholder}
@@ -306,6 +304,13 @@ export function RigEditor() {
onChange={(e) => set(e.target.value)}
/>
);
// A wide field (the LUT) takes the whole row, right under the
// Video Editor row it belongs to.
return (
<div key={field.id} className={clsx("min-w-0", field.wide && "sm:col-span-2")}>
{input}
</div>
);
})}
</div>
</div>
+37 -9
View File
@@ -9,12 +9,14 @@ import {
RT_MODES,
FRAMEGEN_VENDORS,
ART_STYLES,
VIDEO_RESOLUTIONS,
type GraphicsPreset,
type RTMode,
type FrameGenVendor,
type FrameGenMultiplier,
type UpscaleQuality,
type ArtStyle,
type UpscaledFrom,
} from "@config/graphics-settings";
import {
getValidUpscaleQualities,
@@ -22,15 +24,11 @@ import {
coerceUpscaleQuality,
coerceFrameGenMultiplier,
} from "@engine/graphics-vendor";
import { upscaleSourcesFor, validUpscaleSource } from "@engine/upscale";
import { VIDEO_STYLE_ERA_IDS, type VideoStyleEra } from "@config/video-styles";
import { FIELD_LIMITS } from "@config/field-limits";
const RESOLUTION_OPTIONS = [
{ value: "720p", label: "720p" },
{ value: "1080p", label: "1080p" },
{ value: "1440p", label: "1440p" },
{ value: "4K", label: "4K" },
];
const RESOLUTION_OPTIONS = VIDEO_RESOLUTIONS.map((r) => ({ value: r, label: r }));
const FPS_OPTIONS = [
{ value: "30", label: "30 FPS" },
@@ -105,6 +103,26 @@ export function VideoSettingsForm() {
if (coercedM !== store.frameGenMultiplier) store.set("frameGenMultiplier", coercedM);
}
// v1.5.0: "Upscaled from" lists only resolutions below the video's own.
// A stale pair (an older profile applied over a 4K draft, say) shows as
// "Not upscaled" — the engine ignores it too.
const resolution = store.resolution ?? "1080p";
const upscaledFrom = validUpscaleSource(resolution, store.upscaledFrom);
const upscaleSources = upscaleSourcesFor(resolution);
const upscaledFromOptions = [
{ value: "", label: t("editor.upscaledFromNone") },
...upscaleSources.map((r) => ({ value: r, label: r })),
];
// Lowering the resolution to or below the upscale source ends the upscale,
// so the draft never keeps a pair the Select can't show.
function handleResolutionChange(next: string) {
store.set("resolution", next);
if (store.upscaledFrom && !validUpscaleSource(next, store.upscaledFrom)) {
store.set("upscaledFrom", "");
}
}
const artStyleOptions = ART_STYLES.map((s) => ({
value: s,
label: t(`editor.artStyleOptions.${s}`),
@@ -112,12 +130,19 @@ export function VideoSettingsForm() {
return (
<div className="flex flex-col gap-3">
<div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-4">
<Select
label={t("editor.resolution")}
options={RESOLUTION_OPTIONS}
value={store.resolution ?? "1080p"}
onChange={(v) => store.set("resolution", v)}
value={resolution}
onChange={handleResolutionChange}
/>
<Select
label={t("editor.upscaledFrom")}
options={upscaledFromOptions}
value={upscaledFrom}
disabled={upscaleSources.length === 0}
onChange={(v) => store.set("upscaledFrom", v as UpscaledFrom)}
/>
<Select
label={t("editor.fps")}
@@ -132,6 +157,9 @@ export function VideoSettingsForm() {
onChange={(v) => store.set("graphicsPreset", v as GraphicsPreset)}
/>
</div>
{upscaledFrom && (
<p className="text-text-muted -mt-1 text-xs">{t("editor.upscaledFromHelp")}</p>
)}
{store.graphicsPreset === "custom" && (
<Input
@@ -88,6 +88,7 @@ export function VietnameseDonateEditor() {
/>
{customMode && (
<Input
aria-label={t("editor.vnBankName")}
placeholder={t("editor.vnBankNamePlaceholder")}
value={vnBankName ?? ""}
onChange={(e) => store.set("vnBankName", e.target.value)}
+1 -1
View File
@@ -47,7 +47,7 @@ export function OfflineBanner() {
type="button"
onClick={() => setDismissed(true)}
aria-label={t("common.dismiss")}
className="text-text-muted hover:bg-surface-2 hover:text-text-primary flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors"
className="text-text-muted hover:bg-surface-2 hover:text-text-primary flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors pointer-coarse:size-9"
>
<X className="size-3.5" aria-hidden="true" />
</button>
+8 -2
View File
@@ -36,7 +36,10 @@ export function HistoryCard({ entry }: { entry: HistoryEntry }) {
<Icon className="size-4" aria-hidden />
</span>
<span className="min-w-0 flex-1">
<span className="text-text-primary block truncate text-sm font-medium">
<span
lang={entry.language}
className="text-text-primary block truncate text-sm font-medium"
>
{entry.title}
</span>
<span className="text-text-muted mt-0.5 block truncate text-xs">
@@ -75,7 +78,10 @@ export function HistoryCard({ entry }: { entry: HistoryEntry }) {
<CopyButton text={entry.description} label={t("output.copyDescription")} />
<CopyButton text={entry.tags} label={t("output.copyTags")} />
</div>
<pre className="bg-surface-0 border-border text-text-secondary max-h-56 scrollbar-thin overflow-y-auto rounded-lg border p-2.5 font-sans text-xs leading-relaxed whitespace-pre-wrap">
<pre
lang={entry.language}
className="bg-surface-0 border-border text-text-secondary max-h-56 scrollbar-thin overflow-y-auto rounded-lg border p-2.5 font-sans text-xs leading-relaxed whitespace-pre-wrap"
>
{entry.description}
</pre>
</div>
+3 -1
View File
@@ -5,6 +5,7 @@ import { Header } from "./Header";
import { Sidebar, NavList, NavFooterLinks } from "./Sidebar";
import { MobileNav } from "./MobileNav";
import { ScrollToTopButton } from "./ScrollToTopButton";
import { RouteAnnouncer } from "./RouteAnnouncer";
import { Drawer } from "@components/ui/Drawer";
import { useKeyboardShortcuts, type ShortcutHandlers } from "@hooks/use-keyboard-shortcuts";
import { useGlobalErrorHandler } from "@hooks/use-global-error-handler";
@@ -77,7 +78,7 @@ export function AppShell() {
e.preventDefault();
mainRef.current?.focus();
}}
className="bg-accent text-accent-fg rounded-control sr-only z-[60] px-3 py-2 text-sm font-medium focus:not-sr-only focus:fixed focus:top-2 focus:left-2"
className="bg-accent-solid text-accent-fg rounded-control sr-only z-[60] px-3 py-2 text-sm font-medium focus:not-sr-only focus:fixed focus:top-2 focus:left-2"
>
{t("nav.skipToContent")}
</a>
@@ -96,6 +97,7 @@ export function AppShell() {
<Outlet />
</main>
<ScrollToTopButton scrollRef={mainRef} />
<RouteAnnouncer />
</div>
<MobileNav onOpenMore={() => setMoreOpen(true)} moreActive={moreOpen} />
</div>
+1 -1
View File
@@ -98,7 +98,7 @@ function PaletteBody({
<Command.Input
autoFocus
placeholder={t("command.placeholder")}
className="text-text-primary placeholder:text-text-muted h-12 w-full bg-transparent text-sm outline-none"
className="text-text-primary placeholder:text-text-muted h-12 w-full bg-transparent text-sm outline-hidden"
/>
<Kbd>Esc</Kbd>
</div>
+54
View File
@@ -0,0 +1,54 @@
import { useEffect, useRef, useState } from "react";
import { useLocation } from "react-router-dom";
import { PAGE_TITLE_EVENT } from "@hooks/use-document-title";
/** A navigation whose page never names itself stops waiting after this long. */
const PENDING_MS = 5000;
/**
* Tells screen readers which page a navigation opened. A single-page app
* swaps the content without loading a page, so nothing is announced on its
* own. Focus stays where it was (on the link that was used), so keyboard users
* carry on from there.
*
* Every page names itself through useDocumentTitle, which fires
* PAGE_TITLE_EVENT — after the commit's effects, so a page rendered in the
* same commit as the path change is heard, and a lazy page is heard once its
* chunk arrives and it renders. A title change with no navigation behind it
* (switching the interface language) stays silent.
*/
export function RouteAnnouncer() {
const { pathname } = useLocation();
const [message, setMessage] = useState("");
const pending = useRef(false);
const lastPath = useRef(pathname);
useEffect(() => {
const onTitle = (event: Event) => {
if (!pending.current || !(event instanceof CustomEvent)) return;
if (typeof event.detail !== "string") return;
pending.current = false;
setMessage(event.detail);
};
window.addEventListener(PAGE_TITLE_EVENT, onTitle);
return () => window.removeEventListener(PAGE_TITLE_EVENT, onTitle);
}, []);
useEffect(() => {
// The first page is announced by the browser's own page load (and
// Strict Mode's second run of this effect must not count as a visit).
if (pathname === lastPath.current) return;
lastPath.current = pathname;
pending.current = true;
const timer = window.setTimeout(() => {
pending.current = false;
}, PENDING_MS);
return () => window.clearTimeout(timer);
}, [pathname]);
return (
<div role="status" aria-live="polite" aria-atomic="true" className="sr-only">
{message}
</div>
);
}
+2 -2
View File
@@ -79,14 +79,14 @@ export function LogEntryCard({ entry }: { entry: LogEntryType }) {
label={t("logs.copyEntry")}
size="icon-sm"
onClick={handleCopy}
className="size-7"
className="size-7 pointer-coarse:size-9"
>
<CopyStateIcon copied={copied} className="size-3.5" />
</IconButton>
<IconButton
label={t("logs.deleteEntry")}
size="icon-sm"
className="hover:text-danger size-7"
className="hover:text-danger size-7 pointer-coarse:size-9"
onClick={() => deleteEntry(entry.id)}
>
<Trash2 className="size-3.5" />
+1 -1
View File
@@ -98,7 +98,7 @@ export function OutputExtras() {
icon={MessageSquareText}
actions={<CopyButton text={templateText} label={t("output.copyPinnedCommentTemplate")} />}
>
<OutputText>{templateText}</OutputText>
<OutputText lang={input.language}>{templateText}</OutputText>
</OutputField>
)}
</div>
+14 -2
View File
@@ -24,10 +24,22 @@ export function OutputField({ title, icon: Icon, actions, children }: OutputFiel
);
}
/** Pre-formatted generated text, scrollable when long. */
export function OutputText({ children, tall }: { children: ReactNode; tall?: boolean }) {
/**
* Pre-formatted generated text, scrollable when long. `lang` is the language
* the text was generated in, so a screen reader reads it with that voice.
*/
export function OutputText({
children,
tall,
lang,
}: {
children: ReactNode;
tall?: boolean;
lang?: string;
}) {
return (
<pre
lang={lang}
className={
tall
? "bg-surface-0 border-border text-text-secondary max-h-[60dvh] scrollbar-thin overflow-y-auto rounded-lg border p-3 font-sans text-sm leading-relaxed whitespace-pre-wrap sm:max-h-[28rem]"
+21 -5
View File
@@ -1,12 +1,13 @@
import { useTranslation } from "react-i18next";
import { FileText, Tags, Type } from "lucide-react";
import { useGeneratedOutput } from "@hooks/use-generated-output";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { CopyButton } from "./CopyButton";
import { CharCounter } from "./CharCounter";
import { OutputField, OutputText } from "./OutputField";
import { YT_LIMITS } from "@engine/types";
import type { GeneratorOutput } from "@engine/types";
import type { GeneratorOutput, SupportedLanguage } from "@engine/types";
import type { OutputLimitStatus } from "@engine/limits";
import { useCopyGate } from "@hooks/use-copy-gate";
@@ -16,19 +17,26 @@ interface OutputPreviewProps {
status: OutputLimitStatus;
/** Strict Mode is blocking: nothing can be copied. */
strictBlocked?: boolean;
/** Language of `output` (the draft's output language when omitted). */
lang?: SupportedLanguage;
}
export function OutputPreview({
output: outputProp,
status,
strictBlocked = false,
lang: langProp,
}: OutputPreviewProps) {
const { t } = useTranslation("ui");
const gate = useCopyGate(status, strictBlocked);
const defaultOutput = useGeneratedOutput();
const showCharCount = useSettingsStore((s) => s.showCharCount);
const compactTagDisplay = useSettingsStore((s) => s.compactTagDisplay);
const draftLanguage = useEditorStore((s) => s.language);
const output = outputProp ?? defaultOutput;
// The cards' headings are interface text; only the generated text itself
// carries the output language.
const lang = langProp ?? draftLanguage;
return (
<div className="flex flex-col gap-4">
@@ -48,7 +56,10 @@ export function OutputPreview({
</>
}
>
<p className="bg-surface-0 border-border text-text-primary rounded-lg border p-3 text-[0.9375rem] font-medium">
<p
lang={lang}
className="bg-surface-0 border-border text-text-primary rounded-lg border p-3 text-[0.9375rem] font-medium"
>
{output.title || "…"}
</p>
</OutputField>
@@ -71,7 +82,9 @@ export function OutputPreview({
</>
}
>
<OutputText tall>{output.description || "…"}</OutputText>
<OutputText tall lang={lang}>
{output.description || "…"}
</OutputText>
</OutputField>
<OutputField
@@ -96,11 +109,14 @@ export function OutputPreview({
}
>
{compactTagDisplay ? (
<p className="bg-surface-0 border-border text-text-secondary rounded-lg border p-3 text-xs leading-relaxed">
<p
lang={lang}
className="bg-surface-0 border-border text-text-secondary rounded-lg border p-3 text-xs leading-relaxed"
>
{output.tagString}
</p>
) : (
<div className="flex flex-wrap gap-1.5">
<div lang={lang} className="flex flex-wrap gap-1.5">
{output.tags.map((tag, i) => (
<span
key={i}
+17 -4
View File
@@ -16,6 +16,8 @@ interface YouTubePreviewProps {
description: string;
channelName: string;
gameName: string;
/** Language the title and description were generated in. */
lang?: string;
}
/**
@@ -23,7 +25,13 @@ interface YouTubePreviewProps {
* search result and above the watch page's "…more". Most viewers never see
* anything past those points, so this is where the important words must go.
*/
export function YouTubePreview({ title, description, channelName, gameName }: YouTubePreviewProps) {
export function YouTubePreview({
title,
description,
channelName,
gameName,
lang,
}: YouTubePreviewProps) {
const { t } = useTranslation("ui");
const titleCut = title.length > SEARCH_TITLE_CHARS;
const descriptionCut = description.length > FOLD_DESCRIPTION_CHARS;
@@ -51,18 +59,23 @@ export function YouTubePreview({ title, description, channelName, gameName }: Yo
</span>
</div>
<div className="min-w-0 flex-1">
<p className="text-text-primary line-clamp-2 text-base leading-snug font-semibold">
<p
lang={lang}
className="text-text-primary line-clamp-2 text-base leading-snug font-semibold"
>
{title || "…"}
</p>
<p className="text-text-muted mt-1 text-xs">{channel}</p>
<p className="text-text-muted mt-2 line-clamp-2 text-xs leading-relaxed">{description}</p>
<p lang={lang} className="text-text-muted mt-2 line-clamp-2 text-xs leading-relaxed">
{description}
</p>
</div>
</div>
{/* Watch page, above "…more" */}
<div className="border-border bg-surface-0/60 mx-4 mb-4 rounded-xl border p-3">
<p className="text-text-secondary text-xs leading-relaxed whitespace-pre-line">
{fold || "…"}
<span lang={lang}>{fold || "…"}</span>
{descriptionCut && (
<span className="text-text-primary font-semibold">
{" "}
+1 -1
View File
@@ -58,7 +58,7 @@ export function Banner({
type="button"
onClick={onDismiss}
aria-label={dismissLabel}
className="-m-1 flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md opacity-70 hover:opacity-100"
className="-m-1 flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md opacity-70 hover:opacity-100 pointer-coarse:size-9"
>
<X className="size-3.5" aria-hidden="true" />
</button>
+36 -41
View File
@@ -1,4 +1,4 @@
import { forwardRef, type ButtonHTMLAttributes } from "react";
import type { ComponentProps } from "react";
import { Slot } from "radix-ui";
import clsx from "clsx";
import { Spinner } from "@components/icons/animated";
@@ -6,7 +6,8 @@ import { Spinner } from "@components/icons/animated";
export type ButtonVariant = "primary" | "brand" | "secondary" | "outline" | "ghost" | "danger";
export type ButtonSize = "sm" | "md" | "lg" | "icon" | "icon-sm";
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/** `ref` is an ordinary prop in React 19 — it comes with `ComponentProps<"button">`. */
export interface ButtonProps extends ComponentProps<"button"> {
variant?: ButtonVariant;
size?: ButtonSize;
/** Shows a spinner, disables the button and keeps its width. */
@@ -16,13 +17,13 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
}
const VARIANTS: Record<ButtonVariant, string> = {
primary: "bg-accent text-accent-fg shadow-sm hover:bg-accent-hover",
primary: "bg-accent-solid text-accent-fg shadow-sm hover:bg-accent-solid-hover",
brand: "bg-brand-gradient text-white shadow-sm hover:brightness-110",
secondary:
"border border-border bg-surface-2 text-text-primary hover:border-border-strong hover:bg-surface-3",
outline: "border border-border text-text-primary hover:bg-surface-2",
ghost: "text-text-secondary hover:bg-surface-2 hover:text-text-primary",
danger: "bg-danger text-white shadow-sm hover:brightness-110",
danger: "bg-danger-solid text-white shadow-sm hover:bg-danger-solid-hover",
};
const SIZES: Record<ButtonSize, string> = {
@@ -42,43 +43,37 @@ export const buttonClasses = (variant: ButtonVariant = "primary", size: ButtonSi
SIZES[size],
);
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
(
{
variant = "primary",
size = "md",
loading = false,
asChild = false,
className,
children,
disabled,
type,
...props
},
ref,
) => {
if (asChild) {
return (
<Slot.Root ref={ref} className={clsx(buttonClasses(variant, size), className)} {...props}>
{children}
</Slot.Root>
);
}
export function Button({
variant = "primary",
size = "md",
loading = false,
asChild = false,
className,
children,
disabled,
type,
ref,
...props
}: ButtonProps) {
if (asChild) {
return (
<button
ref={ref}
// A button inside a <form> defaults to submit — make every other one explicit.
type={type ?? "button"}
disabled={disabled || loading}
aria-busy={loading || undefined}
className={clsx(buttonClasses(variant, size), className)}
{...props}
>
{loading && <Spinner />}
<Slot.Root ref={ref} className={clsx(buttonClasses(variant, size), className)} {...props}>
{children}
</button>
</Slot.Root>
);
},
);
Button.displayName = "Button";
}
return (
<button
ref={ref}
// A button inside a <form> defaults to submit — make every other one explicit.
type={type ?? "button"}
disabled={disabled || loading}
aria-busy={loading || undefined}
className={clsx(buttonClasses(variant, size), className)}
{...props}
>
{loading && <Spinner />}
{children}
</button>
);
}
+1 -1
View File
@@ -63,7 +63,7 @@ export function Drawer({
{title}
</Dialog.Title>
<Dialog.Close
className="text-text-muted hover:bg-surface-2 hover:text-text-primary flex size-8 cursor-pointer items-center justify-center rounded-lg"
className="text-text-muted hover:bg-surface-2 hover:text-text-primary flex size-8 cursor-pointer items-center justify-center rounded-lg pointer-coarse:size-10"
aria-label={t("common.close")}
>
<X className="size-4" aria-hidden="true" />
+3 -1
View File
@@ -68,7 +68,9 @@ export const controlClasses = (invalid: boolean) =>
clsx(
"w-full min-w-0 rounded-control border bg-surface-1 px-3 text-text-primary",
"placeholder:text-text-muted transition-[border-color,box-shadow] duration-150",
"focus:outline-none focus-visible:outline-none focus:ring-3 focus:ring-accent/25",
// `outline-hidden`, not `outline-none`: Windows High Contrast drops the
// ring, and this keeps a transparent outline there that it paints instead.
"focus:outline-hidden focus-visible:outline-hidden focus:ring-3 focus:ring-accent/25",
"disabled:cursor-not-allowed disabled:opacity-55",
invalid
? "border-danger focus:border-danger"
+19 -13
View File
@@ -1,29 +1,35 @@
import { forwardRef } from "react";
import type { ReactNode } from "react";
import { Button, type ButtonProps } from "./Button";
import { Tooltip } from "./Tooltip";
interface IconButtonProps extends Omit<ButtonProps, "size" | "children" | "aria-label"> {
/** Accessible name AND tooltip text — an icon-only control needs both. */
label: string;
children: React.ReactNode;
children: ReactNode;
size?: "icon" | "icon-sm";
/** Hide the hover tooltip (the name stays for screen readers). */
noTooltip?: boolean;
tooltipSide?: "top" | "right" | "bottom" | "left";
}
/** A square, icon-only button that cannot be rendered without a name. */
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
(
{ label, children, variant = "ghost", size = "icon", noTooltip, tooltipSide, ...props },
ref,
) => (
/**
* A square, icon-only button that cannot be rendered without a name. A `ref`
* reaches the button through `props`.
*/
export function IconButton({
label,
children,
variant = "ghost",
size = "icon",
noTooltip,
tooltipSide,
...props
}: IconButtonProps) {
return (
<Tooltip content={label} disabled={noTooltip} side={tooltipSide}>
<Button ref={ref} variant={variant} size={size} aria-label={label} {...props}>
<Button variant={variant} size={size} aria-label={label} {...props}>
{children}
</Button>
</Tooltip>
),
);
IconButton.displayName = "IconButton";
);
}
+40 -33
View File
@@ -1,8 +1,8 @@
import { forwardRef, type InputHTMLAttributes, type ReactNode } from "react";
import type { ComponentProps, ReactNode } from "react";
import clsx from "clsx";
import { Field, controlClasses } from "./Field";
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
interface InputProps extends ComponentProps<"input"> {
label?: string;
error?: boolean;
/** Inline error message shown below the input (also forces the red border). */
@@ -15,35 +15,42 @@ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
leading?: ReactNode;
}
export const Input = forwardRef<HTMLInputElement, InputProps>(
({ label, error, errorText, helpText, labelExtra, leading, className, id, ...props }, ref) => {
const isError = Boolean(error) || Boolean(errorText);
return (
<Field label={label} error={errorText} help={helpText} labelExtra={labelExtra} id={id}>
{(control) => (
<div className="relative">
{leading && (
<span className="text-text-muted pointer-events-none absolute inset-y-0 left-3 flex items-center [&_svg]:size-4">
{leading}
</span>
export function Input({
label,
error,
errorText,
helpText,
labelExtra,
leading,
className,
id,
ref,
...props
}: InputProps) {
const isError = Boolean(error) || Boolean(errorText);
return (
<Field label={label} error={errorText} help={helpText} labelExtra={labelExtra} id={id}>
{(control) => (
<div className="relative">
{leading && (
<span className="text-text-muted pointer-events-none absolute inset-y-0 left-3 flex items-center [&_svg]:size-4">
{leading}
</span>
)}
<input
ref={ref}
{...control}
aria-invalid={isError || undefined}
className={clsx(
controlClasses(isError),
"h-control text-base sm:text-sm",
leading ? "pl-9" : undefined,
className,
)}
<input
ref={ref}
{...control}
aria-invalid={isError || undefined}
className={clsx(
controlClasses(isError),
"h-control text-base sm:text-sm",
leading ? "pl-9" : undefined,
className,
)}
{...props}
/>
</div>
)}
</Field>
);
},
);
Input.displayName = "Input";
{...props}
/>
</div>
)}
</Field>
);
}
+17 -2
View File
@@ -1,4 +1,4 @@
import type { ReactNode } from "react";
import type { ReactNode, RefObject } from "react";
import { useTranslation } from "react-i18next";
import { Dialog, VisuallyHidden } from "radix-ui";
import { X } from "lucide-react";
@@ -15,6 +15,12 @@ interface ModalProps {
/** Max width: sm 24rem · md 32rem (default) · lg 42rem · xl 56rem. */
size?: "sm" | "md" | "lg" | "xl";
className?: string;
/**
* Where focus lands when the dialog opens. Without it, Radix focuses the
* first focusable element (the close button). Use this instead of an
* `autoFocus` attribute on the target.
*/
initialFocusRef?: RefObject<HTMLElement | null>;
}
const SIZES = { sm: "max-w-sm", md: "max-w-lg", lg: "max-w-2xl", xl: "max-w-4xl" } as const;
@@ -34,6 +40,7 @@ export function Modal({
footer,
size = "md",
className,
initialFocusRef,
}: ModalProps) {
const { t } = useTranslation("ui");
return (
@@ -41,6 +48,14 @@ export function Modal({
<Dialog.Portal>
<Dialog.Overlay className="bg-overlay animate-fade-in fixed inset-0 z-50 backdrop-blur-[2px]" />
<Dialog.Content
onOpenAutoFocus={
initialFocusRef
? (event) => {
event.preventDefault();
initialFocusRef.current?.focus();
}
: undefined
}
className={clsx(
"bg-surface-1 border-border shadow-pop animate-pop-in rounded-panel fixed top-1/2 left-1/2 z-50 flex max-h-[min(88dvh,52rem)] w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col border",
"focus:outline-none",
@@ -65,7 +80,7 @@ export function Modal({
)}
</div>
<Dialog.Close
className="text-text-muted hover:bg-surface-2 hover:text-text-primary -m-1.5 flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-lg transition-colors"
className="text-text-muted hover:bg-surface-2 hover:text-text-primary -m-1.5 flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-lg transition-colors pointer-coarse:size-10"
aria-label={t("common.close")}
>
<X className="size-4" aria-hidden="true" />
+17 -8
View File
@@ -1,4 +1,4 @@
import { forwardRef, type SelectHTMLAttributes } from "react";
import type { ComponentProps } from "react";
import { ChevronsUpDown } from "lucide-react";
import clsx from "clsx";
import { Field, controlClasses } from "./Field";
@@ -8,7 +8,7 @@ interface SelectOption {
label: string;
}
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "onChange"> {
interface SelectProps extends Omit<ComponentProps<"select">, "onChange"> {
label?: string;
options: readonly SelectOption[];
onChange: (value: string) => void;
@@ -21,8 +21,19 @@ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "onC
* Android and iOS, type-ahead, and full keyboard support for free — and it
* now matches the other controls' height (it used to be ~6px shorter).
*/
export const Select = forwardRef<HTMLSelectElement, SelectProps>(
({ label, options, value, onChange, helpText, errorText, className, id, ...props }, ref) => (
export function Select({
label,
options,
value,
onChange,
helpText,
errorText,
className,
id,
ref,
...props
}: SelectProps) {
return (
<Field label={label} help={helpText} error={errorText} id={id}>
{(control) => (
// `className` sizes the control box (e.g. max-w-40), so the chevron
@@ -52,7 +63,5 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(
</div>
)}
</Field>
),
);
Select.displayName = "Select";
);
}
+22 -7
View File
@@ -1,6 +1,7 @@
import { useMemo, useState } from "react";
import { useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { Search } from "lucide-react";
import { useSettingsStore } from "@store/settings-store";
import { Modal } from "./Modal";
import { ShortcutKeys, keyName } from "./Badge";
@@ -16,6 +17,8 @@ const SHORTCUTS = [
{ keys: ["mod", "shift", "C"], labelKey: "shortcuts.copyAll" },
{ keys: ["mod", "S"], labelKey: "shortcuts.saveToHistory" },
{ keys: ["mod", "B"], labelKey: "shortcuts.toggleSidebar" },
// sonner's hotkey: focuses the notifications while any are on screen.
{ keys: ["alt", "T"], labelKey: "shortcuts.notifications" },
{ keys: ["mod", "/"], labelKey: "shortcuts.help" },
{ keys: ["?"], labelKey: "shortcuts.help" },
{ keys: ["esc"], labelKey: "shortcuts.close" },
@@ -24,6 +27,10 @@ const SHORTCUTS = [
export function ShortcutHelpModal({ open, onClose }: ShortcutHelpModalProps) {
const { t } = useTranslation("ui");
const [query, setQuery] = useState("");
const singleKey = useSettingsStore((s) => s.singleKeyShortcuts);
// The search box gets focus when the modal opens (through Radix, not an
// `autoFocus` attribute).
const searchRef = useRef<HTMLInputElement>(null);
// A closed modal has no filter. Deriving this rather than resetting `query`
// in an effect means a re-open always starts fresh without an extra render
@@ -31,28 +38,36 @@ export function ShortcutHelpModal({ open, onClose }: ShortcutHelpModalProps) {
const activeQuery = open ? query : "";
const filtered = useMemo(() => {
// The bare `?` row goes when Settings turned single-key shortcuts off.
const available = singleKey ? SHORTCUTS : SHORTCUTS.filter((s) => s.keys[0] !== "?");
const trimmed = activeQuery.trim().toLowerCase();
if (!trimmed) return SHORTCUTS;
return SHORTCUTS.filter((s) => {
if (!trimmed) return available;
return available.filter((s) => {
const label = t(s.labelKey).toLowerCase();
const keys = s.keys.map(keyName).join(" ").toLowerCase();
return label.includes(trimmed) || keys.includes(trimmed);
});
}, [activeQuery, t]);
}, [activeQuery, singleKey, t]);
return (
<Modal open={open} onClose={onClose} title={t("shortcuts.title")} size="sm">
<Modal
open={open}
onClose={onClose}
title={t("shortcuts.title")}
size="sm"
initialFocusRef={searchRef}
>
<div className="flex flex-col gap-3">
<label className="border-border bg-surface-0 focus-within:border-accent focus-within:ring-accent/25 h-control rounded-control flex items-center gap-2 border px-3 transition-colors focus-within:ring-2">
<Search className="text-text-muted size-4 shrink-0" aria-hidden="true" />
<input
ref={searchRef}
type="search"
value={activeQuery}
onChange={(e) => setQuery(e.target.value)}
placeholder={t("shortcuts.searchPlaceholder")}
aria-label={t("shortcuts.searchPlaceholder")}
className="text-text-primary placeholder:text-text-muted w-full bg-transparent text-sm outline-none"
autoFocus
className="text-text-primary placeholder:text-text-muted w-full bg-transparent text-sm outline-hidden"
/>
</label>
{filtered.length === 0 ? (
+32 -26
View File
@@ -1,8 +1,8 @@
import { forwardRef, type ReactNode, type TextareaHTMLAttributes } from "react";
import type { ComponentProps, ReactNode } from "react";
import clsx from "clsx";
import { Field, controlClasses } from "./Field";
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
interface TextareaProps extends ComponentProps<"textarea"> {
label?: string;
error?: boolean;
errorText?: string;
@@ -10,27 +10,33 @@ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
labelExtra?: ReactNode;
}
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
({ label, error, errorText, helpText, labelExtra, className, id, ...props }, ref) => {
const isError = Boolean(error) || Boolean(errorText);
return (
<Field label={label} error={errorText} help={helpText} labelExtra={labelExtra} id={id}>
{(control) => (
<textarea
ref={ref}
{...control}
aria-invalid={isError || undefined}
className={clsx(
controlClasses(isError),
"min-h-24 resize-y py-2 text-base leading-relaxed sm:text-sm",
className,
)}
{...props}
/>
)}
</Field>
);
},
);
Textarea.displayName = "Textarea";
export function Textarea({
label,
error,
errorText,
helpText,
labelExtra,
className,
id,
ref,
...props
}: TextareaProps) {
const isError = Boolean(error) || Boolean(errorText);
return (
<Field label={label} error={errorText} help={helpText} labelExtra={labelExtra} id={id}>
{(control) => (
<textarea
ref={ref}
{...control}
aria-invalid={isError || undefined}
className={clsx(
controlClasses(isError),
"min-h-24 resize-y py-2 text-base leading-relaxed sm:text-sm",
className,
)}
{...props}
/>
)}
</Field>
);
}
+6 -1
View File
@@ -1,3 +1,4 @@
import { useTranslation } from "react-i18next";
import { Toaster as Sonner } from "sonner";
import { useSettingsStore } from "@store/settings-store";
@@ -8,21 +9,25 @@ import { useSettingsStore } from "@store/settings-store";
* floating elements.
*/
export function Toaster() {
const { t } = useTranslation("ui");
const theme = useSettingsStore((s) => s.theme);
return (
<Sonner
theme={theme}
position="bottom-center"
closeButton
// sonner's own labels are English ("Notifications alt+T", "Close toast").
customAriaLabel={t("common.notificationsRegion")}
// globals.css switches this at the md breakpoint, where the bar goes.
offset={{ bottom: "var(--toast-offset-bottom)" }}
mobileOffset={{ bottom: "var(--toast-offset-bottom)" }}
toastOptions={{
closeButtonAriaLabel: t("common.closeNotification"),
classNames: {
toast:
"!bg-surface-1 !border-border !text-text-primary !rounded-card !shadow-pop !font-sans",
description: "!text-text-secondary",
actionButton: "!bg-accent !text-accent-fg !rounded-lg !font-medium",
actionButton: "!bg-accent-solid !text-accent-fg !rounded-lg !font-medium",
cancelButton: "!bg-surface-2 !text-text-secondary !rounded-lg",
closeButton: "!bg-surface-2 !border-border !text-text-secondary",
},
+3 -2
View File
@@ -28,8 +28,9 @@ export const ABOUT = {
},
/**
* One address per purpose, so a message lands with whoever handles it.
* Keep in sync with SECURITY.md, PRIVACY.md, TERMS.md, NOTICE and
* public/.well-known/security.txt.
* Keep in sync with SECURITY.md, PRIVACY.md, TERMS.md, NOTICE and the
* `/.well-known/security.txt` that `renderSecurityTxt` in
* build-plugins/web-only.ts writes at build time.
*/
contacts: {
general: "contact@poli0981.dev",
+17 -1
View File
@@ -4,7 +4,7 @@ import type { ContentWarning } from "@engine/types";
* UI grouping for the content-warning checklist. The engine doesn't
* care about groups — render order in the description follows the
* user's selection order in the array — but the editor uses these
* groups to render collapsible sections so 40+ items are scannable.
* groups to render collapsible sections so 250+ items are scannable.
*
* Add a new warning by:
* 1. Appending the id to {@link CONTENT_WARNINGS} in `@engine/types`.
@@ -220,6 +220,7 @@ export const CONTENT_WARNING_GROUPS: readonly ContentWarningGroup[] = [
"influencer_culture",
"online_radicalization",
"loot_boxes",
"in_game_purchases",
"ai_themes",
"data_privacy",
],
@@ -246,6 +247,7 @@ export const CONTENT_WARNING_GROUPS: readonly ContentWarningGroup[] = [
"discrimination",
"police_violence",
"smoking_drinking",
"simulated_gambling",
"detailed_killing",
"cult_occult",
"psychological_manipulation",
@@ -341,4 +343,18 @@ export const CONTENT_WARNING_GROUPS: readonly ContentWarningGroup[] = [
"educational_purpose_only",
],
},
{
// v1.2.0: the game is made or run with generative AI.
id: "ai_content",
labelKey: "editor.contentWarningGroups.ai_content",
items: [
"ai_generated_content",
"ai_generated_visuals",
"ai_generated_voices",
"ai_generated_music",
"ai_generated_text",
"ai_live_generated",
"ai_disclosed_by_developer",
],
},
] as const;
+4
View File
@@ -7,6 +7,7 @@ import type {
FrameGenMultiplier,
UpscaleQuality,
ArtStyle,
UpscaledFrom,
} from "./graphics-settings";
import type { VideoStyleEra } from "./video-styles";
import { DEFAULT_GACHA_QUEST_TYPE, type GachaQuestType } from "./gacha-quest-types";
@@ -56,6 +57,8 @@ export interface EditorDefaults {
/** Gacha-quest game version label (v0.13) — e.g. "1.2", "2.4". Only used for `gacha_quest` videoType. */
gachaVersion: string;
resolution: string;
/** v1.5.0: recorded at this resolution, upscaled to `resolution` in the editor. "" = not upscaled. */
upscaledFrom: UpscaledFrom;
fps: string;
graphicsPreset: GraphicsPreset;
graphicsPresetCustom: string;
@@ -194,6 +197,7 @@ export const DEFAULTS = {
anniversaryYear: null,
gachaVersion: "",
resolution: "1080p",
upscaledFrom: "",
fps: "60",
graphicsPreset: "medium",
graphicsPresetCustom: "",
+21
View File
@@ -1,5 +1,26 @@
import type { GenreId } from "./genres";
/**
* The video's resolution — the uploaded file's, which is what the title badge,
* the quality tags and the description's "Video:" line name. Lowest first, so
* an index comparison tells which of two is higher.
*/
export const VIDEO_RESOLUTIONS = ["720p", "1080p", "1440p", "4K"] as const;
/**
* v1.5.0: the resolution the footage was recorded at when it was upscaled to
* {@link VIDEO_RESOLUTIONS} in the video editor (e.g. 1440p → 4K). `""` = not
* upscaled. Only a value below the video's resolution counts — the engine
* ignores any other pair (see `@engine/upscale`).
*/
export const UPSCALED_FROM_OPTIONS = ["", "720p", "1080p", "1440p"] as const;
export type UpscaledFrom = (typeof UPSCALED_FROM_OPTIONS)[number];
/** Type guard so the migration and patches can drop values from elsewhere. */
export function isUpscaledFrom(value: unknown): value is UpscaledFrom {
return typeof value === "string" && (UPSCALED_FROM_OPTIONS as readonly string[]).includes(value);
}
/**
* Graphics-quality preset ladder. Mirrors the most common in-game preset
* names across Unreal/Unity/proprietary engines. `"custom"` reveals a
+8
View File
@@ -20,6 +20,7 @@ export type LegalDocId =
| "license"
| "third-party"
| "security"
| "accessibility"
| "notice"
| "conduct";
@@ -54,6 +55,13 @@ export const LEGAL_DOCS: readonly LegalDoc[] = [
consent: false,
},
{ id: "security", labelKey: "legal.docs.security", source: "SECURITY.md", consent: false },
{
id: "accessibility",
labelKey: "legal.docs.accessibility",
source: "ACCESSIBILITY.md",
sourceVi: "docs/i18n/vi/ACCESSIBILITY.md",
consent: false,
},
{ id: "notice", labelKey: "legal.docs.notice", source: "NOTICE", consent: false },
{ id: "conduct", labelKey: "legal.docs.conduct", source: "CODE_OF_CONDUCT.md", consent: false },
];
+1
View File
@@ -18,6 +18,7 @@ export const PROFILE_FIELDS = [
"social",
"rig",
"resolution",
"upscaledFrom",
"fps",
"graphicsPreset",
"graphicsPresetCustom",
+5 -2
View File
@@ -140,8 +140,11 @@ export const PLATFORMS: readonly PlatformConfig[] = [
tagName: "Android",
label: "Google Play",
urlPrefix: "https://play.google.com/store/apps/details?id=",
// `id=` first or after other parameters (`?hl=en&id=…`).
urlPattern: /^https:\/\/play\.google\.com\/store\/apps\/details\?(?:[^\s]*&)?id=[\w.]+[^\s]*$/i,
// `id=` first or after other parameters (`?hl=en&id=…`). The lookahead
// finds the parameter (each `&`-separated step is unambiguous), then one
// `\S*$` scan checks the rest — linear, where `[^\s]*&` + `[^\s]*$` was not.
urlPattern:
/^https:\/\/play\.google\.com\/store\/apps\/details\?(?=(?:[^\s&]*&)*id=[\w.])\S*$/i,
},
{
id: "appstore",
+98 -11
View File
@@ -102,6 +102,15 @@ export interface RigField {
readonly composite?: CompositeFieldSpec;
/** `text` fields: values offered while typing (the user may type anything). */
readonly suggestions?: readonly string[];
/**
* `text` fields: tidies the typed or pasted text. Runs when the user
* leaves the field and again in {@link formatRigValue}, so a shortcut
* pressed while the cursor is still in the field prints the tidy form
* too. Must be idempotent.
*/
readonly clean?: (raw: string) => string;
/** Takes both columns of the editor's grid (long values, such as a LUT name). */
readonly wide?: boolean;
}
/**
@@ -461,15 +470,80 @@ export const CPU_SUGGESTIONS: readonly string[] = [
* Text it doesn't recognise is only trimmed and de-duplicated of spaces.
*/
export function cleanCpuName(raw: string): string {
return raw
.replace(/\((?:R|TM|C)\)|[®™©]/gi, "")
.replace(/^\s*\d{1,2}(?:st|nd|rd|th)\s+Gen\s+/i, "")
.replace(/\s+CPU\s*@\s*[\d.]+\s*[GM]Hz\b/i, "")
.replace(/\s+@\s*[\d.]+\s*[GM]Hz\b/i, "")
.replace(/\s+\d{1,3}-Core\s+Processor\b/i, "")
.replace(/\s+(?:with\s+Radeon(?:\s+\w+)?\s+Graphics|Processor)\s*$/i, "")
.replace(/\s{2,}/g, " ")
.trim();
return (
raw
.replace(/\((?:R|TM|C)\)|[®™©]/gi, "")
// From here on every whitespace run is a single character, so the
// patterns below need only `\s` / `\s?`. A leading `\s+` would be
// re-tried at every position of a long run (quadratic).
.replace(/\s{2,}/g, " ")
.replace(/^\s*\d{1,2}(?:st|nd|rd|th)\s+Gen\s+/i, "")
.replace(/\sCPU\s?@\s?[\d.]+\s?[GM]Hz\b/i, "")
.replace(/\s@\s?[\d.]+\s?[GM]Hz\b/i, "")
.replace(/\s\d{1,3}-Core\sProcessor\b/i, "")
.replace(/\s(?:with\sRadeon(?:\s\w+)?\sGraphics|Processor)\s?$/i, "")
.trim()
);
}
/**
* LUTs that come with DaVinci Resolve, named the way its LUT menu shows
* them (from Resolve 21's own LUT folder), offered while typing in the
* LUT field. Any other LUT's name is accepted as typed.
*/
export const LUT_SUGGESTIONS: readonly string[] = [
"Arri Alexa LogC to Rec709",
"Rec709 Kodak 2383 D65",
"Rec709 Kodak 2383 D60",
"Rec709 Kodak 2383 D55",
"Rec709 Fujifilm 3513DI D65",
"Rec709 Fujifilm 3513DI D60",
"Rec709 Fujifilm 3513DI D55",
"HDR 1000 nits to Gamma 2.4",
"Blackmagic Gen 6 DaVinci to Rec709 BT1886 Film Look",
"SLog3SGamut3.CineToLC-709",
"SLog3SGamut3.CineToLC-709TypeA",
"V-Log to V-709",
"Leica Pure L-Log to Rec.709 Gamma 2.4",
"Samsung Log to Rec709",
];
/** The file extensions LUTs come in. Anchored at the end: linear. */
const LUT_FILE_EXTENSION = /\.(?:cube|3dl|dat|csp|ilut|olut|look)$/i;
/** One pass of {@link cleanLutName}. */
function tidyLutNameOnce(text: string): string {
let name = text.trim();
// Explorer's "Copy as path" wraps the path in double quotes.
if (name.length >= 2 && name.startsWith('"') && name.endsWith('"')) {
name = name.slice(1, -1).trim();
}
// A path (a backslash, a drive letter, or a leading / or ~/) keeps only
// its file name. A slash in an ordinary name ("Teal/Orange") stays.
const isPath =
name.includes("\\") || /^[a-z]:\//i.test(name) || name.startsWith("/") || name.startsWith("~/");
if (isPath) {
name = name.slice(Math.max(name.lastIndexOf("\\"), name.lastIndexOf("/")) + 1).trim();
}
return name.replace(LUT_FILE_EXTENSION, "").trim();
}
/**
* Tidy a LUT name pasted from a file manager:
* `"Rec709 Kodak 2383 D65.cube"` → `"Rec709 Kodak 2383 D65"`, and
* Explorer's `"C:\…\Arri\Arri Alexa LogC to Rec709.dat"` (or a macOS
* path) → `"Arri Alexa LogC to Rec709"`. Dots inside a name
* ("SLog3SGamut3.CineToLC-709", "Rec.709 Gamma 2.4") stay. Idempotent:
* passes repeat until nothing changes.
*/
export function cleanLutName(raw: string): string {
let name = raw;
let previous: string;
do {
previous = name;
name = tidyLutNameOnce(name);
} while (name !== previous);
return name;
}
/**
@@ -483,6 +557,7 @@ export const RIG_FIELDS: readonly RigField[] = [
type: "text",
placeholder: "AMD Ryzen 7 9800X3D",
suggestions: CPU_SUGGESTIONS,
clean: cleanCpuName,
},
{ id: "gpu", labelKey: "rig.gpu", type: "gpu" },
{ id: "ram", labelKey: "rig.ram", type: "composite_dropdown", composite: RAM_COMPOSITE },
@@ -509,6 +584,16 @@ export const RIG_FIELDS: readonly RigField[] = [
options: VIDEO_EDITOR_OPTIONS,
versionPlaceholder: "20 / 2026 / v25",
},
// The LUT graded in that editor — its own line, right under it.
{
id: "lut",
labelKey: "rig.lut",
type: "text",
placeholder: "Arri Alexa LogC to Rec709",
suggestions: LUT_SUGGESTIONS,
clean: cleanLutName,
wide: true,
},
];
/**
@@ -562,7 +647,9 @@ function withSuffix(text: string, suffix: string): string {
* - `composite_dropdown` ("32|DDR5|6000", "custom:48|DDR5|") →
* "32 GB DDR5-6000" / "48 GB DDR5" via the field's
* {@link CompositeFieldSpec.format}.
* - All other field types pass the raw value through.
* - `text` fields with a {@link RigField.clean} go through it (a pasted
* "Rec709 Kodak 2383 D65.cube" → "Rec709 Kodak 2383 D65"); other text
* passes through as typed.
*/
export function formatRigValue(fieldId: string, raw: string): string {
const field = RIG_FIELDS.find((f) => f.id === fieldId);
@@ -614,5 +701,5 @@ export function formatRigValue(fieldId: string, raw: string): string {
return field.composite.format(resolved);
}
return raw;
return field.clean ? field.clean(raw) : raw;
}
+6 -1
View File
@@ -34,7 +34,12 @@ export const TECH_NOTE_GROUPS: readonly TechNoteGroup[] = [
{
id: "video_quality",
labelKey: "editor.techNoteGroups.video_quality",
items: ["low_resolution_hardware", "low_graphics_performance", "fps_drops_hardware"],
items: [
"low_resolution_hardware",
"low_graphics_performance",
"fps_drops_hardware",
"upscaling_artifacts_possible",
],
},
{
id: "recording_issues",
+3 -3
View File
@@ -2,9 +2,9 @@
* 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.
* state-owned commercial banks, 24 joint-stock commercial banks (TMCP)
* by retail presence, five renamed in 2025 or digital-first, 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
+3 -1
View File
@@ -58,5 +58,7 @@ export function withoutEmptyChannel(text: string, language: SupportedLanguage):
let out = text;
for (const pattern of [...DROP[language], ENGLISH]) out = out.replace(pattern, "");
out = out.split(CHANNEL_SLOT).join(FALLBACK[language]);
return out.replace(/[ \t]{2,}/g, " ").replace(/[ \t]+([.,!?。!?])/g, "$1");
// After the first replace no run of spaces/tabs is longer than one, so the
// second needs no `+` (which would make it quadratic on long runs).
return out.replace(/[ \t]{2,}/g, " ").replace(/[ \t]([.,!?。!?])/g, "$1");
}
+33 -6
View File
@@ -1,4 +1,4 @@
import type { GeneratorInput, TranslationFn, CharLimitWarning } from "./types";
import type { GeneratorInput, TranslationFn, CharLimitWarning, AutoTechNote } from "./types";
import { channelOrSlot, withoutEmptyChannel } from "./channel-phrase";
import { YT_LIMITS } from "./types";
import { PLATFORMS } from "@config/platforms";
@@ -11,6 +11,7 @@ import { buildRigLines } from "./rig-block";
import { parseTimeline, renderTimeline } from "./timeline-parser";
import { formatEndingEntry, sliceEndingsForVideo } from "./endings-format";
import { sanitizeHashtag } from "@utils/sanitize";
import { validUpscaleSource } from "./upscale";
const SOCIAL_ICONS: Record<string, string> = {
kofi: "☕",
@@ -223,6 +224,26 @@ function composeVideoStyleLine(input: GeneratorInput, t: TranslationFn): string
return t("description.videoSettings.styleLineNoEditor", { era: eraLabel });
}
/**
* The v1.5.0 "Upscale:" line — `Upscale: 1440p → 4K (DaVinci Resolve Studio
* 21.2)`, the editor named by the rig's `video_editor` field (no brackets when
* it's empty). Empty string when the video isn't upscaled. Like the style
* line, it survives `skipGraphicsSettings`: it describes the video, not the
* game's settings, and the title's "Upscaled" badge needs it explained.
*/
function composeUpscaleLine(input: GeneratorInput, t: TranslationFn): string {
const from = validUpscaleSource(input.resolution, input.upscaledFrom);
if (!from) return "";
const editor = formatRigValue("video_editor", input.rig?.video_editor ?? "").trim();
const tool = editor ? ` (${editor})` : "";
return `${t("description.graphics.upscaleLabel")}: ${from} → ${input.resolution}${tool}`;
}
/** The tech notes the engine adds after the user's own ({@link AUTO_TECH_NOTES}). */
function autoTechNotes(input: GeneratorInput): AutoTechNote[] {
return validUpscaleSource(input.resolution, input.upscaledFrom) ? ["editor_upscaled"] : [];
}
export interface BuildDescriptionOptions {
hashtagCount?: number;
/** When true and channelName is non-empty, appends an auto-generated
@@ -450,6 +471,7 @@ export function buildDescription(
// still edit their footage, so the style credit shouldn't disappear
// with the graphics block.
const styleLine = composeVideoStyleLine(input, t);
const upscaleLine = composeUpscaleLine(input, t);
if (!input.skipGraphicsSettings) {
const lines: string[] = [];
@@ -461,6 +483,8 @@ export function buildDescription(
if (captureParts.length > 0) {
lines.push(`${t("description.graphics.videoLabel")}: ${captureParts.join(" - ")}`);
}
// v1.5.0: what the video was upscaled from, right under its resolution.
if (upscaleLine) lines.push(upscaleLine);
// In-game side: preset + modifiers + RT.
const gfxPart = composeGraphicsPart(input, t);
@@ -489,11 +513,12 @@ export function buildDescription(
if (lines.length > 0) {
sections.push(`${t("description.sections.videoSettings")}\n${lines.join("\n")}`);
}
} else if (styleLine) {
} else if (upscaleLine || 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}`);
// creator still upscaled the video or set a style era, so emit those
// lines as a standalone section under the same header.
const lines = [upscaleLine, styleLine].filter(Boolean);
sections.push(`${t("description.sections.videoSettings")}\n${lines.join("\n")}`);
}
// 5.5 Difficulty — moved into the unified Playthrough Notes block
@@ -534,8 +559,10 @@ export function buildDescription(
// Sits next to Content Warnings because both are transparency blocks;
// grouping them keeps disclaimers visually together. Same bilingual
// checklist shape.
// v1.5.0: the engine's own notes (the upscaling warning) follow the user's.
const techNotes = [...(input.techNotes ?? []), ...autoTechNotes(input)];
const tnSection = buildBilingualBulletSection(
input.techNotes ?? [],
techNotes,
"description.techNotes",
input.language,
t,
+120 -11
View File
@@ -1,6 +1,7 @@
import type { GeneratorInput, SupportedLanguage } from "./types";
import { YT_LIMITS } from "./types";
import { PLATFORMS } from "@config/platforms";
import { VIDEO_TYPES } from "@config/video-types";
/**
* Length of a tag list as YouTube counts it against the 500-character
@@ -26,8 +27,12 @@ export function youtubeTagsLength(tags: readonly string[]): number {
*/
const COMPOSITE_NAME_BUDGET = YT_LIMITS.SINGLE_TAG_MAX - 9;
// The match may only start right before a run of `:`/whitespace (or at the
// start), never inside one — a leading `[:\s]+` alone would be re-tried at
// every position of a long run (quadratic). Group 1 keeps the character before
// the run; the caller puts it back with "$1".
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;
/(^|[^:\s])[:\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
@@ -57,7 +62,7 @@ export function tagFriendlyGameName(name: string, budget: number): string {
let prev: string;
do {
prev = n;
n = n.replace(QUALIFIER_SUFFIX_RE, "").trim();
n = n.replace(QUALIFIER_SUFFIX_RE, "$1").trim();
} while (n !== prev);
if (n.length <= budget) return n;
@@ -69,16 +74,111 @@ export function tagFriendlyGameName(name: string, budget: number): string {
n = head;
}
const words = n.split(/\s+/);
const acc: string[] = [];
let len = 0;
for (const w of words) {
const sep = acc.length === 0 ? 0 : 1;
if (len + sep + w.length > budget) break;
acc.push(w);
len += sep + w.length;
return leadingWordsWithin(n.split(/\s+/), budget);
}
/**
* The leading whole words that fit `budget` characters, joined by single
* spaces; when even the first word is longer, its first `budget`
* characters.
*/
function leadingWordsWithin(words: readonly string[], budget: number): string {
const kept: string[] = [];
let length = 0;
for (const word of words) {
const separator = kept.length === 0 ? 0 : 1;
if (length + separator + word.length > budget) break;
kept.push(word);
length += separator + word.length;
}
return acc.join(" ") || n.slice(0, budget);
return kept.join(" ") || (words[0] ?? "").slice(0, budget);
}
/**
* What a boss name's tag keeps: letters in any script (with their
* combining marks), digits, whitespace, and `.` `'` `’` `-` for the word
* rules below. Everything else — `,` `;` `:` `!` `?` quotes, brackets,
* `&` `/` `#`, `「」` `・` `、` `。`, ™, emoji — becomes a space. A single
* character class: linear.
*/
const BOSS_NAME_NOISE = /[^\p{L}\p{M}\p{N}\s.'’-]/gu;
/**
* Where a long boss name's title starts: "Loretta, Knight of the
* Haligtree", "Margit – the Fell Omen", "Sister Friede (Phase 2)".
*/
const BOSS_NAME_BREAK = /[,,、::;;(([【「『|—–]| - /;
const DIGIT = /^\p{Nd}$/u;
const INITIAL = /^\p{L}\p{M}*$/u;
/** Apostrophes and hyphens belong inside a word ("Mergo's", "T-103"), not at its edges. */
const WORD_EDGE_MARKS = new Set(["'", "’", "-"]);
function trimWordEdges(word: string): string {
let start = 0;
let end = word.length;
while (start < end && WORD_EDGE_MARKS.has(word.charAt(start))) start++;
while (end > start && WORD_EDGE_MARKS.has(word.charAt(end - 1))) end--;
return word.slice(start, end);
}
/**
* The dots in one word: kept between two digits ("2.0"), dropped between
* initials ("S.T.A.L.K.E.R." → "STALKER", "K.K." → "KK"), a space
* everywhere else ("Mr.X" → "Mr X", "Dr.ワイリー" → "Dr ワイリー").
* Done in code, not with a lookbehind: older WebKit (the macOS 11–13
* desktop webview) rejects one, and the whole chunk would fail to load.
*/
function resolveDots(word: string): string {
const parts = word.split(".");
let out = parts[0] ?? "";
for (let i = 1; i < parts.length; i++) {
const before = parts[i - 1] ?? "";
const after = parts[i] ?? "";
if (DIGIT.test(before.slice(-1)) && DIGIT.test(after.charAt(0))) out += ".";
else if (!(INITIAL.test(before) && (after === "" || INITIAL.test(after)))) out += " ";
out += after;
}
return out;
}
function bossNameWords(text: string): string[] {
return text
.replace(BOSS_NAME_NOISE, " ")
.split(/\s+/)
.flatMap((word) => resolveDots(word).split(" "))
.map(trimWordEdges)
.filter(Boolean);
}
/**
* The boss's name as one tag, without the marks that add nothing to a
* search: "Gael, Slave Knight" → "Gael Slave Knight", "Mr. X" → "Mr X",
* "「マレニア」" → "マレニア". Over 30 characters (the per-tag limit), the
* name before its title is tried ("Loretta, Knight of the Haligtree" →
* "Loretta"), then the leading words that fit. Empty when nothing is left.
*
* Pure — exported for testing.
*/
export function bossNameTag(name: string): string {
const text = name.normalize("NFC");
const words = bossNameWords(text);
const full = words.join(" ");
if (full.length <= YT_LIMITS.SINGLE_TAG_MAX) return full;
const breakAt = text.search(BOSS_NAME_BREAK);
const headWords = breakAt > 0 ? bossNameWords(text.slice(0, breakAt)) : [];
const head = headWords.join(" ");
if (head && head.length <= YT_LIMITS.SINGLE_TAG_MAX) return head;
return leadingWordsWithin(headWords.length > 0 ? headWords : words, YT_LIMITS.SINGLE_TAG_MAX);
}
/** Video types that ask for a boss name (Boss Fight, Boss No Hit). */
function takesBossName(videoType: string): boolean {
const extraFields: readonly string[] =
VIDEO_TYPES.find((type) => type.id === videoType)?.extraFields ?? [];
return extraFields.includes("bossName");
}
/**
@@ -537,6 +637,15 @@ export function generateTags(input: GeneratorInput, options?: TagOptions): strin
if (bareNameTag) allTags.push(bareNameTag);
if (composeName && composeName !== bareNameTag) allTags.push(composeName);
// Boss videos (v1.4.0): the boss's name as a tag of its own, right after
// the game's, so fitting the list to 500 characters never drops it. Only
// for the video types that ask for a boss name — one left in the draft
// after switching to another type isn't this video's.
if (takesBossName(input.videoType)) {
const bossTag = bossNameTag(input.bossName ?? "");
if (bossTag) allTags.push(bossTag);
}
// Core tags — language-specific (highest priority)
const coreFn = CORE_TAGS_BY_LANG[input.language] ?? CORE_TAGS_BY_LANG.en;
allTags.push(...coreFn(composeName));
+8 -4
View File
@@ -25,9 +25,13 @@ export interface TimelineEntry {
* frames `:FF` dropped, as editors export them), an optional `]` / `)`,
* an optional separator (`-`, `–`, `—`, `:`, `|`, `•`) and the label.
* "[0:00] Intro", "0:00 - Intro" and "00:00:00:12 Intro" all parse.
*
* Match it against `line.trimEnd()`: the label runs to the end of the line,
* and trimming first (rather than a lazy label + `\s*$`) keeps the match
* linear on long runs of spaces.
*/
const LINE_RE =
/^\s*[[(]?((?:\d{1,2}:)?\d{1,2}:\d{2})(?::\d{2})?[\])]?\s*(?:[-–—:|•·]\s*)?(\S.*?)\s*$/u;
/^\s*[[(]?((?:\d{1,2}:)?\d{1,2}:\d{2})(?::\d{2})?[\])]?\s*(?:[-–—:|•·]\s*)?(\S.*)$/u;
// Keyword patterns. Order matters — "final boss" must be tried before "boss".
// Each regex captures the optional number group when applicable.
@@ -128,7 +132,7 @@ export function parseTimeline(raw: string): TimelineEntry[] {
for (const line of lines) {
if (!line.trim()) continue;
const lineMatch = line.match(LINE_RE);
const lineMatch = LINE_RE.exec(line.trimEnd());
if (!lineMatch) {
// Not a `time label` line — keep the raw text so nothing disappears.
entries.push({ time: "", rawLabel: line.trim() });
@@ -152,7 +156,7 @@ export function parseTimeline(raw: string): TimelineEntry[] {
for (let i = 1; i < m.length - 1; i++) {
const g = m[i];
if (g && /^\d+$/.test(g)) {
entry.number = parseInt(g, 10);
entry.number = Number.parseInt(g, 10);
break;
}
}
@@ -200,7 +204,7 @@ export function renderTimeline(
// Collapse the trailing whitespace that creeps in when a numbered
// keyword pattern (`"Boss {{n}}"`) interpolates with an empty `n`.
const translated = t(`timeline.keywords.${entry.keyword}`, { n: numberVar })
.replace(/\s+$/u, "")
.trimEnd()
.replace(/\s{2,}/gu, " ");
const withRest = entry.rest ? `${translated} ${entry.rest}` : translated;
rendered.push(`${entry.time} ${withRest}`);
+17 -5
View File
@@ -15,6 +15,7 @@ import {
} from "@config/gacha-quest-types";
import { formatEndingEntry, sliceEndingsForVideo } from "./endings-format";
import type { EndingEntry } from "./types";
import { validUpscaleSource } from "./upscale";
/**
* Compact "[2K 60FPS]" badge appended to the video-type segment when the
@@ -26,10 +27,15 @@ import type { EndingEntry } from "./types";
* - Non-default FPS → include the resolution alongside (e.g. "1080p 120FPS")
* so a lonely FPS number isn't ambiguous.
*
* Always returns upper-case. Callers apply `badgeCase: "lower"` downstream
* — this function is a label producer, not a display formatter.
* - v1.5.0: `upscaledWord` (the locale's "Upscaled", passed only when the
* video was upscaled in the editor) follows the resolution — "4K Upscaled",
* "4K Upscaled 120FPS". It never makes a badge on its own: 1080p 60fps
* upscaled from 720p still has none (the description says so instead).
*
* Callers apply `badgeCase: "lower"` downstream — this function is a label
* producer, not a display formatter.
*/
export function buildQualityBadge(resolution?: string, fps?: string): string {
export function buildQualityBadge(resolution?: string, fps?: string, upscaledWord = ""): string {
const res = resolution || "1080p";
const fpsValue = fps || "60";
const resDefault = res === "1080p";
@@ -37,7 +43,8 @@ export function buildQualityBadge(resolution?: string, fps?: string): string {
if (resDefault && fpsDefault) return "";
const resLabel = res === "1440p" ? "2K" : res;
return fpsDefault ? resLabel : `${resLabel} ${fpsValue}FPS`;
const head = upscaledWord ? `${resLabel} ${upscaledWord}` : resLabel;
return fpsDefault ? head : `${head} ${fpsValue}FPS`;
}
export interface BuildTitleOptions {
@@ -285,7 +292,12 @@ export function buildTitle(
const gameName = input.gameNameLocalized?.[input.language] ?? input.gameName;
let badge = opts.showQualityBadge ? buildQualityBadge(input.resolution, input.fps) : "";
const upscaledWord = validUpscaleSource(input.resolution, input.upscaledFrom)
? t("title.upscaled")
: "";
let badge = opts.showQualityBadge
? buildQualityBadge(input.resolution, input.fps, upscaledWord)
: "";
if (badge && opts.badgeCase === "lower") badge = badge.toLowerCase();
// Gacha-quest titles compose their own head segment via the
+44
View File
@@ -227,6 +227,12 @@ export const TECH_NOTES = [
"low_resolution_hardware",
"low_graphics_performance",
"fps_drops_hardware",
// v1.2.0: DLSS / FSR / XeSS upscaling and frame generation leave their own
// artifacts in a recording (ghosting around the HUD, smeared particles).
// Which upscaler / frame generation was on is the structured
// `upscaleQuality` / `frameGenVendor` line in 🖥 VIDEO SETTINGS; this note
// only warns about what they do to the footage.
"upscaling_artifacts_possible",
// Recording issues
"bug_from_game",
"crash_kept_transparency",
@@ -249,6 +255,17 @@ export const TECH_NOTES = [
] as const;
export type TechNote = (typeof TECH_NOTES)[number];
/**
* Tech notes the engine adds on its own (v1.5.0), after the ones the user
* picked — never stored in `techNotes` and not in the editor's checklist.
* `editor_upscaled` comes with a valid {@link GeneratorInput.upscaledFrom}: the
* structured "Upscale:" line in 🖥 VIDEO SETTINGS says what was upscaled to
* what, this note warns what upscaling does to the image. Their bullets share
* `description.techNotes.items` with {@link TECH_NOTES}.
*/
export const AUTO_TECH_NOTES = ["editor_upscaled"] as const;
export type AutoTechNote = (typeof AUTO_TECH_NOTES)[number];
/**
* Content warnings (v0.11 unified bilingual checklist). Replaces the
* v0.7 trio (flashing_lights / loud_noises / jump_scares) plus the
@@ -440,6 +457,9 @@ export const CONTENT_WARNINGS = [
"influencer_culture",
"online_radicalization",
"loot_boxes",
// v1.2.0: ESRB / PEGI "In-Game Purchases" — real-money purchases of any
// kind, beside the random-item kind above.
"in_game_purchases",
"ai_themes",
"data_privacy",
// Mature / sensitive
@@ -464,6 +484,9 @@ export const CONTENT_WARNINGS = [
"discrimination",
"police_violence",
"smoking_drinking",
// v1.2.0: ESRB "Simulated Gambling" / PEGI "Gambling" — casino or betting
// games played inside the game, no real money involved.
"simulated_gambling",
"detailed_killing",
"cult_occult",
"psychological_manipulation",
@@ -550,6 +573,19 @@ export const CONTENT_WARNINGS = [
// v0.25.0: the game itself is educational / PSA / propaganda material —
// a nature-of-content disclosure, not a playthrough disclosure.
"educational_purpose_only",
// AI-generated content (v1.2.0): the game is made or run with generative
// AI — not a story about AI, which is `ai_themes`. Mirrors Steam's AI
// disclosure: content made with AI during development and shipped in the
// game (visuals, voices, music, text) vs content an AI generates live while
// the game runs. Machine translation is the structured `languagePatch`
// field (`mtl`), so there is no translation id here.
"ai_generated_content",
"ai_generated_visuals",
"ai_generated_voices",
"ai_generated_music",
"ai_generated_text",
"ai_live_generated",
"ai_disclosed_by_developer",
] as const;
export type ContentWarning = (typeof CONTENT_WARNINGS)[number];
@@ -619,7 +655,15 @@ export interface GeneratorInput {
* is rendered inside Gacha-specific intros (showcase / anniversary etc.).
*/
gachaVersion?: string;
/** The video's resolution — the uploaded file's ("4K" when 1440p footage was upscaled). */
resolution?: string;
/**
* v1.5.0: recorded at this resolution and upscaled to {@link resolution} in
* the video editor. Adds "Upscaled" to the title badge, an "Upscale:" line
* to 🖥 VIDEO SETTINGS and the {@link AUTO_TECH_NOTES} warning. Ignored
* unless it is below `resolution` (`@engine/upscale`).
*/
upscaledFrom?: string;
fps?: string;
/**
* Graphics-quality preset (v0.8 enum + `"custom"` escape hatch).
+39
View File
@@ -0,0 +1,39 @@
import {
UPSCALED_FROM_OPTIONS,
VIDEO_RESOLUTIONS,
type UpscaledFrom,
} from "@config/graphics-settings";
/**
* Upscaling in the video editor (v1.5.0): footage recorded at one resolution
* and exported at a higher one, e.g. 1440p → 4K. The title badge, the
* description's "Upscale:" line and the automatic tech note all go through
* {@link validUpscaleSource}, so a pair that isn't an upscale (same or higher
* source, unknown value) changes nothing anywhere.
*/
function rank(resolution: string): number {
return (VIDEO_RESOLUTIONS as readonly string[]).indexOf(resolution);
}
/**
* `from` when it is a known resolution below `resolution` (the video's own,
* 1080p when unset — the editor's default); otherwise `""`.
*/
export function validUpscaleSource(
resolution: string | undefined,
from: string | undefined,
): string {
if (!from) return "";
const source = rank(from);
const target = rank(resolution || "1080p");
return source >= 0 && target >= 0 && source < target ? from : "";
}
/** The sources a video at `resolution` can be upscaled from, lowest first. */
export function upscaleSourcesFor(resolution: string | undefined): Exclude<UpscaledFrom, "">[] {
return UPSCALED_FROM_OPTIONS.filter(
(from): from is Exclude<UpscaledFrom, ""> =>
from !== "" && validUpscaleSource(resolution, from) !== "",
);
}
+1
View File
@@ -44,6 +44,7 @@ export function buildGeneratorInputFromEditor(
anniversaryYear: state.anniversaryYear,
gachaVersion: state.gachaVersion,
resolution: state.resolution,
upscaledFrom: state.upscaledFrom,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
graphicsPresetCustom: state.graphicsPresetCustom,
+12
View File
@@ -1,5 +1,12 @@
import { useEffect } from "react";
/**
* Fired on `window` (detail: the page name) whenever a page sets its title.
* RouteAnnouncer reads it out after a navigation; restoring the previous title
* on unmount does not fire it, so a page being left is never announced.
*/
export const PAGE_TITLE_EVENT = "ytdescgen:page-title";
/**
* Sets `document.title` to `"<title> · YTDescGen"` for the lifetime of the
* component, and restores the previous title on unmount. Per-page titles
@@ -12,6 +19,11 @@ export function useDocumentTitle(title: string): void {
useEffect(() => {
const previous = document.title;
document.title = `${title} · YTDescGen`;
// A microtask, so listeners hear it after every effect of this commit has
// run — RouteAnnouncer marks the navigation in one of them.
queueMicrotask(() => {
window.dispatchEvent(new CustomEvent(PAGE_TITLE_EVENT, { detail: title }));
});
return () => {
document.title = previous;
};
+5 -1
View File
@@ -1,5 +1,6 @@
import { useEffect, useRef } from "react";
import { useNavigate } from "react-router-dom";
import { useSettingsStore } from "@store/settings-store";
import { useOutputCopy } from "./use-output-copy";
import { useSaveToHistory } from "./use-save-to-history";
@@ -60,9 +61,12 @@ export function useKeyboardShortcuts(handlers: ShortcutHandlers) {
} else if (
// Bare `?` (Shift+/) opens the cheatsheet too. Skip when the
// user is typing into a form field — `?` is a legitimate
// character in titles, descriptions, and other inputs.
// character in titles, descriptions, and other inputs — and when
// Settings › Editor turned single-key shortcuts off (WCAG 2.1.4:
// speech input says "question mark" and opens a dialog otherwise).
e.key === "?" &&
!mod &&
useSettingsStore.getState().singleKeyShortcuts &&
!isEditableTarget(e.target)
) {
e.preventDefault();
Loaded 100 of 165 files, more files were not shown because too many files have changed in this diff. Show more