Skip to content

Commit 5b274e1

Browse files
authored
chore(trace ai queries): Beta badge and styles (#95303)
- Add beta badges - Update CTA - Fix double highlighting button on hover when already selected <img width="562" height="477" alt="image" src="https://github.com/user-attachments/assets/9fa4dab0-86d6-47b4-ad51-534e0bfd45e6" /> <img width="256" height="160" alt="image" src="https://github.com/user-attachments/assets/b55068a1-5257-4562-81ad-2a186b24a070" /> <img width="366" height="195" alt="image" src="https://github.com/user-attachments/assets/a3a66811-73a1-4835-9c27-964c22aba5b7" />
1 parent 9e6b93e commit 5b274e1

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

static/app/components/searchQueryBuilder/askSeer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ export const AskSeerListItem = styled('div')`
3737
&:hover,
3838
&:focus {
3939
cursor: pointer;
40-
background-color: ${p => p.theme.purple100};
41-
color: ${p => p.theme.purple400};
4240
}
4341
4442
&[aria-selected='true'] {
@@ -52,4 +50,7 @@ export const AskSeerLabel = styled('span')`
5250
color: ${p => p.theme.purple400};
5351
font-size: ${p => p.theme.fontSize.md};
5452
font-weight: ${p => p.theme.fontWeight.bold};
53+
display: flex;
54+
align-items: center;
55+
gap: ${space(1)};
5556
`;

static/app/components/searchQueryBuilder/index.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ describe('SearchQueryBuilder', function () {
957957
await userEvent.click(getLastInput());
958958
await userEvent.type(screen.getByRole('combobox'), 'some free text');
959959

960-
expect(screen.getByRole('option', {name: 'Ask Seer'})).toBeInTheDocument();
960+
expect(screen.getByRole('option', {name: /Ask Seer/i})).toBeInTheDocument();
961961
});
962962

963963
it('can add parens by typing', async function () {

static/app/components/searchQueryBuilder/tokens/combobox.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {type ComboBoxState, useComboBoxState} from '@react-stately/combobox';
1717
import type {CollectionChildren, Key, KeyboardEvent} from '@react-types/shared';
1818

1919
import Feature from 'sentry/components/acl/feature';
20+
import {FeatureBadge} from 'sentry/components/core/badge/featureBadge';
2021
import {ListBox} from 'sentry/components/core/compactSelect/listBox';
2122
import type {
2223
SelectKey,
@@ -287,7 +288,9 @@ function AskSeerOption<T>({state}: {state: ComboBoxState<T>}) {
287288
<AskSeerListItem ref={ref} onClick={handleClick} {...optionProps}>
288289
<InteractionStateLayer isHovered={isFocused} isPressed={isPressed} />
289290
<IconSeer />
290-
<AskSeerLabel {...labelProps}>{t('Ask Seer')}</AskSeerLabel>
291+
<AskSeerLabel {...labelProps}>
292+
{t('Ask Seer')} <FeatureBadge type="beta" />
293+
</AskSeerLabel>
291294
</AskSeerListItem>
292295
);
293296
}

static/app/components/searchQueryBuilder/tokens/filterKeyListBox/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type {ComboBoxState} from '@react-stately/combobox';
77
import type {Key} from '@react-types/shared';
88

99
import Feature from 'sentry/components/acl/feature';
10+
import {FeatureBadge} from 'sentry/components/core/badge/featureBadge';
1011
import {Button} from 'sentry/components/core/button';
1112
import {ListBox} from 'sentry/components/core/compactSelect/listBox';
1213
import type {
@@ -171,7 +172,10 @@ function AskSeerOption<T>({state}: {state: ComboBoxState<T>}) {
171172
<AskSeerListItem ref={ref} onClick={handleClick} {...optionProps}>
172173
<InteractionStateLayer isHovered={isFocused} isPressed={isPressed} />
173174
<IconSeer />
174-
<AskSeerLabel {...labelProps}>{t('Ask Seer')}</AskSeerLabel>
175+
<AskSeerLabel {...labelProps}>
176+
{t('Ask Seer')}
177+
<FeatureBadge type="beta" />
178+
</AskSeerLabel>
175179
</AskSeerListItem>
176180
);
177181
}

static/app/views/explore/components/seerSearch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export function SeerSearch({initialQuery = ''}: SeerSearchProps) {
281281
</QueryResultsSection>
282282
) : (
283283
<SeerContent>
284-
<SeerHeader title={t("Type something in and I'll do my best to help")} />
284+
<SeerHeader title={t("Describe what you're looking for!")} />
285285
</SeerContent>
286286
)}
287287

0 commit comments

Comments
 (0)