feat(mothership): restore attachment previews on draft and add video support#4435
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds video preview support: video files now get preview URLs and render as a Reviewed by Cursor Bugbot for commit edcf1d2. Configure here. |
Greptile SummaryThis PR fixes missing attachment previews on Mothership draft restore and adds video preview support (input chip + sent message) by extracting a shared Confidence Score: 5/5Safe to merge — the fix is well-scoped and the only finding is a P2 accessibility nit on the video element in chat-message-attachments. All findings are P2 (missing aria-label on the apps/sim/app/workspace/[workspaceId]/home/components/chat-message-attachments.tsx — video element missing accessible name. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[File attached / Draft restored] --> B{Has key?}
B -- Yes --> C[getMothershipAttachmentPreviewUrl]
B -- No uploading --> D[URL.createObjectURL blob URL]
C --> E{media_type?}
D --> E
E -- image/ --> F[previewUrl set]
E -- video/ --> F
E -- other --> G[previewUrl = undefined]
F --> H{Render location}
G --> I[FileAttachmentPill / icon chip]
H -- attached-files-list input chip --> J{isVideo?}
H -- chat-message-attachments sent msg --> K{isVideo?}
J -- Yes --> L[icon fallback + video element]
J -- No --> M[img element]
K -- Yes --> N[icon fallback + video element]
K -- No --> O[img element]
Reviews (2): Last reviewed commit: "fix(mothership): icon fallback behind vi..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit edcf1d2. Configure here.
Summary
getMothershipAttachmentPreviewUrlhelper<video preload="metadata">display-message,use-chat, draft restore, andloadQueuedMessageType of Change
Testing
Tested manually — attached PNG, switched tasks, returned: preview restored. Attached MP4: first frame shown in input and after send.
Checklist