-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(searchbar): Add tooltip descriptions to filter keys #92449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
47b58a1
d8aff06
56cfce4
7b9692d
90ce693
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import type {ListState} from '@react-stately/list'; | |
import type {Node} from '@react-types/shared'; | ||
|
||
import {CompactSelect, type SelectOption} from 'sentry/components/core/compactSelect'; | ||
import {Tooltip} from 'sentry/components/core/tooltip'; | ||
import InteractionStateLayer from 'sentry/components/interactionStateLayer'; | ||
import {useSearchQueryBuilder} from 'sentry/components/searchQueryBuilder/context'; | ||
import {UnstyledButton} from 'sentry/components/searchQueryBuilder/tokens/filter/unstyledButton'; | ||
|
@@ -89,17 +90,22 @@ function FilterKeyOperatorLabel({ | |
opLabel, | ||
includeKeyLabel, | ||
}: { | ||
keyLabel: string; | ||
includeKeyLabel?: boolean; | ||
keyLabel?: string; | ||
opLabel?: string; | ||
}) { | ||
const {getFieldDefinition} = useSearchQueryBuilder(); | ||
const fieldDefinition = getFieldDefinition(keyLabel); | ||
|
||
if (!includeKeyLabel) { | ||
return <OpLabel>{opLabel}</OpLabel>; | ||
} | ||
|
||
return ( | ||
<KeyOpLabelWrapper> | ||
<span>{keyLabel}</span> | ||
<Tooltip title={fieldDefinition?.desc} skipWrapper> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to wrap this tooltip around the whole thing? For There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<span>{keyLabel}</span> | ||
</Tooltip> | ||
{opLabel ? <OpLabel> {opLabel}</OpLabel> : null} | ||
</KeyOpLabelWrapper> | ||
); | ||
|
Uh oh!
There was an error while loading. Please reload this page.