fix(composer): 🐛 Persist attachments in thread drafts & remove plan mode toggle#184
Conversation
AI Code Review SummaryPR: #184 (fix(composer): 🐛 Persist attachments in thread drafts & remove plan mode toggle) Overall AssessmentDetected 1 actionable findings, prioritize CRITICAL/HIGH before merge. Major Findings by Severity
Actionable Suggestions
Potential Risks
Test Suggestions
File-Level Coverage Notes
Inline Downgraded Items (processed but not inline)
Coverage Status
Uncovered list:
No-patch covered list:
Runtime/Budget
|
| return { | ||
| text: draft.text, | ||
| referencedFiles: draft.referencedFiles ?? [], | ||
| attachmentData: draft.attachmentData ?? [], |
There was a problem hiding this comment.
[MEDIUM] Missing test coverage for draft backward-compatibility normalization
getDraft now normalizes missing attachmentData and referencedFiles via ?? [], but no test verifies this path for partially persisted legacy drafts.
Suggestion: Add Vitest tests for getDraft covering: (1) legacy string drafts, (2) object drafts missing attachmentData, (3) object drafts missing referencedFiles, and (4) fully populated drafts.
Risk: Legacy partial payloads could cause silent UI failures if normalization regresses.
Confidence: 0.85
Summary
attachmentDatain composer draftsChanges
attachmentDatafield toComposerDraftData;getDraft()normalizes missing/legacy data with backward compatibilityinitialAttachmentDataandonAttachmentDataChangeto the composer so attachments survive thread switchesRunModeTogglecomponent and related props (runMode,showRunModeToggle,onRunModeChange,runModeDisabled); hard-code run mode to"default"inbuildSubmissionFromPromptInputattachmentDatapersistence, independent update, backward compat for legacy drafts missingattachmentDataTest Plan
attachmentData) render without errorsnpm run typecheckandnpm run test:unitto verify no regressions🤖 Generated with TiyCode