From 9a17b0c369aad374bf10c31660700c50b025b873 Mon Sep 17 00:00:00 2001 From: Onivoid Date: Tue, 3 Nov 2026 09:13:10 +0100 Subject: [PATCH 01/11] chore: remove Hallmark artifacts Drop the Hallmark log and pre-emit critique comments so design work can move to Impeccable. --- .hallmark/log.json | 9 --------- package.json | 2 +- src-tauri/tauri.conf.json | 2 +- src/components/workbench/ToolWorkbench.tsx | 5 ----- src/index.css | 5 ----- 5 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 .hallmark/log.json diff --git a/.hallmark/log.json b/.hallmark/log.json deleted file mode 100644 index 5e1e96c..0000000 --- a/.hallmark/log.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "date": "2026-08-19", - "macrostructure": "Stage+filmstrip", - "theme": "existing tokens", - "enrichment": "none", - "brief": "Pour le web — destination photo, WebP quality-first + byte ceilings" - } -] diff --git a/package.json b/package.json index 6e2886c..5dba08a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pictoolsapp", "private": true, - "version": "0.3.5", + "version": "0.4.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 84fda88..89f7bb1 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PictoolsApp", - "version": "0.3.5", + "version": "0.4.0", "identifier": "com.onivoid.pictoolsapp", "build": { "beforeDevCommand": "pnpm dev", diff --git a/src/components/workbench/ToolWorkbench.tsx b/src/components/workbench/ToolWorkbench.tsx index 3bb3944..2f06aa5 100644 --- a/src/components/workbench/ToolWorkbench.tsx +++ b/src/components/workbench/ToolWorkbench.tsx @@ -1,10 +1,5 @@ import type { DragEvent, ReactNode, Ref } from "react"; -/* Hallmark · pre-emit critique: P4 H5 E4 S5 R5 V4 - * macrostructure: Stage+filmstrip · tone: utilitarian · theme: existing tokens - * genre: modern-minimal · enrichment: none - */ - interface ToolWorkbenchProps { icon: ReactNode; title: string; diff --git a/src/index.css b/src/index.css index ecd0066..1752f03 100644 --- a/src/index.css +++ b/src/index.css @@ -192,11 +192,6 @@ animation: page-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both; } -/* Hallmark · pre-emit critique: P4 H5 E4 S5 R5 V4 - * macrostructure: Stage+filmstrip · tone: utilitarian · theme: existing tokens - * genre: modern-minimal · enrichment: none - */ - @media (prefers-reduced-motion: reduce) { .page-enter { animation: none; From b54ca85525b52a8560467f03e432cfabc4f47f83 Mon Sep 17 00:00:00 2001 From: Onivoid Date: Tue, 3 Nov 2026 09:13:40 +0100 Subject: [PATCH 02/11] docs: add PRODUCT.md via Impeccable init Capture durable product truth for local-first image and video tools before design documentation. --- PRODUCT.md | 68 +++++++++++++++++++++++++++++++++++++++ package.json | 2 +- src-tauri/tauri.conf.json | 2 +- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 PRODUCT.md diff --git a/PRODUCT.md b/PRODUCT.md new file mode 100644 index 0000000..a3cd9c6 --- /dev/null +++ b/PRODUCT.md @@ -0,0 +1,68 @@ +# Product + + + +## Platform + +web + +## Users + +People who need to convert, compress, or prepare images and videos on their own machine — freelancers, developers, and anyone tired of uploading media to untrusted websites. They work locally, often in short task bursts: drop files, pick an output, leave with smaller or converted files. + +## Product Purpose + +PictoolsApp is a local-first media toolbox. It converts and optimizes images (and video) entirely on-device so files never leave the computer. Success means fast, predictable offline processing with clear progress and no account, upload, or third-party server. + +## Positioning + +Offline media tools that stay on the user’s machine — not a browser SaaS, not a cloud encoder. Processing runs in the desktop app (Rust + bundled codecs); privacy and speed are the product, not a feature checklist. + +## Operating Context + +Desktop app (Tauri v2) on macOS, Windows, and Linux. Typical flow: open a tool from the sidebar, drag-and-drop or pick files, choose format/preset and output folder, run, then open the result folder. Languages: English and French (in-app Settings). Home is a quiet wordmark landing; tools use a stage + filmstrip workbench. + +## Capabilities and Constraints + +Confirmed: +- Image conversion: PNG, JPEG, WEBP, ICO; App Icons pack (PNG + ICNS + ICO) +- Image optimize « Pour le web »: resize ceilings, WebP/JPEG quality search, never overwrite sources +- Video compress + convert (presets light / balanced / quality; outputs mp4, webm, mov, mkv) via bundled FFmpeg sidecar +- Drag-and-drop, file picker, per-file progress events +- Auto-updater for shipped builds + +Constraints: +- Local-only: no uploads, no remote processing APIs +- Never overwrite source files; force a suffix when paths collide +- FFmpeg is GPL: the sidecar binary’s license obligations apply to distribution of builds that include it +- Impeccable Live mode is not available inside the Tauri webview; design work uses PRODUCT.md / DESIGN.md and shipped UI inspection + +Undecided / out of current scope: +- Advanced video controls (manual CRF, AV1, fine audio routing) +- Cloud sync, accounts, collaboration + +## Brand Commitments + +- Name: PictoolsApp +- Voice: utilitarian, calm, verb-led CTAs (“Convert”, “Ready for the web”); silent success (no celebratory toasts) +- Assets: wordmark / logo in TopBar and Home (`public/Base Logo.png`) +- Visual world is owned by DESIGN.md; do not invent a second palette on tool pages + +## Evidence on Hand + +- README product story and feature list +- Implemented tools: Convert, Optimize, Settings; Home landing +- Design tokens and workbench in `src/index.css` and `src/components/workbench/` +- No fabricated testimonials, benchmarks, or customer quotes — do not invent them + +## Product Principles + +1. Files stay on the machine — privacy is default, not a setting. +2. Tools are destinations: one job per page, stage-first, minimal chrome. +3. Silent success: show size deltas and checks, not confetti. +4. Never destroy the original; always write beside or into a chosen folder. +5. Prefer clear presets over exposed encoder knobs unless the user asks for advanced control. + +## Accessibility & Inclusion + +Keyboard-reachable controls and focus-visible styles on interactive chrome. Respect `prefers-reduced-motion` (opacity-only where motion exists). Full UI available in English and French. diff --git a/package.json b/package.json index 5dba08a..f64a75a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pictoolsapp", "private": true, - "version": "0.4.0", + "version": "0.4.1", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 89f7bb1..0d1f700 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PictoolsApp", - "version": "0.4.0", + "version": "0.4.1", "identifier": "com.onivoid.pictoolsapp", "build": { "beforeDevCommand": "pnpm dev", From 6630060734d00245b14e3bb514dda105952c056e Mon Sep 17 00:00:00 2001 From: Onivoid Date: Tue, 3 Nov 2026 09:15:10 +0100 Subject: [PATCH 03/11] docs: replace design.md with Impeccable DESIGN.md Document the incumbent Quiet Workbench system and drop the Hallmark-era design.md. --- .impeccable/design.json | 166 ++++++++++++++++++++++++++++++++++++ DESIGN.md | 171 ++++++++++++++++++++++++++++++++++++++ design.md | 85 ------------------- package.json | 2 +- src-tauri/tauri.conf.json | 2 +- 5 files changed, 339 insertions(+), 87 deletions(-) create mode 100644 .impeccable/design.json create mode 100644 DESIGN.md delete mode 100644 design.md diff --git a/.impeccable/design.json b/.impeccable/design.json new file mode 100644 index 0000000..d6e55c6 --- /dev/null +++ b/.impeccable/design.json @@ -0,0 +1,166 @@ +{ + "schemaVersion": 2, + "generatedAt": "2026-11-03T08:00:00.000Z", + "title": "Design System: PictoolsApp", + "extensions": { + "colorMeta": { + "primary": { + "role": "primary", + "displayName": "Workbench Violet", + "canonical": "oklch(59.01% 0.19675 278.523)", + "tonalRamp": [ + "oklch(25% 0.12 278.523)", + "oklch(35% 0.15 278.523)", + "oklch(45% 0.18 278.523)", + "oklch(59.01% 0.19675 278.523)", + "oklch(70% 0.14 278.523)", + "oklch(80% 0.08 278.523)", + "oklch(90% 0.04 278.523)", + "oklch(96% 0.015 278.523)" + ] + }, + "secondary": { + "role": "secondary", + "displayName": "Done Mint", + "canonical": "oklch(78.158% 0.14381 171.311)", + "tonalRamp": [ + "oklch(30% 0.08 171.311)", + "oklch(42% 0.1 171.311)", + "oklch(55% 0.12 171.311)", + "oklch(65% 0.13 171.311)", + "oklch(78.158% 0.14381 171.311)", + "oklch(85% 0.1 171.311)", + "oklch(92% 0.05 171.311)", + "oklch(97% 0.02 171.311)" + ] + }, + "background": { + "role": "neutral", + "displayName": "Cool Paper", + "canonical": "oklch(98.511% 0.00011 271.152)", + "tonalRamp": [ + "oklch(18% 0.002 286.055)", + "oklch(30% 0.002 286.055)", + "oklch(50% 0.01 278.523)", + "oklch(70% 0.005 278.523)", + "oklch(88% 0.005 278.523)", + "oklch(93% 0.00025 271.152)", + "oklch(96.5% 0.00015 271.152)", + "oklch(98.511% 0.00011 271.152)" + ] + } + }, + "typographyMeta": { + "title": { "displayName": "Title", "purpose": "Tool page titles." }, + "body": { "displayName": "Body", "purpose": "Supporting copy and dock summaries." }, + "label": { "displayName": "Section label", "purpose": "Uppercase tracking labels above controls." }, + "mono": { "displayName": "Mono", "purpose": "Sizes, versions, percents." } + }, + "shadows": [], + "motion": [ + { + "name": "page-enter", + "value": "opacity + 10px translate, 250ms cubic-bezier(0.16, 1, 0.3, 1)", + "purpose": "Page mount entrance via .page-enter." + }, + { + "name": "interactive", + "value": "color/opacity 150–200ms", + "purpose": "Default interactive transitions." + }, + { + "name": "cta-lift", + "value": "translateY(-1.5px) on hover; translateY(1px) on press", + "purpose": "Primary CTA press feedback; opacity-only under reduced motion." + } + ], + "breakpoints": [] + }, + "components": [ + { + "name": "Primary Button", + "kind": "button", + "refersTo": "button-primary", + "description": "Verb-led filled CTA for run actions.", + "html": "", + "css": ".ds-btn-primary { background: var(--primary); color: var(--primary-foreground); border: none; border-radius: var(--radius); padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: transform 150ms ease, opacity 150ms ease; } .ds-btn-primary:hover { transform: translateY(-1.5px); } .ds-btn-primary:active { transform: translateY(1px); } .ds-btn-primary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; } .ds-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }" + }, + { + "name": "Secondary Button", + "kind": "button", + "refersTo": "button-secondary", + "description": "Outline secondary actions such as Open folder or Advanced.", + "html": "", + "css": ".ds-btn-secondary { background: transparent; color: var(--muted-foreground); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: color 150ms ease, background 150ms ease; } .ds-btn-secondary:hover { color: var(--foreground); background: var(--muted); } .ds-btn-secondary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }" + }, + { + "name": "Format Chip On", + "kind": "chip", + "refersTo": "format-chip-on", + "description": "Selected format or preset chip.", + "html": "", + "css": ".ds-chip-on { background: var(--primary); color: var(--primary-foreground); border: none; border-radius: calc(var(--radius) - 2px); padding: 0.375rem 0.625rem; font-size: 0.75rem; font-weight: 500; cursor: pointer; } .ds-chip-on:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }" + }, + { + "name": "Format Chip Off", + "kind": "chip", + "refersTo": "format-chip-off", + "description": "Idle format or preset chip.", + "html": "", + "css": ".ds-chip-off { background: var(--background); color: var(--muted-foreground); border: 1px solid color-mix(in oklch, var(--border) 60%, transparent); border-radius: calc(var(--radius) - 2px); padding: 0.375rem 0.625rem; font-size: 0.75rem; font-weight: 500; cursor: pointer; transition: background 150ms ease, color 150ms ease; } .ds-chip-off:hover { background: var(--accent); color: var(--accent-foreground); } .ds-chip-off:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }" + }, + { + "name": "Settings Card", + "kind": "card", + "refersTo": "card", + "description": "Bordered content card for Settings.", + "html": "

