Skip to content

Commit 6e0dbc9

Browse files
committed
Gate phone layout on mobile OS (iOS/Android) instead of width alone
1 parent 19f3f0a commit 6e0dbc9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/vs/sessions/browser/layoutPolicy.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,22 @@ export interface IPartSizeDefaults {
3232
const PHONE_MAX_WIDTH = 640;
3333
const TABLET_MAX_WIDTH = 1024;
3434

35+
/**
36+
* Whether the current platform is a phone/tablet OS. The phone layout is
37+
* only applied on actual mobile devices so that resizing a desktop window
38+
* below 640px does not switch the agents workbench into phone mode.
39+
*/
40+
const isMobilePlatform = isIOS || isAndroid;
41+
3542
/**
3643
* Classifies the viewport into one of three classes based on width.
44+
* Phone and tablet classifications are gated on a mobile OS; desktop
45+
* browsers and Electron always report `desktop` regardless of width.
3746
*/
3847
function classifyViewport(width: number): ViewportClass {
48+
if (!isMobilePlatform) {
49+
return 'desktop';
50+
}
3951
if (width < PHONE_MAX_WIDTH) {
4052
return 'phone';
4153
}

0 commit comments

Comments
 (0)