From 0d65edfa44f143294f222da242bb61d3f3aab85a Mon Sep 17 00:00:00 2001
From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
Date: Thu, 8 Oct 2026 18:11:37 -0400
Subject: [PATCH] feat(walkthrough): move source picker into the panel header
---
.../navigation/ToolSidePanel.test.tsx | 1 +
.../components/navigation/ToolSidePanel.tsx | 2 +
.../session/ChangesWalkthroughSheet.test.tsx | 13 ++-
.../session/ChangesWalkthroughSheet.tsx | 91 ++++++++++---------
4 files changed, 61 insertions(+), 46 deletions(-)
diff --git a/frontend/src/components/navigation/ToolSidePanel.test.tsx b/frontend/src/components/navigation/ToolSidePanel.test.tsx
index e8e4edd6..4c2a292b 100644
--- a/frontend/src/components/navigation/ToolSidePanel.test.tsx
+++ b/frontend/src/components/navigation/ToolSidePanel.test.tsx
@@ -27,6 +27,7 @@ vi.mock('@/components/session/ChangesWalkthroughSheet', () => ({
ChangesWalkthroughProvider: ({ children }: { children: ReactNode }) => <>{children}>,
ChangesWalkthroughNav: () => null,
ChangesWalkthroughRegenerate: () => null,
+ ChangesWalkthroughSourcePicker: () => null,
ChangesWalkthroughView: () =>
-
+ )
+})
- {sourceKind === 'branch' || sourceKind === 'pullRequest' ? (
-
setBaseInput(event.target.value)}
- onBlur={commitInputs}
- onKeyDown={(event) => {
- if (event.key === 'Enter') commitInputs()
- }}
- />
- ) : null}
+/** Collects the base branch or pull request number for git-backed walkthrough sources. */
+const WalkthroughSourceInputs = memo(function WalkthroughSourceInputs() {
+ const { sourceKind, baseInput, setBaseInput, numberInput, setNumberInput, setSource } =
+ useChangesWalkthrough()
+
+ const commitInputs = useCallback(() => {
+ const next = toWalkthroughSource({ kind: sourceKind, base: baseInput, number: Number(numberInput) })
+ if (next) setSource(next)
+ }, [sourceKind, baseInput, numberInput, setSource])
+
+ if (sourceKind !== 'branch' && sourceKind !== 'pullRequest') return null
+
+ return (
+
)
@@ -429,7 +429,7 @@ export const ChangesWalkthroughView = memo(function ChangesWalkthroughView() {
return (
-
+
{error ? (
@@ -569,6 +569,7 @@ export function ChangesWalkthroughSheet({ sessionId, open, onOpenChange }: Chang
onClose={close}
actions={
<>
+
>