File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,10 +32,22 @@ export interface IPartSizeDefaults {
3232const PHONE_MAX_WIDTH = 640 ;
3333const 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 */
3847function classifyViewport ( width : number ) : ViewportClass {
48+ if ( ! isMobilePlatform ) {
49+ return 'desktop' ;
50+ }
3951 if ( width < PHONE_MAX_WIDTH ) {
4052 return 'phone' ;
4153 }
You can’t perform that action at this time.
0 commit comments