File tree Expand file tree Collapse file tree 5 files changed +32
-5
lines changed
Expand file tree Collapse file tree 5 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -589,6 +589,7 @@ function AppInner() {
589589 namedWorkspacePath = { selectedWorkspace . namedWorkspacePath ?? "" }
590590 runtimeConfig = { currentMetadata ?. runtimeConfig }
591591 incompatibleRuntime = { currentMetadata ?. incompatibleRuntime }
592+ status = { currentMetadata ?. status }
592593 />
593594 </ ErrorBoundary >
594595 ) ;
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ interface AIViewProps {
5555 className ?: string ;
5656 /** If set, workspace is incompatible (from newer mux version) and this error should be displayed */
5757 incompatibleRuntime ?: string ;
58+ /** If 'creating', workspace is still being set up (git operations in progress) */
59+ status ?: "creating" ;
5860}
5961
6062const AIViewInner : React . FC < AIViewProps > = ( {
@@ -65,6 +67,7 @@ const AIViewInner: React.FC<AIViewProps> = ({
6567 namedWorkspacePath,
6668 runtimeConfig,
6769 className,
70+ status,
6871} ) => {
6972 const { api } = useAPI ( ) ;
7073 const chatAreaRef = useRef < HTMLDivElement > ( null ) ;
@@ -637,6 +640,7 @@ const AIViewInner: React.FC<AIViewProps> = ({
637640 onStartResize = { isReviewTabActive ? startResize : undefined } // Pass resize handler when Review active
638641 isResizing = { isResizing } // Pass resizing state
639642 onReviewNote = { handleReviewNote } // Pass review note handler to append to chat
643+ isCreating = { status === "creating" } // Workspace still being set up
640644 />
641645 </ div >
642646 ) ;
Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ interface RightSidebarProps {
8484 isResizing ?: boolean ;
8585 /** Callback when user adds a review note from Code Review tab */
8686 onReviewNote ?: ( note : string ) => void ;
87+ /** Workspace is still being created (git operations in progress) */
88+ isCreating ?: boolean ;
8789}
8890
8991const RightSidebarComponent : React . FC < RightSidebarProps > = ( {
@@ -95,6 +97,7 @@ const RightSidebarComponent: React.FC<RightSidebarProps> = ({
9597 onStartResize,
9698 isResizing = false ,
9799 onReviewNote,
100+ isCreating = false ,
98101} ) => {
99102 // Global tab preference (not per-workspace)
100103 const [ selectedTab , setSelectedTab ] = usePersistedState < TabType > ( "right-sidebar-tab" , "costs" ) ;
@@ -298,6 +301,7 @@ const RightSidebarComponent: React.FC<RightSidebarProps> = ({
298301 workspacePath = { workspacePath }
299302 onReviewNote = { onReviewNote }
300303 focusTrigger = { focusTrigger }
304+ isCreating = { isCreating }
301305 />
302306 </ div >
303307 ) }
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ interface ReviewPanelProps {
4545 onReviewNote ?: ( note : string ) => void ;
4646 /** Trigger to focus panel (increment to trigger) */
4747 focusTrigger ?: number ;
48+ /** Workspace is still being created (git operations in progress) */
49+ isCreating ?: boolean ;
4850}
4951
5052interface ReviewSearchState {
@@ -120,6 +122,7 @@ export const ReviewPanel: React.FC<ReviewPanelProps> = ({
120122 workspacePath,
121123 onReviewNote,
122124 focusTrigger,
125+ isCreating = false ,
123126} ) => {
124127 const { api } = useAPI ( ) ;
125128 const panelRef = useRef < HTMLDivElement > ( null ) ;
@@ -618,6 +621,17 @@ export const ReviewPanel: React.FC<ReviewPanelProps> = ({
618621 return ( ) => window . removeEventListener ( "keydown" , handleKeyDown ) ;
619622 } , [ ] ) ;
620623
624+ // Show loading state while workspace is being created
625+ if ( isCreating ) {
626+ return (
627+ < div className = "flex h-full flex-col items-center justify-center p-8 text-center" >
628+ < div className = "mb-4 text-2xl" > ⏳</ div >
629+ < p className = "text-secondary text-sm" > Setting up workspace...</ p >
630+ < p className = "text-secondary mt-1 text-xs" > Review will be available once ready</ p >
631+ </ div >
632+ ) ;
633+ }
634+
621635 return (
622636 < div
623637 ref = { panelRef }
Original file line number Diff line number Diff line change @@ -177,14 +177,18 @@ export class WorktreeRuntime extends LocalBaseRuntime {
177177 const newPath = this . getWorkspacePath ( projectPath , newName ) ;
178178
179179 try {
180- // Use git worktree move to rename the worktree directory
181- // This updates git's internal worktree metadata correctly
182- using proc = execAsync ( `git -C "${ projectPath } " worktree move "${ oldPath } " "${ newPath } "` ) ;
183- await proc . result ;
180+ // Move the worktree directory (updates git's internal worktree metadata)
181+ using moveProc = execAsync ( `git -C "${ projectPath } " worktree move "${ oldPath } " "${ newPath } "` ) ;
182+ await moveProc . result ;
183+
184+ // Rename the git branch to match the new workspace name
185+ // Run from the new worktree path since that's where the branch is checked out
186+ using branchProc = execAsync ( `git -C "${ newPath } " branch -m "${ oldName } " "${ newName } "` ) ;
187+ await branchProc . result ;
184188
185189 return { success : true , oldPath, newPath } ;
186190 } catch ( error ) {
187- return { success : false , error : `Failed to move worktree : ${ getErrorMessage ( error ) } ` } ;
191+ return { success : false , error : `Failed to rename workspace : ${ getErrorMessage ( error ) } ` } ;
188192 }
189193 }
190194
You can’t perform that action at this time.
0 commit comments