Skip to content

Commit d939aea

Browse files
committed
fix(chat): align MothershipChat's onContextRemove with the surface contract
The remaining-contexts argument was added to ChatSurfaceContextValue but not to MothershipChat's own prop type, which forwards straight into it. Nothing passes the handler there today so it typechecked (fewer params is assignable), but the two declarations of the same wiring disagreed. Does not change behavior: home still wires the remove handler only to the empty-state surface, as it did before this PR.
1 parent eff18e6 commit d939aea

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ interface MothershipChatProps {
6464
userId?: string
6565
chatId?: string
6666
onContextAdd?: (context: ChatContext) => void
67-
onContextRemove?: (context: ChatContext) => void
67+
/**
68+
* Receives the input's context list AFTER the removal, so the owner can tell
69+
* whether another chip still references the removed chip's resource. Matches
70+
* `ChatSurfaceContextValue`, which this forwards to.
71+
*/
72+
onContextRemove?: (context: ChatContext, remaining: ChatContext[]) => void
6873
onWorkspaceResourceSelect?: (resource: MothershipResource) => void
6974
draftScopeKey?: string
7075
layout?: 'mothership-view' | 'copilot-view'

0 commit comments

Comments
 (0)