From aa80dbdd3e58e79401008665f2199d98fa14b3d0 Mon Sep 17 00:00:00 2001 From: jotaen4tinypilot <83721279+jotaen4tinypilot@users.noreply.github.com> Date: Wed, 23 Aug 2023 17:36:35 +0200 Subject: [PATCH] Make for smooth vertical resizing of remote screen (#1583) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of https://github.com/tiny-pilot/tinypilot/issues/728. The vertical resizing behaviour of the remote screen is currently so that the screen element’s height appears to “jump” at certain steps due to [CSS breakpoints](https://github.com/tiny-pilot/tinypilot/blob/069cf2d9829a4fe2b8df33cb03b26c141c60593b/app/templates/custom-elements/remote-screen.html#L11-L33), while you resize the window vertically. This PR implements “smooth” and step-less vertical resizing, while maintaining a constant margin between remote screen and status-bar during that process. The breakpoint-less resizing is important for the “dedicated window” (popup) that we are about to implement in https://github.com/tiny-pilot/tinypilot/issues/728, where it would probably feel weird if the remote screen height jumped around the way it currently does, or if we wouldn’t be able to fill up the entire vertical space of the popup window due to the breakpoint setup. ## Demo: After https://github.com/tiny-pilot/tinypilot/assets/83721279/66758c7c-ce78-4f0a-8323-4990be47fe49 ## Demo: Before https://github.com/tiny-pilot/tinypilot/assets/83721279/f768b3c0-8b5b-44c3-8cbd-2ee724e46a02 ## Notes - We had introduced these breakpoints in https://github.com/tiny-pilot/tinypilot/pull/878 originally, as kind of “heuristic”/pragmatic approach for resizing the remote screen, without having the remote screen visually collide with the status bar. The breakpoints itself are arbitrary, and they don’t serve any other purpose except for facilitating the vertical screen size while resizing the window. - I discovered https://github.com/tiny-pilot/tinypilot/issues/1581 while testing this PR; so this behaviour is not a regression, but it’s currently broken on master. - This PR leaves a “naked” `