@@ -272,10 +272,13 @@ test.describe("mobile copy on select", () => {
272272 const body = document . body ;
273273 const doc = document . documentElement ;
274274 const overlay = document . querySelector ( ".mobile-terminal-copy-mode" ) ;
275+ const toolbar = document . querySelector ( ".mobile-terminal-copy-mode__toolbar" ) ;
275276 const content = document . querySelector ( ".mobile-terminal-copy-mode__content" ) ;
276277 const text = document . querySelector ( ".mobile-terminal-copy-mode__text" ) ;
277278 const sheet = document . querySelector ( ".mobile-sheet--terminal" ) ;
278279 const terminalSheet = document . querySelector ( ".mobile-terminal-sheet" ) ;
280+ const xtermViewport = document . querySelector ( ".mobile-sheet--terminal .xterm-viewport" ) ;
281+ const xtermRows = document . querySelector ( ".mobile-sheet--terminal .xterm-rows" ) ;
279282 const viewportWidth = window . innerWidth ;
280283 const viewportHeight = window . innerHeight ;
281284
@@ -289,10 +292,17 @@ test.describe("mobile copy on select", () => {
289292 bodyScrollWidth : body . scrollWidth ,
290293 bodyScrollHeight : body . scrollHeight ,
291294 overlayRect : rect ( overlay ) ,
295+ toolbarRect : rect ( toolbar ) ,
292296 contentRect : rect ( content ) ,
293297 textRect : rect ( text ) ,
294298 sheetRect : rect ( sheet ) ,
295299 terminalSheetRect : rect ( terminalSheet ) ,
300+ xtermViewportRect : rect ( xtermViewport ) ,
301+ xtermRowsRect : rect ( xtermRows ) ,
302+ contentClientHeight : content instanceof HTMLElement ? content . clientHeight : null ,
303+ contentScrollHeight : content instanceof HTMLElement ? content . scrollHeight : null ,
304+ textClientHeight : text instanceof HTMLElement ? text . clientHeight : null ,
305+ textScrollHeight : text instanceof HTMLElement ? text . scrollHeight : null ,
296306 } ;
297307 } ) ;
298308
@@ -326,6 +336,10 @@ test.describe("mobile copy on select", () => {
326336 ( beforeMetrics . terminalSheetRect ?. height ?? 0 )
327337 )
328338 ) . toBeLessThanOrEqual ( 1 ) ;
339+ expect (
340+ afterMetrics . contentScrollHeight ,
341+ `copy mode content should not overflow by default:\n${ JSON . stringify ( afterMetrics , null , 2 ) } `
342+ ) . toBeLessThanOrEqual ( ( afterMetrics . contentClientHeight ?? 0 ) + 1 ) ;
329343 } ) ;
330344
331345 test ( "mobile long press does not enter copy mode when copy on select is disabled" , async ( {
0 commit comments