@@ -277,6 +277,121 @@ export const ExplorerTab: AppStory = {
277277 } ,
278278} ;
279279
280+ /**
281+ * Explorer tab with expanded directory showing Collapse All button
282+ */
283+ export const ExplorerTabExpanded : AppStory = {
284+ render : ( ) => (
285+ < AppWithMocks
286+ setup = { ( ) => {
287+ localStorage . setItem ( RIGHT_SIDEBAR_TAB_KEY , JSON . stringify ( "explorer" ) ) ;
288+ localStorage . setItem ( RIGHT_SIDEBAR_WIDTH_KEY , "350" ) ;
289+ localStorage . removeItem ( getRightSidebarLayoutKey ( "ws-explorer-expanded" ) ) ;
290+
291+ const client = setupSimpleChatStory ( {
292+ workspaceId : "ws-explorer-expanded" ,
293+ workspaceName : "feature/files" ,
294+ projectName : "my-app" ,
295+ messages : [
296+ createUserMessage ( "msg-1" , "Show me the project structure" , { historySequence : 1 } ) ,
297+ createAssistantMessage ( "msg-2" , "Here is the project structure." , {
298+ historySequence : 2 ,
299+ } ) ,
300+ ] ,
301+ } ) ;
302+ expandRightSidebar ( ) ;
303+ return client ;
304+ } }
305+ />
306+ ) ,
307+ play : async ( { canvasElement } ) => {
308+ const canvas = within ( canvasElement ) ;
309+
310+ // Wait for explorer tab and click it
311+ const explorerTab = await canvas . findByRole ( "tab" , { name : / ^ e x p l o r e r / i } , { timeout : 3000 } ) ;
312+ await userEvent . click ( explorerTab ) ;
313+
314+ // Wait for file tree to load
315+ await waitFor (
316+ ( ) => {
317+ canvas . getByText ( "src" ) ;
318+ } ,
319+ { timeout : 5000 }
320+ ) ;
321+
322+ // Click on src folder to expand it
323+ const srcFolder = canvas . getByText ( "src" ) ;
324+ await userEvent . click ( srcFolder ) ;
325+
326+ // Wait for src contents to load and collapse all button to appear
327+ await waitFor (
328+ ( ) => {
329+ canvas . getByText ( "App.tsx" ) ;
330+ canvas . getByText ( "components" ) ;
331+ } ,
332+ { timeout : 5000 }
333+ ) ;
334+
335+ // Verify collapse all button is visible (tooltip text)
336+ await waitFor ( ( ) => {
337+ canvas . getByRole ( "button" , { name : / c o l l a p s e a l l / i } ) ;
338+ } ) ;
339+
340+ // Blur to get clean screenshot
341+ blurActiveElement ( ) ;
342+ } ,
343+ } ;
344+
345+ /**
346+ * Explorer tab with selected item showing blue background
347+ */
348+ export const ExplorerTabSelected : AppStory = {
349+ render : ( ) => (
350+ < AppWithMocks
351+ setup = { ( ) => {
352+ localStorage . setItem ( RIGHT_SIDEBAR_TAB_KEY , JSON . stringify ( "explorer" ) ) ;
353+ localStorage . setItem ( RIGHT_SIDEBAR_WIDTH_KEY , "350" ) ;
354+ localStorage . removeItem ( getRightSidebarLayoutKey ( "ws-explorer-selected" ) ) ;
355+
356+ const client = setupSimpleChatStory ( {
357+ workspaceId : "ws-explorer-selected" ,
358+ workspaceName : "feature/files" ,
359+ projectName : "my-app" ,
360+ messages : [
361+ createUserMessage ( "msg-1" , "Show me the project structure" , { historySequence : 1 } ) ,
362+ createAssistantMessage ( "msg-2" , "Here is the project structure." , {
363+ historySequence : 2 ,
364+ } ) ,
365+ ] ,
366+ } ) ;
367+ expandRightSidebar ( ) ;
368+ return client ;
369+ } }
370+ />
371+ ) ,
372+ play : async ( { canvasElement } ) => {
373+ const canvas = within ( canvasElement ) ;
374+
375+ // Wait for explorer tab and click it
376+ const explorerTab = await canvas . findByRole ( "tab" , { name : / ^ e x p l o r e r / i } , { timeout : 3000 } ) ;
377+ await userEvent . click ( explorerTab ) ;
378+
379+ // Wait for file tree to load
380+ await waitFor (
381+ ( ) => {
382+ canvas . getByText ( "package.json" ) ;
383+ } ,
384+ { timeout : 5000 }
385+ ) ;
386+
387+ // Click on package.json to select it (will have focus/selected blue background)
388+ const packageJson = canvas . getByText ( "package.json" ) ;
389+ await userEvent . click ( packageJson ) ;
390+
391+ // Don't blur - keep the item selected/focused for the screenshot
392+ } ,
393+ } ;
394+
280395/**
281396 * Stats tab when idle (no timing data) - shows placeholder message
282397 */
0 commit comments