[twarp 07b] Claude Code panel: resurrect view + event model#67
Open
timomak wants to merge 2 commits into
Open
Conversation
7b scaffolds feature 07's Claude Code left-panel. It registers as a left-panel tab, opens, and renders its zero state (PRODUCT §5) or, when `claude` is not on PATH, its unavailable state (PRODUCT §6) — but it spawns no `claude` process: merely showing the panel starts no subprocess (PRODUCT §7). The live session, streaming, cards, permissions, and session list are 7c–7h. New headless crate `crates/claude_code` defines the contract both halves of the feature meet at (TECH §Parallelization): the thin twarp-native `TranscriptEvent` the 7c driver will emit and the `Transcript` / `TranscriptItem` model the panel renders. `Transcript::apply` — delta accumulation, in-place TodoWrite updates, tool-result matching, verbatim error surfacing — is unit-tested (6 tests) with no GPUI, so the event→model mapping is verifiable before any live `claude` exists. The panel (`app/src/claude_code_panel/`) is a proper child View (the Warp Drive pattern) so 7c–7h have a home to grow into. It re-checks `claude` on PATH at render time (PRODUCT §6). The message input is a styled, non-editable placeholder in 7b; real editing + Enter-to-send is 7c (§8) and 7g (§43). Registration: `ToolPanelView::ClaudeCode` + `LeftPanelDisplayedTab::ClaudeCode` (both From directions), a toolbelt button (Agent Mode icon), focus/render arms, and a `compute_left_panel_views` push gated on the new `FeatureFlag::ClaudeCodePanel`. The flag is dogfood-only: DOGFOOD_FLAGS + cargo feature `claude_code_panel`, intentionally absent from `default`, so it stays hidden in stable. Keybinding: ⌘⌥K (Ctrl+Alt+K) toggles the panel via `WorkspaceAction::ToggleClaudeCodePanel` + `CustomAction::ToggleClaudeCodePanel`. Per the feature-06 lesson, the default chord is registered in `custom_tag_to_keystroke`, NOT `EditableBinding::with_key_binding` (which would clobber `Trigger::Custom` and panic the mac menu builder); the binding stays an `EditableBinding` so it remains remappable, and is flag-gated via `.with_enabled`. Conflict check: `cmd-alt-k` / `ctrl-alt-k` were unbound. Per PRODUCT §2, re-pressing the chord while the tab is active returns focus to the terminal rather than collapsing the whole left panel. Deferred to later sub-phases (noted so review scopes correctly): live session / streaming / Stop / UniformList auto-scroll (7c, §8–§22); rich tool / diff / thinking / todo cards (7d–7f — the transcript renderer is a placeholder); permission prompts + editable multi-line input (7g, §39–§45); session list, resume, and the cwd-in-header + zero-state "Resume…" entry point (7h / 7c, §4, §46–§51). Validation: `cargo check` and `cargo clippy` clean with the feature; rustfmt clean; `claude_code` unit tests pass. Full `./script/presubmit` is not runnable on this Mac (clang-format/wgslfmt/nextest gaps). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reconcile STATUS to git (spec #66 merged) and record the 7b impl PR. Tick the 7b sub-phase, flip the feature phase to impl-in-review, and note the resolved decisions: ⌘⌥K conflict-free (cmd-alt-k/ctrl-alt-k unbound), FeatureFlag::ClaudeCodePanel dogfood-only, launch-verified no startup panic, and the 7c–7h deferrals. Co-Authored-By: Claude Opus 4.7 (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.
twarp 07b — Claude Code panel: resurrect view + event model
First implementation sub-phase of feature 07 (
roadmap/07-claude-code-panel/). Specs (PRODUCT.md + TECH.md) merged in #66.Framing: feature 02 removed Warp's AI service (accounts, LLM clients, billing, cloud storage). Feature 07 brings back only the rendering layer, driven by the local
claudeCLI the user already runs. 7b is the scaffold — the panel registers, opens, and renders its zero/unavailable states. It spawns noclaudeprocess; the live session is 7c. No LLM client, billing, or cloud sync comes back.What's in this PR
crates/claude_code(new, headless): the contract both halves of the feature meet at — the thin twarp-nativeTranscriptEventthe 7c driver will emit and theTranscript/TranscriptItemmodel the panel renders.Transcript::apply(delta accumulation, in-placeTodoWriteupdates, tool-result matching, verbatim error surfacing) is unit-tested (6 tests) with no GPUI, per TECH §Parallelization. The subprocess + stream-json parser land in 7c.app/src/claude_code_panel/(new): a childView(the Warp Drive pattern, so 7c–7h have a home). Renders the zero state (explanation + message input + "Start session", PRODUCT §5) or, whenclaudeis not onPATH, the unavailable state (PRODUCT §6, re-checked each render). The input is a styled, non-editable placeholder in 7b; real editing is 7c/7g.ToolPanelView::ClaudeCode+LeftPanelDisplayedTab::ClaudeCode(bothFromdirections), toolbelt button (Agent Mode icon), focus/render arms, and acompute_left_panel_viewspush gated on the newFeatureFlag::ClaudeCodePanel.FeatureFlag::ClaudeCodePanelinDOGFOOD_FLAGS+ cargo featureclaude_code_panel, intentionally absent fromdefaultso it stays hidden in stable.WorkspaceAction::ToggleClaudeCodePanel+CustomAction::ToggleClaudeCodePanel. The default chord is registered incustom_tag_to_keystroke, notEditableBinding::with_key_binding— the feature-06 lesson (it would clobberTrigger::Customand panic the mac menu). The binding stays anEditableBinding, so it remains remappable. Conflict check:cmd-alt-k/ctrl-alt-kwere unbound. Per PRODUCT §2, re-pressing the chord while the tab is active returns focus to the terminal rather than collapsing the whole left panel.Deferred to later sub-phases (so review scopes correctly)
claude, stream assistant text, send messages, Stop/teardown,UniformListbottom-stick auto-scroll, markdown, cwd-in-header (§8–§22, §52–§57). The transcript renderer here is a placeholder.Validation
cargo checkandcargo clippyclean with--features claude_code_panel;rustfmtclean;claude_codeunit tests pass (6/6).warp-oss --features claude_code_paneland launched it: app reaches steady state with no startup panic (the menu-build path the feature-06 keybinding bug tripped).claude_code_paneladds no menu item, so that lookup is never invoked../script/presubmitis not runnable on this machine (clang-format / wgslfmt / nextest gaps); the checks above are the runnable subset.Smoke test (reviewer)
Run the 7b section of the Smoke test in
roadmap/07-claude-code-panel/PRODUCT.mdagainst a dogfood build (./script/runof the localwarpbin, or--features claude_code_panel): toolbelt entry shows ("Claude Code"); ⌘⌥K toggles (opens+focuses when inactive, returns focus when active) and is rebindable; left-panel width persists across restart; zero state shows with noclaudesubprocess spawned; renaming/hidingclaudeonPATHshows the unavailable state.🤖 Generated with Claude Code