main
13
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3b1b17ebf1 |
fix(qodana): clear the first run's findings
The first Qodana run found 74 problems in TypeScript / JavaScript and 12 in Rust. Fixed: - React 19.3 deprecates `FormEvent`: the three save forms take the `SubmitEvent` their `onSubmit` hands them. - The URL patterns read `\S` instead of `[^\s]` (18 patterns in platforms.ts and playtest-platforms.ts, same characters). - public/theme-init.js declares its browser globals and drops an unused catch binding. - The two private `stable()` JSON helpers (restore.ts, library-apply.ts) become one `stableJson()` in src/utils/stable-json.ts, with a test. - vitest.config.ts reuses vite.config.ts's alias map instead of a copy. - Accordion destructures `icon` as `Icon` instead of copying it, a JSDoc link points at nothing any more, and i18next's `init()` promise is `void`ed on purpose. - Rust: the three "show the main window" blocks become `show_main_window`. Excluded in qodana.yaml, each with its reason: the Discord webhook secret reference (HardcodedPasswords), escaped `]` / `}` in regexes, the `@i18n/index` imports tsconfig needs, the three react-hooks warnings eslint.config.js documents, the legacy `@deprecated` draft fields in the files that migrate them; in src-tauri/qodana.yaml the module paths `generate_handler!` needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ad523ea0fb |
chore(typescript): move to TypeScript 7 with an ES2025 target
TypeScript 7.0 is the native compiler and ships no JavaScript API, which typescript-eslint still needs. Install both, as Microsoft documents it: - "@typescript/native": "npm:typescript@^7.0.2" gives `tsc` = 7.0 - "typescript": "npm:@typescript/typescript6@^6.0.2" gives the 6.0 API that typescript-eslint loads (its peer range stops below 6.1), and `tsc6` CI fails if `tsc` ever resolves to TypeScript 6 (@typescript/old, pulled in by the 6.0 package, ships a `tsc` too). tsconfig.json (src): - target ES2025: the newest year TypeScript 7.0, esbuild and Vite all know - lib ES2022 + DOM: the browser floor (Vite's baseline-widely-available, Chrome 111 / Safari 16.4 / Firefox 114), because nothing polyfills - baseUrl removed (gone in 7.0; paths were already relative), DOM.Iterable dropped (merged into DOM), `types: []` spelled out, erasableSyntaxOnly and verbatimModuleSyntax on (both clean) tsconfig.check.json: lib ES2025 for tests, scripts, worker and build plugins. Platform floor: the Tauri build no longer lowers to es2020; it shares the web build's baseline (the stylesheet already needed Chromium 99+ / Safari 15.4+). macOS minimumSystemVersion is 11.0 (the build is arm64). Also: eslint.config.js uses ESLint's defineConfig (tseslint.config is deprecated); THIRD_PARTY_NOTICES names the real package behind an npm alias, sorted with a shared code-unit comparator (src/utils/sort.ts); Dependabot groups typescript + @typescript/*; a test's typed-array annotation follows TypeScript 7's lib.dom. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3912ca5152 |
feat(data): backup & restore with preview and undo; desktop files by name only
Storage (desktop): - The webview can no longer name a path. Five commands that read, wrote, listed and deleted any path the frontend sent are replaced by name-only commands (backups, logs) that resolve under the app data folder, and by export/import commands that open the native dialog from Rust, so the only file touched is the one the user picked (json/jsonl/txt/csv/md, 20 MB). The fs and shell plugins are removed (Rust, npm, capabilities). - The settings "mirror" file is gone: it was written next to the data folder (a missing path separator) and never read back. On first start the file becomes a restorable backup — never applied on its own — and the stray log folder is merged into the right one. - Automatic backups on desktop: after library changes (quiet 30 s, at most every 10 min, skipped when unchanged or empty), newest ten kept, plus one before every restore. Settings lists them with Restore. - One tray icon, built in code with the app icon (the config entry that could add a second, iconless one is removed). Backup & restore (every platform): - Format 2 files carry each section's store version; imports run the stores' own migrations (now exported functions), then a whitelist sanitizer: known fields and values only, editor limits, safe unique ids. - Reads every earlier export: v0.15-v0.38 envelopes (log exports were labelled "history"), pre-v0.15 bare arrays, the old desktop data file. - Restore dialog: new / already here / different per item, merge (keep the newer one, or both) or replace, section and item selection, one step, Undo. Newer-version sections are shown, not restored. - Settings: Back up (choose sections) / Restore / drop a file. Consent and panel state are never exported or overwritten. - History export as CSV (spreadsheet-safe) or JSON; logs export as "logs"; dated file names; no more 250 ms timer guessing that a picker was cancelled. Library: - Templates save every editor field; presets save store link types and the other per-game fields; profiles save donate, community links and the custom graphics preset. Edit forms can update from the current editor, start fresh each time they open, and save on Enter. Toasts translated. Dev: Vite no longer watches src-tauri (cargo's locked .dll crashed `tauri dev` on Windows). Verified in `tauri dev` on Windows under a test identifier: legacy file recovered, old logs merged, auto backup, restore from the legacy backup with a backup before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a70580e703 |
ci: security, licensing and style gates; pin every action by SHA
New checks - security.yml: dependency-review blocks PRs that add a high/critical advisory; actionlint + zizmor lint the workflows themselves (template injection, permissions, credential persistence, unpinned uses); OpenSSF Scorecard weekly and on main (published, not uploaded as alerts). - compliance.yml: REUSE lint over the whole repo (REUSE.toml + LICENSES/, no per-file headers) and Conventional-Commit PR titles. - rust.yml (src-tauri changes + weekly): rustfmt, clippy -D warnings, cargo test, and cargo-deny for RustSec advisories, licenses and sources. - ci.yml `check` gains: coverage thresholds (src/engine, worker), check:licenses, check:bundle, and a `wrangler deploy --dry-run`. Licensing - THIRD_PARTY_NOTICES.md is now generated from package.json, the installed packages and Cargo.toml/Cargo.lock (`npm run generate:third-party`); CI fails when it is stale or when anything bundled into the app carries a license outside the allowlist. It had drifted to React 18 / Vite 7 / Tailwind 3. - Vite's build.license emits the full text of every bundled package's license to /licenses/third-party.md (served publicly, before the gate). Bundle budget - scripts/check-bundle-size.ts measures what CLAUDE.md's "500KB" never defined: initial load (everything index.html references) <= 280 KB gzip (197 KB today) and no JS chunk over 500 KB raw. Coverage - @vitest/coverage-v8; thresholds sit just under today's numbers. The engine is at 89% lines / 64% functions — not the 100% CLAUDE.md claimed. Supply chain - Every third-party action pinned to a commit SHA (Dependabot updates the SHA and its version comment); checkout never persists credentials. - Release workflows: a `verify` job (typecheck, tests, version sync, Tauri alignment, tag == package version) gates the build; no dependency caches in release jobs; permissions granted per job. - Reusable Discord workflows receive only the secrets they declare instead of `secrets: inherit` (which exposed the Android signing keys to them). - Rust: cargo-deny found RUSTSEC-2026-0194/0195 (quick-xml DoS, via plist) that Dependabot had not raised; plist 1.10 brings quick-xml 0.41. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
5ced6b4a86 |
feat(web): Turnstile gate, in-site legal pages and clean URLs on ytgenerator.stream
A Worker (worker/) now sits in front of the static build, configured from the same wrangler.jsonc. Cloudflare builds and deploys it; nothing in GitHub Actions does. Gate - First visit shows a branded check page (8 languages, Accept-Language) with Cloudflare Turnstile. The token is verified server-side against TURNSTILE_SECRET: success, hostname, action "enter", age <= 300 s. Only Cloudflare's own test-key results skip the hostname/action check, so `npm run cf:dev` works with the published test keys. - Pass -> `__Host-ytg_gate` (HttpOnly, Secure, SameSite=Lax, 24 h): an HMAC over expiry + a user-agent hash, keyed from the Turnstile secret, so no second secret exists and a cookie copied into a scraper is useless. - The page reloads in place instead of redirecting, so there is no `next` parameter to open-redirect with; /__gate/status lets the page tell a cookie-blocking browser what is wrong instead of looping; after one failure it waits for a click rather than resubmitting. - Missing secret = deployment mistake: the site stays up without the gate and the Worker logs it, instead of locking every visitor out. - The agree box on the gate records `ytg_terms`, which the app reads on boot so web visitors meet one blocking screen, not two. Headers and static files - worker/headers.ts sets CSP (nonce + strict-dynamic on the gate, no script at all on legal pages), nosniff, Referrer-Policy, Permissions-Policy, COOP, CORP, X-Frame-Options on everything the Worker returns; _headers covers the files served directly; a test keeps the two baselines identical. - `not_found_handling: "404-page"` (a static 404.html) instead of the SPA fallback, which would have handed index.html past the gate for any excluded path. The Worker serves the shell itself by fetching "/" - not "/index.html", which html_handling would 307 back to the home page. - security.txt (RFC 9116) is generated per build so Expires stays ~6 months ahead; the Web Analytics beacon is injected into the web build only. - theme-init.js applies the saved theme before first paint (no inline script). Legal in-site - build-plugins/legal-docs.ts renders TERMS, PRIVACY, DISCLAIMER (+ vi), LICENSE, THIRD_PARTY_NOTICES, SECURITY, NOTICE and CODE_OF_CONDUCT at build time into static /legal pages (public, before the gate) and a lazy `virtual:legal-docs` module for the in-app Legal Center, which works offline on desktop and Android and never leaves the webview. - PRIVACY, TERMS and SECURITY rewritten for Cloudflare hosting, Turnstile, Web Analytics and the two cookies; contacts moved to the poli0981.dev aliases (privacy@, legal@, dmca@, copyright@, security@, code@). - CURRENT_TERMS_VERSION 1 -> 2: the Privacy Policy changed materially. App - Web uses BrowserRouter (real paths; analytics can count them), Tauri keeps HashRouter; old /#/x bookmarks are rewritten to /x before the router reads them. Consent is a layout route; /legal sits outside it. - <html lang> follows the UI language; a stale chunk after a deploy triggers one reload instead of an error page. .gitattributes pins LF everywhere so Windows checkouts stop failing Prettier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1fc939b711 |
fix(web): serve from ytgenerator.stream root and retire the GitHub Pages deploy
The Worker connected to ytgenerator.stream was serving a build made for the GitHub Pages sub-path: index.html asked for /youtube-generator/assets/*.js, the SPA fallback answered every one of those with index.html, and the site loaded blank. Both builds are now served from `/`. - vite.config.ts: base "/" for web and Tauri alike. - wrangler.jsonc: the one Cloudflare file in the repo. Assets-only for now (dist/, SPA fallback, custom domain declared so `wrangler deploy` never detaches it, workers.dev off, build.command runs `npm run build`). - public/_headers: CSP, nosniff, Referrer-Policy, Permissions-Policy, COOP, X-Frame-Options; immutable caching for hashed /assets/*. No HSTS - the zone edge already sends it with preload. - index.html, manifest, robots, sitemap: canonical/OG/JSON-LD on the new domain, pt-BR and id added to the locale metadata, Android listed. - Brand: one SVG source in assets/brand/ now drives the favicon, the PWA icons (192/512/maskable), apple-touch-icon, a 1200x630 link-preview card and every Tauri desktop/Android/iOS icon. The desktop and Android apps had been shipping a flat indigo placeholder square; manifest and index.html pointed at four PNGs that did not exist. `npm run generate:brand` re-renders the web images; the Android adaptive icon gets a glyph-only foreground on the brand colour instead of a tile on a white disc. - deploy-web.yml and notify-deploy.yml removed, .nojekyll dropped. The last Pages deployment stays online untouched until the data-migration page replaces it. - .node-version pins Node 22 for Workers Builds; wrangler, @tauri-apps/cli and @resvg/resvg-js are pinned dev dependencies (`npm run cf:dev`, `npm run cf:check` for a dry-run deploy). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
b920d3567e |
chore(release): v0.38.0 — Portuguese (Brazil) and Indonesian
Two new locales, 1,562 strings each, complete: titles, every description block, all 248 content warnings, tech notes, playthrough notes, pinned comments, playlist copy, and the whole interface. Brazil is a top-three market for gameplay viewing and Indonesia the largest in Southeast Asia. Both use Latin script, so neither needed font or layout work. **docs/I18N.md was wrong about what registering a locale takes**, and this release is where that bit. It claimed `SUPPORTED_LANGUAGES` was "the only registration step". It is one of four, and they fail differently: SupportedLanguage union compile error CORE_TAGS_BY_LANG compile error (there are TWO such records, MULTILINGUAL_TAGS compile error not one — the doc mentioned one) detectBrowserLanguage SILENT The silent one matters most: the language works perfectly and simply never auto-selects for a visitor whose browser is set to it. `SUPPORTED_LANGUAGES` also wasn't type-bound to the union, and every consumer casts, so a mismatch between the first two compiled cleanly — it now carries a `satisfies` clause. `tests/i18n/locale-registration.test.ts` exists to close those gaps: it checks the picker list against the locale directories on disk in BOTH directions, plus namespace files, flags, native names and tag pools. Browser-language detection now matches the full BCP-47 tag before the bare language, or `pt-BR` would be reduced to `pt` and never found. Any other Portuguese variant resolves to pt-BR rather than falling through to English. 115 UI keys were not hand-translated at all: their English text is byte-identical to a string already translated in templates.json (graphics presets, ray-tracing modes, difficulty names, content-warning labels), so they are copied across. Translating those twice risks a checkbox and the rendered description disagreeing about what the same option is called. Deliberately left in English, matching what the Spanish locale already does: vendor product names (NVIDIA DLSS, AMD FSR, Intel XeSS, Fluid Motion Frames), platform brands, hardware acronyms, genre terms that are loanwords in both languages, and example URLs/emails in placeholders. So pt-BR reads 1,344/1,562 and id 1,308/1,562 "differing from English" — the remainder are those pass-throughs, not gaps. Both are AI-translated and NOT native-reviewed. Recorded in DISCLAIMER.md alongside JA/ES/KO/ZH. Also replaces `__dirname` in the Vite and Vitest configs with `import.meta.dirname` — Vite 8's native config loader doesn't provide the CJS global and warned on every run. v0.36.0 is skipped: the dependency release shipped first and took 0.37.0. Tests 692 → 698. Validator now 1,562 keys x 8 locales. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
89c0e76c2c |
feat(android): Android (.apk) build + packaging, WebView fixes, Android 11+ (v0.29.0)
Build and package the app for Android from the same Tauri 2 codebase, shipping an installable, sideloadable signed APK alongside the desktop binaries. Build / packaging - cfg-gate desktop-only tray / single-instance / hide-to-tray / exit-prevention in lib.rs behind #[cfg(desktop)]; move tauri-plugin-single-instance to a desktop-only target table so the library compiles for Android. - `cargo tauri android init` -> committed gen/android Gradle project; release signingConfigs read keystore.properties (gitignored, from CI secrets locally). - .github/workflows/release-android.yml: JDK 17 + Android SDK/NDK + rust targets, decode keystore from secrets, build --apk, upload to the same draft release. - vite.config.ts: es2020 build.target for Tauri builds (older-WebView safety). Runtime fixes (found via on-device testing) - External links: a real tap on `<a target="_blank">` makes the Android WebView fire onCreateWindow, which Tauri tries to satisfy via the shell plugin's open (no such binary on Android -> uncaught error, nothing opens). Strip target="_blank" from external anchors and route clicks through the opener plugin in the capture phase. (open-external.ts, main.tsx) - Boot black screen on old WebViews: crypto.randomUUID() (Chrome/WebView 92+) ran at module load and threw on WebView 91. Fall back to a manual RFC 4122 v4 built on getRandomValues. (uuid.ts; +4 regression tests, 509 -> 513) - File export on Android routes through the in-WebView blob download. (IS_MOBILE) Compatibility - minSdk 30 (Android 11+), targetSdk 36 (Android 16): covers the large majority of active devices with a modern, patched WebView + Google Play system updates. Release: bump manifests 0.28.0 -> 0.29.0; docs (README, FEATURES, PACKAGING, CHANGELOG). Verified on an Android 13 emulator (render, links, export). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
9554dcc7af |
chore(deps): upgrade vite 7->8 to patch esbuild advisories (v0.27.1)
Resolves the 4 high-severity esbuild advisories (GHSA-gv7w-rqvm-qjhr, GHSA-g7r4-m6w7-qqqr) deferred from v0.27.0. esbuild 0.17.0-0.28.0 is vulnerable; the fix (0.28.1) is only reachable via vite 8 -- vite 7.3.3 pins esbuild ^0.27.0 and cannot reach it. Dev-server-only; the shipped static bundle was never affected. npm audit: 4 high -> 0. - vite ^7.3.3 -> ^8.0.16, @vitejs/plugin-react ^4.3.0 -> ^5.2.0, tsx ^4.16.0 -> ^4.22.4 (vitest 4.1.8 already supports vite 8) - vite 8 bundles with Rolldown: manualChunks object form -> function form (vite.config.ts) is the only source change required - Full gate chain green (typecheck, lint, knip, validate:locales, 500/500 tests, build); dev/preview + Tauri-context build verified - Bump 5 manifests 0.27.0 -> 0.27.1; CHANGELOG + stack-version docs Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
820bbb9369 |
feat(i18n): lazy-load locale bundles per language
Only English ships in the main chunk (fallbackLng + the engine's bilingual tEn must resolve synchronously); the 10 non-English locale JSONs become Vite async chunks fetched on first use via i18next-resources-to-backend. Main chunk: 594.0 -> 264.0 kB min (204.3 -> 82.0 kB gzip), back under the 500 kB warning threshold. Every reactive getFixedT site gates on the new useLanguagesReady hook (an unloaded language would silently render English — and OutputPage would save that as a wrong-language history entry); Batch/Social bulk handlers preload all selected languages before their loops; main.tsx preloads the persisted UI + output languages before first paint. A failed chunk fetch is retried once via direct import (i18next pins failed languages permanently), then logged, degrading to English. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
58d7a94ca7 |
feat(v0.10): Pub/Dev tag, GH Pages base-path fix, vertical sidebar + About page (#44)
* fix(deploy): correct GH Pages base path to /youtube-generator/ The deployed site at https://poli0981.github.io/youtube-generator/ was serving a blank page because Vite's base was hardcoded to /yt-desc-gen/ (an old project name). Every asset request 404'd. The actual GitHub repo is poli0981/youtube-generator, confirmed by the Pages deploy log: "Evaluated environment url: https://poli0981.github.io/youtube-generator/". Aligning the Vite base unblocks the live web build. Also adds an empty public/.nojekyll so Vite copies it into dist/ — defensive against future bundle filenames Jekyll might skip. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(editor): add Pub/Dev Name field that emits a YouTube tag When the Publisher / Developer site URL is filled in, a free-text "Pub/Dev Name" input now appears underneath. Whatever the user types becomes a bare YouTube tag (e.g. "Ubisoft", "FromSoftware") via the tag generator — so SEO-relevant publisher names enter the tag pool without inflating the description. The new field is independent from the existing sponsorName/sponsorPlatform pair, which still drive the description's "🎁 Thanks to …" line — that flow is unchanged. Different semantic, different output. - Schema bumped to v8 with an additive migration (empty-string default). - Tag generator gates on a non-empty trim, reuses tagFriendlyGameName for the 30-char per-tag limit, and lets the existing dedup pass collapse case-insensitive duplicates against any future tag source. - All 6 locales (en/vi/ja/es/ko/zh) translated; validate:locales clean. - 4 new tag-generator tests cover emission, empty/whitespace skip, dedup vs sponsorName, and over-long truncation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(v0.10): vertical collapsible sidebar + About page Reworks the app shell from a horizontal top tab bar into a vertical sidebar with a hamburger collapse toggle, and adds a new /about route with app metadata, third-party credits, and configurable social links. Sidebar - TabBar.tsx renamed to Sidebar.tsx (vertical NavLink list, lucide PanelLeftClose / PanelLeftOpen, w-56 ↔ w-14 width transition). - AppShell switched from `flex flex-col` to a left-sidebar / right-pane layout; Header stays at the top of the right pane. - Collapsed state persisted via a new `sidebarCollapsed` field in the settings store (v7 → v8, additive — healSettings back-fills the default through the existing initialSettings spread). - Ctrl+B toggles the sidebar (VS Code convention); shortcut surfaced in the keyboard help cheatsheet. About page - New `/about` lazy route. Page reads from a new `src/config/about.ts` (app name, version pulled live from package.json, repo + issues + author + license URLs, and placeholder social URLs that hide their rows when blank). YouTube channel left blank with a TODO marker — fill in before tagging the v0.10 release. - Third-party credits sourced from a new `src/config/third-party.ts` with versions read from package.json deps so npm installs keep the list honest. License + project URL hardcoded. i18n - All 6 locales (en/vi/ja/es/ko/zh) updated with `tabs.about`, the new `sidebar.{expand,collapse}` block, the full `about.*` namespace including `about.socials.*`, and `shortcuts.toggleSidebar`. validate:locales clean at 448/448 keys. Version bumped to 0.10.0. shadcn/ui evaluated and skipped — would have forced a 10+ component retrofit and a token-system swap for one feature. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(about): fill in social links (YouTube/X/Discord/Ko-fi/Patreon) Replaces the TODO placeholders with the channel's actual URLs so the About page's Connect section renders all five rows. Empty entries would have hidden silently — wiring the real links is what the page was waiting on before the v0.10 release. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
47f924535f |
feat: Phase 4 — Tauri 2 desktop app (Windows MSI 4.1MB)
Tauri 2 setup: - src-tauri/ scaffold with Rust backend (lib.rs, main.rs) - System tray with Show/Quit menu + left-click to show - save_to_file and read_from_file Tauri commands - Capabilities: dialog, fs, shell permissions - All icon sizes generated (ico, icns, png) Frontend integration: - IS_TAURI platform detection (src/utils/platform.ts) - file-ops.ts: native save/load with web fallback - Vite base URL conditional (/ for Tauri, /yt-desc-gen/ for web) Build output (Windows): - MSI installer: 4.1MB - NSIS setup: 2.7MB - EXE: 14MB CI/CD: - release-desktop.yml: tag-triggered cross-platform builds - Windows (x64) + macOS (arm64 + x64) matrix Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
a763f7c78a |
feat: Phase 1 MVP scaffold — core engine, i18n, UI, CI/CD
Complete Phase 1 implementation of YTDescGen: - Project setup: Vite 5 + React 18 + TypeScript strict + Tailwind CSS dark theme - Config layer: 7 video types, 10 genres, 7 platforms, rig/social fields - i18n: EN/VI/JA with separate UI and template namespaces + validation script - Core engine: title-builder, description-builder, tag-generator (pure TS, zero React) - 42 unit tests covering all engine functions - Zustand stores: editor + settings with localStorage persistence - UI: 6 primitives, 11 editor components, 4 output components, 3 layout components - Pages: Editor (form + quick preview) and Output (title/desc/tags + copy) - CI/CD: GitHub Actions for lint/typecheck/test/build + GitHub Pages deploy Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |