Skip to content

feat: add demo GIF for parallel worktrees + agents workflow#132

Merged
liam-russell merged 2 commits into
mainfrom
feat/demo-gif
Jul 6, 2026
Merged

feat: add demo GIF for parallel worktrees + agents workflow#132
liam-russell merged 2 commits into
mainfrom
feat/demo-gif

Conversation

@liam-russell

Copy link
Copy Markdown
Contributor

Closes #122

Type

  • feat — new feature or user-visible capability

Summary

  • Added a ~18s demo GIF at the top of the README and on the landing page showing the core pitch: creating worktrees, launching parallel AI agent sessions in each one, reviewing a diff, and merging — all from one window.
  • Fixed a bug in the Changes panel where a single unstaged file could be misreported as staged (with its path missing its first character).

Why

Issue #122 (P0, adoption blocker): the whole value prop fits in ~20 seconds of screen capture, but no demo asset existed.

demo

How the GIF was produced

It's a real screen capture of the actual app, not a mockup. e2e/specs/demo-gif.spec.ts extends the existing WebdriverIO hero-screenshots pattern to script a full session against a real Electron build: create 3 worktrees via the UI, launch a simulated agent in each (a canned node -e transcript keyed off the SPROUTGIT_WORKTREE_NAME env var the app already injects — no live coding-agent CLI needed to look authentic), review a diff, then merge two branches and show the resulting graph. It captures a numbered PNG per beat, and scripts/build-demo-gif.sh stitches them into website/public/demo.gif with ffmpeg (palette-based encoding, ~414KB). Run pnpm --filter app build then ./scripts/build-demo-gif.sh to regenerate.

I considered folding the GIF into the existing ScreenshotSlider component but it's purpose-built for static optimized PNGs (per-platform, light/dark variants via astro:assets) — a GIF doesn't fit that model, so it's a new small standalone DemoGif section between the hero and the slider instead.

Bug fix bundled in (found while building this)

Building the diff-review beat of the recording surfaced a real, pre-existing bug: getWorktreeStatus's porcelain-status parser (packages/git/src/staging.ts) assumed the raw git status output never has leading whitespace trimmed. But gitForPath() constructs its SimpleGit client with trimmed: true, which trims the entire raw string — eating the leading space off an unstaged-only file when it's the first line of output ( M pathM path). That shifts every column, so the file gets misreported as staged and its path loses its first character. This is a common case (any workspace with exactly one unstaged, alphabetically-first change) and was reproducible in the running app, not just synthetically. Fixed by detecting the column shift the same way simple-git's own built-in status parser does, with a regression test added (packages/git/src/__tests__/staging.test.ts).

Also: pnpm --filter app build was broken on main — @sproutgit/fs-watch (extracted in #71) was missing from electron.vite.config.ts's WORKSPACE_PACKAGES externalization-exclusion list, so bundling the main process failed outright (chokidar unresolved). Needed a one-line fix to get any build running for this task, included here since it blocks everyone.

Breaking changes

None

Test plan

  • Added packages/git/src/__tests__/staging.test.ts (3 new tests) — pnpm --filter @sproutgit/git test passes (67/67).
  • pnpm lint && pnpm typecheck pass.
  • Manually ran e2e/specs/demo-gif.spec.ts against a real built app (CAPTURE_SCREENSHOTS=1 pnpm --filter @sproutgit/e2e demo-gif-frames) and visually reviewed all 15 captured frames.
  • Verified the landing page section renders correctly (astro dev) and the GIF/section display as expected.

Adds a scripted WebdriverIO spec (e2e/specs/demo-gif.spec.ts) that drives the
real app through the core pitch -- create worktrees, launch simulated
parallel agent sessions, review a diff, merge -- capturing a frame sequence
that scripts/build-demo-gif.sh stitches into website/public/demo.gif via
ffmpeg. The GIF is featured at the top of the README and in a new landing
page section.

Also fixes a real bug surfaced while building this: getWorktreeStatus's
porcelain parser assumed the raw git output never has its leading
whitespace trimmed, but gitForPath()'s SimpleGit client sets `trimmed:
true`, which eats the leading space off an unstaged-only first status line
-- misreporting it as staged and truncating its path by one character.
Fixed in packages/git/src/staging.ts with a regression test.

Also adds @sproutgit/fs-watch to electron.vite.config.ts's WORKSPACE_PACKAGES
list -- it was missing since the package was extracted in #71, which broke
`pnpm --filter app build` entirely (chokidar unresolved by rolldown).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 6, 2026 09:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a user-facing demo asset to better communicate SproutGit’s “parallel worktrees + parallel agents” workflow (per #122), and includes a small but important git-status parsing fix surfaced while producing the recording. It also introduces supporting automation to regenerate the GIF from scripted E2E frame capture.

Changes:

  • Add a new “Demo GIF” section to the website landing page and embed the GIF near the top of the README.
  • Fix git status --porcelain=v1 parsing for the “single unstaged file” case when SimpleGit output is globally trimmed; add regression tests.
  • Add an E2E spec + shell script to capture frames and stitch demo.gif, plus a small Electron build config fix.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/src/pages/index.astro Inserts the new DemoGif section into the landing page flow.
website/src/components/DemoGif.astro New landing-page section rendering /demo.gif with framing and copy.
website/public/demo.gif Demo asset referenced by the website and README.
README.md Embeds the demo GIF near the top for immediate value-prop clarity on GitHub.
scripts/build-demo-gif.sh Automates regenerating demo.gif from captured E2E frames via ffmpeg.
packages/git/src/staging.ts Fixes porcelain v1 status parsing when leading-space columns are shifted.
packages/git/src/tests/staging.test.ts Adds regression coverage for staging/status parsing edge cases.
e2e/specs/demo-gif.spec.ts New WDIO spec that drives a full “parallel agents/worktrees” story and captures frames.
e2e/package.json Adds a dedicated demo-gif-frames script for frame capture.
e2e/helpers/screenshots.ts Exports forceTheme for reuse by the new demo spec.
app/electron.vite.config.ts Adds @sproutgit/fs-watch to workspace package handling to unblock app builds.

Comment thread scripts/build-demo-gif.sh
Comment thread packages/git/src/__tests__/staging.test.ts Outdated
- build-demo-gif.sh: use the correct platform subfolder (mac/windows/linux)
  for captured frames instead of hardcoding "mac", matching the logic in
  e2e/helpers/screenshots.ts.
- staging.test.ts: clean up the temp git repos each test creates, matching
  the afterEach + rmSync convention used elsewhere in this package (e.g.
  first-worktree.test.ts).

Addresses Copilot review comments on PR #132.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@liam-russell

Copy link
Copy Markdown
Contributor Author

Addressed both review comments in 303d025:

  • build-demo-gif.sh now picks the platform subfolder (mac/windows/linux) the same way e2e/helpers/screenshots.ts does, instead of hardcoding mac.
  • staging.test.ts now tracks and removes its temp repos in afterEach, matching the convention in first-worktree.test.ts.

@liam-russell liam-russell merged commit 54f53cd into main Jul 6, 2026
15 checks passed
@liam-russell liam-russell deleted the feat/demo-gif branch July 6, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Demo GIF: parallel agents in separate worktrees

2 participants