Takazudo Modular Docs

Type to search...

to open search from anywhere

/sub-packages/wip-assets-viewer/CLAUDE.md

CLAUDE.md at /sub-packages/wip-assets-viewer/CLAUDE.md

Path: sub-packages/wip-assets-viewer/CLAUDE.md

wip-assets-viewer

Tauri v2 viewer app for browsing WIP asset files (SVG diagrams, etc.) from a user-configurable directory. Part of the Synth Diagram System.

Cloned and stripped from image-stash-viewer. See sub-packages/TAURI-WRAPPERS.md for the common Tauri wrapper architecture pattern.

Quick Start

pnpm tauri:dev          # launch the Tauri desktop app (from package root)
pnpm dev:mock           # frontend-only dev with mock data (no Tauri window)

Port

Dev server: 14153 Mock dev server: 14154

Architecture

  • src-tauri/ — Rust backend (Tauri v2 app)
    • src/commands/files.rs — Directory listing, file watching, base64 asset read
    • src/commands/settings.rs — Watched-dir persistence via JSON config file
    • src/state.rs — App state (file watcher)
  • frontend/ — Loading page shown while Vite dev server starts
  • src/ — React + Vite frontend

Key Files

  • src-tauri/Cargo.toml — Rust dependencies (notify, serde, chrono, base64, tauri-plugin-clipboard-manager, tauri-plugin-dialog)
  • src-tauri/tauri.conf.json — Tauri configuration (port 14153, identifier com.takazudo.wip-assets-viewer)
  • src-tauri/src/lib.rs — Command registration
  • package.json — Frontend + Tauri scripts
  • src/components/header.tsx — Watched-dir display + “Change folder…” button
  • src/components/asset-card.tsx — Image preview + copy-path button
  • src/hooks/use-settings.ts — Watched-dir state backed by Rust settings commands

Settings Persistence

The watched directory is stored at ~/.config/wip-assets-viewer/settings.json (via dirs::config_dir()). On first launch with no settings file, defaults to static/images/synth-svg/spike/ if it exists, else static/images/synth-svg/.

Image Rendering

SVG and raster (PNG, JPG, GIF, WebP) files render as <img> tags using a data:<mime>;base64,... URL returned by the read_asset_as_data_url Rust command. HEIC is not supported.

What Was Stripped vs image-stash-viewer

  • No HEIC support
  • No thumbnail generation or caching
  • No delete button / file deletion
  • No image preview panel (cards show inline previews instead)
  • No images.rs commands module