Files
searchi/tools/desktop-capture/README.md
T

69 lines
3.9 KiB
Markdown
Raw Normal View History

# Real-engine desktop screenshots
This independent software-test runner launches its own bundled headless Chromium
with CPU rendering/video-decode flags. It does not control the user's Chrome,
reuse personal profiles, or use Windows UI Automation. Screenshots render the
production frontend against the actual shared Rust/Google EmbeddingGemma 2 engine;
responses are neither replayed nor supplied by page evaluation.
Playwright 1.64.0 is pinned in the package lock. See the official
[browser installation](https://playwright.dev/docs/browsers) and
[screenshot API](https://playwright.dev/docs/screenshots). The browser binaries
stay under this tool's ignored node_modules directory.
## Prepare
Build the production frontend from apps/desktop with `npm ci && npm run build`.
Build/stage the CPU Google worker and verified media helpers as documented in
[BUILDING](../../docs/BUILDING.md). Provision the actual Google models first.
The backend uses a dedicated generated/verified fixture corpus, never a user
home/document directory. It indexes documents and two licensed real photos,
then warms its retained CPU worker before listening on 127.0.0.1:1431.
```powershell
$env:SEARCHI_FORCE_CPU = '1'
$env:SEARCHI_EXTRACT_WORKER = (Resolve-Path target/release/searchi-extract-worker.exe).Path
cargo run --manifest-path tools/desktop-capture/backend/Cargo.toml -- --root .searchi/readme-capture/files --db .searchi/readme-capture/index.sqlite --models .searchi/models/embeddinggemma2 --worker .searchi/runtime/cpu/Release/searchi-gemma-worker.exe --dist apps/desktop/dist --ffmpeg .searchi/media-runtime/bin/ffmpeg.exe --ffprobe .searchi/media-runtime/bin/ffprobe.exe
```
Keep that owned test process running while capturing. Its loopback API is a
fixture-only test adapter with origin/token checks, not a product HTTP server.
The production Tauri app keeps its native command/asset-protocol interface.
In another terminal, from the repository root:
```powershell
npm ci --prefix tools/desktop-capture
$env:PLAYWRIGHT_BROWSERS_PATH = '0'
npm run --prefix tools/desktop-capture install-browser
npm run --prefix tools/desktop-capture capture
```
The runner always uses the local browser cache and its own temporary profile.
CPU flags are `--disable-gpu --disable-accelerated-video-decode --disable-webgl`.
Only loopback fixture origin requests are permitted during capture. It waits for
actual backend readiness, measured hybrid responses, matching DOM results,
loaded fonts, image pixels, and genuine worker inference counters in debug mode.
## Artifacts and limits
Outputs under docs/screenshots are launcher-empty.png, search-light.png, search-dark.png,
media-search.png, related-suggestions.png and performance-details.png, plus capture-manifest.json. The
manifest contains actual fixture queries, counts/selection, measured response
metrics, device/model, viewport, PNG SHA256, runner/browser versions, Git base
commit and dirty-state flag. The base commit does not identify uncommitted
source exactly. It also records the actual frontend package version and built
index SHA-256. The compact empty-bar capture has no manufactured results and
uses the genuine ready backend. The ephemeral API token is never saved in the manifest.
The 0.1.9 capture also records exact hashes of the shared service, relevance
policy, frontend and capture sources. It checks that related suggestions start
collapsed and are skipped by result keyboard navigation, remain accessible when
expanded, and restore a visible primary selection when collapsed. The extra
related-suggestions image shows actual expanded neighbors, not invented results.
Captures are **browser-rendered production UI with the actual CPU engine**.
They omit native window chrome. They do not establish native WebView visual QA,
OS integration, playback codec parity, production relevance, GPU behavior or
other operating-system releases. The runner closes only its browser; stop only
the separately launched owned backend when finished.