Repository navigation
fix(HoverCard): text written around an expression gets the focusable trigger and hover cue - #9603
Conversation
…trigger
component:HoverCard FR2: text children are wrapped in a focusable inline
span. isTextOnly accepted only a single string or number, so text that
reaches React as several strings (`Edited {when}`) was treated as element
children; the wrapper found no element to attach to, and hover and focus
never opened the card.
isTextOnly now also accepts an array whose renderable items are all strings
or numbers (holes that render nothing, per isRenderable, are skipped); one
element still means element children. No Children introspection. Tests:
mixed text wraps and opens (red before), holes are ignored, and a present
element still takes the wiring. Record: FR2 states it, the Current-state
bullet is dropped, and the verification row names the tests.
…d an expression
Specs' ruling: FR8's hasHoverIndication auto applies to text children,
strings and numbers with holes such as false and null ignored, the same set
FR2 wraps. The trigger already took the cue from isTextOnly; tests now pin
that several text children, and text with holes, get the same cue class as
one string, and that hasHoverIndication={false} removes it. Record: FR8 and
FR2 use the same wording, and the verification row names the cue.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 2408c09 |
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
The fix works: text written around an expression, such as Edited {when}, now gets the focusable trigger, opens on hover and keyboard focus, and shows the same hover cue as a single string, and the new tests fail without the change. Before this merges, please update the documentation that still describes the old behaviour:
HoverCard.doc.mjs(thechildrenandhasHoverIndicationentries, in both the full and the dense docs) and thehasHoverIndicationJSDoc inHoverCard.tsxstill say such text gets no trigger, or thatautocovers only a single string or number.- The Compatibility/readiness row of
HoverCard.spec.mdstill counts "eight further implementation gaps"; with the mixed-text bullet removed, seven remain.
[Automated review]
CodeBunny on #9603: HoverCard.doc.mjs (children and hasHoverIndication, full and dense docs, both languages) and the hasHoverIndication JSDoc still said text in several pieces gets no trigger, or that auto covers only a single string or number. They now describe text children with holes ignored, as FR2 and FR8 do, and the readiness count drops to seven gaps.
|
/approve-spec 6ec4de8 |
There was a problem hiding this comment.
Approving: text written around an expression, such as Edited {when}, now gets the focusable trigger, opens on hover and keyboard focus, and shows the same hover cue as a single string, the new tests fail without the change, and the documentation and gap count flagged earlier are fixed. One optional cleanup: the verification map in HoverCard.spec.md still lists hasHoverIndication={false} and the default cue as having no unit test, which the new cue test now covers.
[Automated review]
…vercard-mixed-text # Conflicts: # docs/specs/components/HoverCard/HoverCard.spec.md
The previous merge commit cut the HoverCard record from the removed Current-state bullet to the next list item, which dropped whole sections. The record is main's again, with only this PR's edits: FR2, FR8, the FR1/FR2/FR8 verification row, the removed mixed-text gap and its count.
|
/approve-spec 62c6cd9 |
There was a problem hiding this comment.
Requesting one small change before merge. Text written around an expression, such as Edited {when}, now gets the focusable trigger, opens on hover and keyboard focus, and shows the same hover cue as a single string, and the new tests fail without the fix.
HoverCard.spec.mdstill says under Compatibility and migration that there is "no public prop, default, DOM, or styling change", but triggers written around an expression now render a focusable span with the dashed underline, so that line should state this effect (a patch[fix]).
Optional: the verification map still lists hasHoverIndication={false} and the default cue as having no unit test, which the new cue test now covers.
[Automated review]
| | End-user impact | Mouse, keyboard, and touch users can open the preview, move into it to use its actions, and dismiss it; screen-reader users hear it as a named popup dialog or as the trigger's description. Under the default `touchTrigger="auto"`, a tap on a trigger that performs an action performs only that action. | | ||
| | Builder impact | `touchTrigger` answers whether it is safe to consume a tap to show the card (DEC-1): keep the default `auto` on a trigger that performs an action, pass `tap` where a tap only reveals the card, and pass `none` where a tap must never show it. | | ||
| | Compatibility/readiness | No public API change: `touchTrigger` keeps its released values and its default `auto`. Seven implementation gaps (see Current-state impact). | | ||
| | Compatibility/readiness | No public API change: `touchTrigger` keeps its released values and its default `auto`. Six implementation gaps (see Current-state impact). | |
There was a problem hiding this comment.
The gap count is updated here, but the Compatibility class bullet under Compatibility and migration (line 66) still says "no public prop, default, DOM, or styling change". Text written around an expression now renders a focusable span with the dashed underline, so that bullet should say so, for example: "no public prop or default change; text written around an expression now renders the focusable trigger span and the auto hover cue, a patch [fix]".
… change; evidence lists follow the new cue test CodeBunny on #9603: text written around an expression now renders the focusable trigger span with the hover cue, so the Compatibility class line says so. The new cue test covers hasHoverIndication={false} and the default cue, so the read-from-source and browser-only lists drop them.
|
/approve-spec 2c81855 |
There was a problem hiding this comment.
Approving. Text written around an expression, such as Edited {when}, now gets HoverCard's focusable trigger, opens on hover and keyboard focus, and shows the same hover cue as a single string, and the new tests fail without the fix. The record's compatibility class and verification lists now describe the change accurately, so nothing further is needed for review.
[Automated review]
# Conflicts: # docs/specs/components/HoverCard/HoverCard.spec.md # packages/core/src/HoverCard/HoverCard.test.tsx # packages/core/src/HoverCard/HoverCard.tsx
|
/approve-spec 581f749 |
There was a problem hiding this comment.
Approving: text written around an expression, such as Edited {when}, now gets HoverCard's focusable trigger, opens on hover and keyboard focus, carries its popup attributes or description, and shows the same hover cue as a single string. The new tests fail without the fix and pass with it, the record and consumer docs describe the change, and the merge of main kept the fix intact.
[Automated review]
User impact
A product writes a hover card around text with an expression in it, such as
<HoverCard content={history}>Edited {when}</HoverCard>. That text gets no trigger:<HoverCard>Edited</HoverCard>.Problem and solution fit
isTextOnlyaccepted only a single string or number. JSX passesEdited {when}as an array of strings, so HoverCard treated it as element children and looked for a first element to attach to. There isn't one.Expected behavior and authority
component:HoverCardFR2: text children are wrapped in a focusable inline span. The record lists "Mixed text children get no trigger" under Current-state impact.hasHoverIndication'sautocovers the same text children, "strings and numbers, with holes such asfalseandnullignored".Smallest restoration
isTextOnlyalso accepts an array (flattened) whose renderable items, per the sharedisRenderable, are all strings or numbers, with at least one present. One element still means element children. There's noChildrenintrospection.HoverCard.doc.mjs(thechildrenandhasHoverIndicationentries, full and dense, both languages) and thehasHoverIndicationJSDoc describe text children the same way.Evidence
Edited {when}gets the focusable span, its description, and hover opening;Edited <time>today</time>) still wires that element.hasHoverIndication={false}still removes the cue.isTextOnlyfails the wrap, holes and cue tests.Scope
autocue, applied to the text children FR2 already covers.Testing
pnpm vitest run packages/core/src/HoverCard: 70 passed.pnpm check:knowledge: aligned.Writing rubric results
Run over FR2, FR8, Current-state impact, and the FR1/FR2/FR8 verification row (
docs/contributing/spec-writing.md):