Language

Choose the interface language.

", + "css": ".ds-card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; } .ds-card-title { margin: 0 0 0.25rem; font-size: 0.875rem; font-weight: 600; } .ds-card-body { margin: 0; font-size: 0.75rem; color: var(--muted-foreground); }" + } + ], + "narrative": { + "northStar": "The Quiet Workbench", + "overview": "PictoolsApp is an operate surface where the media is the page. Empty tools are a full-canvas drop zone; loaded tools are stage + plan dock + horizontal filmstrip. Chrome stays thin and calm. Accent is rare; success is silent.", + "keyCharacteristics": [ + "Stage + filmstrip macrostructure", + "System UI type only", + "Violet primary used sparingly; mint for done only", + "Flat tonal surfaces", + "Verb-led CTAs and segmented chips" + ], + "rules": [ + { + "name": "The One Voice Rule", + "body": "Primary accent appears on ≤ ~5% of the viewport; rarity is the signal.", + "section": "colors" + }, + { + "name": "The Mint Is Done Rule", + "body": "Secondary mint is reserved for success/done states only.", + "section": "colors" + }, + { + "name": "The Flat-By-Default Rule", + "body": "Surfaces rest flat. Motion and tint carry state, not drop shadows.", + "section": "elevation" + }, + { + "name": "The System Stack Rule", + "body": "Do not add display webfonts to tool pages.", + "section": "typography" + } + ], + "dos": [ + "Keep tool pages stage-first with filmstrip + dock", + "Use silent success (check + size delta)", + "Preserve source files; force a suffix on path collision", + "Extend this system when adding tools" + ], + "donts": [ + "Invent a second palette or loud enrichment on app pages", + "Add celebratory toasts on success", + "Restyle Home or Sidebar opportunistically", + "Overwrite source media" + ] + } +} diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 0000000..fab2ed7 --- /dev/null +++ b/DESIGN.md @@ -0,0 +1,171 @@ +--- +name: PictoolsApp +description: Local-first media toolbox — calm operate UI, stage-first tools +colors: + background: "oklch(98.511% 0.00011 271.152)" + foreground: "oklch(21.82% 0.00195 286.055)" + card: "oklch(96.5% 0.00015 271.152)" + primary: "oklch(59.01% 0.19675 278.523)" + primary-foreground: "oklch(98% 0 0)" + secondary: "oklch(78.158% 0.14381 171.311)" + muted: "oklch(93% 0.00025 271.152)" + muted-foreground: "oklch(50% 0.01 278.523)" + accent: "oklch(90% 0.04 278.523)" + destructive: "oklch(0.577 0.245 27.325)" + border: "oklch(88% 0.005 278.523)" + ring: "oklch(59.01% 0.19675 278.523)" +typography: + title: + fontFamily: "ui-sans-serif, system-ui, sans-serif" + fontSize: "1.125rem" + fontWeight: 600 + letterSpacing: "-0.025em" + body: + fontFamily: "ui-sans-serif, system-ui, sans-serif" + fontSize: "0.875rem" + fontWeight: 400 + label: + fontFamily: "ui-sans-serif, system-ui, sans-serif" + fontSize: "0.75rem" + fontWeight: 500 + letterSpacing: "0.1em" + mono: + fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace" + fontSize: "0.75rem" + fontWeight: 400 +rounded: + sm: "calc(0.625rem - 4px)" + md: "calc(0.625rem - 2px)" + lg: "0.625rem" +spacing: + header-x: "1.25rem" + header-y: "0.75rem" + dock-x: "1.25rem" + dock-y: "0.75rem" + filmstrip-thumb: "6rem" +components: + button-primary: + backgroundColor: "{colors.primary}" + textColor: "{colors.primary-foreground}" + rounded: "{rounded.lg}" + padding: "0.5rem 1rem" + button-secondary: + backgroundColor: "transparent" + textColor: "{colors.muted-foreground}" + rounded: "{rounded.lg}" + padding: "0.5rem 1rem" + format-chip-on: + backgroundColor: "{colors.primary}" + textColor: "{colors.primary-foreground}" + rounded: "{rounded.md}" + padding: "0.375rem 0.625rem" + format-chip-off: + backgroundColor: "{colors.background}" + textColor: "{colors.muted-foreground}" + rounded: "{rounded.md}" + padding: "0.375rem 0.625rem" +--- + +# Design System: PictoolsApp + +## Overview + +**Creative North Star: "The Quiet Workbench"** + +PictoolsApp is an operate surface, not a marketing spectacle. The media is the page: empty tools are a full-canvas drop zone; loaded tools are stage + plan dock + horizontal filmstrip. Chrome stays thin, utilitarian, and calm so attention stays on the file being processed. + +Personality is modern-minimal and restrained. Accent color is rare. Success is silent (check + size delta), never celebratory. Home keeps its centered wordmark; tool pages must not invent enrichment, second palettes, or dashboard chrome. + +**Key Characteristics:** +- Stage + filmstrip macrostructure on tool pages +- System UI type only; tight title tracking +- Violet primary used sparingly; mint secondary for done/success only +- Flat tonal surfaces; motion is short and optional +- Verb-led CTAs; segmented format chips + +## Colors + +Cool near-white paper with a restrained violet accent and a mint reserved for completion. + +### Primary +- **Workbench Violet** (`oklch(59.01% 0.19675 278.523)`): primary CTA fill, selected chips, focus ring, active nav bar. ≤ ~5% of any viewport. + +### Secondary +- **Done Mint** (`oklch(78.158% 0.14381 171.311)`): success / done indicators only — never as a second brand accent on idle chrome. + +### Neutral +- **Cool Paper** (`oklch(98.511% 0.00011 271.152)`): app background +- **Ink** (`oklch(21.82% 0.00195 286.055)`): body text +- **Card Mist** (`oklch(96.5% 0.00015 271.152)`): cards / elevated panels +- **Mute Wash** (`oklch(93% 0.00025 271.152)`): muted fills, active nav row +- **Hairline** (`oklch(88% 0.005 278.523)`): borders and inputs + +### Named Rules +**The One Voice Rule.** Primary accent appears on ≤ ~5% of the viewport; rarity is the signal. + +**The Mint Is Done Rule.** Secondary mint is reserved for success/done states only. + +## Typography + +**Display / Body Font:** system UI stack (`ui-sans-serif, system-ui, sans-serif`) +**Mono Font:** system mono for sizes, versions, percents + +**Character:** Quiet OS-native type. No webfonts. Hierarchy comes from size, weight, and tracking — not personality typefaces. + +### Hierarchy +- **Title** (600, `text-lg`, tight tracking): tool page titles +- **Body** (400, `text-sm`): supporting copy, dock summaries +- **Label** (500, `text-xs`, uppercase, `tracking-widest`, muted): section labels above controls +- **Mono** (400, `text-xs`): byte sizes, dimensions, percents + +### Named Rules +**The System Stack Rule.** Do not add display webfonts to tool pages. + +## Layout + +Desktop operate shell: custom TopBar + collapsible Sidebar + content outlet. Tool pages share header rhythm `px-5 py-3`, edge-to-edge stage, dock `px-5 py-3`, filmstrip thumbs `w-24` with horizontal scroll. No three-pane settings workbench on media tools. Settings uses bordered cards and the same header rhythm. Home stays a centered wordmark composition. + +Spacing follows Tailwind’s 4-point scale. Density is comfortable but chrome-light — the file owns the canvas. + +## Elevation & Depth + +Flat by default. Depth comes from tonal layering (background → card → muted) and hairline borders, not multi-layer shadows. Interactive lift on primary CTAs is a 1.5px translate on hover (opacity-only under reduced motion). + +### Named Rules +**The Flat-By-Default Rule.** Surfaces rest flat. Motion and tint carry state, not drop shadows. + +## Shapes + +Base radius `--radius: 0.625rem` with sm/md/lg steps derived in CSS. Buttons and chips use `rounded-lg` / `rounded-md`. Cards and settings panels use the same radius language with `border-border`. No pill-full chrome on primary actions. + +## Components + +### Buttons +Primary: filled primary, `rounded-lg`, verb label, hover lift 1.5px, press `translateY(1px)`. Secondary: outline `border-border`, muted text. Disabled only while in-flight or missing required inputs (files; Convert also needs output folder). + +### Format chips +Segmented control feel: selected = primary fill; idle = background + hairline border + muted text. + +### Tool workbench +Header (icon + title + subtitle) → stage (empty drop or media preview) → optional dock → optional filmstrip. Drag overlay and busy overlay are first-class states. + +### Sidebar / TopBar +Shared shell. Active nav: muted fill + 2px primary left bar. Tooltips delay 300ms on hover. Do not restyle Home or Sidebar as part of tool work. + +### Settings cards +Bordered cards only; no stage, no enrichment. + +## Do's and Don'ts + +**Do** +- Keep tool pages stage-first with filmstrip + dock +- Use silent success (check + size delta) +- Preserve source files; force a suffix on path collision +- Extend this system when adding tools (Video matches Convert/Optimize chrome) + +**Don't** +- Invent a second palette or loud enrichment on app pages +- Add celebratory toasts/confetti on convert/optimize/video success +- Restyle Home or Sidebar opportunistically +- Expose encoder knobs when presets carry the product voice +- Overwrite source media diff --git a/design.md b/design.md deleted file mode 100644 index e6b4567..0000000 --- a/design.md +++ /dev/null @@ -1,85 +0,0 @@ -# Design — PictoolsApp - -A locked design system for this app. Every page redesign reads this file before -emitting code. Do not regenerate per page — extend or amend this file when the -system needs to grow. - -## Genre -modern-minimal - -## Macrostructure family -- Marketing pages: Home stays as-is (centered wordmark + subtitle). Do not restyle. -- App pages: Stage + filmstrip. The photo is the page. Empty = full-canvas drop. - Loaded = stage (before/after) + plan dock + horizontal filmstrip. No three-pane - settings workbench. -- Content pages: Settings uses the same header rhythm and bordered cards, no enrichment. - -## Theme -Existing tokens in `src/index.css`. Do not invent a second palette. - -- `--background` oklch(98.511% 0.00011 271.152) (dark: oklch(18% 0.002 286.055)) -- `--foreground` oklch(21.82% 0.00195 286.055) -- `--card` oklch(96.5% 0.00015 271.152) -- `--primary` oklch(59.01% 0.19675 278.523) — violet accent, ≤ 5% of viewport -- `--secondary` oklch(78.158% 0.14381 171.311) — mint, success/done only -- `--muted` oklch(93% 0.00025 271.152) -- `--destructive` oklch(0.577 0.245 27.325) -- `--border` oklch(88% 0.005 278.523) -- `--radius` 0.625rem - -## Typography -- Display / body: inherited system UI stack (no extra webfont). -- Mono: system mono for sizes, versions, percents. -- Headings: roman, `font-style: normal`. Tracking tight on titles (`tracking-tight`). -- App page title: `text-lg font-semibold`. Section labels: `text-xs uppercase tracking-widest text-muted-foreground`. - -## Spacing -4-point scale via Tailwind. -- Header: `px-5 py-3`. -- Stage: edge-to-edge, no side columns. -- Dock: `px-5 py-3`. -- Filmstrip thumbs: `w-24`, horizontal scroll. - -## Motion -- Page enter: `.page-enter` (opacity + 10px translate, 250ms). -- Interactive: color/opacity 150–200ms. Transforms only on hover of chrome already using them (Home, Sidebar). -- CTA: 1.5px lift on hover, press `translateY(1px)`. Reduced-motion: opacity only. -- Reduced-motion: existing `useReducedMotion` — keep opacity-only there. -- App pages: no celebratory toasts. Silent success (check icon + size delta). - -## Microinteractions stance -- Silent success. No confetti, no extra toast on optimize/convert. -- Hover delay on tooltips 300ms (sidebar). Focus delay 0ms. -- Primary CTA disabled only while in-flight or missing files (and Convert: missing output folder). - -## CTA voice -- Primary: filled `--primary`, `rounded-lg`, verb label (“Prêt pour le web”, “Convertir”). -- Secondary: outline `border-border`, muted text (“Ouvrir le dossier”, “Avancé”). -- Segmented format chips: selected = primary fill. - -## Per-page allowances -- Home MAY keep its existing logo motion. Do not restyle Home or Sidebar. -- App pages MUST NOT use enrichment — function carries the page. -- Settings: cards only. - -## What pages MUST share -- Wordmark / logotype in the TopBar. -- Accent colour and placement. -- Display + body fonts (system stack). -- CTA voice (button shape, radius, padding). -- Section heading rhythm (uppercase tracking label above controls). -- Stage + filmstrip chrome on Convert and Optimize. - -## What pages MAY differ on -- Convert dock content (format chips + folder) vs Optimize dock (plan + one CTA). -- Settings has no stage. - -## Notes -- App pages are destinations, not settings panels. Optimize is « Pour le web »: detect orientation, show the plan, one CTA. -- Web fit (no crop, no upscale): landscape max 1920 wide, portrait max 1350 tall, square max 1080. -- Web profile encodes WebP at quality 78 (JPEG 82 if forced), then drops toward quality 55 only to hit the ceiling. Never climbs to quality 100. -- Web ceilings after fit: landscape 300 KiB, portrait 220 KiB, square 200 KiB. -- `keep_percent` is ignored by the web profile. The slider lives in Advanced for custom (non-web) runs only. -- Never overwrite the source file: if output path equals input path, force a suffix. -- Default web output sits next to the source with `_web`. -- PNG output is lossless; the UI must say so instead of pretending the slider will shrink it. diff --git a/package.json b/package.json index f64a75a..f21f552 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pictoolsapp", "private": true, - "version": "0.4.1", + "version": "0.4.2", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 0d1f700..671252f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PictoolsApp", - "version": "0.4.1", + "version": "0.4.2", "identifier": "com.onivoid.pictoolsapp", "build": { "beforeDevCommand": "pnpm dev", From 8908a793e0669321ec6fde33ca559c81e40f1560 Mon Sep 17 00:00:00 2001 From: Onivoid Date: Tue, 3 Nov 2026 09:15:53 +0100 Subject: [PATCH 04/11] refactor: share format chips and image extensions Deduplicate Convert/Optimize chip styles and accepted image extensions behind shared workbench helpers. --- package.json | 2 +- src-tauri/tauri.conf.json | 2 +- src/ARCHITECTURE.md | 5 ++- src/components/workbench/FormatChip.tsx | 43 +++++++++++++++++++++++++ src/components/workbench/index.ts | 1 + src/constants/index.ts | 18 +++++++++++ src/pages/Convert.tsx | 28 ++++++---------- src/pages/Optimize.tsx | 32 +++++++----------- 8 files changed, 90 insertions(+), 41 deletions(-) create mode 100644 src/components/workbench/FormatChip.tsx diff --git a/package.json b/package.json index f21f552..2f2e6b8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pictoolsapp", "private": true, - "version": "0.4.2", + "version": "0.4.3", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 671252f..efa67c8 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PictoolsApp", - "version": "0.4.2", + "version": "0.4.3", "identifier": "com.onivoid.pictoolsapp", "build": { "beforeDevCommand": "pnpm dev", diff --git a/src/ARCHITECTURE.md b/src/ARCHITECTURE.md index 70c1585..a958a5e 100644 --- a/src/ARCHITECTURE.md +++ b/src/ARCHITECTURE.md @@ -15,7 +15,10 @@ src/ │ ├── components/ # Reusable components │ ├── ui/ # UI components (shadcn/ui) -│ └── ... # Your custom components +│ ├── workbench/ # Shared tool chrome (ToolWorkbench, FormatChip, FileQueue…) +│ └── ... # Shell components (Sidebar, TopBar…) + +Design authority for agents: PRODUCT.md + DESIGN.md at the repo root (Impeccable). │ ├── composables/ # Custom hooks (Nuxt-style composables) │ ├── useLocalStorage.ts # localStorage persistence diff --git a/src/components/workbench/FormatChip.tsx b/src/components/workbench/FormatChip.tsx new file mode 100644 index 0000000..875b9cb --- /dev/null +++ b/src/components/workbench/FormatChip.tsx @@ -0,0 +1,43 @@ +import type { ButtonHTMLAttributes, ReactNode } from "react"; +import { cn } from "@/lib/utils"; + +type FormatChipVariant = "default" | "accent"; + +interface FormatChipProps extends ButtonHTMLAttributes { + selected?: boolean; + variant?: FormatChipVariant; + children: ReactNode; +} + +const base = + "px-2.5 py-1.5 rounded-md text-xs font-medium cursor-pointer transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 disabled:cursor-not-allowed"; + +export function FormatChip({ + selected = false, + variant = "default", + className, + children, + type = "button", + ...props +}: FormatChipProps) { + const selectedClass = + variant === "accent" + ? "bg-primary/10 border border-primary text-primary" + : "bg-primary text-primary-foreground border border-transparent"; + + const idleClass = + variant === "accent" + ? "bg-background text-muted-foreground border border-border/60 hover:bg-accent hover:text-accent-foreground" + : "bg-background text-muted-foreground border border-border/60 hover:bg-accent hover:text-accent-foreground"; + + return ( + + ); +} diff --git a/src/components/workbench/index.ts b/src/components/workbench/index.ts index 65e6a46..c56615e 100644 --- a/src/components/workbench/index.ts +++ b/src/components/workbench/index.ts @@ -4,3 +4,4 @@ export { FileDropzone } from "./FileDropzone"; export { FileQueue } from "./FileQueue"; export type { QueueFile, QueueStatus } from "./FileQueue"; export { BeforeAfterCompare } from "./BeforeAfterCompare"; +export { FormatChip } from "./FormatChip"; diff --git a/src/constants/index.ts b/src/constants/index.ts index b49d190..7c07373 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -12,3 +12,21 @@ export const STORAGE_KEYS = { THEME: "theme", LANGUAGE: "language", } as const; + +/** Common raster formats accepted by Convert / Optimize dropzones. */ +export const ACCEPTED_IMAGE_EXTENSIONS = [ + "png", + "jpg", + "jpeg", + "webp", + "bmp", + "gif", + "tiff", + "tif", +] as const; + +/** Convert also accepts ICO sources. */ +export const ACCEPTED_CONVERT_EXTENSIONS = [ + ...ACCEPTED_IMAGE_EXTENSIONS, + "ico", +] as const; diff --git a/src/pages/Convert.tsx b/src/pages/Convert.tsx index c47c60e..8d376a5 100644 --- a/src/pages/Convert.tsx +++ b/src/pages/Convert.tsx @@ -9,11 +9,13 @@ import { BeforeAfterCompare, FileDropzone, FileQueue, + FormatChip, ToolDock, ToolWorkbench, type QueueFile, } from "@/components/workbench"; import { loadImageEntries, useImageDrop } from "@/composables"; +import { ACCEPTED_CONVERT_EXTENSIONS } from "@/constants"; import { formatBytes } from "@/utils/format"; type TargetFormat = "png" | "jpeg" | "webp" | "ico" | "appicons"; @@ -37,7 +39,6 @@ interface AppIconsResult { } const ICO_SIZES = [16, 32, 48, 64, 128, 256]; -const ACCEPTED_EXTENSIONS = ["png", "jpg", "jpeg", "webp", "bmp", "gif", "tiff", "tif", "ico"]; const FORMATS: { label: string; value: TargetFormat; special?: boolean }[] = [ { label: "PNG", value: "png" }, { label: "JPEG", value: "jpeg" }, @@ -107,7 +108,7 @@ export default function Convert() { }, [files, selectedId]); const { isDragging, dropRef, handleBrowse, handleDragOver, handleDragLeave, handleDrop } = - useImageDrop(ACCEPTED_EXTENSIONS, addPaths); + useImageDrop([...ACCEPTED_CONVERT_EXTENSIONS], addPaths); useEffect(() => { let unlisten: (() => void) | undefined; @@ -239,30 +240,21 @@ export default function Convert() { const formatButtons = (
{FORMATS.filter((format) => !format.special).map((format) => ( - + ))} - +
); diff --git a/src/pages/Optimize.tsx b/src/pages/Optimize.tsx index e1c1e20..0f461e5 100644 --- a/src/pages/Optimize.tsx +++ b/src/pages/Optimize.tsx @@ -8,11 +8,13 @@ import { BeforeAfterCompare, FileDropzone, FileQueue, + FormatChip, ToolDock, ToolWorkbench, type QueueFile, } from "@/components/workbench"; import { loadImageEntries, useImageDrop, type Orientation } from "@/composables"; +import { ACCEPTED_IMAGE_EXTENSIONS } from "@/constants"; import { formatBytes } from "@/utils/format"; type OutputFormat = "png" | "jpeg" | "webp" | "original"; @@ -35,19 +37,12 @@ interface OptimizeResult { error: string | null; } -const ACCEPTED_EXTENSIONS = ["png", "jpg", "jpeg", "webp", "bmp", "gif", "tiff", "tif"]; - const WEB_CEILING_KIB: Record = { landscape: 300, portrait: 220, square: 200, }; -const CHIP = - "py-1.5 px-2.5 rounded-md text-xs font-medium cursor-pointer transition-colors duration-150 focus-visible:outline-2 focus-visible:outline-ring"; -const CHIP_ON = "bg-primary text-primary-foreground"; -const CHIP_OFF = "bg-background text-muted-foreground hover:bg-accent hover:text-accent-foreground border border-border/60"; - function parentFolder(path: string): string { return path.replace(/[\\/][^\\/]+$/, "") || path; } @@ -141,7 +136,7 @@ export default function Optimize() { }, [files, selectedId]); const { isDragging, dropRef, handleBrowse, handleDragOver, handleDragLeave, handleDrop } = - useImageDrop(ACCEPTED_EXTENSIONS, addPaths); + useImageDrop([...ACCEPTED_IMAGE_EXTENSIONS], addPaths); const handleSelectOutputDir = async () => { const dir = await open({ directory: true, multiple: false }); @@ -414,14 +409,13 @@ export default function Optimize() {
{(["webp", "jpeg", "png", "original"] as const).map((format) => ( - + ))}
{useWebProfile && ( @@ -436,20 +430,18 @@ export default function Optimize() { {t("optimize.output.naming")}
- - +
{outputNaming === "suffix" && ( Date: Tue, 3 Nov 2026 09:18:02 +0100 Subject: [PATCH 05/11] feat: bundle FFmpeg as Tauri sidecar Add shell plugin, externalBin wiring, fetch script, and a Rust helper so video tooling can spawn a portable FFmpeg. --- package.json | 3 +- pnpm-lock.yaml | 15 ++++ scripts/fetch-ffmpeg.sh | 110 ++++++++++++++++++++++++++++ src-tauri/.gitignore | 5 ++ src-tauri/Cargo.lock | 96 ++++++++++++++++++++++++ src-tauri/Cargo.toml | 1 + src-tauri/binaries/.gitkeep | 0 src-tauri/binaries/README.md | 19 +++++ src-tauri/capabilities/default.json | 22 +++++- src-tauri/src/ffmpeg.rs | 14 ++++ src-tauri/src/lib.rs | 2 + src-tauri/tauri.conf.json | 5 +- 12 files changed, 289 insertions(+), 3 deletions(-) create mode 100755 scripts/fetch-ffmpeg.sh create mode 100644 src-tauri/binaries/.gitkeep create mode 100644 src-tauri/binaries/README.md create mode 100644 src-tauri/src/ffmpeg.rs diff --git a/package.json b/package.json index 2f2e6b8..ce173cc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pictoolsapp", "private": true, - "version": "0.4.3", + "version": "0.4.4", "type": "module", "scripts": { "dev": "vite", @@ -19,6 +19,7 @@ "@tauri-apps/plugin-notification": "^2.3.3", "@tauri-apps/plugin-opener": "^2.5.3", "@tauri-apps/plugin-process": "^2.3.1", + "@tauri-apps/plugin-shell": "^2.6.0", "@tauri-apps/plugin-updater": "^2.10.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9013e52..2693e96 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,6 +32,9 @@ importers: '@tauri-apps/plugin-process': specifier: ^2.3.1 version: 2.3.1 + '@tauri-apps/plugin-shell': + specifier: ^2.6.0 + version: 2.6.0 '@tauri-apps/plugin-updater': specifier: ^2.10.0 version: 2.10.0 @@ -832,6 +835,9 @@ packages: '@tauri-apps/api@2.10.1': resolution: {integrity: sha512-hKL/jWf293UDSUN09rR69hrToyIXBb8CjGaWC7gfinvnQrBVvnLr08FeFi38gxtugAVyVcTa5/FD/Xnkb1siBw==} + '@tauri-apps/api@2.12.4': + resolution: {integrity: sha512-pVmfis+4zT8H0Qhp3xPZx9Ju7kpzvA6rr/PSJPyuwfvucTQ8sVt61NYU9KMkK703UFlYadFmjKA4HhybOtN0gg==} + '@tauri-apps/cli-darwin-arm64@2.10.0': resolution: {integrity: sha512-avqHD4HRjrMamE/7R/kzJPcAJnZs0IIS+1nkDP5b+TNBn3py7N2aIo9LIpy+VQq0AkN8G5dDpZtOOBkmWt/zjA==} engines: {node: '>= 10'} @@ -920,6 +926,9 @@ packages: '@tauri-apps/plugin-process@2.3.1': resolution: {integrity: sha512-nCa4fGVaDL/B9ai03VyPOjfAHRHSBz5v6F/ObsB73r/dA3MHHhZtldaDMIc0V/pnUw9ehzr2iEG+XkSEyC0JJA==} + '@tauri-apps/plugin-shell@2.6.0': + resolution: {integrity: sha512-z9LZGSr8jfD0FWWJ+CdD99i2FQcmJ26ebNJlYJdrlFdMLcggUS29BYrfS4hJlXO1UAI6A6r084vJUAG5734Y6w==} + '@tauri-apps/plugin-updater@2.10.0': resolution: {integrity: sha512-ljN8jPlnT0aSn8ecYhuBib84alxfMx6Hc8vJSKMJyzGbTPFZAC44T2I1QNFZssgWKrAlofvJqCC6Rr472JWfkQ==} @@ -1923,6 +1932,8 @@ snapshots: '@tauri-apps/api@2.10.1': {} + '@tauri-apps/api@2.12.4': {} + '@tauri-apps/cli-darwin-arm64@2.10.0': optional: true @@ -1986,6 +1997,10 @@ snapshots: dependencies: '@tauri-apps/api': 2.10.1 + '@tauri-apps/plugin-shell@2.6.0': + dependencies: + '@tauri-apps/api': 2.12.4 + '@tauri-apps/plugin-updater@2.10.0': dependencies: '@tauri-apps/api': 2.10.1 diff --git a/scripts/fetch-ffmpeg.sh b/scripts/fetch-ffmpeg.sh new file mode 100755 index 0000000..d2d3e0f --- /dev/null +++ b/scripts/fetch-ffmpeg.sh @@ -0,0 +1,110 @@ +#!/usr/bin/env bash +# Download FFmpeg builds into src-tauri/binaries/ with Tauri sidecar naming. +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +BIN_DIR="$ROOT/src-tauri/binaries" +# Static macOS/Windows builds from eugeneware/ffmpeg-static (b6.0) +FFMPEG_STATIC_TAG="b6.0" +mkdir -p "$BIN_DIR" + +host_triple() { + rustc -vV | sed -n 's/^host: //p' +} + +download_gzip_binary() { + local url="$1" + local dest="$2" + local tmp + tmp="$(mktemp)" + curl -fsSL "$url" -o "$tmp" + gzip -dc "$tmp" > "$dest" + chmod 755 "$dest" + rm -f "$tmp" +} + +download_macos() { + local triple="$1" + local arch url + case "$triple" in + aarch64-apple-darwin) arch="darwin-arm64" ;; + x86_64-apple-darwin) arch="darwin-x64" ;; + *) + echo "Unsupported macOS triple: $triple" >&2 + return 1 + ;; + esac + url="https://github.com/eugeneware/ffmpeg-static/releases/download/${FFMPEG_STATIC_TAG}/ffmpeg-${arch}.gz" + echo "→ macOS FFmpeg for ${triple}" + download_gzip_binary "$url" "$BIN_DIR/ffmpeg-${triple}" + echo " ✓ $BIN_DIR/ffmpeg-${triple}" +} + +download_windows() { + local triple="x86_64-pc-windows-msvc" + local url="https://github.com/eugeneware/ffmpeg-static/releases/download/${FFMPEG_STATIC_TAG}/ffmpeg-win32-x64.gz" + echo "→ Windows FFmpeg for ${triple}" + download_gzip_binary "$url" "$BIN_DIR/ffmpeg-${triple}.exe" + echo " ✓ $BIN_DIR/ffmpeg-${triple}.exe" +} + +download_linux() { + local triple="$1" + local zip_name + case "$triple" in + x86_64-unknown-linux-gnu) zip_name="ffmpeg-n7.1-latest-linux64-gpl-7.1.tar.xz" ;; + aarch64-unknown-linux-gnu) zip_name="ffmpeg-n7.1-latest-linuxarm64-gpl-7.1.tar.xz" ;; + *) + echo "Unsupported Linux triple: $triple" >&2 + return 1 + ;; + esac + local tmp + tmp="$(mktemp -d)" + echo "→ Linux FFmpeg for ${triple}" + curl -fsSL "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/${zip_name}" -o "$tmp/ffmpeg.tar.xz" + tar -xJf "$tmp/ffmpeg.tar.xz" -C "$tmp" + local bin + bin="$(find "$tmp" -type f -path '*/bin/ffmpeg' | head -n 1)" + if [[ -z "$bin" ]]; then + echo " ✗ ffmpeg not found in archive" >&2 + exit 1 + fi + install -m 755 "$bin" "$BIN_DIR/ffmpeg-${triple}" + rm -rf "$tmp" + echo " ✓ $BIN_DIR/ffmpeg-${triple}" +} + +fetch_one() { + local triple="$1" + case "$triple" in + aarch64-apple-darwin|x86_64-apple-darwin) + download_macos "$triple" + ;; + x86_64-pc-windows-msvc) + download_windows + ;; + x86_64-unknown-linux-gnu|aarch64-unknown-linux-gnu) + download_linux "$triple" + ;; + *) + echo "No fetch recipe for triple: $triple" >&2 + return 1 + ;; + esac +} + +main() { + if [[ "${1:-}" == "--all" ]]; then + fetch_one aarch64-apple-darwin + fetch_one x86_64-apple-darwin + fetch_one x86_64-pc-windows-msvc + fetch_one x86_64-unknown-linux-gnu + fetch_one aarch64-unknown-linux-gnu + else + fetch_one "$(host_triple)" + fi + echo "Done." +} + +main "$@" diff --git a/src-tauri/.gitignore b/src-tauri/.gitignore index b21bd68..61efd4f 100644 --- a/src-tauri/.gitignore +++ b/src-tauri/.gitignore @@ -5,3 +5,8 @@ # Generated by Tauri # will have schema files for capabilities auto-completion /gen/schemas + +# FFmpeg sidecars (fetched via scripts/fetch-ffmpeg.sh) +/binaries/ffmpeg-* +!/binaries/.gitkeep +!/binaries/README.md diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 989fc5f..90f75ab 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -662,6 +662,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + [[package]] name = "cpufeatures" version = "0.2.17" @@ -991,6 +997,20 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" +[[package]] +name = "encoding_rs" +version = "0.8.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5" +dependencies = [ + "cfg-if", + "core_detect", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + [[package]] name = "endi" version = "1.1.1" @@ -2456,6 +2476,12 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + [[package]] name = "ndk" version = "0.9.0" @@ -2869,6 +2895,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "os_pipe" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "osakit" version = "0.3.1" @@ -3110,6 +3146,7 @@ dependencies = [ "tauri-plugin-notification", "tauri-plugin-opener", "tauri-plugin-process", + "tauri-plugin-shell", "tauri-plugin-updater", "tokio", "webp", @@ -4126,12 +4163,44 @@ dependencies = [ "digest", ] +[[package]] +name = "shared_child" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "607549934f6cc26b89cfecfdc46fa90f1e5d1536a68349b0c3a4f9d1c0d37959" +dependencies = [ + "libc", + "sigchld", + "windows-sys 0.61.2", +] + [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "sigchld" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24f2b37f04360cd465089b87a9c3869c08220a2f3458463f0adf8badf5e77f2c" +dependencies = [ + "libc", + "os_pipe", + "signal-hook", +] + +[[package]] +name = "signal-hook" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f7447afd772ca79ad17ae0a3972a6b0df0cb4b80990fd82707593e9e012a74" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" version = "1.4.8" @@ -4157,6 +4226,12 @@ dependencies = [ "quote", ] +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "siphasher" version = "0.3.11" @@ -4639,6 +4714,27 @@ dependencies = [ "tauri-plugin", ] +[[package]] +name = "tauri-plugin-shell" +version = "2.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8548af174c5516e4f71f142acea4d02e00316296ea9aafa58798851481003e3c" +dependencies = [ + "encoding_rs", + "log", + "open", + "os_pipe", + "regex", + "schemars 0.8.22", + "serde", + "serde_json", + "shared_child", + "tauri", + "tauri-plugin", + "thiserror 2.0.18", + "tokio", +] + [[package]] name = "tauri-plugin-updater" version = "2.10.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index e6952c2..70876eb 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -26,6 +26,7 @@ serde_json = "1" tauri-plugin-updater = "2.10.0" tauri-plugin-process = "2.3.1" tauri-plugin-dialog = "2" +tauri-plugin-shell = "2" image = { version = "0.25", features = ["png", "jpeg", "webp"] } webp = "0.3" ico = "0.3" diff --git a/src-tauri/binaries/.gitkeep b/src-tauri/binaries/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src-tauri/binaries/README.md b/src-tauri/binaries/README.md new file mode 100644 index 0000000..d8240db --- /dev/null +++ b/src-tauri/binaries/README.md @@ -0,0 +1,19 @@ +# FFmpeg sidecars + +Tauri expects one binary per Rust target triple next to this README: + +- `ffmpeg-aarch64-apple-darwin` +- `ffmpeg-x86_64-apple-darwin` +- `ffmpeg-x86_64-pc-windows-msvc.exe` +- `ffmpeg-x86_64-unknown-linux-gnu` +- `ffmpeg-aarch64-unknown-linux-gnu` + +Fetch the host binary: + +```bash +./scripts/fetch-ffmpeg.sh +``` + +Pass `--all` to attempt downloads for every supported target (CI / release machines). + +Binaries are gitignored — they are GPL-licensed and large. Ship them only via the fetch script or your release pipeline. diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 896b60e..0b114c4 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -26,6 +26,26 @@ "dialog:allow-open", "core:window:allow-start-dragging", "core:path:default", - "core:event:default" + "core:event:default", + { + "identifier": "shell:allow-execute", + "allow": [ + { + "name": "binaries/ffmpeg", + "sidecar": true, + "args": true + } + ] + }, + { + "identifier": "shell:allow-spawn", + "allow": [ + { + "name": "binaries/ffmpeg", + "sidecar": true, + "args": true + } + ] + } ] } diff --git a/src-tauri/src/ffmpeg.rs b/src-tauri/src/ffmpeg.rs new file mode 100644 index 0000000..b719fb9 --- /dev/null +++ b/src-tauri/src/ffmpeg.rs @@ -0,0 +1,14 @@ +//! FFmpeg sidecar helpers. Binary is configured as `bundle.externalBin: ["binaries/ffmpeg"]`. + +use tauri::AppHandle; +use tauri_plugin_shell::process::Command; +use tauri_plugin_shell::ShellExt; + +/// Filename passed to `shell().sidecar(...)` (not the `binaries/` prefix). +pub const FFMPEG_SIDECAR_NAME: &str = "ffmpeg"; + +pub fn ffmpeg_command(app: &AppHandle) -> Result { + app.shell() + .sidecar(FFMPEG_SIDECAR_NAME) + .map_err(|err| format!("FFmpeg sidecar unavailable: {err}")) +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index bd4c780..d5d64cf 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1,4 +1,5 @@ mod commands; +mod ffmpeg; use commands::*; @@ -10,6 +11,7 @@ pub fn run() { .plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_notification::init()) .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_shell::init()) .invoke_handler(tauri::generate_handler![ greet, get_system_info, diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index efa67c8..89ceeea 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PictoolsApp", - "version": "0.4.3", + "version": "0.4.4", "identifier": "com.onivoid.pictoolsapp", "build": { "beforeDevCommand": "pnpm dev", @@ -35,6 +35,9 @@ "active": true, "targets": "all", "createUpdaterArtifacts": true, + "externalBin": [ + "binaries/ffmpeg" + ], "icon": [ "icons/32x32.png", "icons/128x128.png", From a0ee1fb0b3cbeb9c7c5111e72469b979e6173dcd Mon Sep 17 00:00:00 2001 From: Onivoid Date: Tue, 3 Nov 2026 09:19:22 +0100 Subject: [PATCH 06/11] feat: add video process Tauri commands Probe metadata and compress/convert videos through the bundled FFmpeg sidecar with progress events. --- package.json | 2 +- src-tauri/src/commands/mod.rs | 2 + src-tauri/src/commands/video.rs | 558 ++++++++++++++++++++++++++++++++ src-tauri/src/lib.rs | 4 +- src-tauri/tauri.conf.json | 2 +- 5 files changed, 565 insertions(+), 3 deletions(-) create mode 100644 src-tauri/src/commands/video.rs diff --git a/package.json b/package.json index ce173cc..b9a2568 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pictoolsapp", "private": true, - "version": "0.4.4", + "version": "0.4.5", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/src/commands/mod.rs b/src-tauri/src/commands/mod.rs index 383f4a2..d3cca15 100644 --- a/src-tauri/src/commands/mod.rs +++ b/src-tauri/src/commands/mod.rs @@ -3,8 +3,10 @@ pub mod convert; pub mod encode; pub mod optimize; pub mod system; +pub mod video; pub use app_icons::*; pub use convert::*; pub use optimize::*; pub use system::*; +pub use video::*; diff --git a/src-tauri/src/commands/video.rs b/src-tauri/src/commands/video.rs new file mode 100644 index 0000000..33f8bd8 --- /dev/null +++ b/src-tauri/src/commands/video.rs @@ -0,0 +1,558 @@ +use crate::ffmpeg::ffmpeg_command; +use serde::{Deserialize, Serialize}; +use std::path::{Path, PathBuf}; +use tauri::{AppHandle, Emitter}; +use tauri_plugin_shell::process::CommandEvent; + +const DEFAULT_SUFFIX: &str = "_compressed"; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct VideoOptions { + pub preset: String, + pub output_format: String, + pub output_naming: String, + pub custom_suffix: String, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct VideoMetadata { + pub path: String, + pub size: u64, + pub format: String, + pub width: Option, + pub height: Option, + pub duration_secs: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct VideoResult { + pub input: String, + pub output: Option, + pub original_size: u64, + pub output_size: u64, + pub error: Option, +} + +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +struct VideoProgress { + index: usize, + total: usize, + file: String, + percent: Option, +} + +struct PresetProfile { + crf_h264: u8, + crf_vp9: u8, + max_width: Option, +} + +fn preset_profile(preset: &str) -> PresetProfile { + match preset.to_lowercase().as_str() { + "light" => PresetProfile { + crf_h264: 32, + crf_vp9: 36, + max_width: Some(1280), + }, + "quality" => PresetProfile { + crf_h264: 23, + crf_vp9: 28, + max_width: None, + }, + _ => PresetProfile { + crf_h264: 28, + crf_vp9: 32, + max_width: Some(1920), + }, + } +} + +fn normalize_format(format: &str) -> Result<&'static str, String> { + match format.to_lowercase().as_str() { + "mp4" => Ok("mp4"), + "webm" => Ok("webm"), + "mov" => Ok("mov"), + "mkv" => Ok("mkv"), + other => Err(format!("Unsupported output format: {other}")), + } +} + +fn extension_of(path: &Path) -> String { + path.extension() + .and_then(|ext| ext.to_str()) + .unwrap_or("") + .to_lowercase() +} + +fn stem_of(path: &Path) -> String { + path.file_stem() + .and_then(|s| s.to_str()) + .unwrap_or("video") + .to_string() +} + +fn parent_folder(path: &Path) -> PathBuf { + path.parent() + .map(Path::to_path_buf) + .unwrap_or_else(|| PathBuf::from(".")) +} + +fn resolve_output_path( + input: &Path, + output_dir: &str, + format: &str, + naming: &str, + custom_suffix: &str, +) -> PathBuf { + let dir = if output_dir.trim().is_empty() { + parent_folder(input) + } else { + PathBuf::from(output_dir) + }; + + let stem = stem_of(input); + let suffix = if naming == "replace" { + String::new() + } else if custom_suffix.trim().is_empty() { + DEFAULT_SUFFIX.to_string() + } else { + custom_suffix.trim().to_string() + }; + + let mut candidate = dir.join(format!("{stem}{suffix}.{format}")); + if candidate == input { + candidate = dir.join(format!("{stem}{DEFAULT_SUFFIX}.{format}")); + } + candidate +} + +fn parse_duration_secs(stderr: &str) -> Option { + // Duration: 00:01:23.45 + let marker = "Duration: "; + let start = stderr.find(marker)? + marker.len(); + let slice = stderr.get(start..start + 11)?; + let parts: Vec<&str> = slice.split(':').collect(); + if parts.len() != 3 { + return None; + } + let hours: f64 = parts[0].trim().parse().ok()?; + let minutes: f64 = parts[1].trim().parse().ok()?; + let seconds: f64 = parts[2].trim().parse().ok()?; + Some(hours * 3600.0 + minutes * 60.0 + seconds) +} + +fn parse_video_dimensions(stderr: &str) -> (Option, Option) { + // Look for patterns like 1920x1080 in a Video: stream line + for line in stderr.lines() { + if !line.contains("Video:") { + continue; + } + let bytes = line.as_bytes(); + let mut i = 0; + while i + 3 < bytes.len() { + if bytes[i].is_ascii_digit() { + let mut j = i; + while j < bytes.len() && bytes[j].is_ascii_digit() { + j += 1; + } + if j < bytes.len() && bytes[j] == b'x' { + let mut k = j + 1; + while k < bytes.len() && bytes[k].is_ascii_digit() { + k += 1; + } + if k > j + 1 { + if let (Ok(w), Ok(h)) = ( + line[i..j].parse::(), + line[j + 1..k].parse::(), + ) { + if w >= 16 && h >= 16 && w <= 7680 && h <= 4320 { + return (Some(w), Some(h)); + } + } + } + } + i = j; + } else { + i += 1; + } + } + } + (None, None) +} + +fn parse_out_time_secs(line: &str) -> Option { + // progress pipe: out_time_ms=1234567 OR out_time=00:00:01.234456 + if let Some(rest) = line.strip_prefix("out_time_ms=") { + let ms: f64 = rest.trim().parse().ok()?; + return Some(ms / 1_000_000.0); + } + if let Some(rest) = line.strip_prefix("out_time=") { + let value = rest.trim(); + if value == "N/A" { + return None; + } + let parts: Vec<&str> = value.split(':').collect(); + if parts.len() != 3 { + return None; + } + let hours: f64 = parts[0].parse().ok()?; + let minutes: f64 = parts[1].parse().ok()?; + let seconds: f64 = parts[2].parse().ok()?; + return Some(hours * 3600.0 + minutes * 60.0 + seconds); + } + None +} + +async fn run_ffmpeg_capture( + app: &AppHandle, + args: Vec, +) -> Result<(i32, String, String), String> { + let cmd = ffmpeg_command(app)?.args(args); + let (mut rx, _child) = cmd.spawn().map_err(|err| format!("Failed to spawn FFmpeg: {err}"))?; + + let mut stdout = String::new(); + let mut stderr = String::new(); + let mut code = 1; + + while let Some(event) = rx.recv().await { + match event { + CommandEvent::Stdout(line) => { + stdout.push_str(&String::from_utf8_lossy(&line)); + stdout.push('\n'); + } + CommandEvent::Stderr(line) => { + stderr.push_str(&String::from_utf8_lossy(&line)); + stderr.push('\n'); + } + CommandEvent::Terminated(payload) => { + code = payload.code.unwrap_or(1); + } + CommandEvent::Error(message) => { + return Err(format!("FFmpeg process error: {message}")); + } + _ => {} + } + } + + Ok((code, stdout, stderr)) +} + +async fn probe_video(app: &AppHandle, path: &str) -> Result { + let size = std::fs::metadata(path) + .map(|meta| meta.len()) + .unwrap_or(0); + let format = extension_of(Path::new(path)); + + let args = vec![ + "-hide_banner".into(), + "-i".into(), + path.to_string(), + ]; + let (_code, _stdout, stderr) = run_ffmpeg_capture(app, args).await?; + let (width, height) = parse_video_dimensions(&stderr); + let duration_secs = parse_duration_secs(&stderr); + + Ok(VideoMetadata { + path: path.to_string(), + size, + format, + width, + height, + duration_secs, + }) +} + +fn build_encode_args( + input: &str, + output: &str, + format: &str, + preset: &str, +) -> Vec { + let profile = preset_profile(preset); + let mut args = vec![ + "-y".into(), + "-hide_banner".into(), + "-i".into(), + input.to_string(), + ]; + + if let Some(max_width) = profile.max_width { + args.extend([ + "-vf".into(), + format!("scale='min({max_width},iw)':-2"), + ]); + } + + match format { + "webm" => { + args.extend([ + "-c:v".into(), + "libvpx-vp9".into(), + "-b:v".into(), + "0".into(), + "-crf".into(), + profile.crf_vp9.to_string(), + "-c:a".into(), + "libopus".into(), + "-b:a".into(), + "96k".into(), + ]); + } + _ => { + args.extend([ + "-c:v".into(), + "libx264".into(), + "-preset".into(), + "medium".into(), + "-crf".into(), + profile.crf_h264.to_string(), + "-c:a".into(), + "aac".into(), + "-b:a".into(), + "128k".into(), + ]); + if format == "mp4" || format == "mov" { + args.extend(["-movflags".into(), "+faststart".into()]); + } + } + } + + args.extend([ + "-progress".into(), + "pipe:1".into(), + "-nostats".into(), + output.to_string(), + ]); + args +} + +async fn encode_one( + app: &AppHandle, + input: &str, + options: &VideoOptions, + output_dir: &str, + index: usize, + total: usize, + duration_hint: Option, +) -> VideoResult { + let original_size = std::fs::metadata(input).map(|m| m.len()).unwrap_or(0); + let format = match normalize_format(&options.output_format) { + Ok(fmt) => fmt, + Err(error) => { + return VideoResult { + input: input.to_string(), + output: None, + original_size, + output_size: 0, + error: Some(error), + }; + } + }; + + let output_path = resolve_output_path( + Path::new(input), + output_dir, + format, + &options.output_naming, + &options.custom_suffix, + ); + + if let Some(parent) = output_path.parent() { + if let Err(error) = std::fs::create_dir_all(parent) { + return VideoResult { + input: input.to_string(), + output: None, + original_size, + output_size: 0, + error: Some(format!("Cannot create output folder: {error}")), + }; + } + } + + let output_str = output_path.to_string_lossy().to_string(); + let file_label = Path::new(input) + .file_name() + .and_then(|n| n.to_str()) + .unwrap_or(input) + .to_string(); + + let _ = app.emit( + "video:progress", + VideoProgress { + index, + total, + file: file_label.clone(), + percent: Some(0), + }, + ); + + let args = build_encode_args(input, &output_str, format, &options.preset); + let cmd = match ffmpeg_command(app) { + Ok(cmd) => cmd.args(args), + Err(error) => { + return VideoResult { + input: input.to_string(), + output: None, + original_size, + output_size: 0, + error: Some(error), + }; + } + }; + + let (mut rx, _child) = match cmd.spawn() { + Ok(pair) => pair, + Err(error) => { + return VideoResult { + input: input.to_string(), + output: None, + original_size, + output_size: 0, + error: Some(format!("Failed to spawn FFmpeg: {error}")), + }; + } + }; + + let mut stderr = String::new(); + let mut code = 1; + let mut last_percent: Option = Some(0); + + while let Some(event) = rx.recv().await { + match event { + CommandEvent::Stdout(line) => { + let text = String::from_utf8_lossy(&line); + for part in text.split(|c| c == '\n' || c == '\r') { + if let Some(secs) = parse_out_time_secs(part) { + if let Some(duration) = duration_hint.filter(|d| *d > 0.0) { + let percent = ((secs / duration) * 100.0).clamp(0.0, 99.0) as u32; + if last_percent != Some(percent) { + last_percent = Some(percent); + let _ = app.emit( + "video:progress", + VideoProgress { + index, + total, + file: file_label.clone(), + percent: Some(percent), + }, + ); + } + } + } + } + } + CommandEvent::Stderr(line) => { + stderr.push_str(&String::from_utf8_lossy(&line)); + stderr.push('\n'); + } + CommandEvent::Terminated(payload) => { + code = payload.code.unwrap_or(1); + } + CommandEvent::Error(message) => { + return VideoResult { + input: input.to_string(), + output: None, + original_size, + output_size: 0, + error: Some(format!("FFmpeg process error: {message}")), + }; + } + _ => {} + } + } + + if code != 0 { + let detail = stderr + .lines() + .rev() + .find(|line| !line.trim().is_empty()) + .unwrap_or("FFmpeg failed") + .to_string(); + return VideoResult { + input: input.to_string(), + output: None, + original_size, + output_size: 0, + error: Some(detail), + }; + } + + let output_size = std::fs::metadata(&output_path).map(|m| m.len()).unwrap_or(0); + let _ = app.emit( + "video:progress", + VideoProgress { + index, + total, + file: file_label, + percent: Some(100), + }, + ); + + VideoResult { + input: input.to_string(), + output: Some(output_str), + original_size, + output_size, + error: None, + } +} + +#[tauri::command] +pub async fn get_videos_metadata( + app: AppHandle, + file_paths: Vec, +) -> Result, String> { + let mut results = Vec::with_capacity(file_paths.len()); + for path in file_paths { + match probe_video(&app, &path).await { + Ok(meta) => results.push(meta), + Err(_) => results.push(VideoMetadata { + path: path.clone(), + size: std::fs::metadata(&path).map(|m| m.len()).unwrap_or(0), + format: extension_of(Path::new(&path)), + width: None, + height: None, + duration_secs: None, + }), + } + } + Ok(results) +} + +#[tauri::command] +pub async fn process_videos( + app: AppHandle, + files: Vec, + options: VideoOptions, + output_dir: String, +) -> Result, String> { + normalize_format(&options.output_format)?; + + let total = files.len(); + let mut results = Vec::with_capacity(total); + + for (index, input) in files.into_iter().enumerate() { + let duration_hint = probe_video(&app, &input) + .await + .ok() + .and_then(|meta| meta.duration_secs); + + let result = encode_one( + &app, + &input, + &options, + &output_dir, + index, + total, + duration_hint, + ) + .await; + results.push(result); + } + + Ok(results) +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index d5d64cf..7656334 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -18,7 +18,9 @@ pub fn run() { convert_images, generate_app_icons, optimize_images, - get_images_metadata + get_images_metadata, + get_videos_metadata, + process_videos ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 89ceeea..2cde72e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PictoolsApp", - "version": "0.4.4", + "version": "0.4.5", "identifier": "com.onivoid.pictoolsapp", "build": { "beforeDevCommand": "pnpm dev", From b1c08a2287b375c179ac468294630856575ddfb4 Mon Sep 17 00:00:00 2001 From: Onivoid Date: Tue, 3 Nov 2026 09:20:46 +0100 Subject: [PATCH 07/11] feat: add video compress/convert tool UI Wire a stage+filmstrip Video page with presets, format chips, and FFmpeg-backed progress. --- package.json | 2 +- src-tauri/tauri.conf.json | 2 +- src/components/Sidebar.tsx | 8 +- src/components/workbench/FileQueue.tsx | 29 +- src/composables/index.ts | 2 + src/composables/useVideoDrop.ts | 122 +++++++ src/constants/index.ts | 13 + src/i18n/locales/en.json | 45 +++ src/i18n/locales/fr.json | 45 +++ src/pages/Video.tsx | 437 +++++++++++++++++++++++++ src/router/index.tsx | 5 + 11 files changed, 700 insertions(+), 10 deletions(-) create mode 100644 src/composables/useVideoDrop.ts create mode 100644 src/pages/Video.tsx diff --git a/package.json b/package.json index b9a2568..c1a8c29 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pictoolsapp", "private": true, - "version": "0.4.5", + "version": "0.4.6", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2cde72e..034b5bc 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PictoolsApp", - "version": "0.4.5", + "version": "0.4.6", "identifier": "com.onivoid.pictoolsapp", "build": { "beforeDevCommand": "pnpm dev", diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 536aab3..a35b671 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import { House, ImageIcon, Sparkles, Settings, PanelLeftClose, PanelLeftOpen } from "lucide-react"; +import { House, ImageIcon, Sparkles, Clapperboard, Settings, PanelLeftClose, PanelLeftOpen } from "lucide-react"; import { ROUTES } from "@/constants"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; import { motion, AnimatePresence } from "framer-motion"; @@ -104,6 +104,12 @@ export default function Sidebar() { route: ROUTES.OPTIMIZE, available: true, }, + { + icon: , + label: t("video.title"), + route: ROUTES.VIDEO, + available: true, + }, ]; const collapseBtn = ( diff --git a/src/components/workbench/FileQueue.tsx b/src/components/workbench/FileQueue.tsx index 01cc22c..e2d6f11 100644 --- a/src/components/workbench/FileQueue.tsx +++ b/src/components/workbench/FileQueue.tsx @@ -1,5 +1,5 @@ import { convertFileSrc } from "@tauri-apps/api/core"; -import { AlertCircle, CheckCircle2, Loader2, Plus, X } from "lucide-react"; +import { AlertCircle, CheckCircle2, Film, Loader2, Plus, X } from "lucide-react"; import { formatBytes } from "@/utils/format"; export type QueueStatus = "pending" | "processing" | "done" | "error"; @@ -23,6 +23,7 @@ interface FileQueueProps { disabled?: boolean; onAdd?: () => void; addLabel?: string; + media?: "image" | "video"; } export function FileQueue({ @@ -33,6 +34,7 @@ export function FileQueue({ disabled = false, onAdd, addLabel, + media = "image", }: FileQueueProps) { if (files.length === 0) return null; @@ -60,12 +62,25 @@ export function FileQueue({ }`} >
- + {media === "video" ? ( + <> +