File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed
app/workspace/[workspaceId]/w
stores/workflows/registry Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ export function ContextMenu({
373373 onKeyDown = { handleHexKeyDown }
374374 onFocus = { handleHexFocus }
375375 onClick = { ( e ) => e . stopPropagation ( ) }
376- className = 'h-[20px] min-w-0 flex-1 rounded-[4px] bg-[#363636] px-[6px] text-[11px] text-white uppercase focus:outline-none'
376+ className = 'h-[20px] min-w-0 flex-1 rounded-[4px] bg-[#363636] px-[6px] text-[11px] text-white uppercase caret-white focus:outline-none'
377377 />
378378 < button
379379 type = 'button'
Original file line number Diff line number Diff line change @@ -206,9 +206,11 @@ export function useImportWorkflow({ workspaceId }: UseImportWorkflowProps) {
206206
207207 logger . info ( `Import complete. Imported ${ importedWorkflowIds . length } workflow(s)` )
208208
209- // Navigate to first imported workflow if any
209+ // Navigate to last imported workflow if any
210210 if ( importedWorkflowIds . length > 0 ) {
211- router . push ( `/workspace/${ workspaceId } /w/${ importedWorkflowIds [ 0 ] } ` )
211+ router . push (
212+ `/workspace/${ workspaceId } /w/${ importedWorkflowIds [ importedWorkflowIds . length - 1 ] } `
213+ )
212214 }
213215 } catch ( error ) {
214216 logger . error ( 'Failed to import workflows:' , error )
Original file line number Diff line number Diff line change @@ -97,11 +97,18 @@ export const useWorkflowRegistry = create<WorkflowRegistry>()(
9797 return acc
9898 } , { } )
9999
100- set ( ( state ) => ( {
101- workflows : mapped ,
102- error : null ,
103- hydration :
104- state . hydration . phase === 'state-loading'
100+ set ( ( state ) => {
101+ // Preserve hydration if workflow is loading or already ready and still exists
102+ const shouldPreserveHydration =
103+ state . hydration . phase === 'state-loading' ||
104+ ( state . hydration . phase === 'ready' &&
105+ state . hydration . workflowId &&
106+ mapped [ state . hydration . workflowId ] )
107+
108+ return {
109+ workflows : mapped ,
110+ error : null ,
111+ hydration : shouldPreserveHydration
105112 ? state . hydration
106113 : {
107114 phase : 'metadata-ready' ,
@@ -110,7 +117,8 @@ export const useWorkflowRegistry = create<WorkflowRegistry>()(
110117 requestId : null ,
111118 error : null ,
112119 } ,
113- } ) )
120+ }
121+ } )
114122 } ,
115123
116124 failMetadataLoad : ( workspaceId : string | null , errorMessage : string ) => {
You can’t perform that action at this time.
0 commit comments