worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

Document why Alt-r picker removal is undocumented

Open worktrunk-bot opened this issue 8 months ago • 4 comments

The interactive wt switch picker supports Alt-r to remove the selected worktree in-place. However, this keybinding is intentionally not documented in the help text or keybinding table because the experience has a known UX limitation:

After removing a worktree with Alt-r, the cursor resets to the top of the list (#1695). This is a limitation in the skim framework — there's currently no API to control cursor position after a reload action.

The feature still works and is useful for those who discover it, but documenting it would set an expectation of a polished experience that we can't deliver yet.

What would unblock documenting this

A newer version of skim may support cursor position control after reload, which would fix #1695. If anyone wants to help move this forward, engaging with the skim project on what features are planned would be welcome.

Current state

  • Alt-r works in the picker — removes the selected worktree in the background
  • Cursor resets to the top after each removal (#1695)
  • Not documented in wt switch --help or the keybinding table

Context: #1866

worktrunk-bot avatar Apr 01 '26 22:04 worktrunk-bot

@worktrunk-bot please triage

max-sixty avatar Apr 07 '26 21:04 max-sixty

Confirmed — Alt-r is functional but intentionally omitted from the keybinding table in src/cli/mod.rs:580-588. The CHANGELOG entry for v0.32.0 documents this decision explicitly: "Currently hidden from picker legend and help text pending a cursor-reset issue (#1695)."

Current state in code:

  • Binding registered at src/commands/picker/mod.rs:488 — works as described
  • Omitted from help at src/cli/mod.rs:578-588 — no inline comment explaining why
  • Cursor-reset root cause (#1695) — skim's reload action resets cursor position; no skim API exists to preserve it

This issue is useful as the canonical reference for why the keybinding is hidden. It could also serve as the gate for adding Alt-r to the keybinding table once #1695 is resolved (either via an upstream skim fix or a workaround).

One small improvement that could be made now: adding an inline comment in the help text keybinding table (src/cli/mod.rs near line 588) noting why Alt-r is absent, so future contributors don't add it without context. Something like a comment in the after_long_help source pointing to #1695.

worktrunk-bot avatar Apr 07 '26 21:04 worktrunk-bot

One small improvement that could be made now: adding an inline comment in the help text keybinding table (src/cli/mod.rs near line 588) noting why Alt-r is absent, so future contributors don't add it without context. Something like a comment in the after_long_help source pointing to #1695.

do this

max-sixty avatar Apr 07 '26 21:04 max-sixty

Done — added an inline HTML comment next to the keybinding table noting why Alt-r is omitted, pointing to #1695 and this issue. PR: #1996

worktrunk-bot avatar Apr 07 '26 21:04 worktrunk-bot