Commit Graph

1003 Commits

Author SHA1 Message Date
Maximilian Roos cb91802689 Add omnibus demo to docs and fix shell-init race condition
Add wt-zellij-omnibus demo to docs build target and update demo
documentation. Fix race condition in background worktree removal by
adding delay before directory deletion to prevent "shell-init: error
retrieving current directory" when shell attempts to read cwd after
process exit. Update Fish shell configuration to disable cursor
blinking for cleaner demo recordings.
2025-12-30 11:17:42 -08:00
Maximilian Roos d5749466a8 Add omnibus demo to docs and fix shell-init race condition (#309)
- Add wt-zellij-omnibus demo to docs site showing advanced features
  (multiple Claude agents, hooks, LLM commits, merge workflow)
- Fix shell-init error after wt remove/merge by adding 1s delay before
  background removal, giving shell wrapper time to cd away
- Add cursor blink disable escape sequences to fish config for cleaner
  demo recordings
- Simplify dependency check to always require zellij

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-30 10:00:02 -08:00
Maximilian Roos 2990fe4776 Update setup_fish_config to install shell extension
Pass repo_root to setup_fish_config and call `wt config shell install`
to properly install the shell extension and completions instead of
sourcing the init output directly in the config file.
2025-12-29 22:24:31 -08:00
Maximilian Roos 525a7a559d Format code examples with Unicode monospace in Twitter thread
Apply Unicode monospace formatting to all command examples and CLI
snippets in the Twitter thread demo to improve readability in tweets
where traditional code formatting is unavailable.
2025-12-29 20:25:44 -08:00
Maximilian Roos bb91b27a87 Update demo user display name to wt 2025-12-29 20:19:07 -08:00
Maximilian Roos 3edae82cfa Update Twitter thread demo step 13 with expanded description
Expand the character count and description for step 13 to better
explain the full lifecycle workflow across parallel Claude Code agents
in Zellij tabs, including the complete sequence of wt commands.
2025-12-29 15:51:50 -08:00
Maximilian Roos 1f9339073f Refactor demo setup functions to reduce duplication
Consolidate 12 specialized demo setup functions into 8 reusable
parameterized functions. Rename functions to describe what they set up
(prepare_basic, prepare_with_hooks, etc.) rather than which demo uses
them. This makes the setup logic clearer and easier to maintain.

Also improve error handling for vhs-keystrokes availability by checking
upfront and exiting with clear error message rather than silently
skipping demos.
2025-12-29 15:50:17 -08:00
Maximilian Roos 3e2a79adb5 Simplify demo hooks and remove redundant commands
Remove unnecessary npm install and build commands from hooks config,
consolidate dev server commands to use hash_port templating, and clean
up wt-core tape by removing config display step and renumbering.
2025-12-29 15:09:52 -08:00
Maximilian Roos 01c036f7bb Update Twitter thread with dev server demo and resequence tweets 2025-12-29 14:56:15 -08:00
Maximilian Roos cd65c69484 Add keyboard shortcut to trigger hero button with Enter key 2025-12-29 14:43:16 -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 0a270ae64b Disable cursor blinking in fish config for VHS recording 2025-12-29 14:20:24 -08:00
Maximilian Roos 1645e3b24c Refactor Twitter thread structure with omnibus demo
Add omnibus Zellij demo showcasing parallel Claude Code agents workflow.
Move demo from tweet 1 hook position to tweet 13 before CTA for better
pacing. Renumber subsequent tweets accordingly and update design decision
notes to reflect final structure.
2025-12-29 14:08:46 -08:00
Maximilian Roos 2937448979 Consolidate demo docs and add comprehensive demo tapes
Move demo development guidelines from docs/CLAUDE.md to dedicated docs/demos/CLAUDE.md, covering vhs-keystrokes setup, timing guidelines, and environment debugging.

Add complete VHS tape collection for Twitter and docs demos:
- Single-command demos: wt-switch, wt-statusline, wt-list, wt-list-remove, wt-hooks, wt-commit, wt-merge, wt-select-short
- Multi-pane Zellij demos: wt-zellij (parallel Claude instances), wt-zellij-omnibus (comprehensive feature showcase)

Restore Twitter launch thread content: thread.md with 14-tweet script and thread-preview.html for reviewing demos during recording.

Build scripts generate light-only GIFs for Twitter (1200x700, FontSize 26). Zellij demos use smaller font (16pt) for readability with tabs and multiple panes.
2025-12-29 13:38:27 -08:00
Maximilian Roos e1776775a6 Refactor documentation for clarity and simplicity
Update README and docs to streamline descriptions of Worktrunk's
core functionality. Simplify wording around core commands, hooks,
and feature descriptions to make the documentation more accessible.
2025-12-29 12:22:48 -08:00
Maximilian Roos 3896d7e138 Update remove command help text for worktrees argument 2025-12-29 09:59:15 -08:00
Maximilian Roos 1ff0d5b03f Refactor documentation for clarity and simplicity
Update README and worktrunk.md to improve messaging around core
concepts. Replace "simple" with "as easy as branches" to set proper
expectations, and clarify that git worktrees are a native feature.
Restructure workflow automation section with introductory text to
emphasize the progression from core commands to advanced features.
Update auto-generated content markers to reflect new section heading.
2025-12-29 09:40:04 -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 c116e04744 Add working tree conflict detection to --full flag (#296)
When using `wt list --full`, conflict detection now includes uncommitted
working tree changes, not just committed content. Uses `git stash create`
to get a tree object representing the working tree state, then runs
merge-tree against the default branch.

This helps catch conflicts earlier - before committing changes that would
conflict with main. The check only runs with --full since stash create
adds ~50-100ms per worktree.

Behavior:
- Without --full: conflict symbol based on HEAD vs main (existing behavior)
- With --full: conflict symbol based on working tree vs main (new)
- Falls back to commit-based check if working tree is clean or stash fails

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-26 13:32:33 -08:00
Maximilian Roos 11a21a2489 Fix syntax highlighting being stripped by 1Password extension (#291)
The 1Password browser extension rewrites code blocks with `language-*`
classes, replacing Zola's syntect-generated spans with its own Prism tokens.
This breaks all syntax highlighting colors.

Fix: Add `data-1p-ignore` attribute to code blocks via MutationObserver,
which tells 1Password to skip processing these elements.

Also fix CSS to let syntax highlighting colors apply by removing hardcoded
color from code blocks and using `color: inherit` for `.content pre code`.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-25 13:38:04 -08:00
Maximilian Roos 10fead752e Add dev server URL workflow to tips-patterns docs (#290)
* Add dev server URL column to `wt list` from project config

Add support for displaying dev server URLs in `wt list` via project
configuration. URLs are computed from templates (e.g.,
`http://localhost:{{ branch | hash_port }}`) and show with health-check
styling: normal if the port is listening, dimmed otherwise.

Key changes:
- New `ProjectListConfig` with `url` template field in `.config/wt.toml`
- URL column in list output, gated by `UrlStatusTask`
- Template expansion deferred to post-skeleton (in task spawning) to
  minimize time-to-skeleton
- Port availability checked via TCP connect with 50ms timeout
- JSON output includes `url` and `url_active` fields
- Layout and rendering support for variable-width URL cells

* Implement two-phase URL rendering with health check

Send URL immediately after template expansion so it appears in normal
styling right away. Health check task (port availability) runs in parallel
and dims URL if port not listening. Estimate URL width from template +
longest branch name for accurate pre-skeleton layout allocation.

* Fix URL column allocation when no template configured

When url_width is 0 (no URL template), don't allocate any space for the
URL column. Previously, fit_header(HEADER_URL, 0) would still return 3
(the header width), causing the URL column to appear in select and other
contexts where no URL template is configured.

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

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

* Add test coverage for URL column feature

- Unit tests for estimate_url_width: no template, hash_port, branch
  variable, fallback, and static template cases
- Integration tests for JSON output with URL fields
- Integration test for JSON output without URL template (null fields)
- Integration test for {{ branch }} variable in URL template

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

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

* Add test for URL with --branches flag to improve coverage

Covers the URL template expansion path in collect_branch_progressive,
which was not exercised by existing tests.

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

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

* Add dev server URL workflow to tips-patterns docs

- Add test_tips_dev_server_workflow to generate snapshot showing URL column
- Add "Dev server per worktree" section to tips-patterns.md
- Shows post-start hook + list.url config working together
- Snapshot auto-synced via AUTO-GENERATED-HTML marker

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

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

* Add dev server URL workflow to tips-patterns docs

- Add test_tips_dev_server_workflow to generate snapshot showing URL column
- Add "Dev server per worktree" section to tips-patterns.md
- Shows post-start hook + list.url config working together
- Snapshot auto-synced via AUTO-GENERATED-HTML marker

🤖 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-25 13:09:53 -08:00
Maximilian Roos d72d6d8042 Add dev server URL column to wt list (#288)
* Add dev server URL column to `wt list` from project config

Add support for displaying dev server URLs in `wt list` via project
configuration. URLs are computed from templates (e.g.,
`http://localhost:{{ branch | hash_port }}`) and show with health-check
styling: normal if the port is listening, dimmed otherwise.

Key changes:
- New `ProjectListConfig` with `url` template field in `.config/wt.toml`
- URL column in list output, gated by `UrlStatusTask`
- Template expansion deferred to post-skeleton (in task spawning) to
  minimize time-to-skeleton
- Port availability checked via TCP connect with 50ms timeout
- JSON output includes `url` and `url_active` fields
- Layout and rendering support for variable-width URL cells

* Implement two-phase URL rendering with health check

Send URL immediately after template expansion so it appears in normal
styling right away. Health check task (port availability) runs in parallel
and dims URL if port not listening. Estimate URL width from template +
longest branch name for accurate pre-skeleton layout allocation.

* Fix URL column allocation when no template configured

When url_width is 0 (no URL template), don't allocate any space for the
URL column. Previously, fit_header(HEADER_URL, 0) would still return 3
(the header width), causing the URL column to appear in select and other
contexts where no URL template is configured.

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

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

* Add test coverage for URL column feature

- Unit tests for estimate_url_width: no template, hash_port, branch
  variable, fallback, and static template cases
- Integration tests for JSON output with URL fields
- Integration test for JSON output without URL template (null fields)
- Integration test for {{ branch }} variable in URL template

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

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

* Add test for URL with --branches flag to improve coverage

Covers the URL template expansion path in collect_branch_progressive,
which was not exercised by existing tests.

🤖 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-25 12:07:14 -08:00
Maximilian Roos 51d42b28e9 Optimize wt list skeleton display speed (#286)
Reduce time-to-skeleton by deferring non-essential git operations:

- Add worktrunk.default-branch cache for O(1) default branch lookup
- Batch timestamp fetching in single git command for sorting
- Detect current worktree via path comparison (no git command)
- Defer previous_branch lookup until after skeleton
- Defer effective_integration_target until after skeleton
- Pre-compute is_bare and pass to hot path functions

Skeleton now shows `·` placeholder for gutter symbols, filled in
when data loads. Added documentation explaining skeleton performance
requirements and the minimal pre-skeleton operation set.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-24 01:08:51 -08:00
Maximilian Roos 7f1ed8577b Add post-switch hook for background execution after every switch (#284)
Add a new `post-switch` hook that runs in the background after every
`wt switch` operation. Unlike post-start (which only runs on creation),
post-switch runs on all switch results: Created, Existing, and AlreadyAt.

Use cases include renaming terminal tabs, updating tmux window names,
and IDE notifications.

Execution order on `wt switch --create`:
1. Create worktree
2. Run post-create hooks (blocking)
3. Show success message
4. Spawn post-switch hooks (background)
5. Spawn post-start hooks (background)

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-22 00:14:55 -08:00
Maximilian Roos b7df819c07 docs: Add section on Worktrunk state side-effects 2025-12-21 11:52:37 -08:00
Maximilian Roos aae3f0808c Clarify wt merge runs from feature worktree
Add introductory text explaining that `wt merge` executes from the
feature worktree and merges into the target branch, similar to GitHub's
merge button. Update example descriptions for consistency.
2025-12-21 11:35:11 -08:00
Maximilian Roos 3471fee63b Update docs and help text to clarify default branch references (#275)
* Update docs and help text to clarify default branch references

* Replace "main" with "default branch" in docs and help text

Update references throughout documentation and help snapshots to use
"default branch" instead of hardcoded "main" for clarity. Changes include:
- Help text descriptions for list, merge, switch, and remove commands
- Configuration file documentation and examples
- JSON output field descriptions
- Status symbol explanations
- Example commands and shortcuts

Also update environment variable from GIT_EDITOR to GIT_CONFIG_GLOBAL
in test snapshots and add missing RUST_LOG variable.
2025-12-21 08:49:03 +00:00
Maximilian Roos 8e581cdf93 Unify wt-select demo with shared infrastructure (#276)
Use prepare_demo_repo() with alpha/beta/hooks branches instead of custom
streaming/doctor/llm-templates setup. This makes all three demos (wt-core,
wt-merge, wt-select) use the same base repository.

- Add utils.rs fixture to alpha branch for larger committed diff (+272 lines)
- Update demo.tape to navigate alpha and filter with "alp"
- Simplify CLAUDE.md to reflect unified approach
- Remove unused create_branches parameter from prepare_demo_repo()

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-21 08:33:25 +00:00
Maximilian Roos 710b881df0 Add colored command reference output to documentation (#273)
Convert --help-page output to HTML with ANSI colors preserved,
matching how `wt list` outputs render in the web docs. The doc
sync test now converts command reference blocks from markdown
code fences to Zola's {% terminal() %} shortcode with proper
HTML styling.

- Add with_colors parameter to get_help_reference()
- Use std::println! to preserve ANSI codes (bypass anstream TTY detection)
- Add strip_ansi_codes() helper for pattern matching
- Convert command reference blocks to HTML in readme_sync test
- Fix URL typo in config docs (/hooks/ → /hook/)

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-20 23:39:55 -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 8173bf8671 Add Local CI section to wt merge help (#272)
Document the workflow pattern that pre-merge hooks enable: faster iteration
with many small changes. Explains how local hooks provide the same process
enforcement that remote CI provided historically.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-20 22:17:41 -08:00
Maximilian Roos 2d84e93f8f Add trailing argument support to wt switch --execute (#271)
Arguments after `--` are now appended to the execute command, enabling
shell aliases like:

    alias wsc='wt switch --create -x claude'
    wsc feature -- 'implement login'

Uses `shlex::try_quote()` for POSIX shell escaping (platform-independent).
Removes vestigial `adjust_completion_command` and custom `shell_escape`
in favor of standard `shlex` crate.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-20 22:04:47 -08:00
Maximilian Roos 87321281d4 Replace --internal flag with WORKTRUNK_DIRECTIVE_FILE environment variable (#269)
* Replace --internal flag with WT_DIRECTIVE_FILE environment variable

* Rename directive file environment variable to WORKTRUNK_DIRECTIVE_FILE

* Update stale comments referencing directive scripts

Codex review identified comments that still referenced "directive scripts"
after migrating to file-based directive passing. Updated to reference
"data output" which is the current terminology.

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

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

* Address documentation review feedback

- Add WORKTRUNK_DIRECTIVE_FILE to env var tables (cli.rs, config.md)
- Update stale "directive mode" terminology in test comments to use
  "shell integration" or "data output" as appropriate
- Regenerate help snapshot

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

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

* Refactor progressive table output to use output module

Remove finalize_non_tty method and simplify non-TTY output path to use
output::table() directly, consistent with buffered mode. Add WORKTRUNK_SHELL
environment variable support for PowerShell-specific path escaping. Update
documentation and templates accordingly.

* Preserve directive script exit code in PowerShell

Add logic to use the directive script's exit code when wt succeeds, and
add redaction for WORKTRUNK_DIRECTIVE_FILE in test snapshots.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-20 21:33:25 -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
Maximilian Roos 5f32e30bd2 Add hash_port filter for deterministic port assignment (#266)
Add a `hash_port` filter that hashes any string to a port number in the
range 10000-19999. This enables running dev servers on unique ports per
worktree without port collisions.

Example usage in hooks:
```toml
[post-start]
dev = "npm run dev --port {{ branch | hash_port }}"
```

The filter uses Rust's DefaultHasher for simple deterministic hashing.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-20 16:59:03 -08:00
Maximilian Roos b4e2f2e4ed Fix shell wrapper piping and simplify process detachment (#258)
Detached processes now use process_group(0) instead of nohup, allowing
them to survive PTY closure while remaining responsive. Shell wrappers
now detect piping via `[[ ! -t 1 ]]` and bypass the wrapper when stdout
isn't a terminal, enabling commands like `wt list --format=json | jq`.

Updated shell templates (bash, zsh, fish, PowerShell) to check for
redirected output and run the binary directly in those cases. Removed
dev-detach dependency in favor of portable PTY for shell integration
tests. Simplified output routing by removing data_raw() function and
consolidating data output handling. Added FAQ entry explaining JSON
output routing and piping behavior.
2025-12-20 16:59:03 -08:00
Maximilian Roos 7e7b49999e Add {{ branch | sanitize }} filter for explicit branch sanitization (#265)
Changes {{ branch }} to provide raw branch names (e.g., feature/auth) and
adds a sanitize filter for filesystem-safe paths. Users now explicitly use
{{ branch | sanitize }} to replace / and \ with -.

This makes sanitization visible in templates rather than implicit.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-20 16:59:03 -08:00
Maximilian Roos ad6ec2351b Replace emojis with single-width Unicode symbols (#255)
* Replace emojis with single-width Unicode symbols

Switch from graphical emojis (🔄, ✅, ❌, etc.) to single-width Unicode
symbols (◎, ✓, ✗, etc.) for message indicators:

- ◎ Progress (bullseye)
- ✓ Success (checkmark)
- ✗ Error (x mark)
- ▲ Warning (triangle)
- ↳ Hint (corner arrow)
- ○ Info (empty circle)
- ❯ Prompt (shell prompt)

Benefits:
- Better terminal compatibility (emojis render inconsistently)
- More serious/professional aesthetic
- Consistent single-character width for alignment

Also reduces gutter indentation from 3 to 2 columns to align with 1-char
symbols, and adds colors to the symbols themselves (red for errors, green
for success, etc.).

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

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

* Update shell integration test snapshots

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

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

* Update documentation and comments to use new symbols

Update help text examples, doc comments, and .claude rules files
to reflect the new single-width Unicode symbols.

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

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

* Update .claude rules to use symbol terminology

Rename emoji→symbol consistently in documentation guidelines.

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

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

* Use cstr! for pre-colored symbols

Symbols now have their semantic colors embedded using color_print's cstr!
macro, which creates colored &'static str constants. This ensures symbols
are always consistently colored without needing to wrap each usage site.

- PROGRESS_SYMBOL: cyan ◎
- SUCCESS_SYMBOL: green ✓
- ERROR_SYMBOL: red ✗
- WARNING_SYMBOL: yellow ▲
- HINT_SYMBOL: dim ↳
- INFO_SYMBOL: dim ○
- PROMPT_SYMBOL: cyan ❯

Message formatting functions now apply color only to the text content,
since symbols are pre-colored.

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

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

* Update shell integration test snapshots for pre-colored symbols

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

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

* Add filter for shell-escaped paths in test snapshots

When shell_escape quotes paths, the filters replace the path portion
but leave the quotes. Add filters to normalize '[REPO]' to [REPO].

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

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

* Filter syntax-highlighted [REPO] placeholders

Shell-escaped paths get green syntax highlighting. Add filter to
normalize colored [REPO] placeholders back to plain [REPO].

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

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

* Fix snapshot filters for shell-escaped path formatting

CI (Ubuntu/Windows) produces different ANSI formatting around
shell-escaped paths than local macOS. Add filters to normalize
the dim formatting codes around [REPO] placeholders.

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

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

* Update snapshots for single-width Unicode symbols

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

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

* Update PTY test snapshots for new symbols

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

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

* Update snapshots for new symbols after merge

🤖 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-19 17:34:44 -08:00
Maximilian Roos 58f00ef8b3 Remove bold styling from current branch in wt list (#254)
The current worktree is already distinguished by the @ gutter symbol
and its position at the top of the list, so bolding adds no additional
information.

This simplifies the styling code by removing the position_style function
entirely and only applying dimming for removable worktrees.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-19 12:25:09 -08:00
Maximilian Roos 7a70274881 Fix broken anchor link in remove.md docs (#253)
The docs linked to `@/switch.md#argument-resolution` but that anchor
doesn't exist - the section in switch.md is named "Shortcuts".

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-18 22:24:11 -08:00
Maximilian Roos f215a466b0 Show relative paths in wt list & fix CI cache Windows flakiness (#252)
* Show paths relative to main worktree in wt list

Previously, paths were shown relative to a computed common prefix, which could
degenerate to `/` when worktrees were in unrelated locations, resulting in
confusing output like `./Users/max/project`.

Now paths are computed relative to the main worktree:
- Main worktree: `.`
- Children: `./subdir`
- Siblings: `../project.feature`

Uses `pathdiff` crate for cross-platform relative path computation.

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

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

* Move CI status cache to file-based storage

Fixes flaky Windows CI test where parallel git operations would fail
with "Permission denied" on .git/config. The git config write
temporarily locks the file, blocking concurrent reads on Windows.

Changes:
- Store CI cache in .git/wt-cache/ci-status/<branch>.json instead of git config
- Add robust branch name sanitization for Windows filenames
- Update demo scripts to use new file-based cache
- Update test helpers for new cache location

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

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

* Show integration reason in remove output

When removing a worktree, show why the branch is safe to delete
(e.g., "ancestor of main", "trees match"). Pre-computes integration
reason before spawning background removal to avoid race conditions
with git locks.

🤖 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-18 21:56:51 -08:00
Maximilian Roos bb86da253b Show paths relative to main worktree in wt list (#251)
Previously, paths were shown relative to a computed common prefix, which could
degenerate to `/` when worktrees were in unrelated locations, resulting in
confusing output like `./Users/max/project`.

Now paths are computed relative to the main worktree:
- Main worktree: `.`
- Children: `./subdir`
- Siblings: `../project.feature`

Uses `pathdiff` crate for cross-platform relative path computation.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-18 17:43:20 -08:00
Maximilian Roos 8cda18587d Improve wt switch documentation clarity (#247)
- Change opening to "Change directory to a worktree"
- Add "Creating a branch" section for --create flag
- Rewrite "Creating worktrees" intro to explain existing worktree behavior
- Remove redundant "For interactive selection" (already in See also)
- Remove technical "Argument resolution" section

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-18 10:21:39 -08:00
Maximilian Roos 47df9b864f Refactor documentation and CLI help text
- Update FAQ to use new config command syntax
- Clarify default branch references in switch help
- Reorganize merge help to better explain cleanup behavior
- Improve wording in merge pipeline description
- Simplify tips-patterns documentation language
2025-12-18 10:08:29 -08:00
Maximilian Roos d36645c796 Fix switch docs: show directory change before hooks (#248)
The docs previously implied post-create runs before switching directories
and post-start runs after. In reality, both hooks run with the new worktree
as their working directory (via subprocess current_dir), and the shell cd
happens at the very end via terminate_output().

Reorder the steps to match the conceptual model: you've "entered" the
worktree before hooks run. This is accurate since hooks execute in the
new directory.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-18 09:43:57 -08:00
Maximilian Roos a0db586e68 Improve wt list output for docs site (#245)
* Add table wrapping in help output and expand JSON documentation

Tables in --help now wrap at terminal width with continuation lines
properly aligned. This replaces the previous approach of setting
term_width(200) to prevent clap from breaking tables.

Key changes:
- Add ```table code fence format for markdown tables
- Clap no longer wraps content (HELP_TERM_WIDTH = usize::MAX)
- Our markdown renderer handles all wrapping
- Expand wt list JSON documentation with Type column and nested
  object details (commit, working_tree, main, remote, worktree, ci)
- Fix ANSI reset codes appearing at start of wrapped lines
- Rename JSON field pr → ci for clarity

The table format uses a simpler pipe-delimited syntax that's easier
to maintain in source, while rendering with proper column alignment
and width constraints.

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

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

* Replace custom table rendering with termimad

Use termimad for markdown table rendering in help text. This provides:
- Automatic column width calculation and balancing
- Cell content wrapping with proper alignment
- Simpler implementation (~100 lines removed)

Trade-offs:
- +99 KB binary size (0.8% increase)
- 9 new crate dependencies
- Backticks stripped from table cells
- 1-space column gaps instead of 2

The custom table rendering code is replaced with termimad's text()
function using a no_style skin with custom border characters for
our separator style (separate line segments under each column).

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

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

* Simplify md_help and standardize JSON boolean fields

- Remove ```table code fence format (use standard markdown tables)
- Deduplicate link stripping by having render_inline_formatting call strip_markdown_links
- Remove bare field from JSON output (worktrees are never bare by definition)
- Make boolean fields always present in JSON (is_current, is_previous, detached)
- Simplify HELP_TERM_WIDTH comment

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

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

* Wrap command reference at 80 chars for web docs

Add width parameter to get_help_reference() so web docs via --help-page
can request wrapped output. Terminal help uses default (no limit, our
markdown renderer handles it).

This prevents horizontal scroll in the command reference sections on
the docs site. Example terminal output tables still have internal
scroll (contained within their blocks), which is expected for wide
tabular output.

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

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

* Reduce README example width to fit docs terminal blocks

Changed COLUMNS from 115 to 90 for README examples so the table
output fits within the docs terminal block width (~87 chars max)
without horizontal scroll.

Trade-off: Message column is now hidden in examples (shows
"1 column hidden" / "2 columns hidden"). All other columns
(Branch, Status, HEAD±, main↕, Path, Remote⇅, Commit, Age)
remain visible.

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

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

* Add Message column to list output

Replace Path column with Message column by default. Message shows the last
commit message (truncated to fit available width). Path is now hidden unless
explicitly shown. Adjust minimum Message width from 20 to 10 chars, increase
README example terminal width from 90 to 98 columns, and update column
allocation logic to handle spacing after Gutter columns correctly.

* Tune list output width and rename truncation function

- Reduce README_COLUMNS from 105 to 98 to fit browser viewport
- Reduce MIN_MESSAGE from 20 to 10 to show Message in narrow layouts
- Rename truncate_at_word_boundary → truncate_to_width (now truncates
  mid-word for consistent column widths)
- Fix spacing calculation after Gutter column with needs_spacing helper
- Update tests that incorrectly assumed Path always visible

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

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

* Fix help output indentation by preserving leading whitespace

The clap library's next_line_help(true) option adds proper indentation
to help descriptions (2 spaces before flags, 10 spaces before descriptions).
However, wrap_ansi's default trim_whitespace(true) was stripping this
indentation.

Changes:
- Add next_line_help(true) to apply_help_template_recursive in cli.rs
- Remove term_width(usize::MAX) which was no longer needed
- Configure wrap_ansi with trim_whitespace(false) to preserve indentation

The fix ensures help output is properly indented:

  Commands:
    config
            Manage configuration and shell integration

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

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

* Refactor help template to remove next_line_help

* Add DEFAULT_HELP_WIDTH constant for consistent doc width

🤖 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-18 09:37:03 -08:00
Maximilian Roos 7b958dc7be Add --clobber flag to wt switch for backing up stale paths (#242)
When `wt switch` encounters a stale directory or file at the target
worktree path, the new `--clobber` flag moves it to a timestamped .bak
file (e.g., `repo.feature.bak.20250102-000000`) instead of failing.

This is separate from `--force`, which only skips approval prompts.
The backup preserves the original content and fails if the backup path
already exists.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-17 18:51:57 -08:00
Maximilian Roos 011d3d5ce6 Fix table width to prevent horizontal scroll overflow
Change table width from 100% to fit-content with max-width constraint
to allow tables to display at their natural width while preventing
overflow beyond the container.
2025-12-17 17:34:19 -08:00
Maximilian Roos d9d5cd139a Add CI fetch error indicator to help documentation
Document the yellow warning symbol (⚠) that appears when CI status
fetch fails due to rate limiting or network issues. Update help text,
CLI output, HTML rendering, and terminal colorization accordingly.
2025-12-17 10:59:17 -08:00