Repository navigation
fix(lab): MobilePowerSearch announces empty and unavailable states only from the open step - #8769
Merged
imdreamrunner merged 1 commit intoOct 28, 2026
Conversation
…able messages only while that step is open A closed step's body stays mounted, so its SheetEmptyMessage could change occasion with no one in the sheet: leaving Add filter after a query that listed suggestions spoke "No results found" (the results are emptied once the step is not 'fields'), and a config update that dropped the last edited field or operator after the value step closed wrote "This filter is no longer available" into the closed dialog, where the words surfaced in the next step that opened, while reopening the same stale filter spoke nothing (same occasion). The message now takes isShown — its step being the open one — speaks only then, and forgets its occasion while hidden, so the same one is spoken again when the step reopens on it.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
imdreamrunner
enabled auto-merge (squash)
October 28, 2026 00:56
|
AI review status for this pull request.
|
Contributor
PR Analysis Report
|
github-actions
Bot
deleted the
fix/lab-mobile-powersearch-stale-announcements
branch
October 28, 2026 06:17
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(lab): MobilePowerSearch speaks a sheet's empty-result and unavailable messages only while that step is open
User impact
Screen-reader users of Lab
MobilePowerSearchafter #8740, in two states. (1) In Add filter with a content search, typing a query that lists suggestions and then leaving the sheet — Back, Escape, the scrim — hears "No results found", though results were listed and nothing was searched for: on the page after Escape, or inside the Filters dialog after Back. (2) After editing a filter and closing the value step, a controlled config update that drops that filter's field or operator writes "This filter is no longer available" with no filter open; the words surface in the next step that opens (editing a different filter speaks the stale message), and reopening the same stale filter speaks nothing, because its occasion is unchanged. Restoring it makes each message speak only while its step is the open one, and again whenever the step reopens on the same occasion.Problem and solution fit
Why does it occur?
BottomSheetkeeps a closed sheet's body mounted, and #8740'sSheetEmptyMessagespoke whenever itsoccasionchanged, with no notion of whether anyone was in the sheet.contentResultsis emptied wheneverstep !== 'fields', so the step change itself produced an "empty result"; and the draft outlives its step, so a later config update changed the unavailable message's occasion inside a closed dialog — whereuseAnnounceholds the words until that dialog's channel is exposed, which is when the next step opens.Why does it harm the task? An announcement that describes a state the person is not in misreports what happened — a search that found nothing, a filter that vanished — and interrupts whatever they moved on to.
Why does that harm matter?
component:PowerSearchFR18 limits the empty-result message to a query whose result set is empty, and FR14 ties the unavailable message to the filter being edited, inside the sheet; AR6 says every announcement a sheet makes is about that sheet's content while it is open. A message spoken from a closed sheet breaks the promise the flow's in-sheet announcement route exists to keep.The narrow fix:
SheetEmptyMessagetakesisShown— its step being the open one. Hidden, it speaks nothing and forgets its spoken occasion; shown, it speaks a new occasion once. The three call sites passstep === 'fields'(both Add filter messages) andstep === 'value'(the unavailable state). Nothing else about the messages, the results list or thearia-controlstarget changes.Expected behavior and authority
component:PowerSearch(current, docs(spec): PowerSearch records the experimental touch sheet presentation (DEC-3) #8000): FR18 — the empty-result message appears for a query whose result set is empty; FR14 — the unavailable state belongs to the value step editing that filter; AR6 — in-sheet announcements are the open sheet's. Lab'sMobilePowerSearchimplements that record's flow (governing record confirmed on feat(lab): MobilePowerSearch gains the Core PowerSearch sheet's behavior #8740).SheetEmptyMessage; its review found both paths.Smallest restoration
MobilePowerSearch.tsx: one prop (isShown) on the internalSheetEmptyMessage, one early return in its effect that also resetsspokenOccasionRef, three call sites gated on the current step. No prop, visual, default or interaction change; the message's element, id and text are as before.Evidence
main's component, checked by stashing the source): "does not announce 'No results found' when Add filter is left after a query that listed suggestions" fails —expected 'No results found' to be ''in the page region after Back; "announces the unavailable state only while its step is open, and again when the same stale filter reopens" fails — the words surface in the live region of the next step opened (editing "Author is Ada").aria-controlstarget, "moves focus to Remove … and announces it in the sheet" — pass unchanged, so a message in the open step still speaks once per occasion.isShowngate fails the first, removing the occasion reset (keeping the gate) fails the second's reopen assertion.Scope
Testing
pnpm exec vitest run packages/lab/src/MobilePowerSearch— 116 tests pass (114 + the two regressions); onmain's component with this test file, the two regressions fail as described.packages/lab/src/MobilePowerSearch/— 0 findings; prettier andgit diff --checkclean.