From 6d8e45aea8e5ff0d22b6e51a9dc51425ecd08466 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 8 Aug 2024 11:27:16 -0400 Subject: [PATCH] Consider any sufficiently short window 'flat' This is because our layouts for flat windows are good at adapting to both small width and small height, while our layouts for narrow windows aren't so good at adapting to a small height. --- src/state/CallViewModel.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index acd145b9..d5a551e0 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -526,8 +526,11 @@ export class CallViewModel extends ViewModel { const height = window.innerHeight; const width = window.innerWidth; if (height <= 400 && width <= 340) return "pip"; - if (width <= 600) return "narrow"; + // Our layouts for flat windows are better at adapting to a small width + // than our layouts for narrow windows are at adapting to a small height, + // so we give "flat" precedence here if (height <= 660) return "flat"; + if (width <= 600) return "narrow"; return "normal"; }), distinctUntilChanged(),