Skip to content

add reusable TUI option selector over shared option snapshots#13716

Open
harryalbert wants to merge 1 commit into
graphite-base/13716from
harry/code-1822-tui-option-selector
Open

add reusable TUI option selector over shared option snapshots#13716
harryalbert wants to merge 1 commit into
graphite-base/13716from
harry/code-1822-tui-option-selector

Conversation

@harryalbert

@harryalbert harryalbert commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

harryalbert commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@harryalbert
harryalbert force-pushed the harry/code-1822-option-snapshots branch from 0e8169a to a1da335 Compare July 14, 2026 22:30
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch 2 times, most recently from ba49160 to d079c43 Compare July 15, 2026 13:22
@harryalbert
harryalbert force-pushed the harry/code-1822-option-snapshots branch 2 times, most recently from 6a11bfe to bf39ff7 Compare July 15, 2026 13:35
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch from d079c43 to 891ad83 Compare July 15, 2026 13:35
@harryalbert
harryalbert changed the base branch from harry/code-1822-option-snapshots to graphite-base/13716 July 15, 2026 16:33
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch from 891ad83 to 8bb2a10 Compare July 15, 2026 16:33
@harryalbert
harryalbert changed the base branch from graphite-base/13716 to harry/code-1822-focus-routing July 15, 2026 16:34
@harryalbert
harryalbert changed the base branch from harry/code-1822-focus-routing to graphite-base/13716 July 15, 2026 16:34
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch from 8bb2a10 to 046ec66 Compare July 15, 2026 16:59
@harryalbert
harryalbert force-pushed the graphite-base/13716 branch from a0ee2eb to 1d2cca1 Compare July 15, 2026 16:59
@harryalbert
harryalbert changed the base branch from graphite-base/13716 to harry/code-1822-focus-routing July 15, 2026 16:59
@harryalbert
harryalbert requested a review from moirahuang July 15, 2026 19:03
@harryalbert
harryalbert marked this pull request as ready for review July 15, 2026 19:03
@oz-for-oss

oz-for-oss Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@harryalbert

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds a reusable headless TUI option selector and generic single-line editor, refactors shared TUI editor keybindings, adds selector/editor render and interaction tests, and documents the as-built design.

Concerns

  • Custom-text editing can be left in an inconsistent state because selector list navigation still runs while the embedded custom editor is active.
  • No material security issues were found in the attached diff.
  • spec_context.md contains no approved or repository spec context, so there was no implementation/spec drift to flag.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread crates/warp_tui/src/option_selector.rs
Comment thread crates/warp_tui/src/option_selector.rs
Comment thread crates/warp_tui/src/option_selector.rs Outdated
Comment thread crates/warp_tui/src/option_selector.rs Outdated
Comment thread crates/warp_tui/src/option_selector.rs Outdated
Comment thread crates/warp_tui/src/option_selector.rs Outdated
@harryalbert
harryalbert force-pushed the harry/code-1822-focus-routing branch from 1d2cca1 to 991c04e Compare July 16, 2026 02:44
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch from 199ce8a to 1e3458b Compare July 16, 2026 02:44
@harryalbert
harryalbert requested a review from moirahuang July 16, 2026 03:23
Comment thread crates/warp_tui/src/input/view.rs Outdated
Comment thread crates/warp_tui/src/editor_view.rs Outdated
@harryalbert
harryalbert changed the base branch from harry/code-1822-focus-routing to graphite-base/13716 July 16, 2026 11:47
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch from d072325 to 6cd77f2 Compare July 16, 2026 11:48
@harryalbert
harryalbert changed the base branch from graphite-base/13716 to harry/code-1822-generic-editor-view July 16, 2026 11:48
@harryalbert harryalbert mentioned this pull request Jul 16, 2026
4 tasks
@harryalbert
harryalbert requested a review from moirahuang July 16, 2026 11:59
@harryalbert
harryalbert force-pushed the harry/code-1822-generic-editor-view branch from a64da86 to db3a140 Compare July 16, 2026 12:44
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch from 6cd77f2 to 2920205 Compare July 16, 2026 12:44
@harryalbert
harryalbert force-pushed the harry/code-1822-generic-editor-view branch from db3a140 to 9ebd6fb Compare July 16, 2026 12:49
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch 2 times, most recently from 57de933 to 1d83418 Compare July 16, 2026 12:53
@harryalbert
harryalbert force-pushed the harry/code-1822-generic-editor-view branch from 9ebd6fb to 159290e Compare July 16, 2026 13:56
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch 2 times, most recently from b8bfd16 to af6c184 Compare July 16, 2026 14:19
@harryalbert
harryalbert force-pushed the harry/code-1822-generic-editor-view branch from 159290e to 6d09be2 Compare July 16, 2026 14:19
}
}
TuiOptionSelectorAction::Dismiss => {
if !self.handle_back(ctx) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when do we want to distinguish dismiss vs. escape?

KeyCode::PageUp => Some("pageup".to_owned()),
KeyCode::PageDown => Some("pagedown".to_owned()),
KeyCode::Tab | KeyCode::BackTab => Some("\t".to_owned()),
KeyCode::Tab | KeyCode::BackTab => Some("tab".to_owned()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to also update named_control_key_to_c0?

- Search and custom text use the shared `TuiEditorView`; printable characters, cursor,
selection, single-line paste, horizontal/word/line navigation, undo/redo, and
kill/yank come from the shared editor layer. Escape remains host policy with a
selector fallback: it clears a non-empty search first, cancels custom editing, or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the code does the right behavior of only clearing the non-empty search if it is focused but want to confirm that was your intended flow? if so maybe we can update this spec to be more specific that we clear a non-empty search only if it's focused

@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch from af6c184 to 36b0f8c Compare July 16, 2026 22:12
@harryalbert
harryalbert force-pushed the harry/code-1822-generic-editor-view branch from 6d09be2 to bc1a9f3 Compare July 16, 2026 22:12
@harryalbert harryalbert mentioned this pull request Jul 16, 2026
4 tasks
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch from 36b0f8c to 1660f1c Compare July 16, 2026 23:09
@harryalbert
harryalbert changed the base branch from harry/code-1822-generic-editor-view to graphite-base/13716 July 16, 2026 23:41
Co-Authored-By: Oz <oz-agent@warp.dev>
@harryalbert
harryalbert force-pushed the harry/code-1822-tui-option-selector branch from 1660f1c to edc2ee4 Compare July 17, 2026 02:57
@harryalbert
harryalbert force-pushed the graphite-base/13716 branch from ee6779e to 1c508d1 Compare July 17, 2026 02:57
@harryalbert
harryalbert changed the base branch from graphite-base/13716 to harry/code-1822-generic-editor-view July 17, 2026 02:57
@harryalbert
harryalbert changed the base branch from harry/code-1822-generic-editor-view to graphite-base/13716 July 17, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants