Repository navigation
fix(web): keep the Featured hero held until both hover and focus leave - #5076
Conversation
The hero's hover and focus holds shared one flag, so whichever left first restarted the slideshow while the other still held it: hovering in and out with focus on a hero control, or tabbing out under the pointer, made slides advance. Hover and focus are now tracked separately, and the slideshow resumes only once both have left. A mouse press inside the hero ends the focus hold, and the focus it moves onto a button does not start one, so clicking a slide control and moving the pointer away still resumes the slideshow, as before. The pointer leaving also ends a focus hold whose focus is gone, for a control removed without a blur. Closes Silo-Server#4924
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
…ore touch hover A mouse press over the hero now turns a focus hold into a hover hold, and the focus it causes holds as hover, instead of dropping the hold. After Play, a Tab and a click on Next no longer restart the slideshow while the pointer is still over the hero. A drag ends the press, so a later keyboard focus holds again. Hover now comes from pointer events and ignores touch, so a tap's emulated mouse entry no longer holds the slideshow after focus leaves. The progress rail restarts whenever the slideshow starts running, from the committed state, instead of predicting the next holds in each handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quick104
left a comment
There was a problem hiding this comment.
Review of f669338. Splitting the hover hold from the focus hold is the right fix for #4924. Both reported-direction tests fail on main for the reported reason and pass here. I found four problems in the new press handling, listed inline. I'm fixing all four in a commit on this branch, so there's no need to change anything yourself.
🤖 Claude Code (claude-opus-5-5)
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Only a primary-button press over the hero turns a focus hold into a hover hold. A right or middle click on a focused control leaves the keyboard user's focus in place, so the slideshow stays held after the pointer leaves. The focus such a press causes still holds as hover. The hover tests now send mouse events with the pointer events, as a browser does, so the two reported directions fail on main again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A browser removes a focused control, such as the hero's Translate button once pressed, without a blur, so the focus hold stayed on. On a touch screen nothing else ended it, since touch no longer counts as hover. While a focus hold is on, the next focus or press outside the hero now ends it once focus is no longer inside. The screen-reader test now checks that the hold stays a focus hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Some Home card actions stop their pointerdown from bubbling, so the listener that ends a focus hold left behind by a removed control never heard the press. The listeners now run in the capture phase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The listener that ends a focus hold left behind by a removed control skipped presses inside the hero, so a tap on the hero's title or artwork after Translate kept the slideshow stopped. It now checks only where focus is. Tests cover a focus elsewhere and a press that leaves focus inside. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Maintainer review summaryReviewed head: bb619b3 (the PR's f669338 plus four review-fix commits; ordinary pushes, no rewrite). Splitting the hover hold from the focus hold fixes #4924. Before this PR, a keyboard user on Next who brushed the mouse across the hero, or who tabbed out while the pointer rested on it, restarted the slideshow. Now it stays held until both have left. Main hasn't touched the hero since this branch's base, so the branch didn't need updating. Addressed in this review (all on the branch, each with a test that fails before its fix):
Tests and live check. Against Evidence: https://evidence.siloserver.org/r/silo-server/pr-5076-review/ Left for the maintainers (none of these block):
Validated features: not checked. The validation board query needs a scope this run's token lacks. The PR's Council (Sol gpt-6.2-sol xhigh, Opus claude-opus-5-5 high, Gemini gemini-4-neon xhigh), four rounds:
Fit: 9/10 · Readiness: 9/10 — ready Fit: it fixes confusing slideshow movement for keyboard and screen-reader users on an existing control, with no new setting or surface. Readiness: every finding this review raised is fixed and tested, the reported behaviour was shown live, and CI is green. The remaining items are low or match 🤖 Claude Code (claude-opus-5-5) |
Problem
Closes #4924
Related issue: N/A
Validation tasks: none
Other clients: N/A (web-only fix to the web hero's pointer and focus handling; no API or shared behavior changes)
On the web Home page, the Featured hero stops its slideshow while the pointer is over it or keyboard focus is inside it. Both shared one flag, so whichever left first restarted the slideshow while the other still held it. A keyboard user on the Next slide button who brushed the mouse across the hero saw slides change and heard the live region announce new titles. Tabbing out of the hero while the pointer rested on it also restarted the slideshow under the pointer. This change keeps the slideshow held until both have left.
Approach
HeroBannernow tracks the hover hold and the focus hold separately, and the slideshow and progress rail resume only when both are off. The Pause/Play choice from #4923 is unchanged.Hover comes from pointer events and ignores touch, since a touch has no hover. A tap that moves focus onto a control holds as a focus, and ends when focus leaves.
Two cases keep the old behavior for mouse users. Clicking a slide control with the mouse focuses that button, and a plain focus hold would then keep the slideshow stopped after the pointer leaves. Instead, a primary-button press while the pointer is over the hero turns a focus hold into a hover hold, and the focus that press causes holds as hover. The slideshow stays held under the pointer and resumes when the pointer leaves. A right or middle click leaves a keyboard user's focus hold in place. A press with no pointer over the hero, such as a screen reader's simulated click, leaves the focus hold alone.
A browser can remove a focused control (the hero's Translate button, once pressed) without a blur; Firefox does. While a focus hold is on, the next focus or press outside the hero ends it once focus is no longer inside, and the pointer leaving rechecks where focus is.
The progress rail restarts whenever the slideshow starts running, from committed state, so it stays in step with the fresh 8 s interval.
Known limits:
Validation
main, the two reported-direction tests fail, along with the drag and right-click tests. Each review-fix test fails on the head before its fix.verify-local-paths,verify-size-ratchet,verify-bidi,verify-case-collisions: pass.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-5076/
Surface and build: web Home, Featured hero with four synthetic movies. Before is
mainat 1bbc479; after is this branch. The same steps ran on the same data at 1440px and 390px. Each list is the live-region title read once a second.Risks
Low. The change is limited to the web hero's hold logic. Mouse-only use behaves as on
main.Checklist
Council review
Maintainer review rounds: 4, last reviewed bb619b3
Fixed: a mouse press restarting the slideshow under the pointer after Play; a drag leaving a press pending; a tap's emulated hover outlasting focus; the rail restart read from stale state; a right or middle click ending a keyboard hold; tests that no longer failed on
main; a focus hold left behind by a control removed without a blur, including presses that stop propagation and taps inside the hero. Answered: a click before the pointer has entered the hero (unverified, low), Enter or Space on a mouse-focused control and the rail ignoring visibility (both onmaintoo), and a Tab pressed while a mouse button is held (contrived).AI Disclosure
Note
Hold Featured hero slideshow until both hover and focus leave
HeroBannerinto separate hover and focus holds, tracked via aHoldsrecord and thereleaseHoldhelper in HeroBanner.tsxMacroscope summarized bb619b3.