Repository navigation
Conversation
|
Found potential problems with the pull request:
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 9 new findings on ac535b2. The verdict and the full list are in the summary comment.
| <TouchableRipple | ||
| borderless | ||
| background={background} | ||
| style={[{ borderRadius }, styles.touchable, ...bodyFocusTarget.style]} | ||
| rippleColor={rippleColor} | ||
| style={[styles.touchable, { borderRadius }, ...bodyFocusTarget.style]} | ||
| focusRing="none" |
There was a problem hiding this comment.
No longer raised on 520457a, with the code it pointed at unchanged: withdrawn, not fixed.
🟡 Minor · Chip body draws the browser's outline plus Paper's ring on web
Tabbing to a chip on web shows two focus indicators: the Surface's :has() ring from bodyFocusRing and the browser's own outline on the focused Pressable. focusRing="none" on the body ripple only suppresses Paper's ring, and useFocusRing adds webNoOutlineStyle only for scope: 'descendant', not the scope: 'within' the chip body uses.
Suggested change
Confirm on web in the ChipExample that a keyboard-focused chip shows exactly one ring; if the browser outline appears as well, set outline: 'none' on the body ripple's style the way the trailing button's unclipped wrapper does.
Details
persona: react-native-paper
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
| onHoverIn={() => setHovered(true)} | ||
| onHoverOut={() => setHovered(false)} |
There was a problem hiding this comment.
No longer raised on 520457a.
🟡 Minor · elevated hover elevation unreachable on a chip with no touch handler
An elevated chip with no onPress/onLongPress/onPressIn/onPressOut stays at elevation 1 on hover: setHovered is only wired to TouchableRipple's onHoverIn/onHoverOut, and with no touch handler TouchableRipple renders a plain View (isControl === false) that never fires hover events. The hover state also never clears if the chip is disabled or loses its handler while hovered, since the element that would fire onHoverOut is gone.
Details
persona: senior-developer
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
| onHoverIn={() => setHovered(true)} | ||
| onHoverOut={() => setHovered(false)} |
There was a problem hiding this comment.
No longer raised on 520457a.
🟡 Minor · hovered state never resets when the pointer leaves without hover-out
An elevated chip stays at elevatedHoverElevation (2) instead of elevatedElevation (1) when the pointer leaves without a hover-out — e.g. the chip scrolls out of the list under the cursor, an overlay/tooltip mounts over it, or the window loses focus. Nothing resets hovered except onHoverOut, which never arrives in those sequences.
Suggested change
Clear hovered when the chip loses focus (and/or disable it while isTouchableDisabled), so a lost hover-out can't leave the chip permanently raised.
Details
persona: javascript
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
| onFocus={(e) => { | ||
| bodyFocusTarget.onFocus?.(e); | ||
| if (e.target !== e.currentTarget || !isKeyboardFocusEvent(e)) return; | ||
| setFocused(true); | ||
| }} | ||
| onBlur={() => { | ||
| bodyFocusTarget.onBlur?.(); | ||
| setFocused(false); | ||
| }} |
There was a problem hiding this comment.
No longer raised on 520457a: the code it pointed at changed.
🟡 Minor · focused/hovered state never resets when the chip stops being interactive
Focus a chip, then set disabled while focus is inside: focused stays true, onBlur never fires (the chip is no longer focusable), and getBorderColor returns focusOutlineColor (onSurfaceVariant) instead of the disabled border. hovered persists the same way for an elevated chip disabled mid-hover, currently masked by the disabled ? 0 branch of elevation.
Suggested change
Skip the focused branch when disabled/isTouchableDisabled, or pass focused && !isTouchableDisabled into getChipColors.
Details
persona: senior-developer
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
Apex Sentinel · 🟠 Request changes · review of
|
| Where | Finding |
|---|---|
src/components/Chip/Chip.tsx:535 |
🆕 Chip label lost flexShrink, so long labels are clipped instead of ellipsized |
Not in the reviewers' prompt (5 files)
docs/public/gallery/chip-dark.png: no text diff (a binary, empty or mode-only change)docs/public/gallery/chip.png: no text diff (a binary, empty or mode-only change)docs/public/screenshots/chip.png: no text diff (a binary, empty or mode-only change)src/components/__tests__/__snapshots__/Chip.test.tsx.snap: generated or a lockfile, so its lines were left outsrc/components/__tests__/__snapshots__/ListItem.test.tsx.snap: generated or a lockfile, so its lines were left out
2 findings below minor hidden (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (c8c3a3945ccb).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 520457a. The verdict and the full list are in the summary comment.
| labelText: { | ||
| textAlignVertical: 'center', | ||
| includeFontPadding: false, | ||
| }, |
There was a problem hiding this comment.
🆕 🟠 Major · Chip label lost flexShrink, so long labels are clipped instead of ellipsized
A Chip whose label is wider than its available space now hard-clips the text with no ellipsis. The labelText style no longer carries flexShrink: 1 (Yoga's default flexShrink is 0), so the Text keeps its measured width while styles.content shrinks and its overflow: 'hidden' cuts the overflow. The ellipsizeMode prop has nothing to act on since numberOfLines={1} only ellipsizes when the text is given a narrower width.
| labelText: { | |
| textAlignVertical: 'center', | |
| includeFontPadding: false, | |
| }, | |
| labelText: { | |
| textAlignVertical: 'center', | |
| includeFontPadding: false, | |
| flexShrink: 1, | |
| }, |
Details
persona: senior-developer
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
Breaking API and behavior
modefrom flat to outlined.compactandshowSelectedOverlayprops; the selected overlay is now handled automatically for avatars.getChipColorsinutils.ts, renamed fromhelpers.tsx) to align with MD3 state and color roles, with a dedicated ripple color and avatar selected-overlay color.selectedColor.elevatedanddisabledprops.Accessibility, focus and interaction
useFocusRinghook, as Button, Card and FAB do.Surface, and passesfocusRing="none"to both ripples soTouchableRippleno longer adds a second ring.hitSlop, and moves the close icon intoTouchableRipplefor consistent ripple/state-layer feedback.hitSlopso it doesn't overlap the label's touch area.More including cleanups, docs, example app and tests.
Motivation
Align the Chip component with Material Design 3 guidelines and specs.
Related issue
refactor(chip): improve selection model and MD3 compliance #4931
feat: implement Chip component #5081
Screenshots / Videos
Test plan
Run the example app (
ChipExample) on iOS, Android and web, in light and dark themes, and click through every chip. Then turn on VoiceOver (iOS) or TalkBack (Android) and swipe through them.