From bc7e1faa1c3f2b61bf2046fdd6d6a4141b484662 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Tue, 2 Apr 2024 12:17:20 +0200 Subject: [PATCH] Fix horizontal layout shift after script selection This commit resolves an issue causing horizontal UI layout shift when a script is selected for the first time, and when all selected scripts are deselected. This issue was only observed on Chromium-based browsers on Linux environment when using macOS and Windows script collections. The underlying cause was identified as the use of percentage-based values for CSS margin and padding. To resolve this issue, these values were updated to absolute measurements. This adjustment maintains layout consistency across user interactions without compromising the responsiveness. The underlying cause was identified as the use of percentage-based values for CSS margin and padding within certain elements. To resolve this issue, these values were updated to absolute measurements. This adjustment maintains layout consistency across user interactions without compromising the responsiveness of the application. Additionally, an end-to-end (E2E) test has been introduced to monitor for future regressions of this layout shift bug, ensuring that the fix remains effective over subsequent updates. --- src/presentation/components/App.vue | 23 +++++- tests/e2e/code-highlighting.cy.ts | 35 ++++----- tests/e2e/no-unintended-layout-shifts.cy.ts | 65 ++++++++++++++++ .../assert/layout-stability.ts} | 74 ++++++++----------- tests/e2e/support/interactions/code-area.ts | 7 ++ .../support/interactions/script-selection.ts | 15 ++++ 6 files changed, 153 insertions(+), 66 deletions(-) create mode 100644 tests/e2e/no-unintended-layout-shifts.cy.ts rename tests/e2e/{modal-layout-shifts.cy.ts => support/assert/layout-stability.ts} (57%) create mode 100644 tests/e2e/support/interactions/code-area.ts create mode 100644 tests/e2e/support/interactions/script-selection.ts diff --git a/src/presentation/components/App.vue b/src/presentation/components/App.vue index 93e3b97c..4881ef98 100644 --- a/src/presentation/components/App.vue +++ b/src/presentation/components/App.vue @@ -50,17 +50,36 @@ function getOptionalDevToolkitComponent(): Component | undefined {