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.
This commit is contained in:
undergroundwires
2024-04-02 12:17:20 +02:00
parent 557cea3f48
commit bc7e1faa1c
6 changed files with 153 additions and 66 deletions

View File

@@ -0,0 +1,15 @@
import { getCurrentHighlightRange } from './code-area';
export function selectAllScripts() {
cy.contains('span', 'All')
.click();
getCurrentHighlightRange()
.should('not.equal', '0');
}
export function unselectAllScripts() {
cy.contains('span', 'None')
.click();
getCurrentHighlightRange()
.should('equal', '0');
}