Repository navigation
refactor(help): compact the aliases section in --help - #2688
Merged
Merged
Conversation
The `Aliases:` block in `wt --help` / `wt step --help` printed each alias's command template verbatim, which wrapped mid-token in narrow terminals. Show just the alias names (deduped, shadowed-by-builtin still flagged inline) and point to `wt config alias show` for the full definitions. Drops `format_alias_summary` and its tests; consolidates the `render_aliases_section` tests. Also terminates each styled name with a full reset so its color doesn't bleed onto the trailing hint line (the markdown pass strips the `\e[39m` that `cformat!`'s `</>` emits). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
# Conflicts: # src/commands/alias.rs
worktrunk-bot
approved these changes
May 11, 2026
worktrunk-bot
left a comment
Collaborator
There was a problem hiding this comment.
Two doc comments in src/commands/config/alias.rs (lines 5–6 and 82–83) still describe wt --help as rendering "the same Aliases: block ... via render_aliases_section" — which is no longer accurate after this PR (the help path now uses the new compact render_aliases_help_section, and render_aliases_section is reused only by wt config alias show). Happy to push a small follow-up updating both if you want.
The `config/alias.rs` doc comments described `wt --help` as rendering the same `Aliases:` block via `render_aliases_section`; the help path now uses the compact `render_aliases_help_section` instead. Addresses review feedback on #2688. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
May 11, 2026
…#2689) `render_aliases_help_section` (the compact `Aliases:` block in `wt --help` / `wt step --help`, added in #2688) padded its joined alias-name list with a trailing space, with a comment claiming `wrap_styled_text` drops a reset that ends a line so the last name's color would otherwise bleed onto the "Run `wt config alias show` …" line below. That premise is wrong: `wrap-ansi` keeps a line-final `\x1b[0m`, so the terminal output never bled. The trailing space only mattered against the snapshot harness's `\x1b[0m\n` → `\n` filter, which would otherwise strip the reset *from the snapshot* and make the diff *look* like a bleed even though the binary is fine. So this drops the space (a stray trailing space on that help line) and updates the two affected snapshots accordingly — the binary still emits the line-final reset; only the snapshot representation changes. The per-name `anstyle::Reset` in that function stays — it's what keeps the `, ` separators uncolored, matching how clap closes each `Commands:` entry. Also corrects the matching stale claim in `wrap_styled_text`'s doc comment ("we move these to line ends" → the code strips leading resets and leaves line-final resets in place — verified directly against the locked `wrap-ansi 0.1.0`). Thanks to the auto-reviewer for catching that the originally-proposed `wrap_styled_text` fix was dead code (codecov showed the new branch never executed). Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Merged
max-sixty
added a commit
that referenced
this pull request
May 13, 2026
Release v0.50.0. Highlights: - Experimental Azure DevOps support (#1256, thanks @mikeyroush; fixes #1144 from @dlecan) — `wt switch pr:<N>`, `wt list --full`, and `wt config show --full` recognize Azure DevOps via the `az` CLI. - Experimental Gitea CI-status detection (#2702) on top of the Gitea `pr:` shortcut (#1320, thanks @SjB). - Hooks now resolve `.config/wt.toml` from the worktree they act on — the primary-worktree fallback is gone, and `post-remove` reads the removed worktree's config (snapshotted before removal). Approval prompts collect hook commands from the same worktree. Breaking change for setups that relied on the primary-worktree fallback; the changelog entry has the recovery action. (#2690, #2703, #2714, #2717, #2701, #2708, #2727, #2736, #2748) - The `wt switch` picker's `alt-r` removal no longer runs unapproved project hooks (#2746) — the picker's removal path is now routed through `handle_remove_output` and consults the existing approval state read-only. - `wt config alias show` with no name lists every alias's full definition (#2684, #2691); `wt --help` switches to a compact aliases pointer (#2688). - `wt list --branches` warm-run perf: SHA-keyed cache for `main↕` and `Remote⇅` ahead/behind counts; shared push-remote URL and local-branch scan (#2704, #2718, #2673). - Claude Code plugin ships the `wt-switch-create` skill (#2737, thanks @onetom for #2631). See `CHANGELOG.md` for the full list (8 Improved, 5 Fixed, 5 Internal). semver-checks reports breaking library-API changes (new enum variants without `#[non_exhaustive]`, removed `Branch::github_push_url`, new trait method on `RemoteRefProvider`), which mandates at minimum a minor bump pre-1.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Aliases:section inwt --help/wt step --helpprinted each alias's command template verbatim. Long one-liners (e.g. alanded = "wt up && wt hook post-merge; git merge ...") wrapped mid-token in an 80-column terminal and made the section look broken.wt --helpnow shows just the alias names — deduped when the same name is defined in both user and project config, with shadowed-by-builtin still flagged inline — and points towt config alias showfor the full listing:The detailed per-alias listing (
name command-summary (source)) stays inrender_aliases_section, whichwt config alias show(no argument) reuses after #2684 — so--helpis the compact orientation view andwt config alias showis the inspection view. A newrender_aliases_help_sectionproduces the compact form.While in there: each styled name ends with a full reset (
\e[0m), and the name list ends with a trailing space. The markdown pass over the spliced help text (wrap_styled_text) strips the\e[39mthatcformat!'s</>emits and drops a reset that ends a line, so without these the last name's color bled onto the "Run …" sentence below. This also matches how clap closes eachCommands:entry.Merged
main(which landed #2684'swt config alias showno-arg listing) and resolved the overlap insrc/commands/alias.rs.