Skip to content

fix(tables): right-align run/stop in embedded toolbar; workflow cells format like normal cells#4806

Merged
TheodoreSpeaks merged 3 commits into
stagingfrom
fix/mothership-table-toolbar-align
May 30, 2026
Merged

fix(tables): right-align run/stop in embedded toolbar; workflow cells format like normal cells#4806
TheodoreSpeaks merged 3 commits into
stagingfrom
fix/mothership-table-toolbar-align

Conversation

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator

Two small follow-ups to the embedded (mothership) table view, on top of the now-merged #4789.

1. Toolbar alignment

In the embedded table resource view, Filter + Sort are left-aligned and the run/stop control is right-aligned (opposite ends of the same bar). Implemented by adding a right-aligned trailing slot to ResourceOptionsBar (pushed right via the existing justify-between) and moving the run/stop control there from the left extras cluster. No-op for the other consumers (logs, resource list) — they pass a search section and no trailing.

2. Workflow-output cells format like normal cells

Workflow-output columns short-circuited in resolveCellRender and rendered their value as plain text, so a value produced by a workflow never got the resource chip / favicon URL link / JSON / date / boolean formatting a normal cell gets (this is why a …/workspace/{id}/w/{id} URL in a workflow column didn't render as a chip).

Value formatting is now factored into a shared resolveValueKind(value, column, workspaceId, { typewriter }) helper used by both the workflow-value branch and the plain-cell branch:

  • Workflow outputs now render sim-resource chips, external URL favicon links, and typed (JSON/date/boolean) values exactly like a normal cell.
  • The typewriter reveal is preserved for plain streaming text via the typewriter flag (value kind for workflow outputs, text for plain cells).
  • Sim-resource chips still require the URL's workspace to match the current workspace (we resolve the resource's name/color from current-workspace data).

Test

  • Embedded table with a run in progress: Filter/Sort left, "N running · Stop all" right.
  • Put a https://www.sim.ai/workspace/{currentWsId}/w/{workflowId} URL as a workflow output value → renders the workflow's colored-square chip. External URL → favicon link.

🤖 Generated with Claude Code

TheodoreSpeaks and others added 2 commits May 29, 2026 19:11
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>
Workflow-output columns short-circuited in resolveCellRender and rendered their
value as plain text, so a sim-resource URL / external URL / JSON / date produced
by a workflow never got the chip, favicon link, or typed formatting a normal
cell gets. Factor value formatting into a shared `resolveValueKind` helper used
by both the workflow-value branch and the plain-cell branch; the workflow branch
keeps the typewriter reveal for plain streaming text via a `typewriter` flag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 30, 2026 5:13pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 30, 2026

PR Summary

Low Risk
UI layout and display-only cell rendering changes with no auth, API, or data-layer impact.

Overview
Adds a right-aligned trailing slot to ResourceOptionsBar (via existing justify-between) so embedded table views can put Filter/Sort on the left and RunStatusControl on the right; the embedded table moves run/stop from extras into trailing. Other consumers are unchanged unless they pass trailing.

In resolveCellRender, workflow-output cells with a non-empty value now run the same whole-string link detection as string columns through shared resolveLinkKind / resolveSimResourceKind, so in-workspace resource URLs and external URLs render as chips/favicon links instead of plain typewriter text; non-URL values still use the value kind for streaming reveal.

Reviewed by Cursor Bugbot for commit d0ea8cf. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 30, 2026

Greptile Summary

This PR delivers two polishing fixes on top of the embedded table view: the run/stop control is repositioned to the far-right of the options bar via a new trailing slot, and workflow-output cells now run through the same resolveValueKind formatter as plain cells so they render resource chips, favicon URL links, and typed (boolean/JSON/date) values instead of always falling back to raw typewriter text.

  • ResourceOptionsBar gains an optional trailing: ReactNode prop placed at the far right via the existing justify-between container; no-op for all existing consumers.
  • cell-render.tsx extracts a resolveValueKind helper shared by both the workflow-output branch (typewriter: true) and the plain-cell branch (typewriter: false), preserving the streaming animation only for the plain-string fallback path.
  • table.tsx is a one-line prop rename (extrastrailing) at the call site.

Confidence Score: 4/5

Safe to merge — both changes are self-contained with no mutations to shared state or API contracts.

The workflow-output formatter correctly unifies plain-cell and workflow-output formatting while preserving typewriter animation for plain strings. The two observations do not affect any current code paths.

cell-render.tsx is worth a second look if workflow columns with non-string types are expected to auto-detect URLs in their output values.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-options-bar/resource-options-bar.tsx Adds a right-aligned trailing ReactNode slot; wires it into hasContent guard and renders it at the far right of the justify-between bar. Backward-compatible — existing consumers see no change.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/cell-render.tsx Extracts a shared resolveValueKind helper so workflow-output cells get the same chip/URL/JSON/date/boolean rendering as plain cells. typewriter flag selects value (animated) vs text (static) only for the plain-string fallback path.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx Moves the embedded run/stop RunStatusControl from the extras (left) slot to the new trailing (right) slot in ResourceOptionsBar. Only a prop rename at the call site — no logic change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[resolveCellRender] --> B{column.workflowGroupId?}
    B -- Yes --> C{isEmpty?}
    C -- No: value present --> D[resolveValueKind\ntypewriter: true]
    C -- Yes: empty/null --> E{inFlight / waiting / etc.}
    E --> F[running / pending / queued / cancelled / error / empty]
    B -- No: plain cell --> G[resolveValueKind\ntypewriter: false]
    D --> H{column.type?}
    G --> H
    H -- boolean --> I[kind: boolean]
    H -- null/undefined --> J[kind: empty]
    H -- json --> K[kind: json]
    H -- date --> L[kind: date]
    H -- string --> M{sim-resource URL?}
    M -- Yes --> N[kind: sim-resource chip]
    M -- No --> O{external URL?}
    O -- Yes --> P[kind: url favicon link]
    O -- No --> Q{typewriter flag?}
    H -- other --> Q
    Q -- true --> R[kind: value animated]
    Q -- false --> S[kind: text static]
Loading

Comments Outside Diff (1)

  1. apps/sim/app/workspace/[workspaceId]/components/resource/components/resource-options-bar/resource-options-bar.tsx, line 103-158 (link)

    P2 search + trailing together would produce a crowded layout

    SearchSection's root element is flex-1, which causes it to consume all available space in the justify-between container. If a future caller passes both search and trailing, the left-controls div would be pinned immediately after the search bar with no breathing room before trailing. No current consumer does this, but the interface documentation doesn't mention the constraint. A brief note in the trailing JSDoc or an invariant/dev warning when both are present would prevent a silent layout regression for the next person who extends this bar.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "fix(tables): workflow-output cells forma..." | Re-trigger Greptile

…of column type

Workflow output columns default to `json` (columnTypeForLeaf), so routing their
values through the type-based formatter (a) gated chip/URL promotion behind
`column.type === 'string'` — a URL produced by a json-typed output never became
a chip — and (b) JSON.stringify'd plain string values, adding quotes and losing
the typewriter reveal. Detect links (sim-resource chip / favicon URL) on the
value string directly for workflow outputs, falling back to the plain `value`
kind; plain cells keep the type-based formatting. Addresses Greptile P2 on #4806.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TheodoreSpeaks TheodoreSpeaks merged commit b4787dd into staging May 30, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/mothership-table-toolbar-align branch May 30, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant