improvement(ui): Merge ui components for mothership chat#3748
improvement(ui): Merge ui components for mothership chat#3748TheodoreSpeaks merged 5 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@cursor review @greptile review |
PR SummaryMedium Risk Overview Standardizes Written by Cursor Bugbot for commit 0fcd52b. This will update automatically on new commits. Configure here. |
Greptile SummaryThis PR consolidates the nearly-identical mothership (home page) and copilot (panel) chat UIs into a single Key changes and observations:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[home.tsx] -->|uses| B[MothershipChat\nlayout='mothership-view']
C[panel.tsx] -->|uses| D[MothershipChat\nlayout='copilot-view']
B --> E[LAYOUT_STYLES\nmothership-view\npx-6 pt-4 pb-8\nmax-w-42rem]
D --> F[LAYOUT_STYLES\ncopilot-view\npx-3 pt-2 pb-4\nno max-width]
G[useChat hook] --> H{getMothershipUseChatOptions}
G --> I{getWorkflowCopilotUseChatOptions}
H -->|apiPath: MOTHERSHIP_CHAT_API_PATH| A
I -->|apiPath: COPILOT_CHAT_API_PATH| C
B --> J[useAutoScroll\ninitialScrollBlocked prop]
D --> K[useAutoScroll\ninitialScrollBlocked=false default]
L[AgentGroup] -->|stable key\nsegment.id| M[wasAutoExpandedRef effect\nmanages expand/collapse\nvia defaultExpanded prop]
M -->|previously| N[key-based remount\nforced expand reset]
Reviews (2): Last reviewed commit: "Fix subagent text not animating collapse..." | Re-trigger Greptile |
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx
Outdated
Show resolved
Hide resolved
| const didAutoCollapseRef = useRef(allDone) | ||
| const wasAutoExpandedRef = useRef(defaultExpanded) | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
Pretty sure this is actually needed - agent-group is unmounted after auto collapsed and needs a timer after the fact to animate itself closed.

Summary
Now that mothership and copilot have almost identical logic, combined them into a single ui component:
MothershipChat.Shared logic for hooks is stored in the
use-chathelper. This will reduce the effort needed when making any ui change, since both locations will need the improvement.Type of Change
Testing
Validated attachments, aborts, queueing, copilot diffs, edits, and terminal logs for workflows all work as intended after change on copilot and mothership sides.
Checklist
Screenshots/Videos