Skip to content

feat(picker): flash alt-x removal-failure reasons in the header - #3350

Merged
max-sixty merged 2 commits into
mainfrom
picker-waiting-row
Jul 1, 2026
Merged

max-sixty merged 2 commits into
mainfrom
picker-waiting-row

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Extends the header flash from #3336 to the two background alt-x failure paths.

#3336 added a transient header "flash" that surfaces why an alt-x removal didn't happen, but only on the synchronous decline paths — keeping the current worktree, keeping an unmerged branch-only row (both ○ info), and the apply Err arm where the target can't be removed at all (✗ error). The two paths where a removal is optimistically applied and then found to have failed still surfaced their reason only when the stashed warning drained to stderr on picker exit:

  • restore_failed_removal — an optimistically-dropped row reappears when the background removal turns out to have failed (target survived).
  • revert_morph — an in-place "morph to / branch" row un-morphs when the background worktree removal failed.

Both now flash the same Kept X — could not remove it reason in the header immediately, as a warning (▲), matching what each already stashes — so the why lands where the user is looking, not only on exit.

For reviewers

All in src/commands/picker/mod.rs:

  • The flash mechanism moved out of the AltXRemover::flash_header method into a free flash_header(header_flash, render_tx, message) so the background threads (off skim's event loop) can reach it; the method now delegates.
  • restore_failed_removal's four row-descriptor params are bundled into a DroppedRow struct (keeps it under clippy's 7-arg limit; mirrors the existing MorphRevert).
  • New test_revert_morph_restores_row_and_flashes, plus flash assertions added to the two restore_failed_removal tests.

No rendered snapshots change (the flash is transient, not snapshotted). The shared locks are never held nested, so the new background-thread flash adds no deadlock risk.

This was written by Claude Code on behalf of max

