Skip to content

fix(tui): honor dismissed Playbook selection menu - #1286

Merged
edwin-zvs merged 1 commit into
mainfrom
fix-playbook-live-selection-menu
Aug 19, 2026
Merged

fix(tui): honor dismissed Playbook selection menu#1286
edwin-zvs merged 1 commit into
mainfrom
fix-playbook-live-selection-menu

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

  • stop rendering a default Playbook selection menu after the first Esc has dismissed its state
  • clear stale selection-menu hit targets while preserving the selected text for the documented second-Esc behavior
  • add a TestBackend regression that creates a selection through rendered mouse geometry, routes Tab and Esc through terminal ingress, and verifies visible focus and dismissal cues
  • retain the fenced-code changes merged in Playbook editor: support triple-backtick fenced code #1281 by building this fix on main at d33289e

Diagnosis

#1285 correctly separated selection_menu from the text selection in key state, but the renderer used unwrap_or_default whenever a non-empty selection existed. After first Esc set selection_menu to None, a passive-looking ghost menu was painted anyway. Tab then reached the editor because no menu existed to focus, and the next Esc cleared the selection, making the painted menu and selection disappear together.

Verification

  • cargo test -p construct-cli --bin construct playbook_live_mouse_selection_tabs_into_menu_then_escapes_in_two_layers -- --nocapture (1 passed)
  • cargo test -p construct-cli --bin construct playbook (353 passed)
  • cargo test -p construct-e2e --test playbook_view (8 passed)
  • cargo build --workspace
  • git diff --check
  • full CLI suite: 1,439 passed; the existing color::tests::truecolor_backend_still_emits_rgb environment-sensitive baseline failed, matching the known main-worktree failure reported in fix(tui): let Tab focus Playbook selection menu #1285

No spec update: spec 0196 already requires menu absence after first Esc while retaining the selection; this fixes the renderer to honor it.

Reviewer media

Not attached. The behavior is a short transient focus/dismiss sequence, and the frame-level regression directly asserts the passive hint, focused cursor cue, menu body, and dismissed frame without introducing a brittle recording harness.

@edwin-zvs
edwin-zvs merged commit 003fa4b into main Aug 19, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the fix-playbook-live-selection-menu branch August 19, 2026 04:48
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.

1 participant