Skip to content

Commit acc082b

Browse files
committed
fix: use live metadata path, skip Review panel data loading during creation
Two fixes for workspace rename not updating UI: 1. App.tsx: Use currentMetadata?.namedWorkspacePath instead of the stale selectedWorkspace.namedWorkspacePath. The live metadata updates when the workspace is renamed, while selectedWorkspace is set once at creation. 2. ReviewPanel.tsx: Add isCreating checks to useEffects that load data. Previously the early return only affected the render output, but the data loading useEffects still ran and tried to call executeBash on a workspace that wasn't in config yet.
1 parent dd84ecc commit acc082b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/browser/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,9 @@ function AppInner() {
576576
currentMetadata?.name ??
577577
selectedWorkspace.namedWorkspacePath?.split("/").pop() ??
578578
selectedWorkspace.workspaceId;
579+
// Use live metadata path (updates on rename) with fallback to initial path
580+
const workspacePath =
581+
currentMetadata?.namedWorkspacePath ?? selectedWorkspace.namedWorkspacePath ?? "";
579582
return (
580583
<ErrorBoundary
581584
workspaceInfo={`${selectedWorkspace.projectName}/${workspaceName}`}
@@ -586,7 +589,7 @@ function AppInner() {
586589
projectPath={selectedWorkspace.projectPath}
587590
projectName={selectedWorkspace.projectName}
588591
branch={workspaceName}
589-
namedWorkspacePath={selectedWorkspace.namedWorkspacePath ?? ""}
592+
namedWorkspacePath={workspacePath}
590593
runtimeConfig={currentMetadata?.runtimeConfig}
591594
incompatibleRuntime={currentMetadata?.incompatibleRuntime}
592595
status={currentMetadata?.status}

src/browser/components/RightSidebar/CodeReview/ReviewPanel.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ export const ReviewPanel: React.FC<ReviewPanelProps> = ({
194194

195195
// Load file tree - when workspace, diffBase, or refreshTrigger changes
196196
useEffect(() => {
197-
if (!api) return;
197+
// Skip data loading while workspace is being created
198+
if (!api || isCreating) return;
198199
let cancelled = false;
199200

200201
const loadFileTree = async () => {
@@ -242,11 +243,13 @@ export const ReviewPanel: React.FC<ReviewPanelProps> = ({
242243
filters.diffBase,
243244
filters.includeUncommitted,
244245
refreshTrigger,
246+
isCreating,
245247
]);
246248

247249
// Load diff hunks - when workspace, diffBase, selected path, or refreshTrigger changes
248250
useEffect(() => {
249-
if (!api) return;
251+
// Skip data loading while workspace is being created
252+
if (!api || isCreating) return;
250253
let cancelled = false;
251254

252255
const loadDiff = async () => {
@@ -336,6 +339,7 @@ export const ReviewPanel: React.FC<ReviewPanelProps> = ({
336339
filters.includeUncommitted,
337340
selectedFilePath,
338341
refreshTrigger,
342+
isCreating,
339343
]);
340344

341345
// Persist diffBase when it changes

0 commit comments

Comments
 (0)