Skip to content

Generalize TUI inline menu routing#13668

Open
harryalbert wants to merge 1 commit into
masterfrom
harry/code-1821-multiple-menu-infrastructure
Open

Generalize TUI inline menu routing#13668
harryalbert wants to merge 1 commit into
masterfrom
harry/code-1821-multiple-menu-infrastructure

Conversation

@harryalbert

@harryalbert harryalbert commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

Before this PR, the TUI input owned one optional TuiInlineMenu, and routing was tied to the concrete slash-command model through an enum and per-operation matches. Adding another inline surface meant expanding that routing enum while also replacing the one menu threaded through session construction. Visible-row capacity was separately split between a hard-coded slash-command limit and renderer-side chrome accounting.

This PR makes inline menus an ordered collection of cloneable, type-erased handles instead. TuiInlineMenuHandle defines the shared lifecycle, navigation, acceptance, and snapshot operations; the slash-command model is the first implementation. Input routing and rendering delegate directly to the first open handle without model-specific matches, and shared sizing derives visible result rows from the allocated height, border, title, and tabs. The slash-command menu remains the only registered menu in this PR, so behavior is unchanged while additional menus can implement the same interface upstack.

Testing

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

Screenshots / Videos

No behavior changes for this PR. Just setting things up for PRs up the stack

Agent Mode

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

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label Jul 13, 2026

harryalbert commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

// ── Layout sizing ────────────────────────────────────────────────────────────

/// Returns the result rows available after reserving border and header chrome.
pub(crate) const fn result_row_capacity(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is just fixing an issue I noticed further up the stack where there were some selection issues b/c the row capacity wasn't being correctly calculated w/ a title

@harryalbert harryalbert force-pushed the harry/code-1821-multiple-menu-infrastructure branch from 9c73d34 to 067fd30 Compare July 13, 2026 20:56
@harryalbert harryalbert marked this pull request as ready for review July 13, 2026 20:58
@oz-for-oss

oz-for-oss Bot commented Jul 13, 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 generalizes the TUI inline-menu plumbing from a single slash-command menu into an ordered collection, reusing shared menu sizing and rendering the first open inline menu. No approved or repository spec context was provided, and I did not find security-sensitive changes in the diff.

Concerns

  • The change touches the TUI inline-menu render/routing path, but the PR body does not include accepted TUI visual evidence. For this user-facing TUI change, please attach a terminal transcript, render_to_lines / TuiBuffer::to_lines snapshot, or a ./script/run-tui / ./script/run capture demonstrating the slash-command menu still works end to end.

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/terminal_session_view.rs
Co-Authored-By: Oz <oz-agent@warp.dev>
@harryalbert harryalbert force-pushed the harry/code-1821-multiple-menu-infrastructure branch from 067fd30 to 053d02e Compare July 13, 2026 22:27
@harryalbert harryalbert requested a review from moirahuang July 13, 2026 22:30
@moirahuang moirahuang mentioned this pull request Jul 14, 2026
13 tasks
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