Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c773512931 |
No files matched your search
@@ -1,123 +0,0 @@
|
||||
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", "needs-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.6.0`.
|
||||
placeholder: v1.6.0
|
||||
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.
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Bug report
|
||||
description: Something is broken or behaving unexpectedly.
|
||||
title: "[Bug]: "
|
||||
labels: ["bug", "needs-triage"]
|
||||
labels: ["bug", "triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
@@ -12,8 +12,8 @@ body:
|
||||
id: version
|
||||
attributes:
|
||||
label: App version
|
||||
description: From the About page. Example `v1.6.0`.
|
||||
placeholder: v1.6.0
|
||||
description: From the About page. Example `v1.2.0`.
|
||||
placeholder: v1.2.0
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Feature ideas (maintenance mode)
|
||||
url: https://github.com/poli0981/youtube-generator/discussions/categories/ideas
|
||||
about: YTDescGen is in maintenance mode and takes no new features. Share ideas in Discussions, with no commitment. To add or remove an option in one of the app's lists, use the Option request form.
|
||||
- name: Report a security vulnerability
|
||||
url: https://github.com/poli0981/youtube-generator/security/advisories/new
|
||||
about: Privately, please — never in a public issue. See SECURITY.md.
|
||||
@@ -11,7 +8,7 @@ contact_links:
|
||||
about: How-tos, backup & restore, troubleshooting and the FAQ.
|
||||
- name: Discord
|
||||
url: https://discord.gg/kDM9GMu5vm
|
||||
about: For casual questions, gameplay chat, or quick help. Use an issue form for anything actionable.
|
||||
about: For casual questions, gameplay chat, or quick help. Use a bug report or feature request for anything actionable.
|
||||
- name: All channels and contacts
|
||||
url: https://poli0981.dev/links/
|
||||
about: Email addresses by purpose and every other way to reach the maintainer.
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
name: Feature request
|
||||
description: Suggest a new feature or improvement.
|
||||
title: "[Feature]: "
|
||||
labels: ["enhancement", "triage"]
|
||||
body:
|
||||
- type: textarea
|
||||
id: problem
|
||||
attributes:
|
||||
label: Problem
|
||||
description: What pain point or workflow gap are you running into today?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: proposal
|
||||
attributes:
|
||||
label: Proposed solution
|
||||
description: What should YTDescGen do? Be concrete — UI sketch, example output, etc.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Alternatives considered
|
||||
description: Other approaches you thought about and why you ruled them out.
|
||||
- type: dropdown
|
||||
id: scope
|
||||
attributes:
|
||||
label: Scope
|
||||
description: Which surfaces does this affect?
|
||||
multiple: true
|
||||
options:
|
||||
- Editor
|
||||
- Output / preview
|
||||
- Batch
|
||||
- Social captions
|
||||
- Playlist
|
||||
- History
|
||||
- Profiles / presets
|
||||
- Templates (description, title, tags)
|
||||
- Backup & restore
|
||||
- i18n / locales
|
||||
- Settings
|
||||
- Web app (ytgenerator.stream)
|
||||
- Desktop (Tauri)
|
||||
- Android
|
||||
- Documentation
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: Pre-flight checks
|
||||
options:
|
||||
- label: I searched existing issues and this is not a duplicate.
|
||||
required: true
|
||||
@@ -1,62 +0,0 @@
|
||||
name: Option request
|
||||
description: Add or remove an option in one of the app's lists — a store, platform, genre, video type, content warning, tech note, GPU or upscaler / frame-generation mode.
|
||||
title: "[Option]: "
|
||||
labels: ["option-request", "needs-triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
YTDescGen is in **maintenance mode** ([CONTRIBUTING.md → Maintenance mode](https://github.com/poli0981/youtube-generator/blob/main/CONTRIBUTING.md#maintenance-mode)): it takes no new features, but an option people really need can still join — or leave — one of the lists the app already has. For anything else, share the idea in [Discussions → Ideas](https://github.com/poli0981/youtube-generator/discussions/categories/ideas).
|
||||
- type: dropdown
|
||||
id: action
|
||||
attributes:
|
||||
label: Add or remove?
|
||||
options:
|
||||
- Add an option
|
||||
- Remove an option
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: list
|
||||
attributes:
|
||||
label: Which list
|
||||
options:
|
||||
- Store (store links)
|
||||
- Social or donate platform
|
||||
- Game genre
|
||||
- Video type
|
||||
- Content warning
|
||||
- Tech note
|
||||
- GPU (rig catalog)
|
||||
- Upscaler / frame generation (Video settings)
|
||||
- Another list (say which below)
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: option
|
||||
attributes:
|
||||
label: The option
|
||||
description: Its name as it should appear, e.g. "itch.io", "Roguelite", "AMD FSR 4 x4".
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: why
|
||||
attributes:
|
||||
label: Who needs it, and why
|
||||
description: What can't you do today? A link helps — the store page, the vendor's announcement, a video of yours that needed it.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: wording
|
||||
attributes:
|
||||
label: Suggested wording (optional)
|
||||
description: For a content warning or tech note, the editor label and the line the description should print, in any of the eight languages you know.
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: Pre-flight checks
|
||||
options:
|
||||
- label: I searched existing issues and this is not a duplicate.
|
||||
required: true
|
||||
- label: This adds or removes an option in a list the app already has — it is not a new feature.
|
||||
required: true
|
||||
@@ -1,69 +0,0 @@
|
||||
name: Translation or wording fix
|
||||
description: Wording that doesn't fit a culture or region, or a spelling mistake that could mislead — in the interface or in the generated text.
|
||||
title: "[i18n]: "
|
||||
labels: ["i18n", "needs-triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
YTDescGen ships eight languages. Vietnamese is native-reviewed; Japanese, Spanish, Korean, Chinese, Portuguese (Brazil) and Indonesian are AI-translated (see [DISCLAIMER.md](https://github.com/poli0981/youtube-generator/blob/main/DISCLAIMER.md)), so corrections from native speakers are very welcome.
|
||||
- type: dropdown
|
||||
id: language
|
||||
attributes:
|
||||
label: 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: dropdown
|
||||
id: where
|
||||
attributes:
|
||||
label: Where
|
||||
options:
|
||||
- The interface (buttons, labels, messages)
|
||||
- The generated title, description or tags
|
||||
- Both
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: current
|
||||
attributes:
|
||||
label: Current text
|
||||
description: Copy it exactly as shown, and say where you saw it — the page or field, or the section of the description. A screenshot helps.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: suggested
|
||||
attributes:
|
||||
label: Suggested text
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: why
|
||||
attributes:
|
||||
label: Why
|
||||
options:
|
||||
- It doesn't fit the culture, region or usual tone
|
||||
- A spelling or grammar mistake that could mislead
|
||||
- The meaning is wrong (a mistranslation)
|
||||
- Something else (say below)
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: details
|
||||
attributes:
|
||||
label: Details (optional)
|
||||
- type: checkboxes
|
||||
id: checks
|
||||
attributes:
|
||||
label: Pre-flight checks
|
||||
options:
|
||||
- label: I searched existing issues and this is not a duplicate.
|
||||
required: true
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
YTDescGen is in maintenance mode (CONTRIBUTING.md → "Maintenance mode"):
|
||||
new features are out of scope, and `feat:` pull requests from outside
|
||||
contributors are closed automatically unless their scope is `options`
|
||||
(an agreed option request), `a11y` or `i18n`.
|
||||
-->
|
||||
|
||||
## Summary
|
||||
|
||||
<!-- 1-3 bullet points describing the change -->
|
||||
@@ -12,17 +5,6 @@ contributors are closed automatically unless their scope is `options`
|
||||
-
|
||||
-
|
||||
|
||||
## Scope
|
||||
|
||||
<!-- Tick what this PR is. Anything else is out of scope while YTDescGen is in maintenance mode. -->
|
||||
|
||||
- [ ] Bug fix, broken UI/UX or accessibility fix
|
||||
- [ ] Translation or wording fix
|
||||
- [ ] Add or remove an option in one of the app's lists, agreed in issue #
|
||||
- [ ] Dependency update, security fix, or major language/runtime/framework upgrade
|
||||
- [ ] Cloudflare / Worker change, or a fix for a website incident
|
||||
- [ ] Docs or tests only
|
||||
|
||||
## Type
|
||||
|
||||
- [ ] `feat` — new feature
|
||||
@@ -60,20 +42,6 @@ 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 -->
|
||||
|
||||
+2
-21
@@ -21,16 +21,6 @@
|
||||
# other long-standing one, left the tree in v1.0.0 when tauri 2.12 dropped
|
||||
# kuchikiki.)
|
||||
#
|
||||
# The npm side holds one package back on purpose: `i18next` stays on 26.6.x
|
||||
# (`~26.6.0` in package.json). 26.7, the last 26.x minor, adds the debug-mode
|
||||
# warnings that prepare the move to v27 — about 1.9 KB gzip in the i18n chunk,
|
||||
# which takes the initial load from 279.0 KB to 280.9 KB, over the 280 KB
|
||||
# budget (`npm run check:bundle`), for code the app never runs. Remove the
|
||||
# ignore and the tilde with the planned i18next 27 migration.
|
||||
#
|
||||
# (`undici`, overridden in package.json for alert #49 until v1.5.1, needs no
|
||||
# override any more: miniflare >= 5.20261101 depends on undici 7.30.1 itself.)
|
||||
#
|
||||
# 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
|
||||
@@ -76,12 +66,6 @@ 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:
|
||||
@@ -105,13 +89,10 @@ updates:
|
||||
patterns: ["@types/*"]
|
||||
ignore:
|
||||
# Majors land in their own planned release because each one needs a real
|
||||
# migration (Vitest 5 is the current example). Dependabot handles minor +
|
||||
# patch.
|
||||
# migration (TypeScript 7, Vitest 5 and lucide-react 1 are the current
|
||||
# examples). Dependabot handles minor + patch.
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
# Bundle budget — see the note at the top.
|
||||
- dependency-name: "i18next"
|
||||
versions: ["26.7.x"]
|
||||
|
||||
- package-ecosystem: "cargo"
|
||||
directory: "/src-tauri"
|
||||
|
||||
@@ -6,9 +6,8 @@ on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
# 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
|
||||
# Least privilege. The job only reads the repo — it publishes nothing, comments
|
||||
# nowhere. Declaring it explicitly also silences CodeQL's
|
||||
# `actions/missing-workflow-permissions`, which otherwise flags the implicit
|
||||
# (and much wider) default token scope.
|
||||
permissions:
|
||||
@@ -32,21 +31,11 @@ jobs:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
# 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\.'
|
||||
- run: npm ci
|
||||
|
||||
# --- correctness ------------------------------------------------------
|
||||
# `typecheck` covers src/ (what Vite builds); `typecheck:all` adds tests/,
|
||||
@@ -62,14 +51,6 @@ 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
|
||||
@@ -112,50 +93,4 @@ jobs:
|
||||
# Validates wrangler.jsonc and bundles the Worker exactly as Workers
|
||||
# Builds will — without deploying anything.
|
||||
- name: Dry-run the Cloudflare deploy
|
||||
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@e805d875275f728fac1885b413934be6d7c63f65 # v8.4.1
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
with:
|
||||
args: -Dsonar.projectVersion=${{ steps.version.outputs.version }}
|
||||
run: npx wrangler deploy --dry-run --outdir .wrangler/dry-run
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
permissions:
|
||||
pull-requests: read
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@2252a14e810aa9b85c2d560bd7070c802206ecf6 # v6.1.2
|
||||
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
name: Maintenance triage
|
||||
|
||||
# YTDescGen is in maintenance mode (CONTRIBUTING.md → Maintenance mode). This
|
||||
# workflow closes, with a bilingual comment and the `out-of-scope` label:
|
||||
# • any issue or pull request the maintainer labels `out-of-scope`;
|
||||
# • when opened by an outside contributor: issues titled [Feature…] or
|
||||
# labelled `enhancement`, and pull requests titled `feat:` — except the
|
||||
# scopes maintenance mode still takes: `options` (an agreed option
|
||||
# request), `a11y` and `i18n`. The owner, members, collaborators and bots
|
||||
# are skipped.
|
||||
# pull_request_target runs in the base repository so it can comment on and
|
||||
# close pull requests from forks. It never checks out or runs pull request
|
||||
# code, and the script reads titles from the event payload itself instead of
|
||||
# having untrusted text interpolated into it (.github/zizmor.yml says so too).
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, labeled]
|
||||
pull_request_target:
|
||||
types: [opened, labeled]
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: maintenance-triage-${{ github.event.issue.number || github.event.pull_request.number }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
name: Close out-of-scope requests
|
||||
if: >-
|
||||
(github.event.action == 'labeled' && github.event.label.name == 'out-of-scope') ||
|
||||
(github.event.action == 'opened' &&
|
||||
!contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'),
|
||||
github.event.issue.author_association || github.event.pull_request.author_association))
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Close if out of scope
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
with:
|
||||
script: |
|
||||
const OUT_OF_SCOPE = 'out-of-scope';
|
||||
const TRUSTED = ['OWNER', 'MEMBER', 'COLLABORATOR'];
|
||||
// Feature pull requests maintenance mode still takes.
|
||||
const KEPT_SCOPES = ['options', 'a11y', 'i18n'];
|
||||
const { payload } = context;
|
||||
const isPR = Boolean(payload.pull_request);
|
||||
const item = payload.pull_request ?? payload.issue;
|
||||
if (!item || item.state !== 'open') return;
|
||||
|
||||
const labels = (item.labels ?? []).map((label) => label.name);
|
||||
let reason = null;
|
||||
if (payload.action === 'labeled') {
|
||||
if (payload.label?.name === OUT_OF_SCOPE) reason = 'labelled out-of-scope';
|
||||
} else if (payload.action === 'opened') {
|
||||
const trusted = TRUSTED.includes(item.author_association);
|
||||
const bot = item.user?.type === 'Bot';
|
||||
const title = String(item.title ?? '').trim();
|
||||
if (!trusted && !bot) {
|
||||
if (isPR) {
|
||||
// Conventional Commits: feat:, feat(scope):, feat!:
|
||||
const feat = /^feat(?:\(([^)]*)\))?!?:/i.exec(title);
|
||||
const scope = (feat?.[1] ?? '').trim().toLowerCase();
|
||||
if (feat && !KEPT_SCOPES.includes(scope)) reason = 'feat: pull request';
|
||||
} else if (/^\[feature/i.test(title) || labels.includes('enhancement')) {
|
||||
reason = 'feature request';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!reason) {
|
||||
core.info(`#${item.number}: within scope, nothing to do.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const ideas = 'https://github.com/poli0981/youtube-generator/discussions/categories/ideas';
|
||||
const policy = 'https://github.com/poli0981/youtube-generator/blob/main/CONTRIBUTING.md#maintenance-mode';
|
||||
const en = isPR ? 'pull request' : 'issue';
|
||||
const vi = isPR ? 'Pull request' : 'Issue';
|
||||
const body = [
|
||||
'<!-- maintenance-triage -->',
|
||||
'Thanks for taking the time to write this. YTDescGen is in **maintenance mode**: it still takes dependency and security updates, major runtime upgrades, fixes for bugs, UI/UX, accessibility and translations, options added to or removed from its lists when people really need them, and Cloudflare or website fixes, but no new features.',
|
||||
'',
|
||||
`This ${en} falls outside that scope, so it has been closed. If it is actually a bug, an accessibility or translation fix, or an option request, reply here and the maintainer will take another look. Ideas are welcome in [Discussions → Ideas](${ideas}). The full policy is in [CONTRIBUTING.md → Maintenance mode](${policy}).`,
|
||||
'',
|
||||
'---',
|
||||
'',
|
||||
'Cảm ơn bạn đã dành thời gian. YTDescGen đang ở **giai đoạn bảo trì**: vẫn nhận cập nhật thư viện và bảo mật, nâng cấp runtime lớn, sửa lỗi, UI/UX, trợ năng (accessibility) và bản dịch, thêm hoặc bỏ một tuỳ chọn trong các danh sách của app khi thật sự có người cần, và sửa lỗi Cloudflare hay website, nhưng không thêm tính năng mới.',
|
||||
'',
|
||||
`${vi} này nằm ngoài phạm vi đó nên đã được đóng. Nếu thực ra đây là lỗi, sửa trợ năng hay bản dịch, hoặc yêu cầu tuỳ chọn, hãy trả lời tại đây để maintainer xem lại. Ý tưởng có thể gửi ở [Discussions → Ideas](${ideas}). Chính sách đầy đủ: [CONTRIBUTING.md → Maintenance mode](${policy}).`,
|
||||
].join('\n');
|
||||
|
||||
const { owner, repo } = context.repo;
|
||||
const number = item.number;
|
||||
await github.rest.issues.createComment({ owner, repo, issue_number: number, body });
|
||||
if (!labels.includes(OUT_OF_SCOPE)) {
|
||||
await github.rest.issues.addLabels({ owner, repo, issue_number: number, labels: [OUT_OF_SCOPE] });
|
||||
}
|
||||
if (isPR) {
|
||||
await github.rest.pulls.update({ owner, repo, pull_number: number, state: 'closed' });
|
||||
} else {
|
||||
await github.rest.issues.update({ owner, repo, issue_number: number, state: 'closed', state_reason: 'not_planned' });
|
||||
}
|
||||
core.notice(`Closed ${en} #${number} as out of scope (${reason}).`);
|
||||
@@ -3,9 +3,9 @@ name: Notify CI Failures
|
||||
on:
|
||||
workflow_run:
|
||||
# Match the exact `name:` of each watched workflow (ci.yml, security.yml,
|
||||
# compliance.yml, rust.yml, qodana.yml). Renaming one silently breaks
|
||||
# this filter — keep them in sync.
|
||||
workflows: ["CI", "Security", "Compliance", "Rust", "Qodana"]
|
||||
# compliance.yml, rust.yml). Renaming one silently breaks this filter —
|
||||
# keep them in sync.
|
||||
workflows: ["CI", "Security", "Compliance", "Rust"]
|
||||
types: [completed]
|
||||
|
||||
# REQUIRED: declare permissions matching the reusable workflow's needs.
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
name: Qodana
|
||||
|
||||
# JetBrains Qodana static analysis, one linter per Qodana Cloud project:
|
||||
#
|
||||
# typescript - qodana-js (native mode) the repository project yt-ts-js, secret QODANA_TOKEN_TS_JS, qodana.yaml
|
||||
# rust - qodana-rust (Docker, EAP) src-tauri/ project yt-rust, secret QODANA_TOKEN_RUST, src-tauri/qodana.yaml
|
||||
#
|
||||
# Every run analyses the whole project (`pr-mode: false`), so a pull request
|
||||
# and `main` report the same way, and each qodana.yaml holds a quality gate of
|
||||
# zero problems. Results: Qodana Cloud, check annotations on the run, and the
|
||||
# qodana-report-* artifacts (SARIF and logs). Not a required check.
|
||||
#
|
||||
# Both linters need an Ultimate licence; the account runs the Qodana Ultimate
|
||||
# trial. When the licence lapses, both jobs fail at the licence check: renew
|
||||
# it, or delete this file and the two qodana.yaml files.
|
||||
#
|
||||
# PRs from forks and from Dependabot get no repository secrets: the `tokens`
|
||||
# job sees that, and the analysis is skipped there, not failed — main is
|
||||
# analysed once they merge. The token reaches the scan step only: npm
|
||||
# packages are installed in a step that never sees it.
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: qodana-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||
|
||||
jobs:
|
||||
tokens:
|
||||
name: Qodana tokens
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
permissions: {}
|
||||
outputs:
|
||||
ts-js: ${{ steps.check.outputs.ts-js }}
|
||||
rust: ${{ steps.check.outputs.rust }}
|
||||
steps:
|
||||
- name: Check which Qodana tokens this run has
|
||||
id: check
|
||||
env:
|
||||
HAS_TS_JS: ${{ secrets.QODANA_TOKEN_TS_JS != '' }}
|
||||
HAS_RUST: ${{ secrets.QODANA_TOKEN_RUST != '' }}
|
||||
run: |
|
||||
echo "ts-js=$HAS_TS_JS" >> "$GITHUB_OUTPUT"
|
||||
echo "rust=$HAS_RUST" >> "$GITHUB_OUTPUT"
|
||||
if [ "$HAS_TS_JS" != true ] || [ "$HAS_RUST" != true ]; then
|
||||
echo "::notice::No Qodana token in this run (a Dependabot or fork pull request): that analysis is skipped."
|
||||
fi
|
||||
|
||||
typescript:
|
||||
name: TypeScript / JavaScript
|
||||
needs: tokens
|
||||
if: needs.tokens.outputs.ts-js == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 40
|
||||
permissions:
|
||||
contents: read
|
||||
checks: write # the action's annotations
|
||||
steps:
|
||||
# The pull request's own head commit, not the merge GitHub makes, so
|
||||
# the report names a commit that exists; full history for its VCS data.
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
# The linter resolves imports and types from node_modules. No lifecycle
|
||||
# scripts, as in every workflow (ci.yml says why).
|
||||
- run: npm ci --ignore-scripts
|
||||
# Native mode: the linter runs on this runner's Node 26 and node_modules
|
||||
# instead of the older Node the Qodana image ships.
|
||||
- name: Qodana scan
|
||||
uses: JetBrains/qodana-action@3e8d76ff0e0241618abd808682f426afe84bab3f # v2026.2.2
|
||||
with:
|
||||
args: --linter qodana-js --within-docker false
|
||||
pr-mode: false
|
||||
post-pr-comment: false
|
||||
upload-result: true
|
||||
artifact-name: qodana-report-typescript
|
||||
primary-cache-key: qodana-2026.2-js-${{ github.ref }}-${{ github.sha }}
|
||||
# A prefix, so pull requests can restore the cache saved on main.
|
||||
additional-cache-key: qodana-2026.2-js-
|
||||
cache-default-branch-only: true
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_TS_JS }}
|
||||
|
||||
rust:
|
||||
name: Rust (Early Access)
|
||||
needs: tokens
|
||||
if: needs.tokens.outputs.rust == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
permissions:
|
||||
contents: read
|
||||
checks: write # the action's annotations
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
# tauri::generate_context!() refuses to expand without the frontend
|
||||
# directory (frontendDist, ../dist): an empty page stands in for the web
|
||||
# build, which the analysis does not need. The icons are committed.
|
||||
- name: Stand-in for the web build
|
||||
run: |
|
||||
mkdir -p dist
|
||||
echo '<!doctype html><title>stand-in</title>' > dist/index.html
|
||||
# qodana-rust ships only as a Docker image. It runs as root so that the
|
||||
# bootstrap in src-tauri/qodana.yaml can install the C toolchain and the
|
||||
# libraries Tauri links against — without them `cargo check` fails and
|
||||
# the linter loads no Cargo package. The crates go to the cached Qodana
|
||||
# directory. --repository-root keeps ../dist and the git data visible.
|
||||
- name: Qodana scan
|
||||
uses: JetBrains/qodana-action@3e8d76ff0e0241618abd808682f426afe84bab3f # v2026.2.2
|
||||
with:
|
||||
args: --project-dir src-tauri --repository-root . --linter qodana-rust -u root -e CARGO_HOME=/data/cache/cargo
|
||||
pr-mode: false
|
||||
post-pr-comment: false
|
||||
upload-result: true
|
||||
artifact-name: qodana-report-rust
|
||||
primary-cache-key: qodana-2026.2-rust-${{ github.ref }}-${{ github.sha }}
|
||||
# A prefix, so pull requests can restore the cache saved on main.
|
||||
additional-cache-key: qodana-2026.2-rust-
|
||||
cache-default-branch-only: true
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_RUST }}
|
||||
@@ -23,13 +23,13 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.event.inputs.tag || github.ref }}
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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 --ignore-scripts
|
||||
- run: npm ci
|
||||
- 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@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
|
||||
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "17"
|
||||
@@ -74,12 +74,13 @@ jobs:
|
||||
run: sdkmanager "ndk;27.3.13750724"
|
||||
|
||||
# A master commit, not the regenerated `stable` branch — see rust.yml.
|
||||
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
|
||||
- uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
|
||||
|
||||
- run: npm ci --ignore-scripts
|
||||
- run: npm ci
|
||||
|
||||
- name: Install Tauri CLI
|
||||
run: cargo install tauri-cli --version "^2" --locked
|
||||
|
||||
@@ -111,7 +112,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@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: ytdescgen-android-apk
|
||||
path: src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
|
||||
|
||||
@@ -27,13 +27,13 @@ jobs:
|
||||
with:
|
||||
ref: ${{ github.event.inputs.tag || github.ref }}
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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 --ignore-scripts
|
||||
- run: npm ci
|
||||
- run: npm run typecheck
|
||||
- run: npm run test:run
|
||||
- run: npm run check:version
|
||||
@@ -64,11 +64,7 @@ jobs:
|
||||
target: x86_64-pc-windows-msvc
|
||||
# Default Windows bundles: MSI + NSIS (.exe). Both ship.
|
||||
bundleArgs: ""
|
||||
# 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
|
||||
- os: macos-14
|
||||
target: aarch64-apple-darwin
|
||||
# macOS DMG bundling on hosted runners flakes inside
|
||||
# `bundle_dmg.sh` (the AppleScript that sets icon
|
||||
@@ -97,14 +93,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@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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@683b588c487a69d01f6c6ddf40f036ff682cc2c8
|
||||
- uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: ${{ matrix.target }}
|
||||
@@ -118,7 +114,7 @@ jobs:
|
||||
libayatana-appindicator3-dev \
|
||||
librsvg2-dev \
|
||||
patchelf
|
||||
- run: npm ci --ignore-scripts
|
||||
- run: npm ci
|
||||
- uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # v1.0.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -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@683b588c487a69d01f6c6ddf40f036ff682cc2c8
|
||||
- uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f
|
||||
with:
|
||||
toolchain: stable
|
||||
components: rustfmt, clippy
|
||||
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
|
||||
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@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
- run: npm ci --ignore-scripts
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- name: rustfmt
|
||||
working-directory: src-tauri
|
||||
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
with:
|
||||
args: -color
|
||||
- name: zizmor
|
||||
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
|
||||
uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
|
||||
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@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
|
||||
- uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
|
||||
with:
|
||||
results_file: scorecard.json
|
||||
results_format: json
|
||||
|
||||
@@ -18,9 +18,3 @@ rules:
|
||||
# actor) to the notifier script through `env:`, never by interpolation.
|
||||
- notify-ci-failure.yml
|
||||
- notify-release-pipeline.yml
|
||||
# Runs on `pull_request_target` so it can label, comment on and close
|
||||
# an out-of-scope pull request from a fork (maintenance mode). It never
|
||||
# checks out the pull request, runs none of its code, and reads the
|
||||
# title from the event payload inside the script — nothing from the
|
||||
# pull request is interpolated into the workflow.
|
||||
- maintenance-triage.yml
|
||||
+1
-1
@@ -1 +1 @@
|
||||
26
|
||||
22
|
||||
@@ -1,127 +0,0 @@
|
||||
# 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.
|
||||
-212
@@ -2,218 +2,6 @@
|
||||
|
||||
All notable changes to YTDescGen ship as tagged releases on `main`.
|
||||
|
||||
## v1.6.0 — 2026-11-17
|
||||
|
||||
The last feature release: **DLSS 5 Neural Rendering** and more frame-generation modes in Video settings, a **Custom** LUT that prints just "LUT applied", and **JetBrains Qodana** next to SonarCloud. From this version on YTDescGen is in **maintenance mode**: it stays maintained, but takes no new features. Web, desktop and Android all ship as 1.6.0.
|
||||
|
||||
### Added
|
||||
|
||||
- **DLSS 5 Neural Rendering** — a switch in **Video settings** for NVIDIA (RTX 50 series), printed after the DLSS mode: `In-game Setting: Ultra - NVIDIA DLSS Quality + NVIDIA DLSS 5 Neural Rendering + NVIDIA Dynamic Multi Frame Generation`. Picking another vendor turns it off.
|
||||
- **More frame generation** — NVIDIA's **x6** and **Dynamic** Multi Frame Generation (DLSS 4.5), and **Custom…** for every vendor: type what you used (_NVIDIA Smooth Motion_, _Lossless Scaling x3_) and the description prints it as typed.
|
||||
- **Custom LUT** — "Custom" is the LUT field's first suggestion (typing it works too, in any case). **My Rig** then reads just _LUT applied_ — _Có áp dụng LUT_ in Vietnamese, and so on in every output language — without naming your own LUT.
|
||||
- **Option request** and **Translation or wording fix** issue forms.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Maintenance mode.** YTDescGen is feature-complete. Dependency and security updates, major language / runtime / framework upgrades, bug, UI/UX, accessibility and translation fixes, options added to or removed from its lists when people really need them, and Cloudflare or website fixes still land; new features don't. See README → Project status and CONTRIBUTING → Maintenance mode; the README carries a status badge.
|
||||
- The **Feature request** form is gone — ideas go to Discussions → Ideas. A workflow closes feature issues and `feat:` pull requests from outside contributors with an explanation in English and Vietnamese (option requests, accessibility and translation pull requests stay open), and anything the maintainer labels `out-of-scope`.
|
||||
- Bug and accessibility reports carry the `needs-triage` label; the `triage` label they named never existed.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- **Qodana** (JetBrains, Ultimate licence): Qodana for JS in native mode and Qodana for Rust (Early Access, Docker) run on every push and pull request, each with a quality gate of zero problems, reported to Qodana Cloud. Dependabot and fork pull requests, which get no token, skip it; the token never shares a step with `npm ci`. The first run's findings (74 in TypeScript, 12 in Rust) were fixed — React 19.3's deprecated `FormEvent` in the three save forms (now `SubmitEvent`), `[^\s]` written as `\S` in the 18 store and playtest URL patterns, the theme start-up script's globals, two copies of the sorted-JSON helper made one (`stableJson`), Vitest reusing Vite's alias map, `show_main_window` for the desktop's three copies of the same block — or excluded in `qodana.yaml` with the reason written next to each.
|
||||
- **Editor store v22** back-fills `frameGenCustom` and `dlssNeuralRendering`; backups and templates from older versions restore unchanged.
|
||||
- **Dependencies**, the newest releases at least a week old: react-i18next 17.1.13, lucide-react 1.70, zustand 5.1.0, simple-icons 16.37, vite 8.3.7 (rolldown 1.2.18), @vitejs/plugin-react 6.3.0, tailwindcss 4.3.5, typescript-eslint 8.72.2, knip 6.44.2, marked 18.2.0, wrangler 4.159.0. Workflows: sonarqube-scan-action 8.4.1, action-semantic-pull-request 6.1.2, setup-java 6.2.0. Rust: async-executor 1.14.0 → 1.14.1 (1.14.0 was yanked). THIRD_PARTY_NOTICES regenerated.
|
||||
- **Node.js 26.13.1**, the 2026-11-11 security release (16 CVEs, 7 rated high, in HTTP/2 and TLS servers): `.node-version` names the 26 line, so CI picks it up; the app runs no Node server, so nothing else changes.
|
||||
- Held back, still inside the 7-day cooldown: eslint 10.15 / typescript-eslint 8.73 — they move to minimatch 11, which closes the medium, development-only alert #50 — and Tauri 2.12.6.
|
||||
- **Docs**: README, CONTRIBUTING, SECURITY, MAINTAINERS, ROADMAP, FEATURES (upscaler and frame generation, LUT Custom), TECH-SPEC (Qodana, store v22, the rig block), DEVELOPMENT (+ Vietnamese), CONTENT-INVENTORY (+ Vietnamese), CLAUDE.md, version references.
|
||||
- typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, check:tauri, check:licenses, check:copyright, **1158 tests** (was 1131), build, cf:check and `cargo fmt` / `clippy` / `test` / `deny` all pass; Qodana reports no problems in either project and SonarCloud none on new code; initial load 279.6 of 280 KB gzip. Verified live: `wrangler dev` on 4.159.0 serves the gate page, `/legal/accessibility` and `robots.txt` and refuses a verify without a token; in the dev server a draft survives a reload on zustand 5.1, a v21 draft migrates to v22, NVIDIA offers x6 / Dynamic / Custom… and the DLSS 5 switch (the Output page prints the line above), switching to AMD turns DLSS 5 off and keeps a Custom frame generation, and a Custom LUT prints "LUT applied" in English and "Có áp dụng LUT" in Vietnamese.
|
||||
- Six manifests bumped 1.5.2 → 1.6.0.
|
||||
|
||||
## v1.5.2 — 2026-11-10
|
||||
|
||||
A maintenance release: the desktop and Android apps move to **Tauri 2.12.5**, with the fixes its window, webview and single-instance layers collected since 2.12.4, and this week's dependency updates are folded in. What the app generates does not change. Web, desktop and Android all ship as 1.5.2.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Windows: starting the app a second time.** A second copy started while the first was still starting up could miss the first one's window and stay open instead of handing over and exiting (tauri-plugin-single-instance 2.5.5). A hidden window — the app sitting in the tray — no longer flashes when it leaves the maximized state (tao 0.37.2).
|
||||
- **macOS: dragging onto the window.** No abort when a drag enters or is dropped on the window, and no panic while the dragged file paths are collected (tao 0.37.2, wry 0.57.1).
|
||||
- **Android:** the webview runs Tauri's start-up scripts once per page instead of twice (wry 0.57.1).
|
||||
- **Windows installer:** the NSIS installer blocks a downgrade over a newer MSI installation in silent, passive and update modes too (Tauri 2.12.5).
|
||||
|
||||
### Under the hood
|
||||
|
||||
- **Tauri 2.12.4 → 2.12.5**: tauri-build, tauri-macros and tauri-codegen 2.7.4, tauri-runtime-wry 2.12.3, wry 0.57.1, tao 0.37.2, tauri-plugin-dialog 2.8.4 (rfd 0.17), tauri-plugin-single-instance 2.5.5.
|
||||
- **Dependencies**, the newest releases at least a week old (the same cooldown Dependabot uses): i18next 26.6.0, react-i18next 17.1.11, i18next-resources-to-backend 1.2.4, lucide-react 1.66, react-router-dom 7.18.5, simple-icons 16.36, vite 8.3.5 (rolldown 1.2.16), @vitejs/plugin-react 6.2.1, tailwindcss 4.3.4, postcss 8.5.32, autoprefixer 10.6.2, marked 18.1.3, eslint 10.14, typescript-eslint 8.72.1, knip 6.44.1, @types/node 26.6.6, wrangler 4.156.2. Workflows: sonarqube-scan-action 8.4.0, zizmor-action 0.8.1. THIRD_PARTY_NOTICES regenerated.
|
||||
- **i18next stays on 26.6.x** (`~26.6.0` and a Dependabot ignore for 26.7.x). 26.7, the last 26.x minor, adds the debug-mode warnings that prepare the move to v27: about 1.9 KB gzip in the i18n chunk, which would take the initial load from 279.0 to 280.9 KB — over the 280 KB budget — for code the app never runs. Both go with the i18next 27 migration.
|
||||
- **The `undici` override from v1.3.1 is gone**: miniflare 5.20261102.0-beta (under wrangler, development only) depends on undici 7.30.1 itself, so alert #49 stays fixed without it.
|
||||
- **Docs**: TECH-SPEC's `package.json` listing follows the real file again (its dependency versions were several releases old) and notes the i18next hold; ROADMAP, version references.
|
||||
- typecheck, typecheck:all, lint, format:check, validate:locales, knip, check:version, check:tauri, check:licenses, check:copyright, **1131 tests**, build, cf:check and `cargo fmt` / `clippy` / `test` / `deny` all pass; initial load 279.0 of 280 KB gzip. Verified live: `wrangler dev` on 4.156.2 serves the gate page, `/legal/accessibility` and `robots.txt`, and refuses a verify without a token; the desktop app (`tauri dev` with a separate test identifier) answers its commands, writes, lists, reads and deletes a backup, and opens and cancels the native Save and Open dialogs on the new dialog plugin.
|
||||
- Six manifests bumped 1.5.1 → 1.5.2.
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -9,32 +9,20 @@
|
||||
- **Repository**: `github.com/poli0981/youtube-generator` · **License**: Apache-2.0 (`LICENSE`, `NOTICE`, REUSE-compliant).
|
||||
- **Maintainer**: poli0981 (SkullMute). Contacts by purpose: see `src/config/about.ts` and README.
|
||||
|
||||
**Status: maintenance mode** (since v1.6.0). Don't propose new features. Every change must fall under the policy in [`CONTRIBUTING.md` → Maintenance mode](CONTRIBUTING.md#maintenance-mode):
|
||||
|
||||
- dependency updates on the regular schedule;
|
||||
- security fixes (a CVE rated high or critical, a serious runtime issue);
|
||||
- major language, runtime or framework upgrades;
|
||||
- bug, UI/UX and accessibility fixes, and adding or removing an option in one of the app's lists (stores, platforms, genres, video types, content warnings, tech notes, GPUs, upscaler / frame-gen modes) when people really need it;
|
||||
- translation fixes (wording that doesn't fit a culture or region, misleading spelling);
|
||||
- Cloudflare / Worker changes the platform forces, website incidents.
|
||||
|
||||
`.github/workflows/maintenance-triage.yml` closes out-of-scope issues and pull requests (label `out-of-scope`); `feat(options)`, `feat(a11y)` and `feat(i18n)` pull requests stay open.
|
||||
|
||||
## Tech Stack
|
||||
|
||||
| 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), Qodana (JS + Rust) |
|
||||
| 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, copyright years, REUSE, actionlint/zizmor, cargo fmt/clippy/deny |
|
||||
|
||||
## Project Structure
|
||||
|
||||
@@ -51,8 +39,7 @@ src/
|
||||
channel-phrase.ts # drops "on {{channel}}" when there is no channel name
|
||||
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)
|
||||
endings-format.ts, graphics-vendor.ts
|
||||
config/ # static data: video types, genres, platforms (stores),
|
||||
# social fields/platforms, GPU catalog, rig fields,
|
||||
# content-warning-groups / tech-note-groups (editor groups),
|
||||
@@ -73,7 +60,7 @@ 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, rate limits, routing
|
||||
worker/ # Cloudflare Worker: gate, cookies, headers, 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)
|
||||
@@ -96,10 +83,6 @@ LICENSES/ # license texts for REUSE
|
||||
|
||||
- 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
|
||||
|
||||
@@ -114,9 +97,7 @@ LICENSES/ # license texts for REUSE
|
||||
### 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 (`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`.
|
||||
- Dark by default, light via class; touch targets grow on coarse pointers.
|
||||
- Watch Tailwind 4 specificity: a base `inline-flex` beats a plain `hidden` — wrap responsive visibility in an element.
|
||||
|
||||
### i18n
|
||||
@@ -141,7 +122,7 @@ LICENSES/ # license texts for REUSE
|
||||
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. Blocking work in an `async` command (a dialog, file I/O) goes through `tauri::async_runtime::spawn_blocking` — SonarCloud flags it otherwise (`rust:S7493`).
|
||||
6. **The desktop webview never names a path**: Rust commands take file names under the app data folder or open the native dialog themselves.
|
||||
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
|
||||
@@ -192,10 +173,5 @@ npm run generate:brand # favicon, PWA icons, link-preview card from assets/
|
||||
- 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`.
|
||||
- New upscaler / frame-gen option: the id in `src/config/graphics-settings.ts`, the vendor's list in `src/engine/graphics-vendor.ts`, the editor label (`editor.upscaleQuality.<vendor>` / `editor.frameGenMultiplier.<vendor>`, `ui.json`) and the description label (`description.graphics.upscale|frameGen.<vendor>`, `templates.json`) in all 8 locales and `_schema.json` — `tests/engine/graphics-vendor.test.ts` fails on a gap. A new id only widens the lists (no store bump); a new field does need one.
|
||||
- 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.
|
||||
- Qodana (`.github/workflows/qodana.yml`) runs on every PR and push to `main`: job `typescript` is Qodana for JS in native mode (`qodana.yaml`, Cloud project `yt-ts-js`, secret `QODANA_TOKEN_TS_JS`), job `rust` is Qodana for Rust, Early Access, in Docker on `src-tauri/` (`src-tauri/qodana.yaml`, project `yt-rust`, secret `QODANA_TOKEN_RUST`). Both gate on zero problems: fix a finding, or exclude it in the `qodana.yaml` with a comment saying why. Both skip without their token (Dependabot and fork PRs). It needs an Ultimate licence (currently the trial): when it lapses both jobs fail at the licence check.
|
||||
- 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.
|
||||
+6
-45
@@ -6,28 +6,6 @@ Thanks for taking the time to contribute. Read this once before opening your fir
|
||||
|
||||
Participation is governed by the [Code of Conduct](./CODE_OF_CONDUCT.md). By contributing, you agree to its terms.
|
||||
|
||||
## Maintenance mode
|
||||
|
||||
Since 1.6.0 (November 2026) YTDescGen is in **maintenance mode**. It is feature-complete and stays maintained, but it doesn't grow new features. These changes are still accepted:
|
||||
|
||||
1. **Dependency updates** on a regular schedule (weekly, grouped by Dependabot after a 7-day cooldown).
|
||||
2. **Security fixes**, as soon as possible: a dependency with a high or critical CVE, or a serious security issue in a runtime such as Node.js.
|
||||
3. **Major upgrades** of a language, runtime or framework, for example Node 24 → 26 or TypeScript 6 → 7.
|
||||
4. **Issues and pull requests** that:
|
||||
- add or remove an option in one of the app's lists when people really need it — a store, a social or donate platform, a genre, a video type, a content warning or tech note, a GPU, an upscaler or frame-generation mode (open an [option request](#option-requests) first);
|
||||
- fix a bug, a broken UI/UX or an accessibility barrier.
|
||||
5. **Language fixes**: wording that doesn't fit a culture or region, and spelling mistakes that could mislead (see [i18n Contributions](#i18n-contributions)).
|
||||
6. **Cloudflare / Worker** changes when the platform changes significantly.
|
||||
7. **Website incidents** such as DDoS or bot spam.
|
||||
|
||||
Anything else is out of scope, new features in particular, unless the maintainer judges one genuinely necessary.
|
||||
|
||||
- The [maintenance triage workflow](.github/workflows/maintenance-triage.yml) closes feature issues and `feat:` pull requests from outside contributors automatically — a `feat(options)`, `feat(a11y)` or `feat(i18n)` pull request stays open. It also closes anything the maintainer labels `out-of-scope`.
|
||||
- Feature ideas are welcome in [Discussions → Ideas](https://github.com/poli0981/youtube-generator/discussions/categories/ideas), with no commitment.
|
||||
- If your issue or pull request was closed by mistake, reply to it and the maintainer will take another look.
|
||||
|
||||
Releases ship only when one of these changes needs one, for example a security fix for the desktop and Android apps. The website keeps deploying from `main`.
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. Read the [Development Guide](./docs/DEVELOPMENT.md) — also available in [Vietnamese](./docs/i18n/vi/DEVELOPMENT.md).
|
||||
@@ -54,33 +32,18 @@ Releases ship only when one of these changes needs one, for example a security f
|
||||
Use the templates in `.github/ISSUE_TEMPLATE/`:
|
||||
|
||||
- **Bug report** — only if you can reproduce on the latest release.
|
||||
- **Option request** — add or remove an option in one of the app's lists; see [Option requests](#option-requests).
|
||||
- **Translation or wording fix** — wording that doesn't fit a culture or region, or a spelling mistake that could mislead, in any of the eight languages.
|
||||
- **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).
|
||||
|
||||
There is no feature request form any more: YTDescGen is in [maintenance mode](#maintenance-mode). Share ideas in [Discussions → Ideas](https://github.com/poli0981/youtube-generator/discussions/categories/ideas).
|
||||
|
||||
### Option requests
|
||||
|
||||
The one kind of addition maintenance mode still takes: an option in a list the app already has, when people really need it — a store (store links), a social or donate platform, a genre, a video type, a content warning or tech note, a GPU in the rig catalog, an upscaler or frame-generation mode. Removing one that no longer makes sense works the same way.
|
||||
|
||||
Open an **Option request** issue first: the option's name as it should appear, which list, and who needs it and why (a link to the store page, the vendor's announcement or a video that needed it helps). Once it's agreed, a pull request titled `feat(options): …` is welcome. [ARCHITECTURE.md → Extensibility Points](./docs/ARCHITECTURE.md) and CLAUDE.md's "Important Notes" say which files each kind of option touches, and the checks fail until all eight locales have its strings.
|
||||
- **Feature request** — only with a concrete use case, not abstract requests.
|
||||
|
||||
### 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`. 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`). JetBrains Qodana does the same for TypeScript and for the Rust shell, and fails on any problem it finds. 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. Commits on `main` are signed.
|
||||
- PR titles start with a lower-case letter after the colon (`feat(editor): add …`, not `feat(editor): Add …`).
|
||||
- In [maintenance mode](#maintenance-mode) a `feat` pull request from an outside contributor is closed automatically, unless its scope is `options`, `a11y` or `i18n`. A fix is a `fix`.
|
||||
- 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:
|
||||
@@ -106,17 +69,15 @@ The following are closed without review and may result in a contributor ban —
|
||||
|
||||
## What We Want
|
||||
|
||||
Within [maintenance mode](#maintenance-mode):
|
||||
|
||||
- Bug fixes with a reproduction case and a regression test.
|
||||
- Locale corrections from native speakers.
|
||||
- An option people really need, agreed in an [option request](#option-requests) first — for example a content-warning or tech-note ID with all 8 translations and a clear rationale (especially horror-genre vocabulary), a store, a genre or a video type that fits the gameplay no-commentary use case.
|
||||
- Accessibility and mobile-responsive fixes.
|
||||
- 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.
|
||||
|
||||
## What We Don't Want
|
||||
|
||||
- New features, unless the maintainer judges one genuinely necessary — share the idea in [Discussions → Ideas](https://github.com/poli0981/youtube-generator/discussions/categories/ideas) instead.
|
||||
- Cosmetic refactors with no behavior change.
|
||||
- Adding new runtime dependencies without first opening an issue to discuss the tradeoff.
|
||||
- Renaming files without coordinating with open PRs.
|
||||
@@ -124,7 +85,7 @@ Within [maintenance mode](#maintenance-mode):
|
||||
|
||||
## Contact
|
||||
|
||||
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]`.
|
||||
Questions about contributing or conduct: `code@poli0981.dev`. Security issues go through [SECURITY.md](./SECURITY.md), never a public issue.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+1
-1
@@ -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 through v1.5.1 and v1.6.0 with Claude Opus 5.5, v1.5.2 with Claude Fable 5.2)**. 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.2.0 with Claude Opus 5.5)**. All commits, releases, and architectural decisions are reviewed and approved by the maintainer before merging.
|
||||
|
||||
This disclosure applies to:
|
||||
|
||||
|
||||
+1
-10
@@ -1,7 +1,5 @@
|
||||
# Maintainers
|
||||
|
||||
Since 1.6.0 the project is in **maintenance mode**: no new features, only the changes listed in [CONTRIBUTING.md → Maintenance mode](./CONTRIBUTING.md#maintenance-mode).
|
||||
|
||||
## Active Maintainers
|
||||
|
||||
### `@poli0981`
|
||||
@@ -14,19 +12,12 @@ Since 1.6.0 the project is in **maintenance mode**: no new features, only the ch
|
||||
|
||||
## Maintainer Responsibilities
|
||||
|
||||
- Triage incoming issues and PRs, keeping them within the maintenance scope: the [triage workflow](./.github/workflows/maintenance-triage.yml) closes feature requests from outside contributors, and anything labelled `out-of-scope`, with an explanation.
|
||||
- Triage incoming issues and PRs.
|
||||
- Run the release process: `CHANGELOG.md` entry, version bump, build artifacts, signed tag.
|
||||
- Enforce the [Code of Conduct](./CODE_OF_CONDUCT.md).
|
||||
- Review and approve locale translation contributions.
|
||||
- Coordinate security advisory disclosure per [SECURITY.md](./SECURITY.md).
|
||||
|
||||
## Where to Reach Us
|
||||
|
||||
- Bug reports, translation fixes and option requests: [GitHub Issues](https://github.com/poli0981/youtube-generator/issues)
|
||||
- Feature ideas, with no commitment while in maintenance mode: [Discussions → Ideas](https://github.com/poli0981/youtube-generator/discussions/categories/ideas)
|
||||
- Accessibility barriers: the [Accessibility barrier](https://github.com/poli0981/youtube-generator/issues/new?template=accessibility.yml) form — see [ACCESSIBILITY.md](./ACCESSIBILITY.md)
|
||||
- Vulnerabilities: privately, as [SECURITY.md](./SECURITY.md) describes
|
||||
|
||||
## Becoming a Maintainer
|
||||
|
||||
There is currently no formal pathway. The project has been solo since inception. If you'd like to help maintain a specific area — most realistically, native-speaker review for one of the AI-translated locales (JA / ES / KO / ZH / PT-BR / ID) — open an issue describing what you'd like to take on.
|
||||
|
||||
@@ -6,12 +6,8 @@
|
||||
|
||||
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.
|
||||
|
||||
[](#project-status)
|
||||
[](https://github.com/poli0981/youtube-generator/actions/workflows/ci.yml)
|
||||
[](https://github.com/poli0981/youtube-generator/actions/workflows/qodana.yml)
|
||||
[](https://sonarcloud.io/summary/new_code?id=poli0981_youtube-generator)
|
||||
[](./LICENSE)
|
||||
[](./docs/DEVELOPMENT.md)
|
||||
[](./docs/DEVELOPMENT.md)
|
||||
[](https://github.com/poli0981/youtube-generator/releases)
|
||||
[](https://github.com/poli0981/youtube-generator/commits)
|
||||
|
||||
@@ -27,18 +23,6 @@ It doesn't talk to the YouTube API and has no account. Your work — profiles, p
|
||||
|
||||
Built for the gameplay no-commentary niche — especially horror / scary games — by someone running the [@SkullMute](https://www.youtube.com/@SkullMute) channel who got tired of pasting the same boilerplate into every video. Released under Apache 2.0 in case it's useful to anyone else.
|
||||
|
||||
## Project status
|
||||
|
||||
**Maintenance mode** since 1.6.0 (November 2026). YTDescGen is feature-complete, and it stays maintained:
|
||||
|
||||
- dependency updates on a regular schedule, and fast fixes for high or critical CVEs and serious runtime security issues;
|
||||
- major language, runtime and framework upgrades (for example Node 24 → 26, TypeScript 6 → 7);
|
||||
- bug, UI/UX and accessibility fixes, and adding or removing an option in one of the app's lists — a store, platform, genre, video type, content warning, GPU or upscaler mode — when people really need it;
|
||||
- translation fixes: wording that doesn't fit a culture or region, and spelling mistakes that could mislead;
|
||||
- changes the Cloudflare or Worker platform forces, and website incidents such as DDoS or bot spam.
|
||||
|
||||
New features are not planned, except the rare one that is genuinely necessary. Feature issues and pull requests outside this list are closed automatically. The full policy is in [CONTRIBUTING.md](./CONTRIBUTING.md#maintenance-mode).
|
||||
|
||||
## Features
|
||||
|
||||
- **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.
|
||||
@@ -55,8 +39,7 @@ New features are not planned, except the rare one that is genuinely necessary. F
|
||||
- **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).
|
||||
- **Dark and light themes**, larger controls on touch screens, and an option to hide every scrollbar.
|
||||
- **Desktop app** — Windows, macOS & Linux via Tauri; **Android app** — Android 11+, sideloaded from [Releases](https://github.com/poli0981/youtube-generator/releases).
|
||||
|
||||
## Quick Start
|
||||
@@ -106,7 +89,7 @@ Full details: [PRIVACY.md](./PRIVACY.md), also at [ytgenerator.stream/legal/priv
|
||||
|
||||
## Tech Stack
|
||||
|
||||
React 19 · TypeScript 7 (strict) · Vite 8 · Tailwind CSS 4 · Radix · Motion · Zustand 5 · i18next · Tauri 2 (Rust) · Cloudflare Workers.
|
||||
React 19 · TypeScript (strict) · Vite 8 · Tailwind CSS 4 · Radix · Motion · Zustand 5 · i18next · Tauri 2 (Rust) · Cloudflare Workers.
|
||||
|
||||
Architecture overview: [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md).
|
||||
|
||||
@@ -120,13 +103,12 @@ Architecture overview: [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md).
|
||||
| [Architecture](./docs/ARCHITECTURE.md) | Layer model, data flow, engine design. |
|
||||
| [Features](./docs/FEATURES.md) | Full feature matrix. |
|
||||
| [Content Inventory](./docs/CONTENT-INVENTORY.md) | Every video type, genre, content warning and tech note the editor surfaces. _(Also: [Vietnamese](./docs/i18n/vi/CONTENT-INVENTORY.md).)_ |
|
||||
| [Roadmap](./docs/ROADMAP.md) | What shipped, and what maintenance mode still covers. |
|
||||
| [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).)_ |
|
||||
@@ -137,7 +119,7 @@ Architecture overview: [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
YTDescGen is in [maintenance mode](#project-status): bug, accessibility and translation fixes and agreed option requests are welcome — read [CONTRIBUTING.md](./CONTRIBUTING.md) first. Native-speaker corrections to the AI-translated locales (JA / ES / KO / ZH / PT-BR / ID) are especially appreciated. Feature ideas go to [Discussions → Ideas](https://github.com/poli0981/youtube-generator/discussions/categories/ideas).
|
||||
PRs welcome — read [CONTRIBUTING.md](./CONTRIBUTING.md) first. Native-speaker corrections to the AI-translated locales (JA / ES / KO / ZH / PT-BR / ID) are especially appreciated.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+2
-4
@@ -6,10 +6,8 @@ Only the latest released version of YTDescGen receives security updates, and the
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | --------- |
|
||||
| 1.6.x | ✅ |
|
||||
| < 1.6 | ❌ |
|
||||
|
||||
YTDescGen has been in [maintenance mode](./CONTRIBUTING.md#maintenance-mode) since 1.6.0. That doesn't change this policy: security fixes keep shipping, and a dependency with a high or critical CVE is fixed as soon as possible.
|
||||
| 1.2.x | ✅ |
|
||||
| < 1.2 | ❌ |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
|
||||
+34
-35
@@ -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.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> |
|
||||
| `@tauri-apps/api` | 2.12.1 | 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> |
|
||||
| `clsx` | 2.1.1 | MIT | <https://github.com/lukeed/clsx> |
|
||||
| `cmdk` | 1.1.1 | MIT | <https://github.com/pacocoursey/cmdk> |
|
||||
| `i18next` | 26.6.0 | MIT | <https://github.com/i18next/i18next> |
|
||||
| `i18next-resources-to-backend` | 1.2.4 | MIT | <https://github.com/i18next/i18next-resources-to-backend> |
|
||||
| `lucide-react` | 1.70.0 | ISC | <https://github.com/lucide-icons/lucide> |
|
||||
| `i18next` | 26.4.2 | 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.52.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.13 | MIT | <https://github.com/i18next/react-i18next> |
|
||||
| `react-router-dom` | 7.18.5 | MIT | <https://github.com/remix-run/react-router> |
|
||||
| `simple-icons` | 16.37.0 | CC0-1.0 | <https://simpleicons.org> |
|
||||
| `radix-ui` | 1.7.0 | 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.16 | 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> |
|
||||
| `sonner` | 2.0.8 | MIT | <https://github.com/emilkowalski/sonner> |
|
||||
| `zustand` | 5.1.0 | MIT | <https://github.com/pmndrs/zustand> |
|
||||
| `zustand` | 5.0.15 | MIT | <https://github.com/pmndrs/zustand> |
|
||||
|
||||
## Build and development tools
|
||||
|
||||
@@ -39,31 +39,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.5 | MIT | <https://github.com/tailwindlabs/tailwindcss> |
|
||||
| `@tauri-apps/cli` | 2.12.4 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
|
||||
| `@tailwindcss/postcss` | 4.3.3 | MIT | <https://github.com/tailwindlabs/tailwindcss> |
|
||||
| `@tauri-apps/cli` | 2.12.1 | 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.6 | MIT | <https://github.com/DefinitelyTyped/DefinitelyTyped> |
|
||||
| `@types/node` | 26.6.3 | 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> |
|
||||
| `@typescript/typescript6` | 6.0.2 | Apache-2.0 | <https://github.com/microsoft/TypeScript> |
|
||||
| `@vitejs/plugin-react` | 6.3.0 | MIT | <https://github.com/vitejs/vite-plugin-react> |
|
||||
| `@vitest/coverage-v8` | 4.1.12 | MIT | <https://github.com/vitest-dev/vitest> |
|
||||
| `autoprefixer` | 10.6.2 | MIT | <https://github.com/postcss/autoprefixer> |
|
||||
| `eslint` | 10.14.0 | MIT | <https://github.com/eslint/eslint> |
|
||||
| `@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> |
|
||||
| `autoprefixer` | 10.6.1 | MIT | <https://github.com/postcss/autoprefixer> |
|
||||
| `eslint` | 10.11.0 | MIT | <https://github.com/eslint/eslint> |
|
||||
| `eslint-plugin-react-hooks` | 7.1.1 | MIT | <https://github.com/facebook/react> |
|
||||
| `knip` | 6.44.2 | ISC | <https://github.com/webpro-nl/knip> |
|
||||
| `marked` | 18.2.0 | MIT | <https://github.com/markedjs/marked> |
|
||||
| `postcss` | 8.5.32 | MIT | <https://github.com/postcss/postcss> |
|
||||
| `prettier` | 3.9.10 | MIT | <https://github.com/prettier/prettier> |
|
||||
| `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> |
|
||||
| `prettier-plugin-tailwindcss` | 0.8.1 | MIT | <https://github.com/tailwindlabs/prettier-plugin-tailwindcss> |
|
||||
| `tailwindcss` | 4.3.5 | MIT | <https://github.com/tailwindlabs/tailwindcss> |
|
||||
| `tailwindcss` | 4.3.3 | MIT | <https://github.com/tailwindlabs/tailwindcss> |
|
||||
| `tsx` | 4.23.15 | MIT | <https://github.com/privatenumber/tsx> |
|
||||
| `typescript` | 7.0.2 | Apache-2.0 | <https://github.com/microsoft/TypeScript> |
|
||||
| `typescript-eslint` | 8.72.2 | MIT | <https://github.com/typescript-eslint/typescript-eslint> |
|
||||
| `vite` | 8.3.7 | MIT | <https://github.com/vitejs/vite> |
|
||||
| `vitest` | 4.1.12 | MIT | <https://github.com/vitest-dev/vitest> |
|
||||
| `wrangler` | 4.159.0 | MIT OR Apache-2.0 | <https://github.com/cloudflare/workers-sdk> |
|
||||
| `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.149.0 | MIT OR Apache-2.0 | <https://github.com/cloudflare/workers-sdk> |
|
||||
|
||||
## Desktop and Android shell (Rust crates)
|
||||
|
||||
@@ -72,11 +71,11 @@ Direct dependencies of `src-tauri/`. Transitive crates are checked in CI by `car
|
||||
| Crate | Version | License | Project |
|
||||
| --- | --- | --- | --- |
|
||||
| `serde` | 1.0.228 | MIT OR Apache-2.0 | <https://github.com/serde-rs/serde> |
|
||||
| `tauri` | 2.12.5 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
|
||||
| `tauri-build` | 2.7.4 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
|
||||
| `tauri-plugin-dialog` | 2.8.4 | 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.5 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/plugins-workspace> |
|
||||
| `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> |
|
||||
|
||||
## Fonts and icons
|
||||
|
||||
|
||||
+10
-20
@@ -79,24 +79,17 @@ 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, "-")
|
||||
// The line above leaves at most one hyphen in a row.
|
||||
.replace(/^-|-$/g, "")
|
||||
);
|
||||
return text
|
||||
.toLowerCase()
|
||||
.replace(/[^\p{L}\p{N}]+/gu, "-")
|
||||
.replace(/^-+|-+$/g, "");
|
||||
}
|
||||
|
||||
function stripInlineMarkdown(text: string): string {
|
||||
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()
|
||||
);
|
||||
return text
|
||||
.replace(/[`*_~]/g, "")
|
||||
.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1")
|
||||
.trim();
|
||||
}
|
||||
|
||||
export function renderMarkdown(source: string, fromFile: string): { title: string; html: string } {
|
||||
@@ -211,8 +204,6 @@ 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.",
|
||||
};
|
||||
@@ -261,7 +252,6 @@ 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",
|
||||
};
|
||||
@@ -299,10 +289,10 @@ function indexPage(): string {
|
||||
return pageShell({
|
||||
title: "Legal",
|
||||
canonicalPath: "/legal",
|
||||
description: "Terms, privacy, licensing, security and accessibility information for YTDescGen.",
|
||||
description: "Terms, privacy, licensing and security information for YTDescGen.",
|
||||
activeId: null,
|
||||
lang: "en",
|
||||
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>`,
|
||||
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>`,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+19
-22
@@ -2,7 +2,7 @@
|
||||
|
||||
## YTDescGen — Technical Architecture
|
||||
|
||||
Reflects **v1.6.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.2.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).
|
||||
|
||||
---
|
||||
|
||||
@@ -32,7 +32,7 @@ Reflects **v1.6.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 · upscale │
|
||||
│ Also: title-variants · limits · social-post-builder │
|
||||
│ 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 │ │ no static pages or analytics │
|
||||
│ security.txt, analytics beacon │ │ es2020 target, no 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, 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).
|
||||
**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.
|
||||
|
||||
**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,7 +93,6 @@ 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 |
|
||||
@@ -140,8 +139,8 @@ interface GeneratorInput {
|
||||
|
||||
// Video-type specific: partNumber, bossName, dlcName, challengeName, modName, modList,
|
||||
// liveUrl, scheduledTime, gacha quest fields …
|
||||
// Video settings: resolution, upscaledFrom, fps, graphicsPreset, ray tracing,
|
||||
// frame generation, upscaling, artStyle, videoStyleEra, versionInfo …
|
||||
// Video settings: resolution, 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 …
|
||||
|
||||
@@ -220,15 +219,14 @@ generateTags(input, { includeMultilingualTags, includeTrendingTags, year })
|
||||
|
||||
priority pool source
|
||||
1 game name bare tag (≤ 30 chars) + a shorter form for composites
|
||||
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
|
||||
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
|
||||
│
|
||||
▼
|
||||
de-duplicate (case-insensitive) · drop tags over 30 characters
|
||||
@@ -258,7 +256,7 @@ export const GENRE_TAG_REGISTRY: Record<string, (gameName: string) => string[]>
|
||||
|
||||
```
|
||||
┌────────────────────────────────────────────────────────────────────┐
|
||||
│ EditorStore — "ytdescgen-editor-draft", v21 │
|
||||
│ EditorStore — "ytdescgen-editor-draft", v20 │
|
||||
│ - the draft: every form field (EditorData) + setter actions │
|
||||
│ - persists data only (editorDataOf); migrateEditorState │
|
||||
├────────────────────────────────────────────────────────────────────┤
|
||||
@@ -276,8 +274,7 @@ 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 · singleKeyShortcuts · appLanguage │
|
||||
│ - titleFormat │
|
||||
│ - theme · hideScrollbars · appLanguage · titleFormat │
|
||||
│ - description toggles · strictMode · copyAllIncludesTags · … │
|
||||
│ - healSettings on every load; consent and UI state never exported │
|
||||
├────────────────────────────────────────────────────────────────────┤
|
||||
@@ -299,7 +296,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 (+ upscaled from) / fps / graphics preset, ad text, Vietnamese donate fields, community links).
|
||||
- **Profile** = the channel: `PROFILE_FIELDS` (channel name, emails, social, rig, resolution / 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, …).
|
||||
@@ -391,7 +388,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, 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).
|
||||
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).
|
||||
|
||||
## 7. Desktop Packaging (Tauri)
|
||||
|
||||
@@ -422,7 +419,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`, `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).
|
||||
**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).
|
||||
|
||||
Tauri advantages over Electron:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Content Inventory
|
||||
|
||||
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.6.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.2.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.
|
||||
|
||||
@@ -166,8 +166,6 @@ The game itself is made or run with generative AI — a story _about_ AI is "AI
|
||||
|
||||
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)
|
||||
|
||||
+9
-12
@@ -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** | **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/>. |
|
||||
| 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/>. |
|
||||
|
||||
### 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 → 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 → Languages → TypeScript → "Use TypeScript from `node_modules/typescript`".
|
||||
- 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,8 +86,6 @@ 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.
|
||||
- The `Qodana` workflow runs JetBrains [Qodana](https://www.jetbrains.com/qodana/) on every PR and every push to `main`: Qodana for JS on the repository (`qodana.yaml`) and Qodana for Rust on `src-tauri/` (`src-tauri/qodana.yaml`). Both fail on any problem. Like SonarCloud, it skips PRs from forks and from Dependabot, which get no Qodana token. It is not a required check.
|
||||
|
||||
Full rules: [CONTRIBUTING.md](../CONTRIBUTING.md).
|
||||
|
||||
@@ -117,7 +115,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/` — 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 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 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. |
|
||||
@@ -247,4 +245,3 @@ 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.
|
||||
+42
-132
@@ -1,6 +1,6 @@
|
||||
# Complete Feature List
|
||||
|
||||
## YTDescGen — All Features (v1.6.0)
|
||||
## YTDescGen — All Features (v1.2.0 + 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 (11 fields)
|
||||
## 💻 Rig Fields (10 fields)
|
||||
|
||||
Printed in this order, with labels in the output language.
|
||||
|
||||
@@ -158,16 +158,6 @@ 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`.
|
||||
**Custom** (v1.6.0), the first suggestion (typing "custom" works too), is for
|
||||
a LUT of your own: the line then reads just _LUT applied_ (_Có áp dụng LUT_ in
|
||||
Vietnamese), without a name.
|
||||
|
||||
**GPU catalog (v1.0.0)** — 198 models in 29 groups: NVIDIA GeForce (desktop
|
||||
and laptop), AMD Radeon (including integrated), Intel Arc and integrated,
|
||||
@@ -189,11 +179,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 (games without graphics settings keep only the upscale and video-style lines)
|
||||
9. 🖥 Video settings (skipped for games without graphics settings)
|
||||
10. 💻 My rig
|
||||
11. 🧩 Mod list (Modded Gameplay only)
|
||||
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)
|
||||
13. 🛠 Tech notes (25 IDs across 5 groups)
|
||||
14. Translation-quality note (opt-in; not for English or Vietnamese)
|
||||
15. 🎁 Sponsor credit (opt-in)
|
||||
16. 🤝 Sponsors & partners (opt-in)
|
||||
@@ -211,48 +201,6 @@ 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.
|
||||
|
||||
**Upscaler and frame generation** — Video settings › the vendor picks the
|
||||
options the other fields offer, and the `In-game Setting:` line names each
|
||||
one under its brand (kept in English in every language, as viewers search
|
||||
for it):
|
||||
|
||||
| Vendor | Upscaling | Frame generation |
|
||||
| ------ | --------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
||||
| NVIDIA | DLAA, DLSS Quality / Balanced / Performance / Ultra Performance | x2, x3, x4, **x6**, **Dynamic** (Dynamic Multi Frame Gen), **Custom…** |
|
||||
| AMD | FSR Native AA, Quality / Balanced / Performance / Ultra Perf. | x2, x3 (Fluid Motion Frames), **Custom…** |
|
||||
| Intel | XeSS Native AA, Ultra Quality, Quality … Ultra Performance | x2 (XeFG), **Custom…** |
|
||||
|
||||
New in v1.6.0 (bold): NVIDIA's x6 and Dynamic Multi Frame Generation;
|
||||
**Custom…** for every vendor, which prints what you type (_NVIDIA Smooth
|
||||
Motion_, _Lossless Scaling x3_); and, for NVIDIA, a **DLSS 5 Neural
|
||||
Rendering** switch, printed after the DLSS mode:
|
||||
|
||||
```
|
||||
In-game Setting: Ultra - NVIDIA DLSS Quality + NVIDIA DLSS 5 Neural Rendering + NVIDIA Dynamic Multi Frame Generation with Path Tracing
|
||||
```
|
||||
|
||||
Changing the vendor drops what the new one doesn't offer. These settings
|
||||
belong to the draft and to templates, not to the 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 —
|
||||
@@ -306,7 +254,6 @@ 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` |
|
||||
@@ -329,17 +276,6 @@ 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
|
||||
@@ -393,39 +329,19 @@ 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 (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 | — |
|
||||
| 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 | — |
|
||||
|
||||
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.
|
||||
@@ -455,42 +371,39 @@ In **Settings › Backup & restore**:
|
||||
|
||||
`Ctrl` on Windows / Linux / Android, `⌘` on a Mac — both work everywhere.
|
||||
|
||||
| Shortcut | Action |
|
||||
| ---------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `Ctrl/⌘+K` | Command palette |
|
||||
| `Ctrl/⌘+Enter` or `Ctrl/⌘+G` | Generate (switch to Output) |
|
||||
| `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 |
|
||||
| `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 |
|
||||
| Shortcut | Action |
|
||||
| ---------------------------- | --------------------------------------------------------------- |
|
||||
| `Ctrl/⌘+K` | Command palette |
|
||||
| `Ctrl/⌘+Enter` or `Ctrl/⌘+G` | Generate (switch to Output) |
|
||||
| `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) |
|
||||
| `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 |
|
||||
| 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 |
|
||||
| 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 |
|
||||
|
||||
"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
|
||||
@@ -599,10 +512,7 @@ documents and ticks one "I agree" checkbox.
|
||||
|
||||
## 🔌 Future Extension Points
|
||||
|
||||
**Frozen: YTDescGen is in maintenance mode** (since v1.6.0) and takes no new
|
||||
features — see [CONTRIBUTING.md → Maintenance mode](../CONTRIBUTING.md#maintenance-mode).
|
||||
The ideas below and the [ROADMAP.md](./ROADMAP.md) backlog stay as a record; one
|
||||
moves only if the maintainer judges it genuinely necessary.
|
||||
See [ROADMAP.md](./ROADMAP.md) for the post-1.0 backlog.
|
||||
|
||||
| Extension | Description | Effort |
|
||||
| -------------------- | ----------------------------------------------------------- | ------ |
|
||||
|
||||
+6
-57
@@ -49,52 +49,13 @@ 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 |
|
||||
| `RATE_LIMIT`, `VERIFY_RATE_LIMIT` | rate limit bindings | `wrangler.jsonc` › `ratelimits` (see [Rate limiting](#rate-limiting)) |
|
||||
| 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 |
|
||||
|
||||
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.
|
||||
|
||||
@@ -104,12 +65,11 @@ 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 26 comes from `.node-version`, and the build variable `NODE_VERSION=26` says the same.
|
||||
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`.
|
||||
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
|
||||
|
||||
@@ -138,14 +98,3 @@ 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.
|
||||
+1
-1
@@ -341,7 +341,7 @@ 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.3.0 (1,264 UI + 584 template keys per locale):
|
||||
`_schema.json`. At v1.2.0 (1,264 UI + 584 template keys per locale):
|
||||
|
||||
```
|
||||
✓ en/ui.json — 1264/1264 keys
|
||||
|
||||
+12
-29
@@ -2,7 +2,7 @@
|
||||
|
||||
## YTDescGen — Tauri 2 Desktop and Android Apps
|
||||
|
||||
Reflects **v1.6.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.2.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).
|
||||
|
||||
---
|
||||
|
||||
@@ -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 26** (`.node-version`) and npm 11.
|
||||
- **Node.js 22** (`.node-version`) and npm.
|
||||
- **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`).
|
||||
@@ -62,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.6.0",
|
||||
"version": "1.2.0",
|
||||
"identifier": "com.skullmute.ytdescgen",
|
||||
"build": {
|
||||
"beforeBuildCommand": "npm run build",
|
||||
@@ -81,8 +81,7 @@ The icons come from the one brand logo: `npx tauri icon assets/brand/logo.svg` r
|
||||
"resizable": true,
|
||||
"maximizable": true,
|
||||
"fullscreen": false,
|
||||
"center": true,
|
||||
"zoomHotkeysEnabled": true
|
||||
"center": true
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
@@ -104,9 +103,6 @@ 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"
|
||||
@@ -139,14 +135,12 @@ 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. set-webview-zoom backs the Ctrl/Cmd +/- zoom polyfill Tauri injects on macOS and Linux (zoomHotkeysEnabled).",
|
||||
"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.",
|
||||
"windows": ["main"],
|
||||
"permissions": ["core:default", "core:webview:allow-set-webview-zoom", "opener:default"]
|
||||
"permissions": ["core:default", "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)
|
||||
@@ -211,10 +205,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. 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`).
|
||||
- **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.
|
||||
- **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, writing the picked file 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 and the import checks.
|
||||
|
||||
### 4. Frontend Tauri Integration
|
||||
|
||||
@@ -299,9 +293,7 @@ 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: the Legal Center content only, and no static legal pages, `security.txt` or analytics beacon.
|
||||
|
||||
**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.
|
||||
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.
|
||||
|
||||
Output file names, with the v1.1.0 release sizes:
|
||||
|
||||
@@ -335,7 +327,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-15` | `aarch64-apple-darwin` | `.app.tar.gz` |
|
||||
| `macos-14` | `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`.
|
||||
@@ -345,7 +337,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-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.
|
||||
- **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.
|
||||
|
||||
**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.)
|
||||
|
||||
@@ -373,13 +365,6 @@ 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
|
||||
@@ -397,9 +382,7 @@ 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. 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.
|
||||
up-to-date WebView.
|
||||
- **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
|
||||
|
||||
+13
-123
@@ -2,12 +2,10 @@
|
||||
|
||||
## YTDescGen — Phased Development Plan
|
||||
|
||||
> **Status (2026-11-17): maintenance mode, from v1.6.0.** YTDescGen is
|
||||
> feature-complete: it stays maintained but takes no new features — see
|
||||
> [Maintenance mode](#maintenance-mode--from-v160) below. 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). Phase 5 and the backlog are frozen.
|
||||
> **Status (2026-10-12): v1.2.0 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.
|
||||
|
||||
---
|
||||
|
||||
@@ -323,117 +321,10 @@ 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).
|
||||
|
||||
## v1.5.2 — Maintenance ✅ SHIPPED 2026-11-10
|
||||
|
||||
Tauri 2.12.5 with the fixes its window, webview and single-instance layers
|
||||
collected, and this week's dependency updates; i18next stays on 26.6 to keep
|
||||
the initial load inside its budget —
|
||||
[CHANGELOG.md](../CHANGELOG.md#v152--2026-11-10).
|
||||
|
||||
## v1.6.0 — Maintenance mode begins ✅ SHIPPED 2026-11-17
|
||||
|
||||
The last feature release: DLSS 5 Neural Rendering, NVIDIA's x6 and Dynamic
|
||||
Multi Frame Generation and a Custom frame generation for every vendor in
|
||||
Video settings, and a Custom LUT that prints just "LUT applied". JetBrains
|
||||
Qodana joins SonarCloud, and the project enters
|
||||
[maintenance mode](#maintenance-mode--from-v160) —
|
||||
[CHANGELOG.md](../CHANGELOG.md#v160--2026-11-17).
|
||||
|
||||
---
|
||||
|
||||
## Maintenance mode — from v1.6.0
|
||||
|
||||
**Status**: ongoing since v1.6.0 (November 2026).
|
||||
|
||||
YTDescGen is feature-complete. From 1.6.0 on it is maintained, not extended:
|
||||
no new features unless one is judged genuinely necessary. The accepted
|
||||
changes, and how out-of-scope issues and pull requests are closed, are in
|
||||
[CONTRIBUTING.md → Maintenance mode](../CONTRIBUTING.md#maintenance-mode):
|
||||
|
||||
1. Dependency updates on a regular schedule.
|
||||
2. Security fixes: a dependency with a high or critical CVE, a serious runtime
|
||||
issue.
|
||||
3. Major language, runtime and framework upgrades (Node 24 → 26, TypeScript
|
||||
6 → 7).
|
||||
4. Bug, UI/UX and accessibility fixes, and adding or removing an option in one
|
||||
of the app's lists when people really need it.
|
||||
5. Translation fixes: wording that doesn't fit a culture or region, misleading
|
||||
spelling mistakes.
|
||||
6. Cloudflare / Worker changes the platform forces.
|
||||
7. Website incidents such as DDoS or bot spam.
|
||||
|
||||
What 1.6.0 set up for it:
|
||||
|
||||
- [x] **Policy**: README → Project status, CONTRIBUTING → Maintenance mode,
|
||||
SECURITY, MAINTAINERS, CLAUDE.md.
|
||||
- [x] **Issue forms**: the feature request form is gone; an Option request
|
||||
and a Translation or wording fix form joined Bug report and
|
||||
Accessibility barrier; a Scope checklist in the pull request template.
|
||||
- [x] **Auto-close**: `maintenance-triage.yml` closes, with a bilingual
|
||||
comment and the `out-of-scope` label, feature issues and `feat:` pull
|
||||
requests from outside contributors (`feat(options)`, `feat(a11y)` and
|
||||
`feat(i18n)` stay open), and anything the maintainer labels
|
||||
`out-of-scope`.
|
||||
- [x] **Qodana**: Qodana for JS and Qodana for Rust (Early Access) on every
|
||||
push and pull request, reported to Qodana Cloud, with a gate of zero
|
||||
problems.
|
||||
|
||||
Known maintenance already queued: the GitHub Pages moving notice comes down
|
||||
on 2026-11-29 (issue #177); i18next 27 and Tauri 3 arrive as planned major
|
||||
upgrades when they are ready.
|
||||
|
||||
---
|
||||
|
||||
## Phase 5 — Extensions & Ecosystem (Priority: P2-P3)
|
||||
|
||||
**Frozen while YTDescGen is in maintenance mode.** An item moves only if it
|
||||
falls under the [maintenance policy](../CONTRIBUTING.md#maintenance-mode).
|
||||
|
||||
**Goal**: IDE extension, CLI, community features.
|
||||
**Estimated**: Ongoing
|
||||
|
||||
@@ -480,8 +371,7 @@ falls under the [maintenance policy](../CONTRIBUTING.md#maintenance-mode).
|
||||
|
||||
## Backlog (after v1.0.0)
|
||||
|
||||
Ideas carried over from the v1.0.0 planning — not scheduled, and frozen while
|
||||
YTDescGen is in maintenance mode.
|
||||
Ideas carried over from the v1.0.0 planning — not scheduled.
|
||||
|
||||
```
|
||||
- [ ] Auto-fill game info from Steam through the Worker — needs rate limiting
|
||||
@@ -499,13 +389,13 @@ YTDescGen is in maintenance mode.
|
||||
|
||||
## Timeline Summary
|
||||
|
||||
| Phase | Scope | Days | Cumulative |
|
||||
| ------- | ------------------ | ------ | ---------- |
|
||||
| Phase 1 | MVP Core | 3-4 | 3-4 days |
|
||||
| Phase 2 | Profiles & Presets | 2-3 | 5-7 days |
|
||||
| Phase 3 | Polish & Advanced | 2-3 | 7-10 days |
|
||||
| Phase 4 | Desktop App | 2-3 | 9-13 days |
|
||||
| Phase 5 | Extensions | Frozen | — |
|
||||
| Phase | Scope | Days | Cumulative |
|
||||
| ------- | ------------------ | ------- | ---------- |
|
||||
| Phase 1 | MVP Core | 3-4 | 3-4 days |
|
||||
| Phase 2 | Profiles & Presets | 2-3 | 5-7 days |
|
||||
| Phase 3 | Polish & Advanced | 2-3 | 7-10 days |
|
||||
| Phase 4 | Desktop App | 2-3 | 9-13 days |
|
||||
| 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; the current release is v1.6.0 (2026-11-17), the first in maintenance mode.**
|
||||
**v1.0.0 shipped on 2026-09-30; the current release is v1.2.0 (2026-10-12).**
|
||||
+59
-103
@@ -2,7 +2,7 @@
|
||||
|
||||
## YTDescGen — Implementation Details
|
||||
|
||||
Reflects **v1.6.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.2.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).
|
||||
|
||||
---
|
||||
|
||||
@@ -13,13 +13,10 @@ Reflects **v1.6.0**. The module map and data flow are in [ARCHITECTURE.md](ARCHI
|
||||
```json
|
||||
{
|
||||
"name": "yt-desc-gen",
|
||||
"version": "1.6.0",
|
||||
"version": "1.2.0",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=26"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
@@ -53,51 +50,50 @@ Reflects **v1.6.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.4",
|
||||
"@tauri-apps/plugin-opener": "^2.7.2",
|
||||
"@tauri-apps/api": "^2.12.0",
|
||||
"@tauri-apps/plugin-opener": "^2.7.0",
|
||||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
"i18next": "~26.6.0",
|
||||
"i18next-resources-to-backend": "^1.2.4",
|
||||
"lucide-react": "^1.66.0",
|
||||
"motion": "^13.5.1",
|
||||
"radix-ui": "^1.8.1",
|
||||
"react": "^19.3.1",
|
||||
"react-dom": "^19.3.1",
|
||||
"react-i18next": "^17.1.11",
|
||||
"react-router-dom": "^7.18.5",
|
||||
"simple-icons": "^16.36.0",
|
||||
"i18next": "^26.4.2",
|
||||
"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",
|
||||
"react-router-dom": "^7.18.4",
|
||||
"simple-icons": "^16.33.0",
|
||||
"sonner": "^2.0.8",
|
||||
"zustand": "^5.0.16"
|
||||
"zustand": "^5.0.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@resvg/resvg-js": "2.6.2",
|
||||
"@tailwindcss/postcss": "^4.3.4",
|
||||
"@tauri-apps/cli": "2.12.4",
|
||||
"@tailwindcss/postcss": "^4.3.3",
|
||||
"@tauri-apps/cli": "2.12.0",
|
||||
"@testing-library/jest-dom": "^7.0.1",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@types/node": "^26.6.6",
|
||||
"@types/node": "^26.6.3",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"@typescript/native": "npm:typescript@^7.0.2",
|
||||
"@vitejs/plugin-react": "^6.2.1",
|
||||
"@vitest/coverage-v8": "^4.1.12",
|
||||
"autoprefixer": "^10.6.2",
|
||||
"eslint": "^10.14.0",
|
||||
"@vitejs/plugin-react": "^6.1.1",
|
||||
"@vitest/coverage-v8": "^4.1.11",
|
||||
"autoprefixer": "^10.6.1",
|
||||
"eslint": "^10.11.0",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"knip": "^6.44.1",
|
||||
"marked": "18.1.3",
|
||||
"postcss": "^8.5.32",
|
||||
"prettier": "^3.9.10",
|
||||
"knip": "^6.38.0",
|
||||
"marked": "18.0.14",
|
||||
"postcss": "^8.5.28",
|
||||
"prettier": "^3.9.9",
|
||||
"prettier-plugin-tailwindcss": "^0.8.1",
|
||||
"tailwindcss": "^4.3.3",
|
||||
"tsx": "^4.23.15",
|
||||
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
||||
"typescript-eslint": "^8.72.1",
|
||||
"vite": "^8.3.5",
|
||||
"vitest": "^4.1.12",
|
||||
"wrangler": "4.156.2"
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.71.0",
|
||||
"vite": "^8.3.1",
|
||||
"vitest": "^4.1.11",
|
||||
"wrangler": "4.144.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -107,37 +103,21 @@ Notes:
|
||||
- **UI stack**: React 19, React Router 7, Zustand 5, i18next 26 / react-i18next 17, Radix primitives through the single `radix-ui` package (Dialog, AlertDialog, Popover, Tooltip, Tabs, Switch, Checkbox, ToggleGroup, Slot), Motion (loaded through `LazyMotion`), cmdk for the command palette, sonner for toasts (react-hot-toast is gone), lucide-react 1.x for UI icons and simple-icons (CC0-1.0) for the brand marks lucide 1.x dropped.
|
||||
- **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`.
|
||||
- **i18next stays on 26.6.x** (`~26.6.0`, and a Dependabot ignore for 26.7.x): 26.7 adds the debug-mode warnings for the move to v27 — about 1.9 KB gzip that would take the initial load over its 280 KB budget. The tilde and the ignore go with the i18next 27 migration (`.github/dependabot.yml` has the note).
|
||||
- **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.
|
||||
- **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`.
|
||||
- **Node 22** comes from `.node-version`, which CI, the release workflows and Cloudflare Workers Builds all read.
|
||||
|
||||
### tsconfig.json
|
||||
|
||||
```jsonc
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
// 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": [],
|
||||
"target": "ES2020",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
@@ -148,6 +128,7 @@ Notes:
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@config/*": ["./src/config/*"],
|
||||
@@ -157,14 +138,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`, 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.
|
||||
`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.
|
||||
|
||||
### vite.config.ts
|
||||
|
||||
@@ -208,9 +189,8 @@ export default defineConfig({
|
||||
watch: { ignored: ["**/src-tauri/**", "**/.wrangler/**"] },
|
||||
},
|
||||
build: {
|
||||
// No `target`: both builds use Vite's default, `baseline-widely-available`
|
||||
// (Chrome 111, Safari 16.4, Firefox 114) — the floor tsconfig's `lib` holds.
|
||||
//
|
||||
// Old Android System WebViews choke on Vite's modern default target.
|
||||
target: isTauri ? "es2020" : undefined,
|
||||
// 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
|
||||
@@ -243,7 +223,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 (`baseline-widely-available`) | the same (before v1.3.0: `es2020`) |
|
||||
| JS target | Vite default | `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.
|
||||
|
||||
@@ -308,10 +288,6 @@ 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"
|
||||
@@ -320,9 +296,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. 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).
|
||||
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).
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## 2. Core Engine Interfaces
|
||||
|
||||
@@ -346,10 +322,9 @@ export interface GeneratorInput {
|
||||
// Video-type specific: partNumber, bossName, dlcName, challengeName, modName, modList,
|
||||
// liveUrl, scheduledTime, gachaQuestType, chapterName, questName, characterName,
|
||||
// anniversaryYear, gachaVersion.
|
||||
// Video settings: resolution, upscaledFrom (v1.5.0), fps, graphicsPreset (+ graphicsPresetCustom),
|
||||
// skipGraphicsSettings, rayTracingModes, frameGenVendor, frameGenMultiplier
|
||||
// (+ frameGenCustom, v1.6.0), upscaleQuality, dlssNeuralRendering (v1.6.0),
|
||||
// artStyle, videoStyleEra, versionInfo.
|
||||
// Video settings: resolution, fps, graphicsPreset (+ graphicsPresetCustom),
|
||||
// skipGraphicsSettings, rayTracingModes, frameGenVendor, frameGenMultiplier,
|
||||
// upscaleQuality, artStyle, videoStyleEra, versionInfo.
|
||||
// Content: timestamps, playlistLink, contactEmail, adEmail, gameKeyEmail,
|
||||
// copyrightEmail, musicAttribution, sponsorName, sponsorPlatform, pubDevName,
|
||||
// thirdPartyAdText,
|
||||
@@ -416,12 +391,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), 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.
|
||||
- `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.
|
||||
- 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, 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). A field with a `customNoteKey` whose value is "Custom" (any case) prints that templates key as its whole line instead — since v1.6.0 the LUT's "LUT applied" (`description.rigNotes.lut_custom`), for a LUT of one's own. 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), 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.
|
||||
|
||||
**Chapters** (`timeline-parser.ts`):
|
||||
|
||||
@@ -475,7 +450,7 @@ interface EditorActions {
|
||||
}
|
||||
|
||||
/** Bump together with a new step in migrateEditorState. */
|
||||
export const EDITOR_STORE_VERSION = 22;
|
||||
export const EDITOR_STORE_VERSION = 20;
|
||||
|
||||
export const useEditorStore = create<EditorData & EditorActions>()(
|
||||
persist(
|
||||
@@ -509,7 +484,7 @@ export function migrateEditorState(persistedState: unknown, version: number): Ed
|
||||
|
||||
| Store | localStorage key | Version | Migration (exported) |
|
||||
| ------------------ | ------------------------ | ----------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| `useEditorStore` | `ytdescgen-editor-draft` | `EDITOR_STORE_VERSION` = 22 | `migrateEditorState` |
|
||||
| `useEditorStore` | `ytdescgen-editor-draft` | `EDITOR_STORE_VERSION` = 20 | `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` |
|
||||
@@ -522,12 +497,6 @@ v1.1.0: editor v20 back-fills `copyrightEmail` (the fourth split contact line) w
|
||||
|
||||
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`.
|
||||
|
||||
v1.6.0: editor v22 back-fills `frameGenCustom` (the frame generation typed for the new `"custom"` multiplier) with `""` and `dlssNeuralRendering` (NVIDIA DLSS 5 Neural Rendering) with `false`, coercing values of the wrong type. The multiplier list only widens (`x6` and `dynamic` for NVIDIA, `custom` for every vendor), and the backup whitelist checks it against `FRAMEGEN_MULTIPLIERS`. `normalizeEditorPatch` and the backup import turn `dlssNeuralRendering` off for any vendor but NVIDIA (`coerceDlssNeuralRendering`). Neither field is a profile or preset field, like the rest of the frame-gen settings. The LUT's "Custom" needs no migration: it is a rig value like any LUT name.
|
||||
|
||||
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.
|
||||
@@ -594,11 +563,10 @@ 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`; `sonarcloud` — the SonarCloud scan with `check`'s coverage (pushes on `main`, PRs from this repository except Dependabot's) |
|
||||
| `ci.yml` (CI) | PRs to and pushes on `main` | `check` — the required status on `main` |
|
||||
| `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`) |
|
||||
| `qodana.yml` (Qodana) | PRs to and pushes on `main`, manual | `typescript` — Qodana for JS in native mode (`qodana.yaml`); `rust` — Qodana for Rust, Early Access, in Docker (`src-tauri/qodana.yaml`); both skip without their token (Dependabot and fork PRs) |
|
||||
| `release-desktop.yml`, `release-android.yml` | `v*` tags, manual with a `tag` input | `verify`, then the builds — see [PACKAGING.md](PACKAGING.md) |
|
||||
| `announce-release.yml` | Release published, manual | Links the release to an Announcements discussion and posts to Discord |
|
||||
| `notify-ci-failure.yml`, `notify-release-pipeline.yml` | `workflow_run` | Discord notifications through the maintainer's shared workflows |
|
||||
@@ -607,14 +575,13 @@ An unknown version is read as 0: every migration step is idempotent, so running
|
||||
The `check` job, in order:
|
||||
|
||||
```yaml
|
||||
- run: npm ci --ignore-scripts
|
||||
- run: npm ci
|
||||
# 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
|
||||
@@ -629,25 +596,14 @@ 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: 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
|
||||
- run: npx wrangler deploy --dry-run --outdir .wrangler/dry-run
|
||||
```
|
||||
|
||||
- **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`).
|
||||
- **Qodana** (v1.6.0; JetBrains, Ultimate licence — the account runs the trial): `qodana.yml` runs Qodana for JS in native mode, on the runner's Node 26 and `node_modules` (`qodana.yaml`), and Qodana for Rust (Early Access, Docker only) on `src-tauri/` (`src-tauri/qodana.yaml`: its `bootstrap` installs the packages `rust.yml` installs, and a stand-in `dist/index.html` lets `generate_context!` expand). Both use the `qodana.recommended` profile and a quality gate of zero problems; every exclusion in a `qodana.yaml` says why. Every run analyses the whole project (`pr-mode: false`). Results go to Qodana Cloud (projects `yt-ts-js` and `yt-rust`), the run's annotations and the `qodana-report-*` artifacts — no PR comment. A `tokens` job checks for `QODANA_TOKEN_TS_JS` and `QODANA_TOKEN_RUST`, which Dependabot and fork PRs don't get, so the analysis is skipped there; the token reaches only the scan step, never the `npm ci` one. Not a required check. When the licence lapses, both jobs fail at the licence check.
|
||||
- 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, Rust and Qodana cancel superseded runs through a `concurrency` group, except on `main`, where each commit's result is a record the release process reads back.
|
||||
- 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).
|
||||
|
||||
@@ -655,7 +611,7 @@ Then `sonarcloud` (after `check` succeeds):
|
||||
|
||||
## 6. Testing Strategy
|
||||
|
||||
Vitest runs `tests/**/*.test.{ts,tsx}` and `src/**/*.test.{ts,tsx}` in the **node** environment, with `globals: true`: 1158 tests in 56 files at v1.6.0. 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.
|
||||
Vitest runs `tests/**/*.test.{ts,tsx}` and `src/**/*.test.{ts,tsx}` in the **node** environment, with `globals: true`: 984 tests in 51 files at v1.2.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.
|
||||
|
||||
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):
|
||||
|
||||
@@ -697,14 +653,14 @@ describe("buildTitle", () => {
|
||||
});
|
||||
```
|
||||
|
||||
`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:
|
||||
`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:
|
||||
|
||||
| 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), `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).
|
||||
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`, 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).
|
||||
|
||||
## 7. YouTube Character Limits Reference
|
||||
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
# 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.
|
||||
@@ -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, 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.6.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.2.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.
|
||||
|
||||
@@ -166,8 +166,6 @@ Bản thân game được làm hoặc chạy bằng AI tạo sinh — còn game
|
||||
|
||||
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)
|
||||
|
||||
@@ -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** | **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/>. |
|
||||
| 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/>. |
|
||||
|
||||
### 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 → 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 → Languages → TypeScript → "Use TypeScript from `node_modules/typescript`".
|
||||
- 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,8 +88,6 @@ 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.
|
||||
- Workflow `Qodana` chạy JetBrains [Qodana](https://www.jetbrains.com/qodana/) trên mọi PR và mọi lần push vào `main`: Qodana for JS cho cả repo (`qodana.yaml`) và Qodana for Rust cho `src-tauri/` (`src-tauri/qodana.yaml`). Cả hai fail khi có bất kỳ lỗi nào. Giống SonarCloud, PR từ fork và từ Dependabot bỏ qua phân tích vì không có token Qodana. Đây không phải check bắt buộc.
|
||||
|
||||
Quy định đầy đủ: [CONTRIBUTING.md](../../../CONTRIBUTING.md).
|
||||
|
||||
@@ -119,7 +117,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/` — 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 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 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. |
|
||||
@@ -249,4 +247,3 @@ 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)).
|
||||
@@ -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; từ bản v1.0.0 đến v1.5.1 và bản v1.6.0 dùng Claude Opus 5.5, bản v1.5.2 dùng Claude Fable 5.2)**. 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.2.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.
|
||||
|
||||
Tuyên bố này áp dụng cho:
|
||||
|
||||
|
||||
+1
-2
@@ -1,9 +1,8 @@
|
||||
import js from "@eslint/js";
|
||||
import { defineConfig } from "eslint/config";
|
||||
import tseslint from "typescript-eslint";
|
||||
import reactHooks from "eslint-plugin-react-hooks";
|
||||
|
||||
export default defineConfig(
|
||||
export default tseslint.config(
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.strict,
|
||||
{
|
||||
|
||||
Generated
+1444
-1663
File diff suppressed because it is too large.
Load diff
+30
-34
@@ -1,12 +1,9 @@
|
||||
{
|
||||
"name": "yt-desc-gen",
|
||||
"version": "1.6.0",
|
||||
"version": "1.2.0",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=26"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
@@ -40,50 +37,49 @@
|
||||
"dependencies": {
|
||||
"@fontsource-variable/inter": "^5.3.0",
|
||||
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
||||
"@tauri-apps/api": "^2.12.4",
|
||||
"@tauri-apps/plugin-opener": "^2.7.2",
|
||||
"@tauri-apps/api": "^2.12.1",
|
||||
"@tauri-apps/plugin-opener": "^2.7.0",
|
||||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
"i18next": "~26.6.0",
|
||||
"i18next-resources-to-backend": "^1.2.4",
|
||||
"lucide-react": "^1.70.0",
|
||||
"i18next": "^26.4.2",
|
||||
"i18next-resources-to-backend": "^1.2.3",
|
||||
"lucide-react": "^1.52.0",
|
||||
"motion": "^13.5.1",
|
||||
"radix-ui": "^1.8.1",
|
||||
"react": "^19.3.1",
|
||||
"react-dom": "^19.3.1",
|
||||
"react-i18next": "^17.1.13",
|
||||
"react-router-dom": "^7.18.5",
|
||||
"simple-icons": "^16.37.0",
|
||||
"radix-ui": "^1.7.0",
|
||||
"react": "^19.3.0",
|
||||
"react-dom": "^19.3.0",
|
||||
"react-i18next": "^17.0.16",
|
||||
"react-router-dom": "^7.18.4",
|
||||
"simple-icons": "^16.33.0",
|
||||
"sonner": "^2.0.8",
|
||||
"zustand": "^5.1.0"
|
||||
"zustand": "^5.0.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@resvg/resvg-js": "2.6.2",
|
||||
"@tailwindcss/postcss": "^4.3.5",
|
||||
"@tauri-apps/cli": "2.12.4",
|
||||
"@tailwindcss/postcss": "^4.3.3",
|
||||
"@tauri-apps/cli": "2.12.1",
|
||||
"@testing-library/jest-dom": "^7.0.1",
|
||||
"@testing-library/react": "^16.3.3",
|
||||
"@types/node": "^26.6.6",
|
||||
"@types/node": "^26.6.3",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"@typescript/native": "npm:typescript@^7.0.2",
|
||||
"@vitejs/plugin-react": "^6.3.0",
|
||||
"@vitest/coverage-v8": "^4.1.12",
|
||||
"autoprefixer": "^10.6.2",
|
||||
"eslint": "^10.14.0",
|
||||
"@vitejs/plugin-react": "^6.1.1",
|
||||
"@vitest/coverage-v8": "^4.1.11",
|
||||
"autoprefixer": "^10.6.1",
|
||||
"eslint": "^10.11.0",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"knip": "^6.44.2",
|
||||
"marked": "18.2.0",
|
||||
"postcss": "^8.5.32",
|
||||
"prettier": "^3.9.10",
|
||||
"knip": "^6.38.0",
|
||||
"marked": "18.0.14",
|
||||
"postcss": "^8.5.28",
|
||||
"prettier": "^3.9.9",
|
||||
"prettier-plugin-tailwindcss": "^0.8.1",
|
||||
"tailwindcss": "^4.3.5",
|
||||
"tailwindcss": "^4.3.3",
|
||||
"tsx": "^4.23.15",
|
||||
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
||||
"typescript-eslint": "^8.72.2",
|
||||
"vite": "^8.3.7",
|
||||
"vitest": "^4.1.12",
|
||||
"wrangler": "4.159.0"
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.71.0",
|
||||
"vite": "^8.3.1",
|
||||
"vitest": "^4.1.11",
|
||||
"wrangler": "4.149.0"
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
// first paint, so a light-theme user never sees the dark default flash. A
|
||||
// separate file rather than an inline <script> so the Content-Security-Policy
|
||||
// needs no exception.
|
||||
/* global document, localStorage */
|
||||
(function () {
|
||||
var root = document.documentElement;
|
||||
var theme = "dark";
|
||||
@@ -15,7 +14,7 @@
|
||||
// Unhealed raw storage, so only a real `true` counts.
|
||||
if (state && state.hideScrollbars === true) hideScrollbars = true;
|
||||
if (state && typeof state.appLanguage === "string") lang = state.appLanguage;
|
||||
} catch {
|
||||
} catch (e) {
|
||||
/* storage blocked or corrupt: keep the defaults */
|
||||
}
|
||||
root.classList.toggle("dark", theme === "dark");
|
||||
|
||||
-59
@@ -1,59 +0,0 @@
|
||||
# Qodana for JavaScript / TypeScript: the web app (src/), the Worker, the
|
||||
# build plugins, scripts, tests and workflows. Run by
|
||||
# .github/workflows/qodana.yml (job `typescript`, native mode), reported to
|
||||
# the Qodana Cloud project yt-ts-js (secret QODANA_TOKEN_TS_JS).
|
||||
version: "1.0"
|
||||
linter: qodana-js
|
||||
profile:
|
||||
name: qodana.recommended
|
||||
# The quality gate: any problem fails the job.
|
||||
failureConditions:
|
||||
severityThresholds:
|
||||
any: 0
|
||||
exclude:
|
||||
- name: All
|
||||
paths:
|
||||
# The Tauri shell is the Rust project (src-tauri/qodana.yaml).
|
||||
- src-tauri
|
||||
# Build output, caches and reports.
|
||||
- dist
|
||||
- coverage
|
||||
- node_modules
|
||||
- .wrangler
|
||||
# The GitHub Pages moving notice, removed on 2026-11-29 (issue #177).
|
||||
- migration-page
|
||||
# `${{ secrets.DISCORD_RELEASE_PIPELINE_WEBHOOK }}` is a reference to a
|
||||
# repository secret, not a secret: the "discord-client-secret" rule only
|
||||
# sees the word.
|
||||
- name: HardcodedPasswords
|
||||
paths:
|
||||
- .github/workflows/notify-release-pipeline.yml
|
||||
# `\]` and `\}` outside a character class stay escaped: they read as the
|
||||
# literal brackets they are, and the patterns stay valid if they ever get
|
||||
# the `u` or `v` flag, where a lone `]` or `}` is a syntax error. ESLint's
|
||||
# no-useless-escape accepts them too.
|
||||
- name: RegExpRedundantEscape
|
||||
# `@i18n/index` is the form tsconfig.json's `@i18n/*` path resolves. The
|
||||
# bare `@i18n` this suggests resolves only through Vite's alias, so tsc
|
||||
# would no longer find the module.
|
||||
- name: ES6PreferShortImport
|
||||
# The three react-hooks warnings eslint.config.js documents (state synced
|
||||
# from i18next, from a store number, and a useMemo the React Compiler
|
||||
# can't keep): each needs a restructure, and the config keeps them as
|
||||
# warnings on purpose. ESLint runs in CI's `check` job as well.
|
||||
- name: Eslint
|
||||
paths:
|
||||
- src/hooks/use-languages-ready.ts
|
||||
- src/components/editor/PlaytestEditor.tsx
|
||||
- src/components/editor/StoreLinkEditor.tsx
|
||||
# The legacy draft fields `spoilerWarning`, `matureWarning` and
|
||||
# `endingsShown` are `@deprecated` so new code doesn't use them; these
|
||||
# files carry them on purpose, to read and migrate drafts, presets and
|
||||
# templates saved by older versions.
|
||||
- name: JSDeprecatedSymbols
|
||||
paths:
|
||||
- src/config/defaults.ts
|
||||
- src/store/editor-store.ts
|
||||
- src/hooks/use-current-generator-input.ts
|
||||
- src/engine/description-builder.ts
|
||||
- src/utils/library-apply.ts
|
||||
@@ -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 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 iso = execFileSync("git", ["log", "-1", "--format=%cI"], {
|
||||
cwd: ROOT,
|
||||
encoding: "utf8",
|
||||
});
|
||||
const year = Number(iso.trim().slice(0, 4));
|
||||
if (Number.isInteger(year) && year >= 2000) return year;
|
||||
} catch {
|
||||
|
||||
+13
-21
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
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");
|
||||
@@ -38,14 +37,12 @@ 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");
|
||||
// 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);
|
||||
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);
|
||||
return ALLOWED.has(expr);
|
||||
}
|
||||
|
||||
interface PackageJson {
|
||||
name?: string;
|
||||
version?: string;
|
||||
license?: string;
|
||||
homepage?: string;
|
||||
@@ -77,21 +74,16 @@ interface Row {
|
||||
url: string;
|
||||
}
|
||||
|
||||
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));
|
||||
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),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,7 +103,7 @@ export function directCrates(toml: string): string[] {
|
||||
const name = inDependencies ? /^([A-Za-z0-9_-]+)\s*=/.exec(line)?.[1] : undefined;
|
||||
if (name) names.add(name);
|
||||
}
|
||||
return [...names].sort(compareCodeUnits);
|
||||
return [...names].sort();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
# 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
|
||||
Generated
+193
-83
@@ -73,9 +73,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "async-executor"
|
||||
version = "1.14.1"
|
||||
version = "1.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f426a31126c735126297bc5ea7a521263c9faff4f63ca415267ee625651c4f37"
|
||||
checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a"
|
||||
dependencies = [
|
||||
"async-task",
|
||||
"concurrent-queue",
|
||||
@@ -225,12 +225,6 @@ 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"
|
||||
@@ -469,7 +463,7 @@ dependencies = [
|
||||
"iana-time-zone",
|
||||
"num-traits",
|
||||
"serde",
|
||||
"windows-link",
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1533,7 +1527,7 @@ dependencies = [
|
||||
"js-sys",
|
||||
"log",
|
||||
"wasm-bindgen",
|
||||
"windows-core",
|
||||
"windows-core 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1547,12 +1541,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ico"
|
||||
version = "0.6.0"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d75e94d66081e4d8dcd098bd8dc5254800fea14a26389b298410158d834de167"
|
||||
checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"png",
|
||||
"png 0.17.16",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2013,7 +2007,7 @@ dependencies = [
|
||||
"objc2-core-foundation",
|
||||
"objc2-foundation",
|
||||
"once_cell",
|
||||
"png",
|
||||
"png 0.18.1",
|
||||
"serde",
|
||||
"thiserror 2.0.18",
|
||||
"windows-sys 0.61.2",
|
||||
@@ -2374,7 +2368,7 @@ dependencies = [
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"windows-link",
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2478,6 +2472,19 @@ dependencies = [
|
||||
"time",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "png"
|
||||
version = "0.17.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"crc32fast",
|
||||
"fdeflate",
|
||||
"flate2",
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "png"
|
||||
version = "0.18.1"
|
||||
@@ -2739,9 +2746,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rfd"
|
||||
version = "0.17.2"
|
||||
version = "0.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "20dafead71c16a34e1ff357ddefc8afc11e7d51d6d2b9fbd07eaa48e3e540220"
|
||||
checksum = "a15ad77d9e70a92437d8f74c35d99b4e4691128df018833e99f90bcd36152672"
|
||||
dependencies = [
|
||||
"block2",
|
||||
"dispatch2",
|
||||
@@ -2749,18 +2756,16 @@ dependencies = [
|
||||
"gobject-sys",
|
||||
"gtk-sys",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"log",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
"objc2-core-foundation",
|
||||
"objc2-foundation",
|
||||
"percent-encoding",
|
||||
"raw-window-handle",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
"windows-sys 0.61.2",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3165,12 +3170,6 @@ 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"
|
||||
@@ -3203,9 +3202,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
||||
|
||||
[[package]]
|
||||
name = "swift-rs"
|
||||
version = "1.0.9"
|
||||
version = "1.0.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cefd87076fd385308ee4aff597256c902f1fbb4d031de1558efc12f8ffefadd9"
|
||||
checksum = "e45c444e496845d3f2a351146bff59aae4975b2280238df1dfaa0c7d1846f38e"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"serde",
|
||||
@@ -3268,9 +3267,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tao"
|
||||
version = "0.37.2"
|
||||
version = "0.37.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d5777b06fe6435126ae8d816eba269e050e1e10d302cf5461e9c49eccabc3548"
|
||||
checksum = "f37f381f4e048e6cdf038b5705f8cf14ad108279d46eb968140a7b291aba9400"
|
||||
dependencies = [
|
||||
"bitflags 2.11.0",
|
||||
"block2",
|
||||
@@ -3301,7 +3300,7 @@ dependencies = [
|
||||
"unicode-segmentation",
|
||||
"url",
|
||||
"windows",
|
||||
"windows-core",
|
||||
"windows-core 0.62.2",
|
||||
"windows-version",
|
||||
"x11-dl",
|
||||
]
|
||||
@@ -3325,9 +3324,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
||||
|
||||
[[package]]
|
||||
name = "tauri"
|
||||
version = "2.12.5"
|
||||
version = "2.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5fb0244332cfb9cee7e2a568bf5da29a36ed8fdbd717f6f47a66b6b7b358c072"
|
||||
checksum = "cb20ef8e6f97d6fe03039666cd82861f09a38b56291fa2f0f9fe140023f61c1a"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
@@ -3376,9 +3375,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-build"
|
||||
version = "2.7.4"
|
||||
version = "2.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adddb0e648752aaac5da9c3c3c6a68e1e87cab55e3b757b18a9441ef8c3ac614"
|
||||
checksum = "5b5ae674f48836f5dd2eeaf9e221c095bd3e78a8d0439c77ca93b48740a1b644"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cargo_toml",
|
||||
@@ -3390,8 +3389,6 @@ dependencies = [
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"static_vcruntime",
|
||||
"strsim",
|
||||
"tauri-utils",
|
||||
"tauri-winres",
|
||||
"walkdir",
|
||||
@@ -3399,16 +3396,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-codegen"
|
||||
version = "2.7.4"
|
||||
version = "2.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb37631cf71dab5e8ab55e1bdd701e18a52653d90b78e71d0e5598b1e0a61316"
|
||||
checksum = "3926b73ac01df7c14f19ff872cd56e67213a87acc0000ea37ddb300f3d11a3e3"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"base64 0.22.1",
|
||||
"brotli",
|
||||
"ico",
|
||||
"json-patch",
|
||||
"plist",
|
||||
"png",
|
||||
"png 0.18.1",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"semver",
|
||||
@@ -3426,9 +3423,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-macros"
|
||||
version = "2.7.4"
|
||||
version = "2.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0cc38db58854c10fb5f91a887ed8bf82d3239bb92b5d8db86eda09e96d9963d1"
|
||||
checksum = "d21d0fa2c0529972ea6ecaf7404fcf40efac098eda0beb06ca682f41e33a6aa5"
|
||||
dependencies = [
|
||||
"heck 0.5.0",
|
||||
"proc-macro2",
|
||||
@@ -3440,9 +3437,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin"
|
||||
version = "2.7.2"
|
||||
version = "2.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "67fb21a77e8f94e8beb3325e583102488659365af0a3948b7ea244c5b779c291"
|
||||
checksum = "c9ff3ebb9fda56ceb93d46f6cbb126bae82951bf43498543a5163dde5def49a1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"glob",
|
||||
@@ -3456,9 +3453,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-dialog"
|
||||
version = "2.8.4"
|
||||
version = "2.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce0fb9c2b6d34a9720627ed930ebc8af26f61e648695aecaeb03d5c33c5896f5"
|
||||
checksum = "7527c5fd1678032d116c1a82e5d609c67370e56f858ae6cfd376bbca37fe0490"
|
||||
dependencies = [
|
||||
"log",
|
||||
"raw-window-handle",
|
||||
@@ -3474,9 +3471,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-fs"
|
||||
version = "2.7.1"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5d58eb1d4984e535f47a642ffec09a2da6f5c18a12b5902d12126cb7626d628b"
|
||||
checksum = "466eb32466fe5021b6728b06862f9ff14a9f7e1af890047654e03a96d7c0e1bb"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"dunce",
|
||||
@@ -3498,9 +3495,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-opener"
|
||||
version = "2.7.2"
|
||||
version = "2.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "53810be1b4fed22bb6ac3f4cab5a2b80d9391d1af436bda145607532bc0bb219"
|
||||
checksum = "d39404b2572927e0d3ed30a7ca226037f7508d22e79c96ee6ef0d42b6a4b3345"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"glob",
|
||||
@@ -3520,9 +3517,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-single-instance"
|
||||
version = "2.5.5"
|
||||
version = "2.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "726b6da0dd5bd1344f84f4108a622c07d01923baacb5c803a605189672c5352f"
|
||||
checksum = "91baf4f5db4b008fc2bcada0f7d3a49b45d911f94575ac236f225ed67554f5c0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -3536,9 +3533,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.12.2"
|
||||
version = "2.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c55766d99cea69055904d1735b93c2049302b2e09effd462120deb5581d78e9"
|
||||
checksum = "c9e6d5ef76985b32ff012a43b58df205d25a285e400ca878afcacddc5d5f3238"
|
||||
dependencies = [
|
||||
"cookie",
|
||||
"dpi",
|
||||
@@ -3561,9 +3558,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-runtime-wry"
|
||||
version = "2.12.3"
|
||||
version = "2.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1aa9d8b7a120f879f44fdc1053f7b7dbf416bf0bbc6a72b714dec46b782b52f"
|
||||
checksum = "fa829eb69860cf1fb0bedb21d2d5f1effce3527d054a68ca1cd7355c654400a3"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
@@ -3571,6 +3568,7 @@ dependencies = [
|
||||
"log",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"raw-window-handle",
|
||||
"softbuffer",
|
||||
@@ -3586,9 +3584,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-utils"
|
||||
version = "2.10.2"
|
||||
version = "2.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "362ab21cd4cc713f2a02b1a9b5688198b1541cfb6907c4281e9190e0f0ef4aa3"
|
||||
checksum = "4dd257082deff79550de3409ed146104aeaf86fe38649615b04a304144939677"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"brotli",
|
||||
@@ -3615,7 +3613,7 @@ dependencies = [
|
||||
"serde_with",
|
||||
"swift-rs",
|
||||
"thiserror 2.0.18",
|
||||
"toml 1.1.6+spec-1.1.0",
|
||||
"toml 0.9.12+spec-1.1.0",
|
||||
"url",
|
||||
"urlpattern",
|
||||
"uuid",
|
||||
@@ -3991,7 +3989,7 @@ dependencies = [
|
||||
"objc2-core-graphics",
|
||||
"objc2-foundation",
|
||||
"once_cell",
|
||||
"png",
|
||||
"png 0.18.1",
|
||||
"serde",
|
||||
"thiserror 2.0.18",
|
||||
"windows-sys 0.61.2",
|
||||
@@ -4355,7 +4353,7 @@ dependencies = [
|
||||
"webview2-com-macros",
|
||||
"webview2-com-sys",
|
||||
"windows",
|
||||
"windows-core",
|
||||
"windows-core 0.62.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4377,7 +4375,7 @@ checksum = "b3a07132775117d6065853d9d1178157b8c90e228de47129d6bce2c7edebedfb"
|
||||
dependencies = [
|
||||
"thiserror 2.0.18",
|
||||
"windows",
|
||||
"windows-core",
|
||||
"windows-core 0.62.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4434,7 +4432,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
|
||||
dependencies = [
|
||||
"windows-collections",
|
||||
"windows-core",
|
||||
"windows-core 0.62.2",
|
||||
"windows-future",
|
||||
"windows-numerics",
|
||||
]
|
||||
@@ -4445,7 +4443,20 @@ version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
|
||||
dependencies = [
|
||||
"windows-core",
|
||||
"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",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4456,9 +4467,9 @@ checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
|
||||
dependencies = [
|
||||
"windows-implement",
|
||||
"windows-interface",
|
||||
"windows-link",
|
||||
"windows-result",
|
||||
"windows-strings",
|
||||
"windows-link 0.2.1",
|
||||
"windows-result 0.4.1",
|
||||
"windows-strings 0.5.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4467,8 +4478,8 @@ version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
|
||||
dependencies = [
|
||||
"windows-core",
|
||||
"windows-link",
|
||||
"windows-core 0.62.2",
|
||||
"windows-link 0.2.1",
|
||||
"windows-threading",
|
||||
]
|
||||
|
||||
@@ -4494,6 +4505,12 @@ 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"
|
||||
@@ -4506,8 +4523,17 @@ version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
|
||||
dependencies = [
|
||||
"windows-core",
|
||||
"windows-link",
|
||||
"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",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4516,7 +4542,16 @@ version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
"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",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4525,7 +4560,7 @@ version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4546,13 +4581,22 @@ dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.60.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
||||
dependencies = [
|
||||
"windows-targets 0.53.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.61.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4579,20 +4623,37 @@ dependencies = [
|
||||
"windows_aarch64_gnullvm 0.52.6",
|
||||
"windows_aarch64_msvc 0.52.6",
|
||||
"windows_i686_gnu 0.52.6",
|
||||
"windows_i686_gnullvm",
|
||||
"windows_i686_gnullvm 0.52.6",
|
||||
"windows_i686_msvc 0.52.6",
|
||||
"windows_x86_64_gnu 0.52.6",
|
||||
"windows_x86_64_gnullvm 0.52.6",
|
||||
"windows_x86_64_msvc 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.53.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
|
||||
dependencies = [
|
||||
"windows-link 0.2.1",
|
||||
"windows_aarch64_gnullvm 0.53.1",
|
||||
"windows_aarch64_msvc 0.53.1",
|
||||
"windows_i686_gnu 0.53.1",
|
||||
"windows_i686_gnullvm 0.53.1",
|
||||
"windows_i686_msvc 0.53.1",
|
||||
"windows_x86_64_gnu 0.53.1",
|
||||
"windows_x86_64_gnullvm 0.53.1",
|
||||
"windows_x86_64_msvc 0.53.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-threading"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4601,7 +4662,7 @@ version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4616,6 +4677,12 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.42.2"
|
||||
@@ -4628,6 +4695,12 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.42.2"
|
||||
@@ -4640,12 +4713,24 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.42.2"
|
||||
@@ -4658,6 +4743,12 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.42.2"
|
||||
@@ -4670,6 +4761,12 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.42.2"
|
||||
@@ -4682,6 +4779,12 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.42.2"
|
||||
@@ -4694,6 +4797,12 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.5.40"
|
||||
@@ -4827,11 +4936,11 @@ checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
|
||||
|
||||
[[package]]
|
||||
name = "wry"
|
||||
version = "0.57.1"
|
||||
version = "0.57.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "759c50ddad0ef9913bb5496cb9d509a50433a3b78cb0238d61105526589cf0e9"
|
||||
checksum = "a819957a01b3119af85e638a38d242af76dbc87d130dca67bfd0441072e21ff0"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"base64 0.22.1",
|
||||
"block2",
|
||||
"cookie",
|
||||
"crossbeam-channel",
|
||||
@@ -4852,6 +4961,7 @@ dependencies = [
|
||||
"objc2-foundation",
|
||||
"objc2-ui-kit",
|
||||
"objc2-web-kit",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"raw-window-handle",
|
||||
"sha2",
|
||||
@@ -4863,7 +4973,7 @@ dependencies = [
|
||||
"webkit2gtk-sys",
|
||||
"webview2-com",
|
||||
"windows",
|
||||
"windows-core",
|
||||
"windows-core 0.62.2",
|
||||
"windows-version",
|
||||
"x11-dl",
|
||||
]
|
||||
@@ -4914,7 +5024,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "yt-desc-gen"
|
||||
version = "1.6.0"
|
||||
version = "1.2.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"tauri",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "yt-desc-gen"
|
||||
version = "1.6.0"
|
||||
version = "1.2.0"
|
||||
description = "YouTube Gameplay Description Generator"
|
||||
authors = ["poli0981"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
{
|
||||
"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).",
|
||||
"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.",
|
||||
"windows": [
|
||||
"main"
|
||||
],
|
||||
"permissions": [
|
||||
"core:default",
|
||||
"core:webview:allow-set-webview-zoom",
|
||||
"opener:default"
|
||||
]
|
||||
}
|
||||
@@ -5,11 +5,7 @@
|
||||
<!-- 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 @@
|
||||
{"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"]}}
|
||||
{"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"]}}
|
||||
@@ -1,32 +0,0 @@
|
||||
# Qodana for Rust (Early Access): the Tauri 2 shell of the desktop and
|
||||
# Android apps. Run by .github/workflows/qodana.yml (job `rust`, Docker),
|
||||
# reported to the Qodana Cloud project yt-rust (secret QODANA_TOKEN_RUST).
|
||||
version: "1.0"
|
||||
linter: qodana-rust
|
||||
profile:
|
||||
name: qodana.recommended
|
||||
# The quality gate: any problem fails the job.
|
||||
failureConditions:
|
||||
severityThresholds:
|
||||
any: 0
|
||||
# The linter evaluates build scripts and expands macros with `cargo check`,
|
||||
# and its image has neither a C toolchain nor the libraries Tauri links
|
||||
# against (the same packages rust.yml installs). Needs root in the container:
|
||||
# the workflow passes `-u root`.
|
||||
bootstrap: |
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends build-essential pkg-config libssl-dev libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
|
||||
exclude:
|
||||
- name: All
|
||||
paths:
|
||||
# Cargo's build output, and the Android project `tauri android init`
|
||||
# generated (Kotlin and Gradle, not Rust).
|
||||
- target
|
||||
- gen
|
||||
# tauri::generate_handler! needs each command's module path
|
||||
# (`storage::backup_list`): the #[tauri::command] macro puts a hidden
|
||||
# helper next to the function, and the handler finds it through that
|
||||
# path. Without the prefix the crate no longer compiles.
|
||||
- name: RsUnnecessaryQualifications
|
||||
paths:
|
||||
- src/lib.rs
|
||||
@@ -85,9 +85,6 @@ 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,
|
||||
@@ -99,29 +96,15 @@ pub async fn export_text_file(
|
||||
title: Option<String>,
|
||||
) -> Result<Option<String>, String> {
|
||||
let filter = allowed_filter(&extensions)?;
|
||||
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);
|
||||
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]);
|
||||
fs::write(&path, content).map_err(|e| e.to_string())?;
|
||||
Ok(path.file_name().map(|n| n.to_string_lossy().into_owned()))
|
||||
}
|
||||
@@ -158,7 +141,6 @@ 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,
|
||||
@@ -168,18 +150,14 @@ pub async fn import_text_file(
|
||||
title: Option<String>,
|
||||
) -> Result<Option<PickedFile>, String> {
|
||||
let filter = allowed_filter(&extensions)?;
|
||||
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())?
|
||||
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),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -226,22 +204,6 @@ 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()));
|
||||
|
||||
+18
-14
@@ -17,17 +17,6 @@ use tauri::{
|
||||
mod file_dialog;
|
||||
mod storage;
|
||||
|
||||
/// Bring the main window back: show it, restore it if minimized and focus
|
||||
/// it. Used by a second launch, the tray menu's "Show" and a tray click.
|
||||
#[cfg(desktop)]
|
||||
fn show_main_window<R: tauri::Runtime>(app: &tauri::AppHandle<R>) {
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
let _ = window.show();
|
||||
let _ = window.unminimize();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
// Plugins and commands shared by every platform (desktop + Android).
|
||||
@@ -73,7 +62,11 @@ pub fn run() {
|
||||
// in the *first* (already-running) instance when a second launch is
|
||||
// attempted: we surface its window instead of letting the second boot.
|
||||
.plugin(tauri_plugin_single_instance::init(|app, _argv, _cwd| {
|
||||
show_main_window(app);
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
let _ = window.show();
|
||||
let _ = window.unminimize();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
}))
|
||||
.setup(move |app| {
|
||||
let show = MenuItem::with_id(app, "show", "Show YTDescGen", true, None::<&str>)?;
|
||||
@@ -90,7 +83,13 @@ pub fn run() {
|
||||
.tooltip("YTDescGen — YouTube Description Generator")
|
||||
.menu(&menu)
|
||||
.on_menu_event(move |app, event| match event.id.as_ref() {
|
||||
"show" => show_main_window(app),
|
||||
"show" => {
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
let _ = window.show();
|
||||
let _ = window.unminimize();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
}
|
||||
"quit" => {
|
||||
quitting_menu.store(true, Ordering::SeqCst);
|
||||
app.exit(0);
|
||||
@@ -104,7 +103,12 @@ pub fn run() {
|
||||
..
|
||||
} = event
|
||||
{
|
||||
show_main_window(tray.app_handle());
|
||||
let app = tray.app_handle();
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
let _ = window.show();
|
||||
let _ = window.unminimize();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
}
|
||||
})
|
||||
.build(app)?;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
|
||||
"productName": "YTDescGen",
|
||||
"version": "1.6.0",
|
||||
"version": "1.2.0",
|
||||
"identifier": "com.skullmute.ytdescgen",
|
||||
"build": {
|
||||
"beforeBuildCommand": "npm run build",
|
||||
@@ -20,8 +20,7 @@
|
||||
"resizable": true,
|
||||
"maximizable": true,
|
||||
"fullscreen": false,
|
||||
"center": true,
|
||||
"zoomHotkeysEnabled": true
|
||||
"center": true
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
@@ -43,9 +42,6 @@
|
||||
"android": {
|
||||
"minSdkVersion": 30
|
||||
},
|
||||
"macOS": {
|
||||
"minimumSystemVersion": "11.0"
|
||||
},
|
||||
"windows": {
|
||||
"webviewInstallMode": {
|
||||
"type": "downloadBootstrapper"
|
||||
|
||||
@@ -55,23 +55,21 @@ 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. (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 }) => {
|
||||
// fall back to the browser console.
|
||||
try {
|
||||
// Dynamic import dodges a circular dep with files that themselves
|
||||
// import ErrorBoundary, e.g. when the boundary is mounted in
|
||||
// main.tsx before the store has registered.
|
||||
void import("@utils/logger").then(({ logger }) => {
|
||||
logger.error(
|
||||
"errorBoundary",
|
||||
`[${this.props.label ?? "app"}] ${error.message}`,
|
||||
info.componentStack ?? error.stack ?? "",
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
console.error("ErrorBoundary caught:", error, info);
|
||||
});
|
||||
} catch {
|
||||
console.error("ErrorBoundary caught:", error, info);
|
||||
}
|
||||
this.props.onError?.(error, info);
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,6 @@ 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();
|
||||
@@ -276,7 +275,6 @@ 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 })}
|
||||
/>
|
||||
@@ -324,8 +322,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">{t("editor.endings.fromLabel")}</th>
|
||||
<th className="px-2 py-1.5 text-left">{t("editor.endings.toLabel")}</th>
|
||||
<th className="px-2 py-1.5 text-left">From</th>
|
||||
<th className="px-2 py-1.5 text-left">To</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -337,7 +335,6 @@ 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 })}
|
||||
/>
|
||||
@@ -347,7 +344,6 @@ 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 })}
|
||||
/>
|
||||
|
||||
@@ -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-hidden"
|
||||
className="text-text-primary placeholder:text-text-muted h-10 w-full bg-transparent text-sm outline-none"
|
||||
/>
|
||||
</div>
|
||||
<Command.List className="max-h-72 scrollbar-thin overflow-y-auto p-1">
|
||||
|
||||
@@ -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-0.5 pl-2.5 text-xs font-medium"
|
||||
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"
|
||||
>
|
||||
{labelOf(id)}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => toggle(id)}
|
||||
aria-label={t("editor.genreRemove", { genre: labelOf(id) })}
|
||||
className="hover:bg-accent/20 flex size-6 cursor-pointer items-center justify-center rounded-full pointer-coarse:size-7"
|
||||
className="hover:bg-accent/20 flex size-5 cursor-pointer items-center justify-center rounded-full"
|
||||
>
|
||||
<X className="size-3" aria-hidden="true" />
|
||||
</button>
|
||||
|
||||
@@ -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-hidden"
|
||||
className="text-text-primary placeholder:text-text-muted h-10 w-full bg-transparent text-sm outline-none"
|
||||
/>
|
||||
</div>
|
||||
<Command.List className="max-h-80 scrollbar-thin overflow-y-auto p-1">
|
||||
|
||||
@@ -33,7 +33,6 @@ 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");
|
||||
|
||||
@@ -74,7 +73,7 @@ export function LivePreview({
|
||||
>
|
||||
<TabPanel value="title" className="p-4">
|
||||
{output.title ? (
|
||||
<p lang={lang} className="text-text-primary text-[0.9375rem] leading-snug font-medium">
|
||||
<p className="text-text-primary text-[0.9375rem] leading-snug font-medium">
|
||||
{output.title}
|
||||
</p>
|
||||
) : (
|
||||
@@ -83,10 +82,7 @@ export function LivePreview({
|
||||
</TabPanel>
|
||||
<TabPanel value="description" className="p-4">
|
||||
{output.description ? (
|
||||
<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"
|
||||
>
|
||||
<pre 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>
|
||||
) : (
|
||||
@@ -95,7 +91,7 @@ export function LivePreview({
|
||||
</TabPanel>
|
||||
<TabPanel value="tags" className="p-4">
|
||||
{output.tags.length > 0 ? (
|
||||
<div lang={lang} className="flex flex-wrap gap-1">
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{output.tags.map((tag, i) => (
|
||||
<span
|
||||
key={i}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { lazy, Suspense, useId, useState, type ReactNode } from "react";
|
||||
import { lazy, Suspense, useId, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { AlertTriangle, ChevronsUpDown } from "lucide-react";
|
||||
import clsx from "clsx";
|
||||
@@ -9,6 +9,7 @@ import { PopoverContent, PopoverRoot, PopoverTrigger } from "@components/ui/Popo
|
||||
import { Spinner } from "@components/icons/animated";
|
||||
import {
|
||||
RIG_FIELDS,
|
||||
cleanCpuName,
|
||||
parseCompositeValue,
|
||||
resolveCompositeOptions,
|
||||
resolveCompositeLabelKey,
|
||||
@@ -116,7 +117,7 @@ function GpuPicker({
|
||||
);
|
||||
}
|
||||
|
||||
/** CPU, LUT (any suggested text field): type freely or pick a suggestion. */
|
||||
/** CPU (and any other suggested text field): type freely or pick a suggestion. */
|
||||
function SuggestedTextField({
|
||||
field,
|
||||
value,
|
||||
@@ -138,11 +139,10 @@ function SuggestedTextField({
|
||||
list={listId}
|
||||
autoComplete="off"
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
// 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.
|
||||
// "Intel(R) Core(TM) i7-12700K CPU @ 3.60GHz", as Windows shows it,
|
||||
// becomes "Intel Core i7-12700K" once the user leaves the field.
|
||||
onBlur={(e) => {
|
||||
const cleaned = field.clean ? field.clean(e.target.value) : e.target.value.trim();
|
||||
const cleaned = field.id === "cpu" ? cleanCpuName(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: ReactNode[] = [];
|
||||
const renderedParts: React.ReactNode[] = [];
|
||||
composite.parts.forEach((part, index) => {
|
||||
const stored = partValues[index] ?? "";
|
||||
if (!part.hiddenWhen?.(previousValues)) {
|
||||
@@ -293,10 +293,12 @@ export function RigEditor() {
|
||||
}
|
||||
if (field.type === "composite_dropdown") return renderComposite(field);
|
||||
if (field.type === "dropdown_with_version") return renderDropdownWithVersion(field);
|
||||
const input = field.suggestions ? (
|
||||
<SuggestedTextField field={field} value={value} onChange={set} />
|
||||
) : (
|
||||
if (field.suggestions) {
|
||||
return <SuggestedTextField key={field.id} field={field} value={value} onChange={set} />;
|
||||
}
|
||||
return (
|
||||
<Input
|
||||
key={field.id}
|
||||
label={t(field.labelKey)}
|
||||
maxLength={FIELD_LIMITS.SHORT_NAME}
|
||||
placeholder={field.placeholder}
|
||||
@@ -304,13 +306,6 @@ 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>
|
||||
|
||||
@@ -9,27 +9,28 @@ 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,
|
||||
getValidFrameGenMultipliers,
|
||||
coerceUpscaleQuality,
|
||||
coerceFrameGenMultiplier,
|
||||
coerceDlssNeuralRendering,
|
||||
} 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 = VIDEO_RESOLUTIONS.map((r) => ({ value: r, label: r }));
|
||||
const RESOLUTION_OPTIONS = [
|
||||
{ value: "720p", label: "720p" },
|
||||
{ value: "1080p", label: "1080p" },
|
||||
{ value: "1440p", label: "1440p" },
|
||||
{ value: "4K", label: "4K" },
|
||||
];
|
||||
|
||||
const FPS_OPTIONS = [
|
||||
{ value: "30", label: "30 FPS" },
|
||||
@@ -102,32 +103,6 @@ export function VideoSettingsForm() {
|
||||
if (coercedQ !== store.upscaleQuality) store.set("upscaleQuality", coercedQ);
|
||||
const coercedM = coerceFrameGenMultiplier(next, store.frameGenMultiplier);
|
||||
if (coercedM !== store.frameGenMultiplier) store.set("frameGenMultiplier", coercedM);
|
||||
// v1.6.0: DLSS 5 Neural Rendering is NVIDIA's; its switch hides for
|
||||
// other vendors, so it turns off rather than linger unseen.
|
||||
const coercedNeural = coerceDlssNeuralRendering(next, store.dlssNeuralRendering);
|
||||
if (coercedNeural !== store.dlssNeuralRendering) {
|
||||
store.set("dlssNeuralRendering", coercedNeural);
|
||||
}
|
||||
}
|
||||
|
||||
// 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) => ({
|
||||
@@ -137,19 +112,12 @@ export function VideoSettingsForm() {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-4">
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
|
||||
<Select
|
||||
label={t("editor.resolution")}
|
||||
options={RESOLUTION_OPTIONS}
|
||||
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)}
|
||||
value={store.resolution ?? "1080p"}
|
||||
onChange={(v) => store.set("resolution", v)}
|
||||
/>
|
||||
<Select
|
||||
label={t("editor.fps")}
|
||||
@@ -164,9 +132,6 @@ 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
|
||||
@@ -218,17 +183,6 @@ export function VideoSettingsForm() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* v1.6.0: "Custom…" frame generation, printed as typed. */}
|
||||
{store.frameGenMultiplier === "custom" && (
|
||||
<Input
|
||||
label={t("editor.frameGenCustom")}
|
||||
maxLength={FIELD_LIMITS.LABEL}
|
||||
placeholder={t("editor.frameGenCustomPlaceholder")}
|
||||
value={store.frameGenCustom}
|
||||
onChange={(e) => store.set("frameGenCustom", e.target.value)}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="grid gap-3 sm:grid-cols-2">
|
||||
<Select
|
||||
label={t("editor.upscaleQuality")}
|
||||
@@ -244,15 +198,6 @@ export function VideoSettingsForm() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* v1.6.0: DLSS 5 Neural Rendering — NVIDIA (RTX 50 series) only. */}
|
||||
{store.frameGenVendor === "nvidia" && (
|
||||
<Toggle
|
||||
label={t("editor.dlssNeuralRendering")}
|
||||
checked={store.dlssNeuralRendering}
|
||||
onChange={(v) => store.set("dlssNeuralRendering", v)}
|
||||
/>
|
||||
)}
|
||||
|
||||
<Input
|
||||
label={t("editor.versionInfo")}
|
||||
maxLength={FIELD_LIMITS.LABEL}
|
||||
|
||||
@@ -88,7 +88,6 @@ export function VietnameseDonateEditor() {
|
||||
/>
|
||||
{customMode && (
|
||||
<Input
|
||||
aria-label={t("editor.vnBankName")}
|
||||
placeholder={t("editor.vnBankNamePlaceholder")}
|
||||
value={vnBankName ?? ""}
|
||||
onChange={(e) => store.set("vnBankName", e.target.value)}
|
||||
|
||||
@@ -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 pointer-coarse:size-9"
|
||||
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"
|
||||
>
|
||||
<X className="size-3.5" aria-hidden="true" />
|
||||
</button>
|
||||
|
||||
@@ -36,10 +36,7 @@ export function HistoryCard({ entry }: { entry: HistoryEntry }) {
|
||||
<Icon className="size-4" aria-hidden />
|
||||
</span>
|
||||
<span className="min-w-0 flex-1">
|
||||
<span
|
||||
lang={entry.language}
|
||||
className="text-text-primary block truncate text-sm font-medium"
|
||||
>
|
||||
<span 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">
|
||||
@@ -78,10 +75,7 @@ export function HistoryCard({ entry }: { entry: HistoryEntry }) {
|
||||
<CopyButton text={entry.description} label={t("output.copyDescription")} />
|
||||
<CopyButton text={entry.tags} label={t("output.copyTags")} />
|
||||
</div>
|
||||
<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"
|
||||
>
|
||||
<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">
|
||||
{entry.description}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,6 @@ 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";
|
||||
@@ -78,7 +77,7 @@ export function AppShell() {
|
||||
e.preventDefault();
|
||||
mainRef.current?.focus();
|
||||
}}
|
||||
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"
|
||||
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"
|
||||
>
|
||||
{t("nav.skipToContent")}
|
||||
</a>
|
||||
@@ -97,7 +96,6 @@ export function AppShell() {
|
||||
<Outlet />
|
||||
</main>
|
||||
<ScrollToTopButton scrollRef={mainRef} />
|
||||
<RouteAnnouncer />
|
||||
</div>
|
||||
<MobileNav onOpenMore={() => setMoreOpen(true)} moreActive={moreOpen} />
|
||||
</div>
|
||||
|
||||
@@ -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-hidden"
|
||||
className="text-text-primary placeholder:text-text-muted h-12 w-full bg-transparent text-sm outline-none"
|
||||
/>
|
||||
<Kbd>Esc</Kbd>
|
||||
</div>
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
@@ -79,14 +79,14 @@ export function LogEntryCard({ entry }: { entry: LogEntryType }) {
|
||||
label={t("logs.copyEntry")}
|
||||
size="icon-sm"
|
||||
onClick={handleCopy}
|
||||
className="size-7 pointer-coarse:size-9"
|
||||
className="size-7"
|
||||
>
|
||||
<CopyStateIcon copied={copied} className="size-3.5" />
|
||||
</IconButton>
|
||||
<IconButton
|
||||
label={t("logs.deleteEntry")}
|
||||
size="icon-sm"
|
||||
className="hover:text-danger size-7 pointer-coarse:size-9"
|
||||
className="hover:text-danger size-7"
|
||||
onClick={() => deleteEntry(entry.id)}
|
||||
>
|
||||
<Trash2 className="size-3.5" />
|
||||
|
||||
@@ -98,7 +98,7 @@ export function OutputExtras() {
|
||||
icon={MessageSquareText}
|
||||
actions={<CopyButton text={templateText} label={t("output.copyPinnedCommentTemplate")} />}
|
||||
>
|
||||
<OutputText lang={input.language}>{templateText}</OutputText>
|
||||
<OutputText>{templateText}</OutputText>
|
||||
</OutputField>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -24,22 +24,10 @@ export function OutputField({ title, icon: Icon, actions, children }: OutputFiel
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}) {
|
||||
/** Pre-formatted generated text, scrollable when long. */
|
||||
export function OutputText({ children, tall }: { children: ReactNode; tall?: boolean }) {
|
||||
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]"
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
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, SupportedLanguage } from "@engine/types";
|
||||
import type { GeneratorOutput } from "@engine/types";
|
||||
import type { OutputLimitStatus } from "@engine/limits";
|
||||
import { useCopyGate } from "@hooks/use-copy-gate";
|
||||
|
||||
@@ -17,26 +16,19 @@ 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">
|
||||
@@ -56,10 +48,7 @@ export function OutputPreview({
|
||||
</>
|
||||
}
|
||||
>
|
||||
<p
|
||||
lang={lang}
|
||||
className="bg-surface-0 border-border text-text-primary rounded-lg border p-3 text-[0.9375rem] font-medium"
|
||||
>
|
||||
<p className="bg-surface-0 border-border text-text-primary rounded-lg border p-3 text-[0.9375rem] font-medium">
|
||||
{output.title || "…"}
|
||||
</p>
|
||||
</OutputField>
|
||||
@@ -82,9 +71,7 @@ export function OutputPreview({
|
||||
</>
|
||||
}
|
||||
>
|
||||
<OutputText tall lang={lang}>
|
||||
{output.description || "…"}
|
||||
</OutputText>
|
||||
<OutputText tall>{output.description || "…"}</OutputText>
|
||||
</OutputField>
|
||||
|
||||
<OutputField
|
||||
@@ -109,14 +96,11 @@ export function OutputPreview({
|
||||
}
|
||||
>
|
||||
{compactTagDisplay ? (
|
||||
<p
|
||||
lang={lang}
|
||||
className="bg-surface-0 border-border text-text-secondary rounded-lg border p-3 text-xs leading-relaxed"
|
||||
>
|
||||
<p className="bg-surface-0 border-border text-text-secondary rounded-lg border p-3 text-xs leading-relaxed">
|
||||
{output.tagString}
|
||||
</p>
|
||||
) : (
|
||||
<div lang={lang} className="flex flex-wrap gap-1.5">
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{output.tags.map((tag, i) => (
|
||||
<span
|
||||
key={i}
|
||||
|
||||
@@ -16,8 +16,6 @@ interface YouTubePreviewProps {
|
||||
description: string;
|
||||
channelName: string;
|
||||
gameName: string;
|
||||
/** Language the title and description were generated in. */
|
||||
lang?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,13 +23,7 @@ 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,
|
||||
lang,
|
||||
}: YouTubePreviewProps) {
|
||||
export function YouTubePreview({ title, description, channelName, gameName }: YouTubePreviewProps) {
|
||||
const { t } = useTranslation("ui");
|
||||
const titleCut = title.length > SEARCH_TITLE_CHARS;
|
||||
const descriptionCut = description.length > FOLD_DESCRIPTION_CHARS;
|
||||
@@ -59,23 +51,18 @@ export function YouTubePreview({
|
||||
</span>
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p
|
||||
lang={lang}
|
||||
className="text-text-primary line-clamp-2 text-base leading-snug font-semibold"
|
||||
>
|
||||
<p 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 lang={lang} className="text-text-muted mt-2 line-clamp-2 text-xs leading-relaxed">
|
||||
{description}
|
||||
</p>
|
||||
<p 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">
|
||||
<span lang={lang}>{fold || "…"}</span>
|
||||
{fold || "…"}
|
||||
{descriptionCut && (
|
||||
<span className="text-text-primary font-semibold">
|
||||
{" "}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useId, useState, type SubmitEvent } from "react";
|
||||
import { useId, useState, type FormEvent } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
import { Modal } from "@components/ui/Modal";
|
||||
@@ -35,7 +35,7 @@ function PresetSaveFormBody({ onClose, editPreset }: PresetSaveFormProps) {
|
||||
);
|
||||
const [fromEditor, setFromEditor] = useState(false);
|
||||
|
||||
const save = (e: SubmitEvent) => {
|
||||
const save = (e: FormEvent) => {
|
||||
e.preventDefault();
|
||||
const fields = presetFieldsFromEditor(editorDataOf(useEditorStore.getState()));
|
||||
const name = gameName.trim() || fields.gameName.trim() || t("presets.unnamed");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useId, useState, type SubmitEvent } from "react";
|
||||
import { useId, useState, type FormEvent } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
import { Modal } from "@components/ui/Modal";
|
||||
@@ -38,7 +38,7 @@ function ProfileSaveFormBody({ onClose, editProfile }: ProfileSaveFormProps) {
|
||||
);
|
||||
const [fromEditor, setFromEditor] = useState(false);
|
||||
|
||||
const save = (e: SubmitEvent) => {
|
||||
const save = (e: FormEvent) => {
|
||||
e.preventDefault();
|
||||
const fields = profileFieldsFromEditor(editorDataOf(useEditorStore.getState()));
|
||||
const finalName = name.trim() || fields.channelName.trim() || t("profiles.unnamed");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useId, useState, type SubmitEvent } from "react";
|
||||
import { useId, useState, type FormEvent } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
import { Modal } from "@components/ui/Modal";
|
||||
@@ -32,7 +32,7 @@ function TemplateSaveFormBody({ onClose, editTemplate }: TemplateSaveFormProps)
|
||||
const [name, setName] = useState(editTemplate?.name ?? "");
|
||||
const [fromEditor, setFromEditor] = useState(false);
|
||||
|
||||
const save = (e: SubmitEvent) => {
|
||||
const save = (e: FormEvent) => {
|
||||
e.preventDefault();
|
||||
const snapshot = structuredClone(editorDataOf(useEditorStore.getState()));
|
||||
const finalName = name.trim() || snapshot.gameName.trim() || t("templates.unnamed");
|
||||
|
||||
@@ -29,8 +29,7 @@ interface AccordionProps {
|
||||
export function Accordion({
|
||||
id,
|
||||
title,
|
||||
// Capitalised so JSX reads it as a component, not an HTML tag.
|
||||
icon: Icon,
|
||||
icon,
|
||||
summary,
|
||||
badge,
|
||||
open,
|
||||
@@ -38,6 +37,7 @@ export function Accordion({
|
||||
children,
|
||||
}: AccordionProps) {
|
||||
const panelId = `section-${id}-panel`;
|
||||
const Icon = icon;
|
||||
return (
|
||||
<section
|
||||
id={`section-${id}`}
|
||||
|
||||
@@ -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 pointer-coarse:size-9"
|
||||
className="-m-1 flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md opacity-70 hover:opacity-100"
|
||||
>
|
||||
<X className="size-3.5" aria-hidden="true" />
|
||||
</button>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ComponentProps } from "react";
|
||||
import { forwardRef, type ButtonHTMLAttributes } from "react";
|
||||
import { Slot } from "radix-ui";
|
||||
import clsx from "clsx";
|
||||
import { Spinner } from "@components/icons/animated";
|
||||
@@ -6,8 +6,7 @@ import { Spinner } from "@components/icons/animated";
|
||||
export type ButtonVariant = "primary" | "brand" | "secondary" | "outline" | "ghost" | "danger";
|
||||
export type ButtonSize = "sm" | "md" | "lg" | "icon" | "icon-sm";
|
||||
|
||||
/** `ref` is an ordinary prop in React 19 — it comes with `ComponentProps<"button">`. */
|
||||
export interface ButtonProps extends ComponentProps<"button"> {
|
||||
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
variant?: ButtonVariant;
|
||||
size?: ButtonSize;
|
||||
/** Shows a spinner, disables the button and keeps its width. */
|
||||
@@ -17,13 +16,13 @@ export interface ButtonProps extends ComponentProps<"button"> {
|
||||
}
|
||||
|
||||
const VARIANTS: Record<ButtonVariant, string> = {
|
||||
primary: "bg-accent-solid text-accent-fg shadow-sm hover:bg-accent-solid-hover",
|
||||
primary: "bg-accent text-accent-fg shadow-sm hover:bg-accent-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-solid text-white shadow-sm hover:bg-danger-solid-hover",
|
||||
danger: "bg-danger text-white shadow-sm hover:brightness-110",
|
||||
};
|
||||
|
||||
const SIZES: Record<ButtonSize, string> = {
|
||||
@@ -43,37 +42,43 @@ export const buttonClasses = (variant: ButtonVariant = "primary", size: ButtonSi
|
||||
SIZES[size],
|
||||
);
|
||||
|
||||
export function Button({
|
||||
variant = "primary",
|
||||
size = "md",
|
||||
loading = false,
|
||||
asChild = false,
|
||||
className,
|
||||
children,
|
||||
disabled,
|
||||
type,
|
||||
ref,
|
||||
...props
|
||||
}: ButtonProps) {
|
||||
if (asChild) {
|
||||
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>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Slot.Root ref={ref} className={clsx(buttonClasses(variant, size), className)} {...props}>
|
||||
<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}
|
||||
</Slot.Root>
|
||||
</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>
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Button.displayName = "Button";
|
||||
@@ -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 pointer-coarse:size-10"
|
||||
className="text-text-muted hover:bg-surface-2 hover:text-text-primary flex size-8 cursor-pointer items-center justify-center rounded-lg"
|
||||
aria-label={t("common.close")}
|
||||
>
|
||||
<X className="size-4" aria-hidden="true" />
|
||||
|
||||
@@ -68,9 +68,7 @@ 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",
|
||||
// `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",
|
||||
"focus:outline-none focus-visible:outline-none focus:ring-3 focus:ring-accent/25",
|
||||
"disabled:cursor-not-allowed disabled:opacity-55",
|
||||
invalid
|
||||
? "border-danger focus:border-danger"
|
||||
|
||||
@@ -1,35 +1,29 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { forwardRef } 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: ReactNode;
|
||||
children: React.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. A `ref`
|
||||
* reaches the button through `props`.
|
||||
*/
|
||||
export function IconButton({
|
||||
label,
|
||||
children,
|
||||
variant = "ghost",
|
||||
size = "icon",
|
||||
noTooltip,
|
||||
tooltipSide,
|
||||
...props
|
||||
}: IconButtonProps) {
|
||||
return (
|
||||
/** 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,
|
||||
) => (
|
||||
<Tooltip content={label} disabled={noTooltip} side={tooltipSide}>
|
||||
<Button variant={variant} size={size} aria-label={label} {...props}>
|
||||
<Button ref={ref} variant={variant} size={size} aria-label={label} {...props}>
|
||||
{children}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
|
||||
IconButton.displayName = "IconButton";
|
||||
+33
-40
@@ -1,8 +1,8 @@
|
||||
import type { ComponentProps, ReactNode } from "react";
|
||||
import { forwardRef, type InputHTMLAttributes, type ReactNode } from "react";
|
||||
import clsx from "clsx";
|
||||
import { Field, controlClasses } from "./Field";
|
||||
|
||||
interface InputProps extends ComponentProps<"input"> {
|
||||
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||
label?: string;
|
||||
error?: boolean;
|
||||
/** Inline error message shown below the input (also forces the red border). */
|
||||
@@ -15,42 +15,35 @@ interface InputProps extends ComponentProps<"input"> {
|
||||
leading?: ReactNode;
|
||||
}
|
||||
|
||||
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,
|
||||
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>
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</Field>
|
||||
);
|
||||
}
|
||||
<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";
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ReactNode, RefObject } from "react";
|
||||
import type { ReactNode } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Dialog, VisuallyHidden } from "radix-ui";
|
||||
import { X } from "lucide-react";
|
||||
@@ -15,12 +15,6 @@ 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;
|
||||
@@ -40,7 +34,6 @@ export function Modal({
|
||||
footer,
|
||||
size = "md",
|
||||
className,
|
||||
initialFocusRef,
|
||||
}: ModalProps) {
|
||||
const { t } = useTranslation("ui");
|
||||
return (
|
||||
@@ -48,14 +41,6 @@ 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",
|
||||
@@ -80,7 +65,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 pointer-coarse:size-10"
|
||||
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"
|
||||
aria-label={t("common.close")}
|
||||
>
|
||||
<X className="size-4" aria-hidden="true" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ComponentProps } from "react";
|
||||
import { forwardRef, type SelectHTMLAttributes } 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<ComponentProps<"select">, "onChange"> {
|
||||
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "onChange"> {
|
||||
label?: string;
|
||||
options: readonly SelectOption[];
|
||||
onChange: (value: string) => void;
|
||||
@@ -21,19 +21,8 @@ interface SelectProps extends Omit<ComponentProps<"select">, "onChange"> {
|
||||
* 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 function Select({
|
||||
label,
|
||||
options,
|
||||
value,
|
||||
onChange,
|
||||
helpText,
|
||||
errorText,
|
||||
className,
|
||||
id,
|
||||
ref,
|
||||
...props
|
||||
}: SelectProps) {
|
||||
return (
|
||||
export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
||||
({ label, options, value, onChange, helpText, errorText, className, id, ...props }, ref) => (
|
||||
<Field label={label} help={helpText} error={errorText} id={id}>
|
||||
{(control) => (
|
||||
// `className` sizes the control box (e.g. max-w-40), so the chevron
|
||||
@@ -63,5 +52,7 @@ export function Select({
|
||||
</div>
|
||||
)}
|
||||
</Field>
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
|
||||
Select.displayName = "Select";
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useMemo, useRef, useState } from "react";
|
||||
import { useMemo, 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";
|
||||
|
||||
@@ -17,8 +16,6 @@ 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" },
|
||||
@@ -27,10 +24,6 @@ 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
|
||||
@@ -38,36 +31,28 @@ 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 available;
|
||||
return available.filter((s) => {
|
||||
if (!trimmed) return SHORTCUTS;
|
||||
return SHORTCUTS.filter((s) => {
|
||||
const label = t(s.labelKey).toLowerCase();
|
||||
const keys = s.keys.map(keyName).join(" ").toLowerCase();
|
||||
return label.includes(trimmed) || keys.includes(trimmed);
|
||||
});
|
||||
}, [activeQuery, singleKey, t]);
|
||||
}, [activeQuery, t]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
onClose={onClose}
|
||||
title={t("shortcuts.title")}
|
||||
size="sm"
|
||||
initialFocusRef={searchRef}
|
||||
>
|
||||
<Modal open={open} onClose={onClose} title={t("shortcuts.title")} size="sm">
|
||||
<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-hidden"
|
||||
className="text-text-primary placeholder:text-text-muted w-full bg-transparent text-sm outline-none"
|
||||
autoFocus
|
||||
/>
|
||||
</label>
|
||||
{filtered.length === 0 ? (
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ComponentProps, ReactNode } from "react";
|
||||
import { forwardRef, type ReactNode, type TextareaHTMLAttributes } from "react";
|
||||
import clsx from "clsx";
|
||||
import { Field, controlClasses } from "./Field";
|
||||
|
||||
interface TextareaProps extends ComponentProps<"textarea"> {
|
||||
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
||||
label?: string;
|
||||
error?: boolean;
|
||||
errorText?: string;
|
||||
@@ -10,33 +10,27 @@ interface TextareaProps extends ComponentProps<"textarea"> {
|
||||
labelExtra?: ReactNode;
|
||||
}
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
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";
|
||||
@@ -1,4 +1,3 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Toaster as Sonner } from "sonner";
|
||||
import { useSettingsStore } from "@store/settings-store";
|
||||
|
||||
@@ -9,25 +8,21 @@ 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-solid !text-accent-fg !rounded-lg !font-medium",
|
||||
actionButton: "!bg-accent !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",
|
||||
},
|
||||
|
||||
@@ -7,7 +7,6 @@ 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";
|
||||
@@ -57,8 +56,6 @@ 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;
|
||||
@@ -66,11 +63,7 @@ export interface EditorDefaults {
|
||||
rayTracingModes: RTMode[];
|
||||
frameGenVendor: FrameGenVendor;
|
||||
frameGenMultiplier: FrameGenMultiplier;
|
||||
/** v1.6.0: the frame generation as typed, when the multiplier is `"custom"`. */
|
||||
frameGenCustom: string;
|
||||
upscaleQuality: UpscaleQuality;
|
||||
/** v1.6.0: NVIDIA DLSS 5 Neural Rendering (NVIDIA only). */
|
||||
dlssNeuralRendering: boolean;
|
||||
artStyle: ArtStyle;
|
||||
/** v0.22.0 opt-in. Empty string = no style line in the description. */
|
||||
videoStyleEra: VideoStyleEra;
|
||||
@@ -201,7 +194,6 @@ export const DEFAULTS = {
|
||||
anniversaryYear: null,
|
||||
gachaVersion: "",
|
||||
resolution: "1080p",
|
||||
upscaledFrom: "",
|
||||
fps: "60",
|
||||
graphicsPreset: "medium",
|
||||
graphicsPresetCustom: "",
|
||||
@@ -209,9 +201,7 @@ export const DEFAULTS = {
|
||||
rayTracingModes: [],
|
||||
frameGenVendor: "none",
|
||||
frameGenMultiplier: "none",
|
||||
frameGenCustom: "",
|
||||
upscaleQuality: "none",
|
||||
dlssNeuralRendering: false,
|
||||
artStyle: "none",
|
||||
videoStyleEra: "" satisfies VideoStyleEra,
|
||||
versionInfo: "",
|
||||
|
||||
@@ -1,26 +1,5 @@
|
||||
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
|
||||
@@ -60,18 +39,12 @@ export const FRAMEGEN_VENDORS = ["none", "nvidia", "amd", "intel"] as const;
|
||||
export type FrameGenVendor = (typeof FRAMEGEN_VENDORS)[number];
|
||||
|
||||
/**
|
||||
* Frame-generation multiplier — DLSS 4 supports up to x4 and DLSS 4.5 adds
|
||||
* x6 and Dynamic Multi Frame Generation (`"dynamic"`, which picks the
|
||||
* multiplier itself), FSR 3 goes up to x3, Intel XeFG is ramping up.
|
||||
* `"none"` means upscaling is in use but frame generation isn't; useful for
|
||||
* builds where DLSS Quality is enabled but FG was left off.
|
||||
*
|
||||
* v1.6.0: `"custom"` reveals a free-form text field (`frameGenCustom`),
|
||||
* printed as typed — the same escape hatch as the graphics preset's, for
|
||||
* modes the list doesn't name (a driver-level or third-party frame
|
||||
* generator, a newer multiplier).
|
||||
* Frame-generation multiplier — DLSS 4 supports up to x4, FSR 3 up to x3,
|
||||
* Intel XeFG is ramping up. `"none"` means upscaling is in use but frame
|
||||
* generation isn't; useful for builds where DLSS Quality is enabled but
|
||||
* FG was left off.
|
||||
*/
|
||||
export const FRAMEGEN_MULTIPLIERS = ["none", "x2", "x3", "x4", "x6", "dynamic", "custom"] as const;
|
||||
export const FRAMEGEN_MULTIPLIERS = ["none", "x2", "x3", "x4", "x6"] as const;
|
||||
export type FrameGenMultiplier = (typeof FRAMEGEN_MULTIPLIERS)[number];
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,6 @@ export type LegalDocId =
|
||||
| "license"
|
||||
| "third-party"
|
||||
| "security"
|
||||
| "accessibility"
|
||||
| "notice"
|
||||
| "conduct";
|
||||
|
||||
@@ -55,13 +54,6 @@ 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 },
|
||||
];
|
||||
|
||||
@@ -18,7 +18,6 @@ export const PROFILE_FIELDS = [
|
||||
"social",
|
||||
"rig",
|
||||
"resolution",
|
||||
"upscaledFrom",
|
||||
"fps",
|
||||
"graphicsPreset",
|
||||
"graphicsPresetCustom",
|
||||
|
||||
+16
-19
@@ -46,7 +46,7 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
// /app/, /sub/ (package) or /bundle/ + <digits>, optionally followed by
|
||||
// /<slug>; or the s.team/a/<digits> short link.
|
||||
urlPattern:
|
||||
/^https:\/\/(?:store\.steampowered\.com\/(?:app|sub|bundle)\/\d+(?:\/\S*)?|s\.team\/a\/\d+\/?)$/i,
|
||||
/^https:\/\/(?:store\.steampowered\.com\/(?:app|sub|bundle)\/\d+(?:\/[^\s]*)?|s\.team\/a\/\d+\/?)$/i,
|
||||
normalize: normalizeSteamUrl,
|
||||
},
|
||||
{
|
||||
@@ -54,14 +54,14 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
tagName: "Epic Games",
|
||||
label: "Epic Games Store",
|
||||
urlPrefix: "https://store.epicgames.com/",
|
||||
urlPattern: /^https:\/\/(?:store\.epicgames\.com|www\.epicgames\.com\/store)\/\S+$/i,
|
||||
urlPattern: /^https:\/\/(?:store\.epicgames\.com|www\.epicgames\.com\/store)\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "ps",
|
||||
tagName: "PlayStation",
|
||||
label: "PlayStation Store",
|
||||
urlPrefix: "https://store.playstation.com/",
|
||||
urlPattern: /^https:\/\/store\.playstation\.com\/\S+$/i,
|
||||
urlPattern: /^https:\/\/store\.playstation\.com\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "xbox",
|
||||
@@ -70,7 +70,7 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
urlPrefix: "https://www.xbox.com/games/",
|
||||
// xbox.com (with or without www) and the Microsoft Store web pages.
|
||||
urlPattern:
|
||||
/^https:\/\/(?:(?:www\.)?xbox\.com|apps\.microsoft\.com|www\.microsoft\.com\/[a-z-]*\/?store)\/\S*$/i,
|
||||
/^https:\/\/(?:(?:www\.)?xbox\.com|apps\.microsoft\.com|www\.microsoft\.com\/[a-z-]*\/?store)\/[^\s]*$/i,
|
||||
},
|
||||
{
|
||||
id: "nintendo",
|
||||
@@ -80,14 +80,14 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
// Every regional site: nintendo.com/us/…, nintendo.co.uk, nintendo.de,
|
||||
// store.nintendo.co.uk, nintendo.co.jp …
|
||||
urlPattern:
|
||||
/^https:\/\/(?:[a-z0-9-]+\.)*nintendo\.(?:com|co\.[a-z]{2}|com\.[a-z]{2}|[a-z]{2})\/\S+$/i,
|
||||
/^https:\/\/(?:[a-z0-9-]+\.)*nintendo\.(?:com|co\.[a-z]{2}|com\.[a-z]{2}|[a-z]{2})\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "gog",
|
||||
tagName: "GOG",
|
||||
label: "GOG",
|
||||
urlPrefix: "https://www.gog.com/game/",
|
||||
urlPattern: /^https:\/\/(?:www\.)?gog\.com\/\S+$/i,
|
||||
urlPattern: /^https:\/\/(?:www\.)?gog\.com\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "itchio",
|
||||
@@ -103,7 +103,7 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
tagName: "Humble Bundle",
|
||||
label: "Humble Bundle",
|
||||
urlPrefix: "https://www.humblebundle.com/store/",
|
||||
urlPattern: /^https:\/\/(?:www\.)?humblebundle\.com\/\S+$/i,
|
||||
urlPattern: /^https:\/\/(?:www\.)?humblebundle\.com\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "amazon",
|
||||
@@ -111,21 +111,21 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
label: "Amazon Luna",
|
||||
urlPrefix: "https://luna.amazon.com/game/",
|
||||
// Luna's own site, or the game's page on any Amazon storefront.
|
||||
urlPattern: /^https:\/\/(?:luna\.amazon\.com|(?:www\.)?amazon\.[a-z.]{2,6})\/\S+$/i,
|
||||
urlPattern: /^https:\/\/(?:luna\.amazon\.com|(?:www\.)?amazon\.[a-z.]{2,6})\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "ea",
|
||||
tagName: "EA app",
|
||||
label: "EA app",
|
||||
urlPrefix: "https://www.ea.com/games/",
|
||||
urlPattern: /^https:\/\/(?:www\.)?ea\.com\/\S+$/i,
|
||||
urlPattern: /^https:\/\/(?:www\.)?ea\.com\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "ubisoft",
|
||||
tagName: "Ubisoft Connect",
|
||||
label: "Ubisoft Store",
|
||||
urlPrefix: "https://store.ubisoft.com/",
|
||||
urlPattern: /^https:\/\/(?:store\.ubisoft\.com|(?:www\.)?ubisoft\.com)\/\S+$/i,
|
||||
urlPattern: /^https:\/\/(?:store\.ubisoft\.com|(?:www\.)?ubisoft\.com)\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "battlenet",
|
||||
@@ -133,25 +133,22 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
label: "Battle.net",
|
||||
urlPrefix: "https://shop.battle.net/",
|
||||
// shop.battle.net and its regional hosts (us.shop.battle.net …).
|
||||
urlPattern: /^https:\/\/(?:[a-z0-9-]+\.)*battle\.net\/\S+$/i,
|
||||
urlPattern: /^https:\/\/(?:[a-z0-9-]+\.)*battle\.net\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "googleplay",
|
||||
tagName: "Android",
|
||||
label: "Google Play",
|
||||
urlPrefix: "https://play.google.com/store/apps/details?id=",
|
||||
// `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=` first or after other parameters (`?hl=en&id=…`).
|
||||
urlPattern: /^https:\/\/play\.google\.com\/store\/apps\/details\?(?:[^\s]*&)?id=[\w.]+[^\s]*$/i,
|
||||
},
|
||||
{
|
||||
id: "appstore",
|
||||
tagName: "iOS",
|
||||
label: "App Store",
|
||||
urlPrefix: "https://apps.apple.com/app/",
|
||||
urlPattern: /^https:\/\/apps\.apple\.com\/\S+$/i,
|
||||
urlPattern: /^https:\/\/apps\.apple\.com\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
id: "meta",
|
||||
@@ -159,7 +156,7 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
label: "Meta Quest Store",
|
||||
urlPrefix: "https://www.meta.com/experiences/",
|
||||
// meta.com, and oculus.com links that still circulate.
|
||||
urlPattern: /^https:\/\/(?:www\.)?(?:meta|oculus)\.com\/\S+$/i,
|
||||
urlPattern: /^https:\/\/(?:www\.)?(?:meta|oculus)\.com\/[^\s]+$/i,
|
||||
},
|
||||
{
|
||||
// Catch-all for indie / niche releases distributed only from a
|
||||
@@ -170,6 +167,6 @@ export const PLATFORMS: readonly PlatformConfig[] = [
|
||||
id: "publisher",
|
||||
label: "Publisher / Developer site",
|
||||
urlPrefix: "https://",
|
||||
urlPattern: /^https:\/\/[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+(?:\/\S*)?$/i,
|
||||
urlPattern: /^https:\/\/[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+(?:\/[^\s]*)?$/i,
|
||||
},
|
||||
] as const;
|
||||
@@ -36,14 +36,14 @@ export const PLAYTEST_PLATFORMS: readonly PlaytestPlatformConfig[] = [
|
||||
id: "steam",
|
||||
label: "Steam Playtest",
|
||||
urlPrefix: "https://store.steampowered.com/app/",
|
||||
urlPattern: /^https:\/\/store\.steampowered\.com\/app\/\d+(?:\/\S*)?$/i,
|
||||
urlPattern: /^https:\/\/store\.steampowered\.com\/app\/\d+(?:\/[^\s]*)?$/i,
|
||||
maxInvites: 100,
|
||||
},
|
||||
{
|
||||
id: "epic",
|
||||
label: "Epic Games Store",
|
||||
urlPrefix: "https://store.epicgames.com/",
|
||||
urlPattern: /^https:\/\/store\.epicgames\.com\/\S+$/i,
|
||||
urlPattern: /^https:\/\/store\.epicgames\.com\/[^\s]+$/i,
|
||||
maxInvites: 100,
|
||||
},
|
||||
{
|
||||
@@ -57,7 +57,7 @@ export const PLAYTEST_PLATFORMS: readonly PlaytestPlatformConfig[] = [
|
||||
id: "discord",
|
||||
label: "Discord / Community",
|
||||
urlPrefix: "https://discord.gg/",
|
||||
urlPattern: /^https:\/\/(?:discord\.gg|discord\.com\/invite)\/\S+$/i,
|
||||
urlPattern: /^https:\/\/(?:discord\.gg|discord\.com\/invite)\/[^\s]+$/i,
|
||||
maxInvites: 100,
|
||||
},
|
||||
{
|
||||
@@ -66,7 +66,7 @@ export const PLAYTEST_PLATFORMS: readonly PlaytestPlatformConfig[] = [
|
||||
id: "other",
|
||||
label: "Other / Signup form",
|
||||
urlPrefix: "https://",
|
||||
urlPattern: /^https:\/\/[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+(?:\/\S*)?$/i,
|
||||
urlPattern: /^https:\/\/[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+(?:\/[^\s]*)?$/i,
|
||||
maxInvites: 100,
|
||||
},
|
||||
] as const;
|
||||
|
||||
+11
-116
@@ -102,30 +102,6 @@ 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;
|
||||
/**
|
||||
* `text` fields (v1.6.0): when the value is "Custom" (any case — the
|
||||
* field's first suggestion), the description prints this templates key
|
||||
* as the whole line instead of "Label: Custom". The LUT's is "LUT
|
||||
* applied", for a LUT of one's own that has no name worth printing.
|
||||
*/
|
||||
readonly customNoteKey?: string;
|
||||
}
|
||||
|
||||
/** The value that selects a field's {@link RigField.customNoteKey} line. */
|
||||
const RIG_CUSTOM_VALUE = "Custom";
|
||||
|
||||
/** True when a rig value is the "Custom" choice (case and spaces ignored). */
|
||||
export function isCustomRigValue(value: string): boolean {
|
||||
return value.trim().toLowerCase() === RIG_CUSTOM_VALUE.toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -485,82 +461,15 @@ 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, "")
|
||||
// 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. v1.6.0: "Custom"
|
||||
* comes first — a LUT of one's own, printed as just "LUT applied".
|
||||
*/
|
||||
export const LUT_SUGGESTIONS: readonly string[] = [
|
||||
RIG_CUSTOM_VALUE,
|
||||
"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;
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -574,7 +483,6 @@ 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 },
|
||||
@@ -601,17 +509,6 @@ 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,
|
||||
customNoteKey: "description.rigNotes.lut_custom",
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -665,9 +562,7 @@ 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}.
|
||||
* - `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.
|
||||
* - All other field types pass the raw value through.
|
||||
*/
|
||||
export function formatRigValue(fieldId: string, raw: string): string {
|
||||
const field = RIG_FIELDS.find((f) => f.id === fieldId);
|
||||
@@ -719,5 +614,5 @@ export function formatRigValue(fieldId: string, raw: string): string {
|
||||
return field.composite.format(resolved);
|
||||
}
|
||||
|
||||
return field.clean ? field.clean(raw) : raw;
|
||||
return raw;
|
||||
}
|
||||
Loaded 100 of 180 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user