[twarp 07b] Claude Code panel: main-pane host + claude-at-submit trigger#71
Open
timomak wants to merge 3 commits into
Open
[twarp 07b] Claude Code panel: main-pane host + claude-at-submit trigger#71timomak wants to merge 3 commits into
timomak wants to merge 3 commits into
Conversation
Relocate the transcript renderer #69 landed in the rejected left sidebar into a first-class main-content pane (IPaneType::ClaudeCode), add the conservative `claude`-at-submit terminal trigger that opens it, and delete the #69 sidebar host. Per the main-pane re-spec (#70). - ClaudeCodeView (BackingView) is the git-mv'd #69 renderer; transcript + docked composer are the pane body, the "Claude Code" + cwd header moves to render_header_content. All render leaves + the synthetic source are unchanged. - ClaudeCodePane (PaneContent) mirrors NetworkLogPane; LeafContents::ClaudeCode is non-persisted (no transcript store; resume via `claude --resume`, 7h). - Trigger mirrors the OpenCodeInWarp chain: Input intercepts a bare top-level `claude` (tokenized via warp_completer; pipes/chains/paths/off-PATH run raw), emits OpenClaudeCodePane through input::Event -> view::Event -> pane_group -> Workspace::open_claude_code_pane. Intercepted block shows a brief toast. - Sidebar host removed: ToolPanelView::ClaudeCode, toolbelt button, LeftPanelDisplayedTab persistence, ToggleClaudeCodePanel action + the cmd-alt-K binding. cargo check/clippy/fmt clean; claude_code 19/19 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…mark #70 merged Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ation Two fixes found testing #71 on a real build: 1. Alias-aware trigger. Warp expands shell aliases at submit, so a user's `alias claude='command claude --flags'` reached the interceptor already expanded as `command claude …`; `top_level_command` then read `command` (the builtin) and the trigger never fired. `claude_pane_trigger` now peels leading env-var assignments and the `command`/`builtin`/`exec` run-a-program wrappers to recover the real program token, and forwards only a leading positional as the first turn (alias-injected flags are not a prompt). 2. Transcript no longer truncates. The ported `UniformList` clips every row to one measured height, so multi-paragraph assistant replies rendered as a single line. Render transcript items at their natural height in a `ClippedScrollable` column instead (a variable-height virtualized list can return later if very large sessions need it, PRODUCT §14). cargo check/clippy/fmt clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sub-phase 7b of feature 07 (Claude Code panel). Per the main-pane re-spec (#70, merged), this relocates the Claude Code chat renderer that #69 landed in the left sidebar into a first-class main-content pane, adds the
claude-at-submit terminal trigger that opens it, and deletes the #69 sidebar host.Nothing new is re-introduced from a branch: the
crates/claude_codedriver and the ported transcript renderer are already on master (via #69). This PR moves the renderer into a pane and wires the entry point.What changed
New pane type (
IPaneType::ClaudeCode), modeled on the simplest existing non-persisted pane (NetworkLogPane/NetworkLogView):app/src/claude_code_view.rs— the [twarp 07b] Claude Code panel: panel shell + ported transcript #69 renderer, repurposed as aBackingView(ClaudeCodeView). The transcript + docked composer are the pane body; the "Claude Code" + cwd header moves torender_header_content. Every render leaf (markdown body, code block, message rows, the synthetic source) is unchanged from [twarp 07b] Claude Code panel: panel shell + ported transcript #69. (File is agit mvofclaude_code_panel/mod.rsso history is preserved.)app/src/pane_group/pane/claude_code_pane.rs—ClaudeCodePane(PaneContent), the thin wrapper aroundPaneView<ClaudeCodeView>.IPaneType::ClaudeCodeenum/Display/render arm +PaneId::from_claude_code_pane_{ctx,view}factories.LeafContents::ClaudeCode— non-persisted (a restored pane can't replay a liveclaude; twarp keeps no transcript store — session restore isclaude --resume, 7h). Handled inis_persisted,restore_pane_leaf,sqlite::save_pane_state,launch_config,vertical_tabs.Terminal trigger (
claudeat submit → open the pane), mirroring the existingOpenCodeInWarp/OpenFileInWarpchain exactly:Input::try_execute_command_from_sourceintercepts a bare top-levelclaudebefore the PTY write. Detection is conservative (PRODUCT §3): tokenized withwarp_completer::parsers::simple::top_level_command(no hand-rolled shell parsing) — pipelines,&&/;chains, subshells, and full paths are not intercepted; ifclaudeisn't onPATHit's not intercepted (the shell's own error stands, §4); onlyCommandExecutionSource::Usersubmissions qualify.Event::OpenClaudeCodePane { args, cwd }throughinput::Event→handle_input_event→view::Event→handle_terminal_view_event→pane_group::Event→Workspace::open_claude_code_pane.Sidebar host deleted (the #69 placement the owner rejected): the
ToolPanelView::ClaudeCodetab, toolbelt button,LeftPanelAction::ClaudeCode,LeftPanelDisplayedTab::ClaudeCodepersistence, theWorkspaceAction::ToggleClaudeCodePanel/CustomActionaction, and the ⌘⌥K binding are all removed.Provisional decisions (flagged for review)
add_pane_with_direction(Direction::Right, …)— exactly what TECH §The pane prescribes and identical to howopen_network_log_paneworks. PRODUCT §load-bearing-2 marks "new tab vs split vs replace" as open; happy to switch to a genuine new top-level tab if preferred.try_execute_command_from_source). Can move to an in-block banner if you'd rather it live in the scrollback.claude <prompt>seeds the first synthetic turn; cwd shows in the header.Testing
cargo check -p warp— 0 errors, 0 warnings.cargo clippy -p warp— clean.cargo fmt --checkon all changed files — clean.cargo test -p claude_code— 19/19 pass (the kept driver crate is unchanged).warp_completer'stop_level_command, which already hastest_top_level_commandcovering the piped/chained/path cases; the smoke test below exercises the edges manually.Smoke test (7b — no live
claudesession needed)claude→ a Claude Code pane opens in the main content area and is focused; the terminal block shows a brief "Opened Claude Code in a pane" note and does not run rawclaude.claude fix the bug→ the pane opens with "fix the bug" already rendered as the first user turn (synthetic reply follows).echo hi | claude,echo x && claude,/usr/bin/claude(full path),claudia.claudefromPATHand runclaude→ twarp does not intercept (the shell shows command-not-found). Restoreclaude.🤖 Generated with Claude Code