Skip to content

tui: Tab cannot indent a multi-line Playbook selection — the selection menu claims the key #1106

Description

@edwin-zvs

Spec 0094 gives Tab / S-Tab list nesting that "operate on every list line the selection spans, or just the cursor's line when there is no selection". The multi-line half is unreachable: a selection also shows the selection action menu, and that menu claims Tab first, to focus itself.

if !menu_focused {
    if matches!(key.code, KeyCode::Tab) && !ctrl && !alt && !super_mod {
        let menu = popup.selection_menu.get_or_insert_with(Default::default);
        menu.focused = true;
        return true;
    }
    return false;
}

(crates/cli/src/app/editor.rs ~lines 1100–1110 @ ad47152handle_playbook_selection_menu_key runs before the editor's own key match, so KeyCode::Tab => self.shift_playbook_indent(false) at ~line 811 never sees it.)

S-Tab is not intercepted, so it still outdents the selection. The pair is asymmetric: you can un-nest a multi-line selection but not nest it.

Repro

Document - one\n- two\n- three\n.

  1. Put the caret at the start, press S-Down twice (selection (2, 14), menu appears).
  2. Press Tab.

Observed: document unchanged; the selection menu takes focus.

after Tab with selection:   '- one\n- two\n- three\n'
after S-Tab with selection: '- one\n- two\n  - three\n'   ← outdent applied

Without a selection, Tab indents the caret's line correctly (- three - three), so the binding works — it is only shadowed while a selection exists, which is exactly when multi-line nesting is wanted.

Expected

Indenting a selected block of list items should work from the keyboard. Options:

Whichever is chosen, Tab and S-Tab should be symmetric.

Acceptance criteria

  • Tab with a multi-line selection indents every list line the selection spans, per spec 0094.
  • S-Tab keeps outdenting the same lines.
  • The selection menu is still reachable from the keyboard, by a key that is advertised.

Found during a hands-on UX audit of the Playbook in the TUI and web UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions