From 88d9707f6ea89889399bd3aec169f145bafc5ceb Mon Sep 17 00:00:00 2001 From: VariableVince <24507472+VariableVince@users.noreply.github.com> Date: Sun, 18 May 2025 22:26:42 +0200 Subject: [PATCH] Fix Player Panel vertical position (top out of view) (#804) ## Description: Fixes the Player Info Panel top part being out of view, at least on some screen resolutions. Workaround was changing browser zoom from 100% to 80%, or to scroll to change the vertical position of the panel. This is now not needed anymore. Also disables vertical scrolling of the position of the panel itself. And prevents zooming the background game map. Position is still not perfect on all resolutions but the top or bottom won't be out of view anymore. Tested using DevTools. I don't have the option to deploy a branch (yet?), this may be needed so others can test on their screens just to be sure. Normally the current "top-1/2 -translate-y-1/2" should have done the trick and put the vertical position at 50% of the screen. The root cause of this not working on all screens may be a parent element or something else, but touching that could create new UI issues. So fixing it from within PlayerPanel.ts itself seemed the best choice here. !! The only actual changes are in lines 228-237. The rest are shifts in positions or from prettier. Before:   After (don't mind the empty player name box, the fix for that bug isn't in main yet https://github.com/openfrontio/OpenFrontIO/pull/795):  ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: tryout33 --- src/client/graphics/layers/PlayerPanel.ts | 331 +++++++++++----------- 1 file changed, 170 insertions(+), 161 deletions(-) diff --git a/src/client/graphics/layers/PlayerPanel.ts b/src/client/graphics/layers/PlayerPanel.ts index 547bd54fd..e7f046e25 100644 --- a/src/client/graphics/layers/PlayerPanel.ts +++ b/src/client/graphics/layers/PlayerPanel.ts @@ -225,196 +225,205 @@ export class PlayerPanel extends LitElement implements Layer { return html`