@@ -108,6 +108,73 @@ describe("responsive app", () => {
108108 expect ( tight ) . not . toMatch ( / ▌ .* ▌ / ) ;
109109 } ) ;
110110
111+ test ( "View menu sidebar checkmark follows actual medium-viewport visibility" , async ( ) => {
112+ const setup = await testRender ( < AppHost bootstrap = { createBootstrap ( "auto" ) } /> , {
113+ width : 180 ,
114+ height : 24 ,
115+ } ) ;
116+
117+ try {
118+ await act ( async ( ) => {
119+ await setup . renderOnce ( ) ;
120+ } ) ;
121+
122+ const initialFrame = setup . captureCharFrame ( ) ;
123+ expect ( ( initialFrame . match ( / a l p h a \. t s / g) ?? [ ] ) . length ) . toBe ( 1 ) ;
124+
125+ await act ( async ( ) => {
126+ await setup . mockInput . pressKey ( "F10" ) ;
127+ } ) ;
128+ await act ( async ( ) => {
129+ await setup . renderOnce ( ) ;
130+ } ) ;
131+ await act ( async ( ) => {
132+ await setup . mockInput . pressArrow ( "right" ) ;
133+ } ) ;
134+ await act ( async ( ) => {
135+ await setup . renderOnce ( ) ;
136+ } ) ;
137+
138+ const menuFrame = setup . captureCharFrame ( ) ;
139+ expect ( menuFrame ) . toContain ( "[ ] Sidebar" ) ;
140+ expect ( menuFrame ) . not . toContain ( "[x] Sidebar" ) ;
141+ } finally {
142+ await act ( async ( ) => {
143+ setup . renderer . destroy ( ) ;
144+ } ) ;
145+ }
146+ } ) ;
147+
148+ test ( "sidebar shortcut opens the hidden sidebar on medium viewport" , async ( ) => {
149+ const setup = await testRender ( < AppHost bootstrap = { createBootstrap ( "auto" ) } /> , {
150+ width : 180 ,
151+ height : 24 ,
152+ } ) ;
153+
154+ try {
155+ await act ( async ( ) => {
156+ await setup . renderOnce ( ) ;
157+ } ) ;
158+
159+ let frame = setup . captureCharFrame ( ) ;
160+ expect ( ( frame . match ( / a l p h a \. t s / g) ?? [ ] ) . length ) . toBe ( 1 ) ;
161+
162+ await act ( async ( ) => {
163+ await setup . mockInput . typeText ( "s" ) ;
164+ } ) ;
165+ await act ( async ( ) => {
166+ await setup . renderOnce ( ) ;
167+ } ) ;
168+
169+ frame = setup . captureCharFrame ( ) ;
170+ expect ( ( frame . match ( / a l p h a \. t s / g) ?? [ ] ) . length ) . toBe ( 2 ) ;
171+ } finally {
172+ await act ( async ( ) => {
173+ setup . renderer . destroy ( ) ;
174+ } ) ;
175+ }
176+ } ) ;
177+
111178 test ( "explicit split and stack modes override responsive auto switching" , async ( ) => {
112179 const forcedSplit = await captureFrameForBootstrap ( createBootstrap ( "split" ) , 140 ) ;
113180 const forcedStack = await captureFrameForBootstrap ( createBootstrap ( "stack" ) , 240 ) ;
0 commit comments