max-sixty and others added 2 commits July 1, 2026 11:22
The header flash added in #3336 covered only the synchronous decline
paths (keep current worktree, keep unmerged branch-only row, and the
Err arm where the target can't be removed). The two background failure
paths — restore_failed_removal (a dropped row reappears) and
revert_morph (an in-place morph un-morphs) — still surfaced their
"Kept X — could not remove it" reason only on the exit stderr drain.

Flash that reason in the header immediately too, as a warning (▲),
matching what each path already stashes. Extract the flash mechanism
from AltXRemover::flash_header into a free function so the background
threads can reach it; bundle restore_failed_removal's row-descriptor
args into DroppedRow to stay under clippy's arg limit.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 6550d7e into main Jul 1, 2026
37 checks passed
@max-sixty
max-sixty deleted the picker-waiting-row branch July 1, 2026 18:43
@max-sixty max-sixty mentioned this pull request Jul 2, 2026
max-sixty added a commit that referenced this pull request Jul 2, 2026
Release v0.65.0. Version bump plus the 0.65.0 changelog section.

**User-facing changes in this release:**

- **Picker `alt-x` flashes why a worktree wasn't removed** (#3336,
#3350) — the keep/failure reason now appears in the picker header
instead of only draining to stderr on exit.
- **`-vv` diagnostics consolidate on `diagnostic.md`, led by the
performance profile** (#3329). This entry's bullet was previously
misfiled under the already-released `0.63.0` section (the PR merged
after `0.64.0` was tagged); this release moves it into `0.65.0`, where
the change actually ships, and drops a misleading "removed
`profile.txt`" clause for a file that never existed.
- **`wt remove` preserves your subdirectory position** (#3344, closes
#3343, thanks @caillou for reporting).

**Also included:** a fix to the release skill's reporter-finding grep —
`sort -un` on `#`-prefixed lines collapsed the whole issue-reference
list to a single entry (every line sorts as numeric 0), which nearly
dropped @caillou's credit. Now sorts on the numeric field after `#`.

The nightly cross-platform suite (full-tests linux/macos/windows,
feature-powerset, release-target, nix-flake, minimal-versions) passed
green on the cut-from tip before this PR was opened.

> _This was written by Claude Code on behalf of max_

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
worktrunk 0.65.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## Release Notes

### Improved

- **Picker `alt-x` flashes why a worktree wasn't removed**: When `alt-x` in the `wt switch` picker keeps a row instead of removing it, the reason now flashes in the picker header for a beat, rather than only draining to stderr after you quit — so the "why" is visible while the row is still in front of you. It covers both the by-design keeps (the current worktree; an unmerged branch-only row shows `○ Kept <branch> — branch is unmerged`) and genuine removal failures (a dirty, locked, or main worktree, shown as an error). The full diagnostic still drains on exit. The `--prs` loading marker now also matches the picker's other in-flight placeholders (`↳ Loading open PRs…`). ([#3336](max-sixty/worktrunk#3336), [#3350](max-sixty/worktrunk#3350))

- **`-vv` diagnostics consolidate on `diagnostic.md`, led by the performance profile**: A `-vv` run now opens with a one-line pointer to the log directory (`○ Verbose logging to .git/wt/logs/`) and closes by naming what it captured — `○ Logs, performance profile, and diagnostics saved @ diagnostic.md` — with the raw `trace.jsonl` / `subprocess.log` companions listed beneath and the `gh gist create` bug-report hint. `diagnostic.md` now leads with the performance profile, expanded by default and promoted above the environment / worktree / config dumps; that profile reports the 20 slowest calls (was 8) and 10 same-context redundant-command offenders (was 3). The profile lives in the `diagnostic.md` bundle, and `wt config state logs profile` re-renders it live from `trace.jsonl`. ([#3329](max-sixty/worktrunk#3329))

### Fixed

- **`wt remove` preserves your subdirectory position**: Removing a worktree from a subdirectory (e.g. `apps/gateway/`) now lands you in the equivalent subdirectory of the destination worktree rather than at its root — matching how `wt switch` already behaves, and falling back to the root when that subdirectory doesn't exist there. `wt merge` lands through the same handler, so it gains the same behavior. ([#3344](max-sixty/worktrunk#3344), closes [#3343](max-sixty/worktrunk#3343), thanks @caillou for reporting)

## Install worktrunk 0.65.0

### Install prebuilt binaries via shell script

```sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-installer.sh | sh && wt config shell install
```

### Install prebuilt binaries via powershell script

```sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-installer.ps1 | iex"; git-wt config shell install
```

### Install prebuilt binaries via Homebrew

```sh
brew install worktrunk && wt config shell install
```

## Download worktrunk 0.65.0

|  File  | Platform | Checksum |
|--------|----------|----------|
| [worktrunk-aarch64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-aarch64-apple-darwin.tar.xz.sha256) |
| [worktrunk-x86_64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-x86_64-apple-darwin.tar.xz.sha256) |
| [worktrunk-x86_64-pc-windows-msvc.zip](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-x86_64-pc-windows-msvc.zip.sha256) |
| [worktrunk-aarch64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-aarch64-unknown-linux-musl.tar.xz) | ARM64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-aarch64-unknown-linux-musl.tar.xz.sha256) |
| [worktrunk-x86_64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-x86_64-unknown-linux-musl.tar.xz) | x64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.65.0/worktrunk-x86_64-unknown-linux-musl.tar.xz.sha256) |



### Install via Cargo

```sh
cargo install worktrunk && wt config shell install
```

### Install via Winget (Windows)

```sh
winget install max-sixty.worktrunk && git-wt config shell install
```

### Install via AUR (Arch Linux)

```sh
paru worktrunk-bin && wt config shell install
```
</pre>
  <p>View the full release notes at <a href="https://github.com/max-sixty/worktrunk/releases/tag/v0.65.0">https://github.com/max-sixty/worktrunk/releases/tag/v0.65.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!13428
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.

2 participants