Merge pull request 'fix(compare): sticky school bar hidden behind the site header' (#44) from fix/schoolbar-sticky-offset into main
Stage (build -> staging -> E2E gate) / Build Backend (FastAPI) (push) Successful in 14s
Stage (build -> staging -> E2E gate) / Build Frontend (Next.js) (push) Successful in 51s
Stage (build -> staging -> E2E gate) / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 13s
Stage (build -> staging -> E2E gate) / Deploy to Staging (push) Successful in 1s
Stage (build -> staging -> E2E gate) / E2E Journeys against Staging (push) Successful in 39s
Stage (build -> staging -> E2E gate) / Build Backend (FastAPI) (push) Successful in 14s
Stage (build -> staging -> E2E gate) / Build Frontend (Next.js) (push) Successful in 51s
Stage (build -> staging -> E2E gate) / Build Pipeline (Meltano + dbt + Airflow) (push) Successful in 13s
Stage (build -> staging -> E2E gate) / Deploy to Staging (push) Successful in 1s
Stage (build -> staging -> E2E gate) / E2E Journeys against Staging (push) Successful in 39s
Reviewed-on: #44
This commit was merged in pull request #44.
This commit is contained in:
@@ -227,6 +227,19 @@ test('compare chart on mobile shows school chips with tap-to-focus', async ({ pa
|
|||||||
);
|
);
|
||||||
expect(bodyOverflowsX).toBe(false);
|
expect(bodyOverflowsX).toBe(false);
|
||||||
|
|
||||||
|
// The sticky school bar must pin *below* the sticky site header, not at
|
||||||
|
// top:0 where the header covers it and the selected schools are hidden.
|
||||||
|
// Assert the sticky offset directly (robust — no scroll timing needed).
|
||||||
|
const barTop = await page
|
||||||
|
.locator('[class*="schoolBar"]')
|
||||||
|
.first()
|
||||||
|
.evaluate((el) => parseFloat(getComputedStyle(el).top));
|
||||||
|
const headerHeight = await page
|
||||||
|
.locator('[class*="header"]')
|
||||||
|
.first()
|
||||||
|
.evaluate((el) => el.getBoundingClientRect().height);
|
||||||
|
expect(barTop).toBeGreaterThanOrEqual(headerHeight - 1);
|
||||||
|
|
||||||
// The trends chart still renders (inside the Explore trends section)…
|
// The trends chart still renders (inside the Explore trends section)…
|
||||||
const chartCanvas = page.locator('canvas:visible').first();
|
const chartCanvas = page.locator('canvas:visible').first();
|
||||||
await expect(chartCanvas).toBeVisible({ timeout: 15_000 });
|
await expect(chartCanvas).toBeVisible({ timeout: 15_000 });
|
||||||
|
|||||||
@@ -80,10 +80,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Sticky school bar — column identity while scrolling; horizontal scroll on
|
/* Sticky school bar — column identity while scrolling; horizontal scroll on
|
||||||
narrow screens */
|
narrow screens. Offset by the sticky site header's height (Navigation is
|
||||||
|
position: sticky, top: 0) so this bar pins just below it instead of
|
||||||
|
sliding underneath and being hidden. Header ≈ 65px desktop / 57px mobile. */
|
||||||
.schoolBar {
|
.schoolBar {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 65px;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
background: var(--bg-primary, #faf7f2);
|
background: var(--bg-primary, #faf7f2);
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -173,6 +175,11 @@
|
|||||||
pills with short names (matching the mobile mockup) instead of full-width
|
pills with short names (matching the mobile mockup) instead of full-width
|
||||||
cards whose names wrap to several lines. */
|
cards whose names wrap to several lines. */
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
|
/* The mobile Navigation header is shorter (≈57px). */
|
||||||
|
.schoolBar {
|
||||||
|
top: 57px;
|
||||||
|
}
|
||||||
|
|
||||||
.schoolChip {
|
.schoolChip {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user