Skip to content

Commit 37a34cf

Browse files
committed
improvement(kb-connectors): restore field descriptions as info-icon tooltips
Restores the 41 field-level `description` lines stripped in fc64421, but instead of rendering them as inline muted-text paragraphs they're shown via a small Info icon next to each field title. Hovering or focusing the icon reveals the description in the existing emcn Tooltip. Keeps the modal layout tight while preserving the per-field guidance. Used <button type="button"> as the tooltip trigger (Radix asChild) rather than <span tabIndex={0}> to satisfy a11y/noNoninteractiveTabindex.
1 parent c81fabb commit 37a34cf

18 files changed

Lines changed: 84 additions & 17 deletions

File tree

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-connector-modal/add-connector-modal.tsx

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

33
import { useMemo, useState } from 'react'
4-
import { ArrowLeft, ArrowLeftRight, Plus, Search } from 'lucide-react'
4+
import { ArrowLeft, ArrowLeftRight, Info, Plus, Search } from 'lucide-react'
55
import { useParams } from 'next/navigation'
66
import {
77
Button,
@@ -347,12 +347,28 @@ export function AddConnectorModal({
347347
return (
348348
<div key={field.id} className='flex flex-col gap-2'>
349349
<div className='flex items-center justify-between'>
350-
<Label>
351-
{field.title}
352-
{field.required && (
353-
<span className='ml-0.5 text-[var(--text-error)]'>*</span>
350+
<div className='flex items-center gap-1'>
351+
<Label>
352+
{field.title}
353+
{field.required && (
354+
<span className='ml-0.5 text-[var(--text-error)]'>*</span>
355+
)}
356+
</Label>
357+
{field.description && (
358+
<Tooltip.Root>
359+
<Tooltip.Trigger asChild>
360+
<button
361+
type='button'
362+
className='flex size-[14px] cursor-help items-center justify-center text-[var(--text-muted)] transition-colors hover-hover:text-[var(--text-secondary)]'
363+
aria-label={`About ${field.title}`}
364+
>
365+
<Info className='size-[12px]' />
366+
</button>
367+
</Tooltip.Trigger>
368+
<Tooltip.Content side='top'>{field.description}</Tooltip.Content>
369+
</Tooltip.Root>
354370
)}
355-
</Label>
371+
</div>
356372
{hasCanonicalPair && canonicalId && (
357373
<Tooltip.Root>
358374
<Tooltip.Trigger asChild>
@@ -372,9 +388,6 @@ export function AddConnectorModal({
372388
</Tooltip.Root>
373389
)}
374390
</div>
375-
{field.description && (
376-
<p className='text-[var(--text-muted)] text-xs'>{field.description}</p>
377-
)}
378391
{field.type === 'selector' && field.selectorKey ? (
379392
<ConnectorSelectorField
380393
field={field as ConnectorConfigField & { selectorKey: SelectorKey }}

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/edit-connector-modal/edit-connector-modal.tsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useMemo, useState } from 'react'
44
import { createLogger } from '@sim/logger'
5-
import { ArrowLeftRight, ExternalLink, RotateCcw } from 'lucide-react'
5+
import { ArrowLeftRight, ExternalLink, Info, RotateCcw } from 'lucide-react'
66
import {
77
Button,
88
ButtonGroup,
@@ -385,10 +385,26 @@ function SettingsTab({
385385
return (
386386
<div key={field.id} className='flex flex-col gap-2'>
387387
<div className='flex items-center justify-between'>
388-
<Label>
389-
{field.title}
390-
{field.required && <span className='ml-0.5 text-[var(--text-error)]'>*</span>}
391-
</Label>
388+
<div className='flex items-center gap-1'>
389+
<Label>
390+
{field.title}
391+
{field.required && <span className='ml-0.5 text-[var(--text-error)]'>*</span>}
392+
</Label>
393+
{field.description && (
394+
<Tooltip.Root>
395+
<Tooltip.Trigger asChild>
396+
<button
397+
type='button'
398+
className='flex size-[14px] cursor-help items-center justify-center text-[var(--text-muted)] transition-colors hover-hover:text-[var(--text-secondary)]'
399+
aria-label={`About ${field.title}`}
400+
>
401+
<Info className='size-[12px]' />
402+
</button>
403+
</Tooltip.Trigger>
404+
<Tooltip.Content side='top'>{field.description}</Tooltip.Content>
405+
</Tooltip.Root>
406+
)}
407+
</div>
392408
{hasCanonicalPair && canonicalId && (
393409
<Tooltip.Root>
394410
<Tooltip.Trigger asChild>
@@ -406,9 +422,6 @@ function SettingsTab({
406422
</Tooltip.Root>
407423
)}
408424
</div>
409-
{field.description && (
410-
<p className='text-[var(--text-muted)] text-xs'>{field.description}</p>
411-
)}
412425
{field.type === 'selector' && field.selectorKey ? (
413426
<ConnectorSelectorField
414427
field={field as ConnectorConfigField & { selectorKey: SelectorKey }}

apps/sim/connectors/discord/discord.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export const discordConnector: ConnectorConfig = {
154154
type: 'short-input',
155155
placeholder: 'e.g. 123456789012345678',
156156
required: true,
157+
description: 'The Discord channel ID to sync messages from',
157158
},
158159
{
159160
id: 'maxMessages',

apps/sim/connectors/dropbox/dropbox.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export const dropboxConnector: ConnectorConfig = {
115115
type: 'short-input',
116116
placeholder: 'e.g. /Documents (default: entire Dropbox)',
117117
required: false,
118+
description: 'Leave empty to sync all supported files',
118119
},
119120
{
120121
id: 'maxFiles',

apps/sim/connectors/evernote/evernote.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ export const evernoteConnector: ConnectorConfig = {
383383
type: 'short-input',
384384
placeholder: 'Leave empty to sync all notebooks',
385385
required: false,
386+
description: 'Sync only notes from this notebook (optional)',
386387
},
387388
],
388389

apps/sim/connectors/fireflies/fireflies.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export const firefliesConnector: ConnectorConfig = {
140140
type: 'short-input',
141141
placeholder: 'e.g. john@example.com',
142142
required: false,
143+
description: 'Only sync transcripts hosted by this email',
143144
},
144145
{
145146
id: 'maxTranscripts',

apps/sim/connectors/gmail/gmail.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ export const gmailConnector: ConnectorConfig = {
360360
multi: true,
361361
placeholder: 'Select one or more labels',
362362
required: false,
363+
description: 'Only sync emails matching any of these labels. Leave empty for all mail.',
363364
},
364365
{
365366
id: 'label',
@@ -370,6 +371,7 @@ export const gmailConnector: ConnectorConfig = {
370371
multi: true,
371372
placeholder: 'e.g. INBOX, IMPORTANT (comma-separated; commas in label names not supported)',
372373
required: false,
374+
description: 'Only sync emails matching any of these labels. Leave empty for all mail.',
373375
},
374376
{
375377
id: 'dateRange',
@@ -411,6 +413,7 @@ export const gmailConnector: ConnectorConfig = {
411413
type: 'short-input',
412414
placeholder: 'e.g. from:boss@company.com subject:report has:attachment',
413415
required: false,
416+
description: 'Additional Gmail search filter. Uses the same syntax as the Gmail search bar.',
414417
},
415418
{
416419
id: 'maxThreads',

apps/sim/connectors/google-calendar/google-calendar.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export const googleCalendarConnector: ConnectorConfig = {
267267
multi: true,
268268
placeholder: 'Select one or more calendars',
269269
required: false,
270+
description: 'Calendars to sync from. Defaults to your primary calendar.',
270271
},
271272
{
272273
id: 'calendarId',
@@ -298,6 +299,7 @@ export const googleCalendarConnector: ConnectorConfig = {
298299
type: 'short-input',
299300
placeholder: 'e.g. standup, sprint review (optional)',
300301
required: false,
302+
description: 'Filter events by text search across all fields.',
301303
},
302304
{
303305
id: 'maxEvents',

apps/sim/connectors/google-sheets/google-sheets.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export const googleSheetsConnector: ConnectorConfig = {
216216
type: 'short-input',
217217
placeholder: 'e.g. 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms',
218218
required: true,
219+
description: 'The ID from the spreadsheet URL: docs.google.com/spreadsheets/d/{ID}/edit',
219220
},
220221
{
221222
id: 'sheetFilter',

apps/sim/connectors/intercom/intercom.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ export const intercomConnector: ConnectorConfig = {
285285
title: 'Content Type',
286286
type: 'dropdown',
287287
required: true,
288+
description: 'Choose what to sync from Intercom',
288289
options: [
289290
{ label: 'Articles Only', id: 'articles' },
290291
{ label: 'Conversations Only', id: 'conversations' },
@@ -296,6 +297,7 @@ export const intercomConnector: ConnectorConfig = {
296297
title: 'Article State',
297298
type: 'dropdown',
298299
required: false,
300+
description: 'Filter articles by state (default: published)',
299301
options: [
300302
{ label: 'Published', id: 'published' },
301303
{ label: 'Draft', id: 'draft' },
@@ -307,6 +309,7 @@ export const intercomConnector: ConnectorConfig = {
307309
title: 'Conversation State',
308310
type: 'dropdown',
309311
required: false,
312+
description: 'Filter conversations by state (default: all)',
310313
options: [
311314
{ label: 'Open', id: 'open' },
312315
{ label: 'Closed', id: 'closed' },
@@ -319,6 +322,7 @@ export const intercomConnector: ConnectorConfig = {
319322
type: 'short-input',
320323
required: false,
321324
placeholder: `e.g. 200 (default: ${DEFAULT_MAX_ITEMS})`,
325+
description: 'Maximum number of articles or conversations to sync',
322326
},
323327
],
324328

0 commit comments

Comments
 (0)