Skip to content

Commit 8cb507c

Browse files
committed
fix(search): match tool descriptions to permission group info badges
1 parent 40f14f9 commit 8cb507c

3 files changed

Lines changed: 24 additions & 9 deletions

File tree

‎apps/docs/content/docs/search/connect-your-account.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Creating Jira sprints requires the Jira sprint permission. If your account was c
4646

4747
## Tool permissions
4848

49-
Open the app in **Integrations** and select your account. Tool permissions appear in its details when the app has supported Assistant tools available to you. Set a preference for each operation or use the **Read-only tools** and **Write tools** group controls:
49+
Open the app in **Integrations** and select your account. Tool permissions appear in its details when the app has supported Assistant tools available to you. Hover over or focus the info button beside a tool to read its description. Set a preference for each operation or use the **Read-only tools** and **Write tools** group controls:
5050

5151
| Preference | Behavior |
5252
| --- | --- |

‎apps/sim/app/o/[organizationId]/integrations/accounts/[credentialId]/tool-permissions.tsx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { ChipInput, ChipLink, ChipSelect, ChipSwitch, Tooltip, toast } from '@sim/emcn'
3+
import { ChipInput, ChipLink, ChipSelect, ChipSwitch, Info, toast } from '@sim/emcn'
44
import { ArrowLeft, Search } from '@sim/emcn/icons'
55
import { useQueryStates } from 'nuqs'
66
import type {
@@ -211,13 +211,13 @@ function ToolPermissionGroup({
211211
key={tool.toolId}
212212
className='flex flex-col items-start gap-3 py-3 sm:flex-row sm:items-center sm:justify-between'
213213
>
214-
<div className='min-w-0 flex-1'>
215-
<Tooltip.Root>
216-
<Tooltip.Trigger asChild>
217-
<span className='text-[var(--text-body)] text-small'>{tool.name}</span>
218-
</Tooltip.Trigger>
219-
<Tooltip.Content>{tool.description}</Tooltip.Content>
220-
</Tooltip.Root>
214+
<div className='flex min-w-0 flex-1 items-center gap-2'>
215+
<span className='text-[var(--text-body)] text-small'>{tool.name}</span>
216+
{tool.description && (
217+
<Info side='top' className='shrink-0'>
218+
{tool.description}
219+
</Info>
220+
)}
221221
</div>
222222
<ChipSwitch
223223
className='max-w-full shrink-0'

‎apps/sim/scripts/test-assistant-actions-e2e.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,21 @@ try {
948948
await policy.getByRole('radio', { name: 'Ask', exact: true }).click()
949949
await expect(policy.getByRole('radio', { name: 'Ask', exact: true })).toBeChecked()
950950
await capture('tool-permissions-desktop')
951+
const toolDescription = page
952+
.getByRole('button', { name: 'More information', exact: true })
953+
.first()
954+
await toolDescription.hover()
955+
await expect(page.getByRole('tooltip')).toBeVisible()
956+
await capture('tool-permission-description')
957+
await page.mouse.move(0, 0)
958+
await expect(page.getByRole('tooltip')).toBeHidden()
959+
await toolDescription.focus()
960+
await page.keyboard.press('Tab')
961+
await page.keyboard.press('Shift+Tab')
962+
await expect(toolDescription).toBeFocused()
963+
await expect(page.getByRole('tooltip')).toBeVisible()
964+
await page.keyboard.press('Tab')
965+
await expect(page.getByRole('tooltip')).toBeHidden()
951966
await page.setViewportSize({ width: 390, height: 844 })
952967
await capture('tool-permissions-mobile')
953968
assert(

0 commit comments

Comments
 (0)