Skip to content

Share slash command behavior between GUI and TUI#13602

Open
moirahuang wants to merge 2 commits into
masterfrom
moira/tui-slash-command-parity
Open

Share slash command behavior between GUI and TUI#13602
moirahuang wants to merge 2 commits into
masterfrom
moira/tui-slash-command-parity

Conversation

@moirahuang

@moirahuang moirahuang commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Description

Stack: 1 of 4. Follow-up: #13603.

Establishes behavioral parity between the GUI and TUI for exact-match slash-command menu visibility, acceptance telemetry, and submitted skill invocation.

The TUI now parses submitted input before clearing it, so recognized static commands and skills take their typed execution paths while ordinary text remains an Agent prompt. Skill resolution and request construction are extracted into BlocklistAIController and reused by both GUI and TUI call sites.

Ordinary nonblank prompts are submitted without trimming their leading whitespace. This preserves GUI parity and prevents input such as /compact from regaining slash-command semantics after the shared parser correctly rejects it.

In scope

  • Share the GUI's exact-match menu-closing rule with the TUI.
  • Route static-command and saved-prompt acceptance telemetry through shared helpers.
  • Extract skill resolution and request construction from the GUI input path.
  • Use that shared controller path for TUI skill submissions.
  • Classify submitted TUI input before clearing the editor.
  • Preserve raw nonblank prompt text while rejecting whitespace-only submissions.
  • Add regression coverage for exact static-command and skill matches, menu lifecycle, submitted-input routing, and leading-whitespace preservation.

Out of scope

  • Semantic command IDs.
  • GUI-style structured editing for parameterized saved prompts.

How to review

  1. Start with app/src/terminal/input/slash_commands/mod.rs for the newly extracted exact-match and telemetry helpers.
  2. Review app/src/ai/blocklist/controller.rs together with app/src/terminal/input.rs; this should be a behavior-preserving extraction of the existing GUI skill path.
  3. Review crates/warp_tui/src/slash_commands.rs for the TUI integration of the shared exact-match rule.
  4. Review crates/warp_tui/src/terminal_session_view.rs for submitted-input classification, raw-prompt preservation, and TUI skill invocation.
  5. Finish with app/src/tui_export.rs, app/src/terminal/input/slash_command_model_tests.rs, and crates/warp_tui/src/terminal_session_view_tests.rs for the exported boundary and parity coverage.

Linked Issue

No 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

Final-stack validation on 2026-07-11:

  • ./script/format — passed.
  • cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warnings — passed.
  • cargo clippy -p warp_completer --all-targets --tests -- -D warnings — passed.
  • Added regression coverage for exact command and skill matches, menu visibility, submitted skill execution, and leading-whitespace preservation.

Cargo tests and manual TUI validation were not rerun after the final restack.

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

Screenshots / Videos

Not included; manual TUI validation remains outstanding.

Agent Mode

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

CHANGELOG-IMPROVEMENT: Keep slash-command behavior consistent between the GUI and TUI.

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

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

moirahuang commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

@oz-for-oss

oz-for-oss Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

@moirahuang

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 shares slash-command parsing, menu-closing behavior, telemetry helpers, and skill invocation plumbing between the GUI and TUI surfaces.

Concerns

  • User-visible TUI slash-command behavior changed, but the PR description explicitly says screenshots/videos are not included and manual TUI validation was skipped. Per the repo review guidance for TUI changes, please attach a terminal transcript, render_to_lines/TuiBuffer::to_lines snapshot diff, or ./script/run-tui capture demonstrating the behavior end to end.
  • Submitted TUI slash-command input is now parsed before trimming, which regresses previously supported inputs with leading whitespace.

Verdict

Found: 0 critical, 2 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

);
} else {
self.send_prompt(prompt.to_owned(), ctx);
.parse_input(input, 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.

⚠️ [IMPORTANT] This now parses the raw input before trimming, so /compact or /skill no longer executes as a slash command even though the old TUI path trimmed before parsing; trim before parse_input and use the same trimmed value for fallback prompt submission.

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 intended, to match GUI behavior

@moirahuang moirahuang marked this pull request as ready for review July 11, 2026 17:52
@oz-for-oss

oz-for-oss Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

@moirahuang

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 extracts shared slash-command helpers and routes TUI exact-match handling, telemetry, and submitted skill invocation through the shared GUI/TUI paths.

Concerns

  • ⚠️ [IMPORTANT] This is a user-facing TUI behavior change, but the PR description explicitly says no screenshots/videos were included and manual TUI validation was skipped. For TUI changes, the repo guidance requires visual evidence such as a terminal transcript, a render_to_lines / TuiBuffer::to_lines snapshot diff, or a ./script/run-tui capture demonstrating the exact-match menu lifecycle and submitted static/skill behavior 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

Co-Authored-By: Oz <oz-agent@warp.dev>
SlashCommandSelectionBehavior::Execute
}
}

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.

extracts GUI logic

|| command.name == commands::COMPACT.name
|| command.name == commands::PLAN.name
}
/// Records a static slash command accepted from either the GUI or TUI surface.

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.

extracts GUI logic

);
if is_argument_entry || executes_on_selection {
if !menu_was_open
|| should_close_slash_command_menu_for_exact_match(

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.

now uses the extracted shared GUI logic

.is_none()
.then(|| detected_skill.name.clone()),
ParsedSlashCommandInput::SkillCommand(detected_skill) => {
if !menu_was_open

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.

was_open guards against re-opening the slash command menu if it was previously open (matching GUI behavior)

}

/// Resolves a skill reference against this controller's active execution host.
pub(crate) fn resolve_skill_for_invocation(

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.

these fns also simplify / pull out GUI logic

);
} else {
self.send_prompt(prompt.to_owned(), ctx);
.parse_input(input, ctx)

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 intended, to match GUI behavior

Co-Authored-By: Oz <oz-agent@warp.dev>
@moirahuang moirahuang requested a review from harryalbert July 12, 2026 00:11
@moirahuang moirahuang force-pushed the moira/tui-slash-command-parity branch from 7139365 to e7b6c57 Compare July 12, 2026 00:17
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.

1 participant