Commit Graph

12 Commits

Author SHA1 Message Date
Maximilian Roos 340a83f6d0 fix: fail fast when ffmpeg lacks libass for demo GIF builds (#1237)
## Summary

- Add early `check_ffmpeg_libass()` at demo build startup — exits with
install
instructions when ffmpeg lacks libass (required for keystroke overlay
ASS
  subtitles)
- Add output verification in `record_vhs()` — catches silent failures
where VHS
  exits 0 but produces no GIF
- Document the Homebrew API-bottle vs tap-formula issue in demos
CLAUDE.md

Homebrew's API-sourced formula strips `libass`; the tap formula includes
it.
The fix is `HOMEBREW_NO_INSTALL_FROM_API=1 brew install
--build-from-source ffmpeg`.

## Test plan

- [x] Verified `check_ffmpeg_libass()` passes with correct ffmpeg
- [x] Verified full demo build succeeds with `--only wt-switch-picker`
- [x] Lints pass (`pre-commit run --all-files`)

> _This was written by Claude Code on behalf of @max-sixty_

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-28 20:11:49 -08:00
Maximilian Roos 47ec8838d4 feat(demos): add snapshot mode for regression testing (#871)
Add `--snapshot` flag to the demo build script that extracts wt/git
commands from VHS tapes and captures their output for regression testing.

This catches unexpected changes like new hints or warnings appearing
in demos, which would otherwise only be noticed by visually inspecting
GIFs.

Key features:
- Extracts commands from tape files (only after Show directive)
- Runs them in the demo environment and captures stdout/stderr
- Normalizes temp paths to <DEMO_DIR> for stable diffs
- Skips TUI demos (wt-select, wt-switch, etc.) automatically
- Documents expected vs regression-indicating changes

Usage: ./docs/demos/build docs --snapshot

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-26 13:39:59 -08:00
Maximilian Roos ad2ba155a3 Refactor demo dependencies to auto-download and build
- Move VHS fork from manual setup to automatic build from source
- Download Claude Code binary and Zellij plugin on demand
- Remove hard-coded binary paths and vhs-keystrokes detection
- Simplify demo registration by removing vhs_type parameter
- Update documentation with new dependency management approach
- Requires Go for building VHS fork, automatically validates on first run
2026-01-01 22:36:25 -08:00
Maximilian Roos e530a16081 Refactor demo setup and remove unused function
Remove is_interactive_tape function and simplify hooks config
generation in prepare_with_hooks by using list concatenation instead
of f-string formatting.
2026-01-01 09:34:18 -08:00
Maximilian Roos e0c41ca8e4 Reorganize demo assets into mode/theme subdirectories
Restructure demo asset output to use mode (docs/social) and theme (light/dark)
subdirectories. Updates all asset references in documentation, build scripts,
and publish tooling to match the new layout:

- docs/light/ and docs/dark/ for documentation site demos (1600x900)
- social/light/ for social media demos (1200x700)

Simplifies asset management and allows docs/social builds to coexist without
overwriting each other. Updates build script to organize GIFs by theme after
recording, fetch-assets to preserve directory structure, and all markdown
references to use the new paths. Renames twitter build target to social for
broader applicability.
2025-12-30 22:00:22 -08:00
Maximilian Roos 2585953cda Add text output recording for demo tapes using VHS
Support recording text output from demo tapes via VHS native .txt format
for capturing authentic shell sessions. Add --text flag to build script to
record shell output instead of GIFs, with automatic detection and skipping
of interactive demos. Refactor tape rendering to share template variable
replacements between GIF and text recording modes.
2025-12-30 15:36:41 -08:00
Maximilian Roos 212fcc9828 Remove unused demo helper functions
Remove setup_gh_mock, build_shell_env, clean_ansi_output, and
run_fish_script from the shared demo library along with their exports
from __init__.py. These functions are no longer used by any demo
recording scripts.
2025-12-30 14:00:24 -08:00
Maximilian Roos f1b402d584 Refactor demo setup into reusable shared functions
Move repetitive CLI mocks, config generation, and environment setup
from build script into shared lib. Extract helper functions for:
- Claude Code configuration (.claude.json + settings.json)
- Zellij configuration with warm-gold theme and plugins
- Fish shell configuration with wsl abbreviation
- Mock CLI setup (npm, docker, flyctl, llm, cargo)
- Validation.rs content for commit demos
- Staging changes and billing branch creation

This reduces build script from 1200 to 336 lines while improving
maintainability and enabling reuse across demo scenarios.
2025-12-29 14:31:00 -08:00
Maximilian Roos 5779a92309 Remove Twitter-specific demo content
Stashing Twitter launch thread content to merge general demo
infrastructure improvements first. Twitter content preserved
in git history and can be restored later.

Removed:
- docs/demos/twitter/ (build script, CLAUDE.md, missing.md)
- docs/static/demos/twitter/ (thread.md, preview.html)
- Twitter-only tapes: wt-switch, wt-statusline, wt-list,
  wt-list-remove, wt-hooks, wt-commit, wt-select-short, wt-zellij

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 15:20:05 -08:00
Maximilian Roos 1d33d3bb86 Extract shared demo script utilities
Add clean_ansi_output and run_fish_script helper functions to shared
lib.py to eliminate duplication in wt-core and wt-merge build scripts.
Update both scripts to use the new helpers instead of inline subprocess
and regex calls.
2025-12-20 22:41:16 -08:00
Maximilian Roos 5b799ea13a Consolidate demo infrastructure and merge improvements
- Move backslash normalization to start of filter chain
- Combine ~/repo pattern with optional worktree suffix
- Inline symbol literals in formatted messages
- Add demo-simple scaffold with shared fixtures and library
- Refactor demo infrastructure: consolidate shared code and rename demos
- Add merge.md to lychee exclude_path
- Add wt-merge demo GIF to merge command help
- Update help snapshots for merge demo placeholder
2025-12-20 22:22:34 -08:00
Maximilian Roos 96b8aa7757 Refactor demo infrastructure: consolidate shared code and rename demos (#270)
* Move backslash normalization to start of filter chain (#263)

By normalizing backslashes to forward slashes FIRST, all subsequent
path filters only need the forward-slash version. This removes:
- Duplicate path filters for backslash versions
- The later backslash normalization filter

Simplifies the filter chain by having one canonical path format.

Co-authored-by: Claude <noreply@anthropic.com>

* Combine ~/repo pattern with optional worktree suffix (#264)

Use a single pattern with optional capture group instead of two separate
patterns. The optional suffix (\.[a-zA-Z0-9_-]+)? matches worktree paths
like ~/repo.feature while also matching plain ~/repo.

Co-authored-by: Claude <noreply@anthropic.com>

* Inline symbol literals in formatted messages

Replace symbol constant references with their literal characters inside
cformat! color blocks. This ensures symbols render with proper coloring
instead of appearing outside the colored sections.

* Add demo-simple scaffold with shared fixtures and library

Extract common demo setup logic into reusable lib.py functions:
- prepare_base_repo() for git repo, Rust project, mock CLIs
- prepare_demo_repo() for full rich repo with varied branches
- commit_dated() for dated commits with offsets
- Helper functions for creating alpha/beta/hooks branches

Create shared fixtures directory:
- lib.rs and lib-hooks.rs for Rust project variants
- gh-mock.sh for mocked GitHub CLI with per-branch CI status
- alpha-readme.md for large diff demo content
- starship.toml for consistent shell prompt

Add demo-simple demo scaffold:
- Build script and VHS tape for simple workflow demo
- Shows hooks execution, branch creation, and removal
- Uses shared fixtures and library for setup

Update wt demo to use shared library, reducing duplication
by ~190 lines while maintaining identical repo structure.

* Refactor demo infrastructure: consolidate shared code and rename demos

- Create shared/ Python package with unified imports
  - Move lib.py and themes.py into shared/
  - Add __init__.py that re-exports all utilities
  - Move fixtures into shared/fixtures/

- Rename demos for clarity
  - demo-simple → wt-core (core workflow demo)
  - wt → wt-merge (merge-focused demo)

- Update doc references
  - Homepage and README use wt-core.gif
  - merge.md page uses wt-merge.gif

- Simplify gitignore
  - Use single glob pattern docs/demos/*/out/
  - Remove per-demo .gitignore files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add merge.md to lychee exclude_path

The merge.md page now has root-relative asset paths (/assets/wt-merge.gif)
that lychee can't resolve locally. These assets are fetched at deploy time.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add wt-merge demo GIF to merge command help

Add demo placeholder in cli.rs so the GIF appears in generated docs.
The placeholder expands to an HTML figure with light/dark variants.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update help snapshots for merge demo placeholder

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-20 21:04:40 -08:00