Repository navigation
Run tab-level commands from launch config URIs - #13103
moirahuang merged 2 commits into
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR deserializes tab-level launch-config commands and normalizes them into the startup pane before opening a launch-config window, including URI launches. It preserves existing pane-level command behavior and includes coverage for leaf layouts and focused panes in split layouts.
Concerns
- No blocking correctness, security, or spec-alignment concerns found. The only non-blocking follow-up is to cover the no-focused-pane fallback path added in this PR.
Verdict
Found: 0 critical, 0 important, 1 suggestion
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| PaneTemplateType::PaneBranchTemplate { panes, .. } => { | ||
| if let Some(focused_pane) = panes.iter_mut().find(|pane| pane.is_focused_pane()) { | ||
| focused_pane.add_commands_to_startup_pane(tab_commands) | ||
| } else if let Some(first_pane) = panes.first_mut() { |
There was a problem hiding this comment.
💡 [SUGGESTION] Add a unit test for the no-focused-pane path so the documented fallback applies tab-level commands to the first pane, not just to focused panes.
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR teaches launch config tab templates to deserialize legacy tab-level commands, normalizes those commands into the startup pane before opening a launch config window, and adds unit coverage for leaf, focused split-pane, and fallback split-pane behavior. The PR description includes before/after videos for the user-facing launch behavior.
Concerns
- No blocking correctness, security, or spec-alignment concerns found in the changed diff.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
moirahuang
left a comment
There was a problem hiding this comment.
This looks good! Mind adding a recording of the multi pane case to the description? Then I'll merge it
|
@moirahuang added the multi-pane recording to the PR description. |
Port upstream commit 482f63a. Launch configuration tabs can include a top-level commands: block. Previously, when opening a launch config through warp://launch/<name>, Warp preserved the tab layout/cwd but dropped those tab-level commands because only pane-level commands were applied to the pane layout. This normalizes tab-level commands into the startup pane before opening the tab. For split layouts, commands are applied to the focused pane, falling back to the first pane if no pane is focused. - Add commands: Vec<CommandTemplate> field to TabTemplate - Add TabTemplate::layout_with_tab_commands() method - Add PaneTemplateType::add_commands_to_startup_pane() and is_focused_pane() helpers - Update workspace/view.rs to call layout_with_tab_commands() - Set commands: Vec::new() in TryFrom<TabSnapshot> and mock/test literals Closes warpdotdev#9007.
Launch configuration tabs can include a top-level `commands:` block. When opening a launch config through `warp://launch/<name>`, Warp preserved the tab layout/cwd but dropped those tab-level commands because only pane-level commands were applied to the pane layout. This normalizes tab-level commands into the startup pane before opening the tab. For split layouts, commands are applied to the focused pane, falling back to the first pane if no pane is focused. CHANGELOG-BUG-FIX: Fixed launch configuration tab-level commands not running when opened through `warp://launch/<name>`. (cherry picked from commit 482f63a) (cherry picked from commit 0826467)
Description
Launch configuration tabs can include a top-level
commands:block. When opening a launch config throughwarp://launch/<name>, Warp preserved the tab layout/cwd but dropped those tab-level commands because only pane-level commands were applied to the pane layout.This normalizes tab-level commands into the startup pane before opening the tab. For split layouts, commands are applied to the focused pane, falling back to the first pane if no pane is focused.
Linked Issue
Closes #9007
ready-to-specorready-to-implement.Testing
./script/runAutomated:
cargo fmtcargo test -p warp launch_config --libcargo check -p warp --libcargo check -p integrationcargo clippy -p warp --tests -- -D warningsManual:
warposs://launch/warptest, butcat /tmp/warp-9007-uri-command.txtreports no such file.echo after > /tmp/warp-9007-uri-command.txt;catprintsafter.cat /tmp/warp-9007-uri-multipane-command.txtprintsmultipane-after.Screenshots / Videos
Agent Mode
CHANGELOG-BUG-FIX: Fixed launch configuration tab-level commands not running when opened through
warp://launch/<name>.