Skip to content

Commit 172c183

Browse files
fix(tables): right-align run/stop in the embedded table toolbar
Add a right-aligned `trailing` slot to ResourceOptionsBar and move the embedded mothership table's run/stop control into it, so Filter + Sort stay left-aligned and run/stop sits opposite on the right. No-op for the search-bearing consumers (logs, resource list), which don't pass `trailing`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 15ca66f commit 172c183

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ interface ResourceOptionsBarProps {
7373
filterActive?: boolean
7474
filterTags?: FilterTag[]
7575
extras?: ReactNode
76+
/** Right-aligned slot. Unlike `extras` (which sits with the left controls),
77+
* `trailing` is pushed to the far right via `justify-between` — used for the
78+
* table's run/stop control opposite the left-aligned filter/sort. */
79+
trailing?: ReactNode
7680
}
7781

7882
export const ResourceOptionsBar = memo(function ResourceOptionsBar({
@@ -83,9 +87,16 @@ export const ResourceOptionsBar = memo(function ResourceOptionsBar({
8387
filterActive,
8488
filterTags,
8589
extras,
90+
trailing,
8691
}: ResourceOptionsBarProps) {
8792
const hasContent =
88-
search || sort || filter || onFilterToggle || extras || (filterTags && filterTags.length > 0)
93+
search ||
94+
sort ||
95+
filter ||
96+
onFilterToggle ||
97+
extras ||
98+
trailing ||
99+
(filterTags && filterTags.length > 0)
89100
if (!hasContent) return null
90101

91102
return (
@@ -143,6 +154,7 @@ export const ResourceOptionsBar = memo(function ResourceOptionsBar({
143154
) : null}
144155
{sort && <SortDropdown config={sort} />}
145156
</div>
157+
{trailing && <div className='flex shrink-0 items-center gap-1.5'>{trailing}</div>}
146158
</div>
147159
</div>
148160
)

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,14 @@ export function Table({
478478
}
479479
/>
480480
)}
481-
{/* Sort + filter render in both modes. In embedded (mothership) mode there's
482-
no ResourceHeader, so the run/stop control rides in the options bar's
483-
`extras` slot — keeping the bar populated whether or not a run is live. */}
481+
{/* Sort + filter render in both modes (left-aligned). In embedded (mothership)
482+
mode there's no ResourceHeader, so the run/stop control rides in the options
483+
bar's right-aligned `trailing` slot — opposite the left-aligned filter/sort. */}
484484
<ResourceOptionsBar
485485
sort={sortConfig}
486486
onFilterToggle={() => setFilterOpen((prev) => !prev)}
487487
filterActive={filterOpen || !!queryOptions.filter}
488-
extras={
488+
trailing={
489489
embedded && selection.totalRunning > 0 ? (
490490
<RunStatusControl
491491
running={selection.totalRunning}

0 commit comments

Comments
 (0)