@@ -27,6 +27,7 @@ import {
2727} from './utils/emptyMobileComposer' ;
2828
2929const COMPOSER_TEXTAREA = 'textarea[data-web-shell-composer-editor]' ;
30+ const SIDEBAR_WIDTH_STORAGE_KEY = 'qwen-code-web-shell-sidebar-width' ;
3031
3132test ( 'renders the textarea backend instead of CodeMirror on touch devices' , async ( {
3233 page,
@@ -102,6 +103,50 @@ test('keeps voice controls reachable on an extra-narrow touch viewport', async (
102103 await expect ( activeToolbar . locator ( 'button:visible' ) ) . toHaveCount ( 2 ) ;
103104} ) ;
104105
106+ test ( 'keeps a persisted wide sidebar inside the mobile drawer and exposes close' , async ( {
107+ page,
108+ } , testInfo ) => {
109+ await page . addInitScript (
110+ ( [ key , width ] ) => {
111+ window . localStorage . setItem ( key , width ) ;
112+ } ,
113+ [ SIDEBAR_WIDTH_STORAGE_KEY , '512' ] as const ,
114+ ) ;
115+ const scenario = createWebShellDaemonScenario ( ) ;
116+ const daemon = await installScenario ( page , scenario , testInfo ) ;
117+
118+ await gotoSession ( page , scenario , daemon ) ;
119+ await page . getByRole ( 'button' , { name : 'Toggle menu' } ) . tap ( ) ;
120+
121+ const drawer = page . getByRole ( 'dialog' , { name : 'Workspace sidebar' } ) ;
122+ const sidebar = page . getByRole ( 'complementary' , {
123+ name : 'Workspace sidebar' ,
124+ } ) ;
125+ await expect ( drawer ) . toBeVisible ( ) ;
126+ await expect ( sidebar ) . toBeVisible ( ) ;
127+ const { drawerWidth, sidebarWidth } = await sidebar . evaluate ( ( element ) => ( {
128+ drawerWidth : element . parentElement ?. getBoundingClientRect ( ) . width ?? 0 ,
129+ sidebarWidth : element . getBoundingClientRect ( ) . width ,
130+ } ) ) ;
131+ expect ( sidebarWidth ) . toBeCloseTo ( drawerWidth * 0.7 , 0 ) ;
132+ expect ( sidebarWidth ) . toBeLessThanOrEqual ( drawerWidth ) ;
133+
134+ await page . screenshot ( {
135+ path : 'client/e2e/test-results/responsive-sidebar-drawer.png' ,
136+ fullPage : true ,
137+ } ) ;
138+ await page . getByRole ( 'button' , { name : 'Collapse' } ) . tap ( ) ;
139+ await expect ( drawer ) . toBeHidden ( ) ;
140+ await expect
141+ . poll ( ( ) =>
142+ page . evaluate (
143+ ( key ) => window . localStorage . getItem ( key ) ,
144+ SIDEBAR_WIDTH_STORAGE_KEY ,
145+ ) ,
146+ )
147+ . toBe ( '512' ) ;
148+ } ) ;
149+
105150test ( 'tap, type, and Send submit through the shared prompt pipeline' , async ( {
106151 page,
107152} , testInfo ) => {
0 commit comments