fix: restore Related Stories resize focus
This commit is contained in:
5 files changed
+24
-37
No files matched your search
@@ -272,7 +272,7 @@ Create real DOM fixtures for two block instances. Inject matchMedia and element
|
||||
- start/end buttons receive correct native disabled states after scroll and resize;
|
||||
- reduced motion selects instant/auto behavior and default permits smooth behavior;
|
||||
- missing buttons, track, cards, matchMedia, or scroll APIs leave controls hidden and do not throw;
|
||||
- 900→901 while either button owns focus moves focus to the visible heading before hiding;
|
||||
- 900→901 while either button owns focus moves focus to the first related-story link before hiding;
|
||||
- unrelated focus stays unchanged;
|
||||
- rail semantics and controls restore at 901→900;
|
||||
- reinitialization does not duplicate listeners; cleanup removes every listener;
|
||||
@@ -384,7 +384,7 @@ On a seeded single-post route containing the default block, add tests for:
|
||||
- button navigation moves exactly one card and updates disabled edges;
|
||||
- native horizontal wheel/touch-compatible scrolling remains possible;
|
||||
- Tab reaches the rail and buttons in DOM order and exits without wrapping/trapping;
|
||||
- resizing at the 900/901 boundary repairs button focus to the heading;
|
||||
- resizing at the 900/901 boundary repairs button focus to the first related-story link, which remains naturally focusable and visible in every engine's grid;
|
||||
- reduced motion produces no smooth programmatic scroll but preserves geometry;
|
||||
- JavaScript-disabled adaptive/carousel variants keep controls hidden and every card/link reachable through the focus order;
|
||||
- controller failure simulated before initialization leaves native rail and links usable;
|
||||
|
||||
@@ -96,7 +96,7 @@ A dedicated `assets/js/related-posts.js` controller enhances every rendered caro
|
||||
- The script does not autoplay, loop, clone cards, modify card links, export globals, or make network requests.
|
||||
- Missing markup, zero cards, unsupported browser APIs, or a reduced-motion preference fail safely. Reduced motion changes programmatic scrolling from smooth to instant without changing layout or content.
|
||||
- Controls carry the native `hidden` attribute in server output. Each controller removes it only after its track, cards, buttons, media query, and scroll APIs initialize successfully. With JavaScript disabled or controller initialization rejected, controls stay hidden and native scrolling remains available.
|
||||
- If a viewport change turns an adaptive rail into a grid while either navigation button owns focus, the controller first gives the always-visible section heading a temporary `tabindex="-1"`, focuses it with `preventScroll`, removes the temporary attribute, and only then hides the controls and removes the track's region/tab-stop enhancement. If focus is elsewhere, it stays unchanged. Crossing back restores rail semantics and control state.
|
||||
- If a viewport change turns an adaptive rail into a grid while either navigation button owns focus, the controller focuses the first full-card related-story link with `preventScroll` before hiding the controls and removing the track's region/tab-stop enhancement. The link is naturally focusable and remains visible in the grid in Chromium, Firefox, and WebKit, so focus never depends on a temporary heading `tabindex`. If focus is elsewhere, it stays unchanged. Crossing back restores rail semantics and control state.
|
||||
|
||||
## Accessibility
|
||||
|
||||
@@ -131,7 +131,7 @@ Test-driven implementation begins with failing tests for:
|
||||
- Playwright coverage at 375, 768, 900, 901, 1440, and 2560 pixels in light and dark themes.
|
||||
- The complete browser `3/5 × adaptive/grid/carousel` matrix, plus isolated PHPUnit factory coverage for availability counts of one, two, and four; browser fixtures never mutate unowned posts to manufacture partial results.
|
||||
- Runtime geometry: exact grid column counts; carousel card width formula within two CSS pixels; 24px-to-25% continuation preview bounds; correct control visibility at 900/901; track-only overflow; and `document.documentElement.scrollWidth <= document.documentElement.clientWidth`.
|
||||
- Resize focus regression in both directions, including 900→901 while Previous owns focus and while Next owns focus; the visible section heading becomes the destination before controls hide.
|
||||
- Resize focus regression in both directions, including 900→901 while Previous owns focus and while Next owns focus; the first related-story link becomes the cross-browser destination before controls hide.
|
||||
- Real pointer/button and keyboard interaction without a focus trap.
|
||||
- No-JS access to every related story.
|
||||
- Clicking a seeded related story returns HTTP 200 rather than 404.
|
||||
|
||||
Reference in new issue
Block a user