feat: mothership/copilot feedback#3940
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Tweaks related UI behavior: message actions are repositioned below completed assistant messages and Reviewed by Cursor Bugbot for commit e9b82ee. Configure here. |
Greptile SummaryThis PR adds a thumbs-up/down feedback mechanism to copilot/mothership message actions, cleans up unused Zustand environment store scaffolding, and removes jarring loading spinners in favour of smoother page transitions.
Confidence Score: 4/5Mostly safe to merge; one P1 logic bug causes feedback to be silently discarded when users click Submit with an empty text field. The P1 issue in apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx — the Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant MA as MessageActions
participant Modal as FeedbackModal
participant Hook as useSubmitCopilotFeedback
participant API as /api/copilot/feedback
U->>MA: Clicks ThumbsUp / ThumbsDown
MA->>Modal: setPendingFeedback('up'|'down') → open modal
U->>Modal: Types optional feedback text
alt text is non-empty
U->>Modal: Clicks Submit
Modal->>Hook: submitFeedback.mutate(payload)
Hook->>API: POST /api/copilot/feedback
API-->>Hook: { success, feedbackId }
Modal->>MA: setPendingFeedback(null) → close modal
else text is empty (current bug)
U->>Modal: Clicks Submit
Modal->>MA: setPendingFeedback(null) → close modal silently
Note over Hook,API: No request sent
end
U->>MA: Clicks Copy
MA->>MA: toPlainText(content)
MA->>U: navigator.clipboard.writeText(plainText)
Reviews (1): Last reviewed commit: "feat: mothership/copilot feedback" | Re-trigger Greptile |
apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx
Outdated
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Feedback silently discarded when text is empty
- Removed the early return that prevented submitFeedback.mutate() from being called when feedbackText was empty, allowing the thumbs up/down vote to be recorded even without optional text feedback.
- ✅ Fixed: Form labels replaced with non-semantic paragraph elements
- Replaced
elements with proper components from EMCN with htmlFor attributes pointing to the form input IDs, restoring accessibility features.
- Replaced
Or push these changes by commenting:
@cursor push c9d526113f
Preview (c9d526113f)
diff --git a/apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx b/apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx
--- a/apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx
@@ -92,17 +92,12 @@
const handleSubmitFeedback = useCallback(() => {
if (!pendingFeedback || !chatId || !userQuery) return
const text = feedbackText.trim()
- if (!text) {
- setPendingFeedback(null)
- setFeedbackText('')
- return
- }
submitFeedback.mutate({
chatId,
userQuery,
agentResponse: content,
isPositiveFeedback: pendingFeedback === 'up',
- feedback: text,
+ feedback: text || undefined,
})
setPendingFeedback(null)
setFeedbackText('')
diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/help-modal/help-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/help-modal/help-modal.tsx
--- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/help-modal/help-modal.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/help-modal/help-modal.tsx
@@ -12,6 +12,7 @@
Button,
Combobox,
Input,
+ Label,
Modal,
ModalBody,
ModalContent,
@@ -431,7 +432,7 @@
<div ref={scrollContainerRef} className='min-h-0 flex-1 overflow-y-auto'>
<div className='space-y-3'>
<div className='flex flex-col gap-2'>
- <p className='font-medium text-[var(--text-secondary)] text-sm'>Request</p>
+ <Label htmlFor='type' className='text-[var(--text-secondary)] text-sm'>Request</Label>
<Combobox
id='type'
options={REQUEST_TYPE_OPTIONS}
@@ -446,7 +447,7 @@
</div>
<div className='flex flex-col gap-2'>
- <p className='font-medium text-[var(--text-secondary)] text-sm'>Subject</p>
+ <Label htmlFor='subject' className='text-[var(--text-secondary)] text-sm'>Subject</Label>
<Input
id='subject'
placeholder='Brief description of your request'
@@ -456,7 +457,7 @@
</div>
<div className='flex flex-col gap-2'>
- <p className='font-medium text-[var(--text-secondary)] text-sm'>Message</p>
+ <Label htmlFor='message' className='text-[var(--text-secondary)] text-sm'>Message</Label>
<Textarea
id='message'
placeholder='Please provide details about your request...'This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e9b82ee. Configure here.
apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/help-modal/help-modal.tsx
Show resolved
Hide resolved
* feat: mothership/copilot feedback * fix(feedback): remove mutation object from useCallback deps


Summary
useCopilotFeedbackmutation hook, and updated message action UIType of Change
Testing
Tested manually
Checklist