ref(cmdk) update cmdk to use scraps input#111493
Conversation
| ) : ( | ||
| <IconSearch size="sm" variant="muted" /> | ||
| )} | ||
| </InputGroup.LeadingItems> |
There was a problem hiding this comment.
Missing disablePointerEvents on non-interactive search icon
Medium Severity
When selectedAction is null, InputGroup.LeadingItems contains the non-interactive IconSearch but doesn't set disablePointerEvents. Per the InputGroup documentation, this means clicking the search icon area won't focus the input underneath. The existing usage in compactSelect/control.tsx and every example in inputGroup.mdx always passes disablePointerEvents for non-interactive icons. The prop needs to be conditionally set — disabled when showing the icon, enabled when showing the interactive back button.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| export const modalCss = (theme: Theme) => { | ||
| return css` | ||
| [role='document'] { | ||
| padding: 0; | ||
|
|
||
| background-color: ${theme.tokens.background.primary}; | ||
| border-top-left-radius: calc(${theme.radius.lg} + 1px); | ||
| border-top-right-radius: calc(${theme.radius.lg} + 1px); | ||
| } | ||
| `; | ||
| }; |
There was a problem hiding this comment.
Bug: The Flex component is used with a render prop pattern, which it may not support. This could prevent the InputGroup from rendering.
Severity: CRITICAL
Suggested Fix
Refactor the code to nest the InputGroup directly inside the Flex component as a standard JSX child, instead of using a function-as-a-child (render prop) pattern. Remove the function wrapper {p => { ... }}.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: static/app/components/commandPalette/ui/modal.tsx#L14-L27
Potential issue: The `Flex` component from `@sentry/scraps/layout` is used with a render
prop pattern to render an `InputGroup`. This pattern is anomalous, as no other usage of
`Flex` or `InputGroup` in the codebase follows this pattern. While some components like
`Surface` support render props, there is no evidence that `Flex` does. If `Flex` does
not support this pattern, the child function will not be executed, and the `InputGroup`
containing the search input will fail to render. This would make the command palette
non-functional as users would be unable to type queries.
Did we get this right? 👍 / 👎 to inform future reviews.
7bea665 to
e2595ed
Compare


Updates search input to use scraps input, adds leading search icon, updates the placeholder text to hint at searching, removes the icon wrap and centers the icon and text inside the content.
Fixes DE-1029