Skip to content

Commit 2659732

Browse files
committed
Align compact banner controls
Center every compact shelf label through the same flex layout and remove the header's unused bottom band. Tighten shelf spacing so the ordinary controls fit at 390px, and cover the alignment in the small-screen page-map browser test.
1 parent 405d5d0 commit 2659732

2 files changed

Lines changed: 23 additions & 7 deletions

File tree

‎skills/leaf/assets/runtime/chrome-style.js‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function chromeStyle({
7878
--lf-ui-lh: 1.45;
7979
}
8080
@media screen and ${COVERING} {
81-
:root { --lf-banner-h: calc(96px + var(--lf-safe-top)); }
81+
:root { --lf-banner-h: calc(88px + var(--lf-safe-top)); }
8282
}
8383
/* A wide touch layout keeps the desktop row, but its forty-four-pixel aims and their
8484
focus ring need a taller bar than the mouse-sized row. This one derived height moves
@@ -1361,17 +1361,18 @@ ${MARK_RULES}
13611361
overflow has to be discovered before a reader can comment or approve. */
13621362
@media screen and ${COVERING} {
13631363
.lf-banner { display: grid; grid-template-columns: minmax(0, 1fr);
1364-
grid-template-rows: 40px 48px; gap: 0;
1365-
padding: var(--lf-safe-top) 0 7px; }
1364+
grid-template-rows: 36px minmax(0, 1fr); gap: 0;
1365+
padding: var(--lf-safe-top) 0 0; }
13661366
.lf-banner-status { grid-row: 1; padding: 0 calc(14px + var(--lf-safe-right)) 0
13671367
calc(14px + var(--lf-safe-left)); gap: 9px; }
13681368
.lf-banner-actions { grid-row: 2; width: 100%; max-width: 100%; min-width: 0;
13691369
justify-content: flex-start;
1370-
scroll-padding-inline: calc(14px + var(--lf-safe-left));
1371-
padding: 4px calc(14px + var(--lf-safe-right)) 4px
1372-
calc(14px + var(--lf-safe-left)); gap: 4px; }
1370+
scroll-padding-inline: calc(10px + var(--lf-safe-left));
1371+
padding: 4px calc(10px + var(--lf-safe-right)) 4px
1372+
calc(10px + var(--lf-safe-left)); gap: 3px; }
13731373
.lf-banner-actions > .lf-others { margin-inline-end: 0; }
1374-
.lf-banner-actions > .lf-btn { min-height: 40px; padding-inline: 8px; }
1374+
.lf-banner-actions > .lf-btn { display: inline-flex; align-items: center;
1375+
justify-content: center; min-height: 40px; padding-inline: 6px; }
13751376
/* A pinned wide row reserves its future Latest address so publication cannot move
13761377
controls. The phone shelf starts at the primary controls, so an unseen slot there
13771378
is only blank scrolling; collapse it until the news itself is present. */

‎tests/test_render_margin.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,21 @@ def test_the_small_screen_map_is_a_complete_accessible_sheet(browser, serve):
10501050
assert toggle.evaluate(
10511051
"button => button.previousElementSibling.matches('.lf-signoff, .lf-threads-toggle')"
10521052
), "the small-screen map is not beside the primary feedback controls"
1053+
text_insets = page.locator(".lf-banner-actions > .lf-btn:visible").evaluate_all(
1054+
"""buttons => buttons.map(button => {
1055+
const box = button.getBoundingClientRect();
1056+
const range = document.createRange();
1057+
range.selectNodeContents(button);
1058+
const text = range.getBoundingClientRect();
1059+
return {label: button.textContent.trim(),
1060+
above: text.top - box.top, below: box.bottom - text.bottom};
1061+
})"""
1062+
)
1063+
assert text_insets
1064+
for inset in text_insets:
1065+
assert inset["above"] == pytest.approx(
1066+
inset["below"], abs=1.5
1067+
), f"{inset['label']} is not vertically centred in the compact banner: {inset}"
10531068

10541069
before = page.evaluate("() => document.scrollingElement.scrollTop")
10551070
page.keyboard.press("g")

0 commit comments

Comments
 (0)