@@ -187,6 +187,66 @@ describe("Hunk integration via tuistory", () => {
187187 }
188188 } ) ;
189189
190+ test ( "explicit split mode stays split after a live resize" , async ( ) => {
191+ const fixture = harness . createTwoFileRepoFixture ( ) ;
192+ const session = await harness . launchHunk ( {
193+ args : [ "diff" , "--mode" , "split" ] ,
194+ cwd : fixture . dir ,
195+ cols : 220 ,
196+ rows : 24 ,
197+ } ) ;
198+
199+ try {
200+ const wide = await session . waitForText ( / V i e w \s + N a v i g a t e \s + T h e m e \s + A g e n t \s + H e l p / , {
201+ timeout : 15_000 ,
202+ } ) ;
203+
204+ expect ( harness . countMatches ( wide , / a l p h a \. t s / g) ) . toBeGreaterThanOrEqual ( 2 ) ;
205+ expect ( wide ) . toMatch ( / ▌ .* ▌ / ) ;
206+
207+ session . resize ( { cols : 140 , rows : 24 } ) ;
208+ const tight = await harness . waitForSnapshot (
209+ session ,
210+ ( text ) => / ▌ .* ▌ / . test ( text ) && harness . countMatches ( text , / a l p h a \. t s / g) === 1 ,
211+ 5_000 ,
212+ ) ;
213+
214+ expect ( tight ) . toContain ( "betaValue = 1" ) ;
215+ } finally {
216+ session . close ( ) ;
217+ }
218+ } ) ;
219+
220+ test ( "explicit stack mode stays stacked after a live resize" , async ( ) => {
221+ const fixture = harness . createTwoFileRepoFixture ( ) ;
222+ const session = await harness . launchHunk ( {
223+ args : [ "diff" , "--mode" , "stack" ] ,
224+ cwd : fixture . dir ,
225+ cols : 140 ,
226+ rows : 24 ,
227+ } ) ;
228+
229+ try {
230+ const narrow = await session . waitForText ( / V i e w \s + N a v i g a t e \s + T h e m e \s + A g e n t \s + H e l p / , {
231+ timeout : 15_000 ,
232+ } ) ;
233+
234+ expect ( harness . countMatches ( narrow , / a l p h a \. t s / g) ) . toBe ( 1 ) ;
235+ expect ( narrow ) . not . toMatch ( / ▌ .* ▌ / ) ;
236+
237+ session . resize ( { cols : 220 , rows : 24 } ) ;
238+ const wide = await harness . waitForSnapshot (
239+ session ,
240+ ( text ) => ! / ▌ .* ▌ / . test ( text ) && harness . countMatches ( text , / a l p h a \. t s / g) >= 2 ,
241+ 5_000 ,
242+ ) ;
243+
244+ expect ( wide ) . toContain ( "1 - export const alpha = 1;" ) ;
245+ } finally {
246+ session . close ( ) ;
247+ }
248+ } ) ;
249+
190250 test ( "filter focus narrows the visible review stream in the live app" , async ( ) => {
191251 const fixture = harness . createTwoFileRepoFixture ( ) ;
192252 const session = await harness . launchHunk ( {
0 commit comments