@@ -354,18 +354,18 @@ describe('workspace list prefetches', () => {
354354 } )
355355
356356 /**
357- * The FILE LIST is deliberately not primed here — `prefetchWorkspaceSidebar` owns it. The
358- * sidebar registers that query on every workspace route (a disabled query still registers), and
359- * `HydrationBoundary` hands an already-registered query to a `useEffect` SSR never runs, so a
360- * page-level seed costs a read per render and still cannot reach the server render.
357+ * The file list is the browser's primary content, so it must be seeded by the page that
358+ * renders it — the layout no longer seeds it, which would have charged every workspace
359+ * route for a list only a few of them read.
361360 */
362- it ( 'leaves the file list to the layout rather than re-reading it per page' , async ( ) => {
361+ it ( 'seeds the file list the browser renders' , async ( ) => {
362+ const files = [ { id : 'file-1' } ]
363+ mockListWorkspaceFilesWithShares . mockResolvedValue ( files )
363364 const client = makeClient ( )
364365
365366 await prefetchFilesBrowser ( client , WORKSPACE_ID , USER_ID )
366367
367- expect ( mockListWorkspaceFilesWithShares ) . not . toHaveBeenCalled ( )
368- expect ( client . getQueryData ( workspaceFilesKeys . list ( WORKSPACE_ID , 'active' ) ) ) . toBeUndefined ( )
368+ expect ( client . getQueryData ( workspaceFilesKeys . list ( WORKSPACE_ID , 'active' ) ) ) . toEqual ( files )
369369 } )
370370
371371 /**
@@ -510,27 +510,15 @@ describe('workspace list prefetches', () => {
510510 } )
511511
512512 /**
513- * The layout is the only boundary that can reach the server render for this key, so it is the
514- * one that seeds it — see the note on the entry itself .
513+ * The file list belongs to the pages that render it, not to every workspace route. A sidebar
514+ * seed would charge the workflow editor, logs, and settings for a read none of them make .
515515 */
516- it ( 'seeds the workspace file list' , async ( ) => {
517- const files = [ { id : 'file-1' , name : 'a.txt' } ]
518- mockListWorkspaceFilesWithShares . mockResolvedValue ( files )
516+ it ( 'does not read the workspace file list' , async ( ) => {
519517 const client = makeClient ( )
520518
521519 await prefetchWorkspaceSidebar ( client , WORKSPACE_ID , USER_ID , HOST_CONTEXT , null )
522520
523- expect ( client . getQueryData ( workspaceFilesKeys . list ( WORKSPACE_ID , 'active' ) ) ) . toEqual ( files )
524- } )
525-
526- /** A failed file read is an optimization loss, not a render failure. */
527- it ( 'does not throw when the file read rejects, and seeds no files' , async ( ) => {
528- mockListWorkspaceFilesWithShares . mockRejectedValue ( new Error ( '500' ) )
529- const client = makeClient ( )
530-
531- await expect (
532- prefetchWorkspaceSidebar ( client , WORKSPACE_ID , USER_ID , HOST_CONTEXT , null )
533- ) . resolves . toBeUndefined ( )
521+ expect ( mockListWorkspaceFilesWithShares ) . not . toHaveBeenCalled ( )
534522 expect ( client . getQueryData ( workspaceFilesKeys . list ( WORKSPACE_ID , 'active' ) ) ) . toBeUndefined ( )
535523 } )
536524
@@ -566,9 +554,9 @@ describe('workspace list prefetches', () => {
566554 ] ,
567555 [
568556 /**
569- * Asserted against the folder key, not the file list: `prefetchFilesBrowser`
570- * deliberately never seeds `workspaceFilesKeys` (the layout owns it), so an
571- * assertion on that key would hold no matter what this function did.
557+ * Asserted against the folder key: the file list is seeded rather than prefetched, so
558+ * a rejecting read leaves that key empty by design and could not distinguish a
559+ * swallowed failure from a function that did nothing .
572560 */
573561 'prefetchFilesBrowser' ,
574562 ( client : QueryClient ) => prefetchFilesBrowser ( client , WORKSPACE_ID , USER_ID ) ,
0 commit comments