-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(conversations): Improve tool badge rendering and overflow behavior #115880
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 7 commits
60eca4e
a2d6ff3
87669cc
b9dfa15
baa1db6
18ff3bd
7a1fc9e
957d236
1d66e2b
5668b35
83ce7c3
cefd566
745a553
61c8508
01b079a
b011ecd
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 |
|---|---|---|
|
|
@@ -183,30 +183,38 @@ export function ConversationAggregatesBar({ | |
| <Text size="sm" bold variant="muted" wrap="nowrap"> | ||
| {t('Used Tools')} | ||
| </Text> | ||
| {aggregates.toolNames.slice(0, VISIBLE_TOOL_COUNT).map(name => ( | ||
| <Tag key={name} variant="info"> | ||
| {name} | ||
| </Tag> | ||
| {aggregates.toolNames.slice(0, VISIBLE_TOOL_COUNT).map((name, index, arr) => ( | ||
| <Tooltip key={name} title={name} showOnlyOnOverflow skipWrapper> | ||
| <Tag | ||
| variant="info" | ||
| style={ | ||
| index === arr.length - 1 | ||
| ? {flexShrink: 1, minWidth: 0} | ||
| : {flexShrink: 0} | ||
| } | ||
| > | ||
| {name} | ||
| </Tag> | ||
| </Tooltip> | ||
|
obostjancic marked this conversation as resolved.
Outdated
|
||
| ))} | ||
| {aggregates.toolNames.length > VISIBLE_TOOL_COUNT && ( | ||
| <DropdownMenu | ||
| size="sm" | ||
| triggerLabel={ | ||
| <Text size="sm" variant="muted"> | ||
| {t('+%s more', aggregates.toolNames.length - VISIBLE_TOOL_COUNT)} | ||
| </Text> | ||
| <Tooltip | ||
| title={ | ||
| <MoreToolsTooltip> | ||
| {aggregates.toolNames.slice(VISIBLE_TOOL_COUNT).map(name => ( | ||
| <Tag key={name} variant="info"> | ||
| {name} | ||
| </Tag> | ||
| ))} | ||
| </MoreToolsTooltip> | ||
| } | ||
| triggerProps={{ | ||
| size: 'zero', | ||
| variant: 'transparent', | ||
| showChevron: false, | ||
| }} | ||
| items={aggregates.toolNames.slice(VISIBLE_TOOL_COUNT).map(name => ({ | ||
| key: name, | ||
| label: <Tag variant="info">{name}</Tag>, | ||
| textValue: name, | ||
| }))} | ||
| /> | ||
| isHoverable | ||
| skipWrapper | ||
| > | ||
| <Text size="sm" variant="muted" wrap="nowrap"> | ||
|
Collaborator
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. could we use |
||
| {t('+%s more', aggregates.toolNames.length - VISIBLE_TOOL_COUNT)} | ||
| </Text> | ||
| </Tooltip> | ||
| )} | ||
| </ToolTagsRow> | ||
| ) | ||
|
|
@@ -405,3 +413,10 @@ function ToolTagsRow({children}: {children: React.ReactNode}) { | |
| </Flex> | ||
| ); | ||
| } | ||
|
|
||
| const MoreToolsTooltip = styled('div')` | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: ${p => p.theme.space.xs}; | ||
| padding: ${p => p.theme.space.xs} 0; | ||
| `; | ||
|
Collaborator
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. this should please be the
cursor[bot] marked this conversation as resolved.
Outdated
|
||
Uh oh!
There was an error while loading. Please reload this page.