Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

chore(remake): baseline e harness de captura

tonhowtf88fa504c609f
diff --git a/.gitignore b/.gitignore
index 46c2e991..219e1cf7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,242 +1,259 @@
-# Dependencies
-node_modules
-
-# SvelteKit
-/build
-/.svelte-kit
-/package
-
-# Vite
-vite.config.js.timestamp-*
-vite.config.ts.timestamp-*
-
-# Rust / Cargo
-src-tauri/target/
-
-# Tauri generated
-src-tauri/gen/schemas
-
-# Environment
-.env
-.env.*
-!.env.example
-
-# OS
-.DS_Store
-Thumbs.db
-Desktop.ini
-
-# IDE
-.vscode/
-!.vscode/extensions.json
-.idea/
-*.swp
-*.swo
-*~
-
-# Logs
-*.log
-npm-debug.log*
-
-# Database (local dev)
-*.sqlite
-*.sqlite-journal
-*.db
-
-# Misc
-*.bak
-*.tmp
-
-# Generated by Cargo
-# will have compiled files and executables
-debug
-target
-
-# These are backup files generated by rustfmt
-**/*.rs.bk
-
-# MSVC Windows builds of rustc generate these, which store debugging information
-*.pdb
-
-# Generated by cargo mutants
-# Contains mutation testing data
-**/mutants.out*/
-
-# RustRover
-# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
-# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
-# and can be added to the global gitignore or merged into this file. For a more nuclear
-# option (not recommended) you can uncomment the following to ignore the entire idea folder.
-#.idea/
-
-# Dependency directories
-node_modules/
-
-# IDE related
-.idea
-
-# Test coverage
-coverage
-*.lcov
-
-# Optional eslint cache
-.eslintcache
-
-# dotenv environment variables file
-.env
-.env.test
-
-# build output
-.vercel
-
-# OS-specific
-.DS_Store
-
-tmp
-
-benchmarking/compare/.results
-
-# Logs
-logs
-*.log
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-lerna-debug.log*
-
-# Diagnostic reports (https://nodejs.org/api/report.html)
-report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
-
-# Runtime data
-pids
-*.pid
-*.seed
-*.pid.lock
-
-# Directory for instrumented libs generated by jscoverage/JSCover
-lib-cov
-
-# Coverage directory used by tools like istanbul
-coverage
-*.lcov
-
-# nyc test coverage
-.nyc_output
-
-# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
-.grunt
-
-# Bower dependency directory (https://bower.io/)
-bower_components
-
-# node-waf configuration
-.lock-wscript
-
-# Compiled binary addons (https://nodejs.org/api/addons.html)
-build/Release
-
-# Dependency directories
-node_modules/
-jspm_packages/
-
-# Snowpack dependency directory (https://snowpack.dev/)
-web_modules/
-
-# TypeScript cache
-*.tsbuildinfo
-
-# Optional npm cache directory
-.npm
-
-# Optional eslint cache
-.eslintcache
-
-# Optional stylelint cache
-.stylelintcache
-
-# Optional REPL history
-.node_repl_history
-
-# Output of 'npm pack'
-*.tgz
-
-# Yarn Integrity file
-.yarn-integrity
-
-# dotenv environment variable files
-.env
-.env.*
-!.env.example
-
-# parcel-bundler cache (https://parceljs.org/)
-.cache
-.parcel-cache
-
-# Next.js build output
-.next
-out
-
-# Nuxt.js build / generate output
-.nuxt
-dist
-.output
-
-# Gatsby files
-.cache/
-# Comment in the public line in if your project uses Gatsby and not Next.js
-# https://nextjs.org/blog/next-9-1#public-directory-support
-# public
-
-# vuepress build output
-.vuepress/dist
-
-# vuepress v2.x temp and cache directory
-.temp
-.cache
-
-# Sveltekit cache directory
-.svelte-kit/
-
-# vitepress build output
-**/.vitepress/dist
-
-# vitepress cache directory
-**/.vitepress/cache
-
-# Docusaurus cache and generated files
-.docusaurus
-
-# Serverless directories
-.serverless/
-
-# FuseBox cache
-.fusebox/
-
-# DynamoDB Local files
-.dynamodb/
-
-# Firebase cache directory
-.firebase/
-
-# TernJS port file
-.tern-port
-
-# Stores VSCode versions used for testing VSCode extensions
-.vscode-test
-
-# pnpm
-.pnpm-store
-
-# yarn v3
-.pnp.*
-.yarn/*
-!.yarn/patches
-!.yarn/plugins
-!.yarn/releases
-!.yarn/sdks
-!.yarn/versions
-
-# Vite files
-vite.config.js.timestamp-*
-vite.config.ts.timestamp-*
-.vite/
\ No newline at end of file
+# Dependencies
+node_modules
+
+# SvelteKit
+/build
+/.svelte-kit
+/package
+
+# Vite
+vite.config.js.timestamp-*
+vite.config.ts.timestamp-*
+
+# Rust / Cargo
+src-tauri/target/
+
+# Tauri generated
+src-tauri/gen/schemas
+
+# Environment
+.env
+.env.*
+!.env.example
+
+# OS
+.DS_Store
+Thumbs.db
+Desktop.ini
+/docs
+settings.local.json
+/.claude
+/.github
+claude.md
+
+
+# IDE
+.vscode/
+!.vscode/extensions.json
+.idea/
+*.swp
+*.swo
+*~
+/platforms
+/estudar/
+# Research / study notes — must never be published
+*-study.md
+*.study.md
+/ANALISE-PORTE.md
+/.tmp-edge-focus-shot
+
+
+# Logs
+*.log
+npm-debug.log*
+
+# Database (local dev)
+*.sqlite
+*.sqlite-journal
+*.db
+
+# Misc
+*.bak
+*.tmp
+
+# Generated by Cargo
+# will have compiled files and executables
+debug
+target
+
+# These are backup files generated by rustfmt
+**/*.rs.bk
+
+# MSVC Windows builds of rustc generate these, which store debugging information
+*.pdb
+.agents
+
+# Generated by cargo mutants
+# Contains mutation testing data
+**/mutants.out*/
+
+# RustRover
+# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+# and can be added to the global gitignore or merged into this file. For a more nuclear
+# option (not recommended) you can uncomment the following to ignore the entire idea folder.
+#.idea/
+
+# Dependency directories
+node_modules/
+
+# IDE related
+.idea
+
+# Test coverage
+coverage
+*.lcov
+
+# Optional eslint cache
+.eslintcache
+
+# dotenv environment variables file
+.env
+.env.test
+
+# build output
+.vercel
+
+# OS-specific
+.DS_Store
+
+tmp
+
+benchmarking/compare/.results
+
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+lerna-debug.log*
+
+# Diagnostic reports (https://nodejs.org/api/report.html)
+report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+*.lcov
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# Snowpack dependency directory (https://snowpack.dev/)
+web_modules/
+
+# TypeScript cache
+*.tsbuildinfo
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional stylelint cache
+.stylelintcache
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variable files
+.env
+.env.*
+!.env.example
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+.parcel-cache
+
+# Next.js build output
+.next
+out
+
+# Nuxt.js build / generate output
+.nuxt
+dist
+.output
+
+# Gatsby files
+.cache/
+# Comment in the public line in if your project uses Gatsby and not Next.js
+# https://nextjs.org/blog/next-9-1#public-directory-support
+# public
+
+# vuepress build output
+.vuepress/dist
+
+# vuepress v2.x temp and cache directory
+.temp
+.cache
+
+# Sveltekit cache directory
+.svelte-kit/
+
+# vitepress build output
+**/.vitepress/dist
+
+# vitepress cache directory
+**/.vitepress/cache
+
+# Docusaurus cache and generated files
+.docusaurus
+
+# Serverless directories
+.serverless/
+
+# FuseBox cache
+.fusebox/
+
+# DynamoDB Local files
+.dynamodb/
+
+# Firebase cache directory
+.firebase/
+
+# TernJS port file
+.tern-port
+
+# Stores VSCode versions used for testing VSCode extensions
+.vscode-test
+
+# pnpm
+.pnpm-store
+
+# yarn v3
+.pnp.*
+.yarn/*
+!.yarn/patches
+!.yarn/plugins
+!.yarn/releases
+!.yarn/sdks
+!.yarn/versions
+
+# Vite files
+vite.config.js.timestamp-*
+vite.config.ts.timestamp-*
+.vite/
+.varredura/
+remake/shots/
diff --git a/REMAKE-LOG.md b/REMAKE-LOG.md
new file mode 100644
index 00000000..9223f074
--- /dev/null
+++ b/REMAKE-LOG.md
@@ -0,0 +1,43 @@
+# REMAKE-LOG — Remake visual v2
+
+Branch: `remake/visual-v2` (checkpoint inicial: `ec8b9aa4`)
+Início: 2026-07-28
+
+## Decisões
+
+- **D-001** (2026-07-28): O prompt da missão chegou truncado — a "DEFINIÇÃO DE PRONTO" final não está no documento. Reconstruída a partir das fases: (A) baseline + harness de shots funcionando; (B) design system derivado das referências, aplicado globalmente, contraste AA verificado programaticamente; (C) todos os primitivos refeitos com todos os estados + kitchen-sink; (D) todas as telas core + hubs de plugins refeitas com ciclo de auto-crítica; zero regressão em check/test/build. Critério "o que a Apple faria" em ambiguidades.
+- **D-002** (2026-07-28): Checkpoint inicial commitado **sem** arquivos `.md` (regra do projeto: nunca commitar .md, exceto os explicitamente pedidos pela missão: REMAKE-LOG.md, remake/PLANO.md, remake/DESIGN-SYSTEM.md). `mobbin/`, `.visual-audit/`, `.impeccable/`, `.varredura/` ficam fora do git (biblioteca de referência local, 5.1MB).
+- **D-003** (2026-07-28): Não existe script `lint` no package.json. Baseline de lint = warnings do `svelte-check` (100). Piso: erros 0, warnings ≤ 100.
+- **D-004** (2026-07-28): Mensagens de commit sem qualquer trailer de atribuição (regra do projeto).
+- **D-005** (2026-07-28): Escopo de telas: rotas core + hubs de plugins recebem redesign completo; as ~70 sub-rotas de `/study` herdam tokens/primitivos globais com redesign dirigido só nas superfícies representativas (player, read, music, notes, anki hub, focus). Study é um "segundo app" — refazer tela a tela seria escopo infinito sem ganho proporcional.
+- **D-006** (2026-07-28): `remake/shots/` entra no `.gitignore` — screenshots são artefato de trabalho (852KB+ por rodada), não código. Os arquivos `.md` da missão (REMAKE-LOG, PLANO, DESIGN-SYSTEM) são commitados por pedido explícito.
+- **D-007** (2026-07-28): Shots de plugins renderizam o estado degradado (comandos de plugin mockados como `null`) — suficiente para comparação antes/depois de tokens/layout, que é o objetivo.
+
+## Contornos
+
+(nenhum ainda)
+
+## Progresso
+
+- [x] Fase A.1 — branch `remake/visual-v2` + checkpoint `ec8b9aa4`
+- [x] Fase A.2 — baseline registrado (ver Métricas)
+- [x] Fase A.3 — `scripts/shots.mjs` (Playwright; mock completo do IPC Tauri via `__TAURI_INTERNALS__`; fixtures sem credenciais; auto-inicia vite dev)
+- [x] Fase A.4 — 132/132 shots baseline em `remake/shots/baseline/` (22 rotas × 3 viewports × 2 temas, zero falhas)
+- [x] Fase A.5 — REMAKE-LOG.md criado
+- [x] Fase A.6 — remake/PLANO.md criado
+- [ ] Fase B — design system
+- [ ] Fase C — primitivos
+- [ ] Fase D — telas
+
+## Métricas
+
+### Baseline (2026-07-28, antes de qualquer mudança visual)
+
+| Verificação | Resultado |
+|---|---|
+| `pnpm check` (svelte-check) | 0 erros, 100 warnings, 1329 arquivos, 49 arquivos com problemas |
+| `pnpm test` (vitest) | 4 suites, 23/23 testes passando |
+| `pnpm build` (vite) | sucesso em 25.8s (adapter-static) |
+| lint | script inexistente (ver D-003) |
+
+Piso inviolável: check 0 erros / ≤100 warnings; test ≥23 passando; build sucesso.
diff --git a/package.json b/package.json
index 3d4adb9e..6b9d4356 100644
--- a/package.json
+++ b/package.json
@@ -76,6 +76,7 @@
"@types/katex": "^0.16.7",
"@types/marked": "^6.0.0",
"@types/node": "^25.6.0",
+ "playwright": "^1.62.0",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"typescript": "~5.6.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 37f988bc..bf600cc2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -168,6 +168,9 @@ importers:
'@types/node':
specifier: ^25.6.0
version: 25.6.0
+ playwright:
+ specifier: ^1.62.0
+ version: 1.62.0
svelte:
specifier: ^5.0.0
version: 5.51.0
@@ -1579,6 +1582,11 @@ packages:
resolution: {integrity: sha512-1rZflSLyrj5/+ryzU+qIQr6IGysPIHT4UrgN+6IaVv7pLDSLu7CvC9e0X7FU6ocpRAEtHk5+UaFXv9NZKRoG3g==}
engines: {node: '>=4.0.0'}
+ resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
+ os: [darwin]
+
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
@@ -1775,6 +1783,16 @@ packages:
resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==}
engines: {node: '>=12'}
+ resolution: {integrity: sha512-nsNRyq0r2zsG8AcRHWknc9QRA5XCueC7gWMrs+Gx2tlZn9hcl8zudfh00lhJPY1DE7NmZ6bDsT9g2yey8mXljA==}
+ engines: {node: '>=20'}
+ hasBin: true
+
+ resolution: {integrity: sha512-Z14dG305dgaLu6foB1TXQagFiW8JfSUIUaUuPaKQ6NtBPKF1P/qXcqfh6c6K/icPqdy37JmjbiBXf6JNg6Sylw==}
+ engines: {node: '>=20'}
+ hasBin: true
+
resolution: {integrity: sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==}
@@ -3384,6 +3402,9 @@ snapshots:
dependencies:
raphael: 2.3.0
+ optional: true
+
optional: true
@@ -3593,6 +3614,14 @@ snapshots:
+
+ dependencies:
+ playwright-core: 1.62.0
+ optionalDependencies:
+ fsevents: 2.3.2
+
diff --git a/remake/PLANO.md b/remake/PLANO.md
new file mode 100644
index 00000000..e510172f
--- /dev/null
+++ b/remake/PLANO.md
@@ -0,0 +1,84 @@
+# PLANO — Remake visual v2 (ledger de retomada)
+
+Regra: atualizar o status após CADA item concluído. `[ ]` pendente, `[~]` em progresso, `[x]` concluído.
+
+## Fase A — Baseline e harness
+
+- [x] A1. Branch `remake/visual-v2` + checkpoint (`ec8b9aa4`)
+- [x] A2. Baseline check/test/build registrado em REMAKE-LOG.md
+- [~] A3. `scripts/shots.mjs` (Playwright, 390×844 / 834×1194 / 1440×900, light+dark, mocks Tauri)
+- [ ] A4. Shots baseline em `remake/shots/baseline/`
+- [x] A5. REMAKE-LOG.md
+- [x] A6. remake/PLANO.md (este arquivo)
+
+## Fase B — Design system
+
+- [ ] B1. Abrir referências (≥6 por eixo: tipografia, cor, forma) — parcialmente feito (8 imagens: Apple Music, Apple Mail, Linear ×1, Things 3, App Store, Bear, Raycast, Apple Fitness)
+- [ ] B2. remake/DESIGN-SYSTEM.md (tipografia, espaçamento, cor, elevação, raio, motion)
+- [ ] B3. Tokens implementados em src/app.css (formato CSS vars existente)
+- [ ] B4. Verificação programática de contraste AA (script)
+- [ ] B5. Aplicação global + check/test/build verdes + commit
+
+## Fase C — Primitivos (ordem obrigatória; todos os estados; foco visível; 2 temas)
+
+- [ ] C1. Button
+- [ ] C2. Input/Field
+- [ ] C3. Select/Picker
+- [ ] C4. Toggle/Checkbox/Radio
+- [ ] C5. Badge/Tag
+- [ ] C6. Avatar
+- [ ] C7. Card/Surface
+- [ ] C8. List row
+- [ ] C9. Section header
+- [ ] C10. Separator
+- [ ] C11. Tooltip
+- [ ] C12. Menu/Popover
+- [ ] C13. Sheet/Modal
+- [ ] C14. Toast
+- [ ] C15. Tabs
+- [ ] C16. Skeleton/Loading
+- [ ] C17. Empty state
+- [ ] C18. Progress
+- [ ] C19. Rota `/_kitchen-sink` com todos os primitivos em todos os estados
+
+## Fase D — Telas (ciclo: ≥6 refs → implementar → estados → shots → auto-crítica)
+
+### Core (redesign completo)
+
+- [ ] D1. Shell global (sidebar + titlebar/toolbar + command palette) — mobbin 01, 02, 03, 22
+- [ ] D2. `/` Home (omnibox, inspector, preview/quality, mascote) — mobbin 04, 05, 06, 15
+- [ ] D3. `/downloads` (fila, histórico, progresso, gráfico) — mobbin 07, 08, 15, 16
+- [ ] D4. `/settings` (estrutura, drill, busca) — mobbin 09, 10, 11
+- [ ] D5. `/settings` → Cookies (multi-conta) — mobbin 12
+- [ ] D6. `/settings` → Appearance (theme picker) — mobbin 20
+- [ ] D7. `/marketplace` — mobbin 13, 15, 16
+- [ ] D8. `/about` + changelog/project/terms/privacy — mobbin 19
+- [ ] D9. Diálogos/modais globais (confirm, recovery, legal, shortcuts, P2P) — mobbin 17
+- [ ] D10. Toasts + banners (yt-dlp, Bilibili) — mobbin 18
+- [ ] D11. Onboarding wizard — mobbin 14
+- [ ] D12. Empty/loading/skeleton globais — mobbin 15, 16
+
+### Hubs de plugins (redesign completo)
+
+- [ ] D13. `/courses` + `/courses/[platform]`
+- [ ] D14. `/convert`
+- [ ] D15. `/telegram`
+- [ ] D16. `/misc` + studio/library/file-clip
+
+### Study (herda tokens globais; redesign dirigido nas superfícies representativas)
+
+- [ ] D17. `/study` hub + layout próprio (alinhar ao shell)
+- [ ] D18. `/study/player` + `/study/watch` — mobbin 21
+- [ ] D19. `/study/read` (lista + leitor) — mobbin 21
+- [ ] D20. `/study/notes` (lista + editor)
+- [ ] D21. `/study/music` (hub + now-playing) — mobbin 21, 06
+- [ ] D22. `/study/focus` + achievements + progress
+- [ ] D23. `/study/anki` (hub + study)
+- [ ] D24. Demais sub-rotas study: varredura de consistência (tokens/primitivos apenas)
+
+## Fase final — verificação
+
+- [ ] F1. check/test/build ≥ baseline (0 erros / ≤100 warnings / 23 testes / build ok)
+- [ ] F2. Shots finais em `remake/shots/final/` + comparação com baseline
+- [ ] F3. Contraste AA verificado em todos os pares texto/fundo dos 2 temas core
+- [ ] F4. REMAKE-LOG.md completo (decisões, contornos, métricas finais)
diff --git a/scripts/shots.mjs b/scripts/shots.mjs
new file mode 100644
index 00000000..160e0746
--- /dev/null
+++ b/scripts/shots.mjs
@@ -0,0 +1,335 @@
+#!/usr/bin/env node
+/*
+ * Screenshot harness for the visual remake.
+ * Usage: node scripts/shots.mjs [phase] [--routes=/a,/b] [--themes=light,dark]
+ * Captures every main route at 3 viewports x 2 themes into remake/shots/<phase>/.
+ * Runs against `vite dev` (port 1420) with the Tauri IPC fully mocked, so no
+ * real backend, credentials or user data are involved.
+ */
+import { chromium } from "playwright";
+import { mkdirSync, existsSync } from "node:fs";
+import { spawn } from "node:child_process";
+import path from "node:path";
+
+const PHASE = process.argv[2] && !process.argv[2].startsWith("--") ? process.argv[2] : "baseline";
+const argOf = (name) => {
+ const a = process.argv.find((x) => x.startsWith(`--${name}=`));
+ return a ? a.split("=")[1] : null;
+};
+
+const BASE = "http://localhost:1420";
+const OUT = path.resolve("remake/shots", PHASE);
+
+const VIEWPORTS = [
+ { name: "390x844", width: 390, height: 844 },
+ { name: "834x1194", width: 834, height: 1194 },
+ { name: "1440x900", width: 1440, height: 900 },
+];
+
+const THEMES = (argOf("themes") || "light,dark").split(",");
+
+const DEFAULT_ROUTES = [
+ "/",
+ "/downloads",
+ "/marketplace",
+ "/settings",
+ "/about",
+ "/about/changelog",
+ "/about/project",
+ "/about/terms",
+ "/about/privacy",
+ "/courses",
+ "/convert",
+ "/telegram",
+ "/misc",
+ "/misc/studio",
+ "/misc/library",
+ "/misc/file-clip",
+ "/study",
+ "/study/player",
+ "/study/read",
+ "/study/library",
+ "/study/music",
+ "/study/watch",
+];
+
+const ROUTES = argOf("routes") ? argOf("routes").split(",") : DEFAULT_ROUTES;
+
+const SETTINGS = {
+ schema_version: 1,
+ appearance: { theme: "dark", language: "en" },
+ download: {
+ default_output_dir: "/Users/demo/Downloads/OmniGet",
+ always_ask_path: false,
+ video_quality: "1080p",
+ skip_existing: true,
+ download_attachments: false,
+ download_descriptions: false,
+ embed_metadata: true,
+ embed_thumbnail: true,
+ clipboard_detection: false,
+ auto_download_on_paste: false,
+ filename_template: "%(title)s.%(ext)s",
+ organize_by_platform: true,
+ download_subtitles: false,
+ include_auto_subtitles: false,
+ caption_locale: "en",
+ keep_vtt: false,
+ subtitle_format: "srt",
+ embed_subtitles: false,
+ keep_subtitle_files: true,
+ skip_archived: false,
+ continuous_lecture_numbers: false,
+ translate_metadata: false,
+ youtube_sponsorblock: false,
+ sponsorblock_mode: "mark",
+ sponsorblock_categories: [],
+ split_by_chapters: false,
+ live_from_start: false,
+ speed_limit: "",
+ hotkey_enabled: true,
+ hotkey_binding: "CmdOrCtrl+Shift+D",
+ music_hotkey_enabled: false,
+ music_hotkey_binding: "CmdOrCtrl+Shift+M",
+ music_audio_format: "mp3",
+ copy_to_clipboard_on_hotkey: false,
+ cookie_file: "",
+ always_use_managed_cookies: false,
+ bilibili_danmaku_enabled: false,
+ bilibili_danmaku_format: "ass",
+ bilibili_container: "mp4",
+ bilibili_nfo_enabled: false,
+ bilibili_cover_sidecar: false,
+ bilibili_cover_format: "jpg",
+ bilibili_naming_video: "",
+ bilibili_naming_multi_part: "",
+ bilibili_naming_bangumi: "",
+ bilibili_naming_cheese: "",
+ bilibili_naming_collection: "",
+ bilibili_cdn_hosts: "",
+ bilibili_cdn_prefer_alternatives: false,
+ bilibili_preferred_qn: 80,
+ bilibili_preferred_codec: 7,
+ bilibili_preferred_audio_qn: 30280,
+ },
+ proxy: { enabled: false, proxy_type: "http", host: "", port: 8080, username: "", password: "" },
+ advanced: {
+ max_concurrent_segments: 4,
+ max_retries: 3,
+ max_concurrent_downloads: 3,
+ concurrent_fragments: 4,
+ stagger_delay_ms: 500,
+ torrent_listen_port: 6881,
+ torrent_auto_trackers: true,
+ torrent_upnp: true,
+ prevent_sleep: true,
+ cookies_from_browser: "",
+ twitter_manual_cookie: "",
+ user_agent: "",
+ },
+ telegram: { concurrent_downloads: 2, fix_file_extensions: true },
+ rpc: { enabled: false, app_id: "", large_image_key: "" },
+ onboarding_completed: true,
+ start_with_system: false,
+ start_minimized: false,
+ legal_acknowledged: true,
+ last_download_options: { mode: "auto", quality: "1080p" },
+};
+
+const navLabel = (en) => ({ en });
+const PLUGINS = [
+ {
+ id: "courses", name: "Courses", version: "1.4.0", description: "Download courses", author: "tonhowtf",
+ enabled: true, loaded: true, icon: null, load_error: null,
+ nav: [{ route: "/courses", label: navLabel("Courses"), icon_svg: null, group: "plugins", order: 10 }],
+ },
+ {
+ id: "study", name: "Study", version: "2.1.0", description: "Reader, player, notes", author: "tonhowtf",
+ enabled: true, loaded: true, icon: null, load_error: null,
+ nav: [{ route: "/study", label: navLabel("Study"), icon_svg: null, group: "plugins", order: 20 }],
+ },
+ {
+ id: "telegram", name: "Telegram", version: "1.2.0", description: "Telegram downloads", author: "tonhowtf",
+ enabled: true, loaded: true, icon: null, load_error: null,
+ nav: [{ route: "/telegram", label: navLabel("Telegram"), icon_svg: null, group: "plugins", order: 30 }],
+ },
+ {
+ id: "convert", name: "Convert", version: "1.0.3", description: "Media conversion", author: "tonhowtf",
+ enabled: true, loaded: true, icon: null, load_error: null,
+ nav: [{ route: "/convert", label: navLabel("Convert"), icon_svg: null, group: "plugins", order: 40 }],
+ },
+ {
+ id: "misc", name: "Utilities", version: "1.1.0", description: "Studio, clips, library", author: "tonhowtf",
+ enabled: true, loaded: true, icon: null, load_error: null,
+ nav: [{ route: "/misc", label: navLabel("Utilities"), icon_svg: null, group: "plugins", order: 50 }],
+ },
+];
+
+const now = Math.floor(Date.now() / 1000);
+const HISTORY = [
+ { id: 101, url: "https://www.youtube.com/watch?v=abc123", platform: "youtube", title: "Building a Desktop App with Tauri 2 — Full Walkthrough", file_path: "/Users/demo/Downloads/OmniGet/YouTube/tauri-walkthrough.mp4", file_size_bytes: 734003200, total_bytes: 734003200, success: true, error: null, completed_at: now - 3600, thumbnail_url: null, kind: "video" },
+ { id: 102, url: "https://vimeo.com/9911223", platform: "vimeo", title: "Ambient Study Mix Vol. 4", file_path: "/Users/demo/Downloads/OmniGet/Vimeo/ambient-mix-4.m4a", file_size_bytes: 88080384, total_bytes: 88080384, success: true, error: null, completed_at: now - 7200, thumbnail_url: null, kind: "audio" },
+ { id: 103, url: "https://www.instagram.com/p/Cxyz/", platform: "instagram", title: "Travel reel — Kyoto in autumn", file_path: null, file_size_bytes: null, total_bytes: null, success: false, error: "Login required: this post is from a private account", completed_at: now - 10800, thumbnail_url: null, kind: "video" },
+ { id: 104, url: "https://twitter.com/user/status/1", platform: "twitter", title: "Thread screenshots (4 images)", file_path: "/Users/demo/Downloads/OmniGet/Twitter/thread-imgs", file_size_bytes: 8388608, total_bytes: 8388608, success: true, error: null, completed_at: now - 86400, thumbnail_url: null, kind: "image" },
+ { id: 105, url: "https://www.reddit.com/r/rust/comments/xyz", platform: "reddit", title: "Why Rust for desktop apps — discussion", file_path: "/Users/demo/Downloads/OmniGet/Reddit/rust-desktop.mp4", file_size_bytes: 157286400, total_bytes: 157286400, success: true, error: null, completed_at: now - 172800, thumbnail_url: null, kind: "video" },
+ { id: 106, url: "https://www.tiktok.com/@user/video/72", platform: "tiktok", title: "60-second pasta recipe", file_path: "/Users/demo/Downloads/OmniGet/TikTok/pasta.mp4", file_size_bytes: 26214400, total_bytes: 26214400, success: true, error: null, completed_at: now - 259200, thumbnail_url: null, kind: "video" },
+];
+
+const QUEUE = [
+ { id: 1, url: "https://www.youtube.com/watch?v=live1", platform: "youtube", title: "Conference Keynote 2026 — Day 1 (4K)", status: { type: "Downloading" }, percent: 42.5, speed_bytes_per_sec: 11534336, downloaded_bytes: 891289600, total_bytes: 2097152000, file_path: null, file_size_bytes: null, file_count: null, thumbnail_url: null, eta_seconds: 105 },
+ { id: 2, url: "https://www.twitch.tv/videos/222", platform: "twitch", title: "Speedrun VOD — GDQ finals", status: { type: "Queued" }, percent: 0, speed_bytes_per_sec: 0, downloaded_bytes: 0, total_bytes: null, file_path: null, file_size_bytes: null, file_count: null, thumbnail_url: null, eta_seconds: null },
+ { id: 3, url: "https://www.bilibili.com/video/BV1xx", platform: "bilibili", title: "Lo-fi mix for late nights", status: { type: "Complete" }, percent: 100, speed_bytes_per_sec: 0, downloaded_bytes: 104857600, total_bytes: 104857600, file_path: "/Users/demo/Downloads/OmniGet/Bilibili/lofi.mp4", file_size_bytes: 104857600, file_count: 1, thumbnail_url: null, eta_seconds: null },
+];
+
+const REGISTRY = [
+ { id: "courses", name: "Courses", description: "Download from Hotmart, Udemy, Kiwify and Rocketseat.", author: "tonhowtf", repo: "tonhowtf/omniget-plugin-courses", homepage: null, tags: ["courses", "education"], official: true, capabilities: ["nav"], installed: true, installed_version: "1.4.0" },
+ { id: "study", name: "Study", description: "Reader, player, notes, flashcards and focus tools.", author: "tonhowtf", repo: "tonhowtf/omniget-study", homepage: null, tags: ["study", "reader"], official: true, capabilities: ["nav"], installed: true, installed_version: "2.1.0" },
+ { id: "telegram", name: "Telegram", description: "Browse and batch-download from Telegram chats.", author: "tonhowtf", repo: "tonhowtf/omniget-plugin-telegram", homepage: null, tags: ["telegram"], official: true, capabilities: ["nav"], installed: true, installed_version: "1.2.0" },
+ { id: "convert", name: "Convert", description: "FFmpeg conversions with GPU acceleration.", author: "tonhowtf", repo: "tonhowtf/omniget-plugin-convert", homepage: null, tags: ["ffmpeg", "convert"], official: true, capabilities: ["nav"], installed: true, installed_version: "1.0.3" },
+ { id: "misc", name: "Utilities", description: "Screen recording studio, file clips and media library.", author: "tonhowtf", repo: "tonhowtf/omniget-plugin-misc", homepage: null, tags: ["studio", "library"], official: true, capabilities: ["nav"], installed: false, installed_version: null },
+];
+
+const DEPS = [
+ { name: "yt-dlp", installed: true, version: "2026.07.10" },
+ { name: "ffmpeg", installed: true, version: "7.1" },
+ { name: "pdfium", installed: false, version: null },
+];
+
+const FIXTURES = { SETTINGS, PLUGINS, HISTORY, QUEUE, REGISTRY, DEPS };
+
+function initScript(theme) {
+ return `(() => {
+ const F = ${JSON.stringify(FIXTURES)};
+ F.SETTINGS.appearance.theme = ${JSON.stringify(theme)};
+ let cbId = 4000;
+ const listeners = {};
+ window.__MOCK_EMIT = (name, payload) => {
+ for (const cb of (listeners[name] || [])) {
+ try { cb({ event: name, id: 1, payload }); } catch (e) {}
+ }
+ };
+ const respond = (cmd, args) => {
+ switch (cmd) {
+ case "plugin:event|listen": {
+ const cb = window["_" + args.handler];
+ if (cb) (listeners[args.event] ||= []).push(cb);
+ return ++cbId;
+ }
+ case "plugin:event|unlisten":
+ case "plugin:event|emit":
+ case "plugin:event|emit_to":
+ return null;
+ case "plugin:app|version": return "0.7.0";
+ case "plugin:app|name": return "OmniGet";
+ case "plugin:updater|check": return null;
+ case "get_settings": return F.SETTINGS;
+ case "save_settings": return null;
+ case "list_plugins": return F.PLUGINS;
+ case "check_ytdlp_available": return true;
+ case "register_external_frontend": return [];
+ case "check_cookie_error": return false;
+ case "get_download_history": return F.HISTORY;
+ case "check_dependencies": return F.DEPS;
+ case "fetch_marketplace_registry": return F.REGISTRY;
+ case "check_plugin_updates": return [];
+ case "rpc_set_idle_stats": return null;
+ case "plugin_command": return null;
+ default: return null;
+ }
+ };
+ window.__TAURI_INTERNALS__ = {
+ invoke: (cmd, args = {}) => {
+ try { return Promise.resolve(respond(cmd, args)); }
+ catch (e) { return Promise.reject(String(e)); }
+ },
+ transformCallback: (cb, once) => {
+ const id = ++cbId;
+ window["_" + id] = cb;
+ return id;
+ },
+ unregisterCallback: (id) => { delete window["_" + id]; },
+ convertFileSrc: (p) => p,
+ metadata: { currentWindow: { label: "main" }, currentWebview: { label: "main" } },
+ };
+ window.isTauri = true;
+ })();`;
+}
+
+async function waitForServer(url, ms) {
+ const deadline = Date.now() + ms;
+ while (Date.now() < deadline) {
+ try {
+ const res = await fetch(url);
+ if (res.ok) return true;
+ } catch {}
+ await new Promise((r) => setTimeout(r, 500));
+ }
+ return false;
+}
+
+async function main() {
+ let devProc = null;
+ const up = await waitForServer(BASE, 2000);
+ if (!up) {
+ console.log("starting vite dev...");
+ devProc = spawn("pnpm", ["dev"], {
+ cwd: process.cwd(),
+ env: { ...process.env, OMNIGET_I18N_STRICT: "0" },
+ stdio: "ignore",
+ detached: false,
+ });
+ const ok = await waitForServer(BASE, 90000);
+ if (!ok) {
+ console.error("vite dev did not come up on " + BASE);
+ process.exit(1);
+ }
+ }
+
+ mkdirSync(OUT, { recursive: true });
+ const browser = await chromium.launch();
+ let count = 0;
+ const failures = [];
+
+ for (const theme of THEMES) {
+ for (const vp of VIEWPORTS) {
+ const ctx = await browser.newContext({
+ viewport: { width: vp.width, height: vp.height },
+ colorScheme: theme === "light" ? "light" : "dark",
+ deviceScaleFactor: 2,
+ reducedMotion: "reduce",
+ });
+ await ctx.addInitScript(initScript(theme));
+ const page = await ctx.newPage();
+ for (const route of ROUTES) {
+ const slug = route === "/" ? "home" : route.replace(/^\//, "").replace(/\//g, "-");
+ const file = path.join(OUT, `${slug}__${vp.name}__${theme}.png`);
+ try {
+ await page.goto(BASE + route, { waitUntil: "domcontentloaded", timeout: 30000 });
+ await page.evaluate(() => document.fonts.ready.catch(() => {}));
+ await page.waitForTimeout(400);
+ await page.evaluate((queue) => {
+ if (window.__MOCK_EMIT) window.__MOCK_EMIT("queue-state-update", queue);
+ }, QUEUE);
+ await page.waitForTimeout(700);
+ await page.screenshot({ path: file });
+ count++;
+ process.stdout.write(`\r${count} shots (${slug} ${vp.name} ${theme}) `);
+ } catch (e) {
+ failures.push({ route, vp: vp.name, theme, error: String(e).slice(0, 200) });
+ }
+ }
+ await ctx.close();
+ }
+ }
+
+ await browser.close();
+ console.log(`\ndone: ${count} screenshots in ${OUT}`);
+ if (failures.length) {
+ console.log("failures:");
+ for (const f of failures) console.log(` - ${f.route} ${f.vp} ${f.theme}: ${f.error}`);
+ }
+ if (devProc) devProc.kill();
+ process.exit(failures.length ? 2 : 0);
+}
+
+main();