Skip to content

Commit ce4d024

Browse files
committed
improvement(knowledge): align connected-sources rows and move source chip left of filter/sort
- Drop the -mx-2 on the connectors list so rows respect the ChipModalBody gutter: the row hover no longer bleeds to the modal edges and row content lines up with the px-4 header. - Add a 'leading' slot to ResourceOptions (left of the filter/sort cluster) and render the knowledge connected-source chip there instead of the far-right 'aside', so it reads as part of the control row. 'aside' stays right-aligned for the table editor's run/stop control.
1 parent ea505f0 commit ce4d024

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-options/resource-options.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,19 @@ interface ResourceOptionsProps {
8282
sort?: SortConfig
8383
filter?: FilterConfig
8484
filterTags?: FilterTag[]
85+
/**
86+
* Lightweight control rendered immediately to the LEFT of the filter/sort
87+
* cluster (still right-aligned after the search) — e.g. the knowledge view's
88+
* connected-source badge, which reads as part of the control row. Use this for
89+
* controls that belong alongside filter/sort; use {@link aside} for status
90+
* widgets that should sit at the far right edge.
91+
*/
92+
leading?: ReactNode
8593
/**
8694
* Supplementary right-aligned slot (pushed opposite the left-aligned
8795
* filter/sort via `justify-between`) for lightweight status content — e.g.
88-
* the knowledge list's connector badges or the table editor's run/stop
89-
* control in embedded mode. Keep it to badges/status widgets; primary
90-
* actions belong in the header's `actions`, not here.
96+
* the table editor's run/stop control in embedded mode. Keep it to
97+
* badges/status widgets; primary actions belong in the header's `actions`.
9198
*/
9299
aside?: ReactNode
93100
}
@@ -97,6 +104,7 @@ export const ResourceOptions = memo(function ResourceOptions({
97104
sort,
98105
filter,
99106
filterTags,
107+
leading,
100108
aside,
101109
}: ResourceOptionsProps) {
102110
/**
@@ -110,13 +118,15 @@ export const ResourceOptions = memo(function ResourceOptions({
110118
const isToggleFilter = filter?.mode === 'toggle'
111119
const popoverFilter = filter && filter.mode !== 'toggle' ? filter : null
112120

113-
const hasContent = search || sort || filter || aside || (filterTags && filterTags.length > 0)
121+
const hasContent =
122+
search || sort || filter || leading || aside || (filterTags && filterTags.length > 0)
114123
if (!hasContent) return null
115124

116125
return (
117126
<div className={cn('border-[var(--border)] border-b py-2.5', search ? 'px-6' : 'px-4')}>
118127
<div className='flex items-center justify-between'>
119128
{search && <SearchSection search={search} />}
129+
{leading && <div className='flex shrink-0 items-center gap-1.5'>{leading}</div>}
120130
<div className='flex items-center'>
121131
{filterTags?.map((tag) => (
122132
<Chip key={tag.label} rightIcon={X} onClick={tag.onRemove}>

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ export function KnowledgeBase({
11541154
sort={sortConfig}
11551155
filter={filterContent ? { content: filterContent } : undefined}
11561156
filterTags={filterTags}
1157-
aside={connectorBadges}
1157+
leading={connectorBadges}
11581158
/>
11591159
<Resource.Table
11601160
columns={DOCUMENT_COLUMNS}

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/connectors-section/connectors-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export function ConnectorsSection({
202202
No connected sources yet. Connect an external source to automatically sync documents.
203203
</p>
204204
) : (
205-
<div className='-mx-2 mt-2 flex flex-col gap-0.5'>
205+
<div className='mt-2 flex flex-col gap-0.5'>
206206
{connectors.map((connector) => (
207207
<ConnectorCard
208208
key={connector.id}

0 commit comments

Comments
 (0)