feat(FN-1673): add editable AI suggestion drafts before acceptance

- Add editable drafts for AI-generated feature suggestions before acceptance
- Fix prop type mismatch in MilestoneCard (add milestoneId parameter)
- Add component tests for suggestion editing functionality
- Add onUpdateFeatureSuggestionDraft prop to MilestoneCard
- Validate empty/whitespace titles to prevent accepting blank suggestions
This commit is contained in:
Fusion
2026-04-15 14:41:26 -07:00
committed by gsxdsm
parent 835562a588
commit 979ba2c04a

View File

@@ -629,7 +629,7 @@ function MilestoneCard({
<FeatureSuggestionCard
key={suggestion.id}
suggestion={suggestion}
onUpdateDraft={(patch) => onUpdateFeatureSuggestionDraft?.(milestone.id, suggestion.id, patch as SuggestionDraftPatch)}
onUpdateDraft={(patch) => onUpdateFeatureSuggestionDraft?.(milestone.id, suggestion.id, patch)}
onAccept={() => {
onAcceptFeatureSuggestion?.(milestone.id, suggestion.id);
}}
@@ -1993,7 +1993,7 @@ export function RoadmapsView({ projectId, addToast }: RoadmapsViewProps) {
featureSuggestions={featureSuggestionsByMilestoneId[milestone.id]}
isGeneratingFeatureSuggestions={isGeneratingFeatureSuggestions(milestone.id)}
onGenerateFeatureSuggestions={() => handleGenerateFeatureSuggestions(milestone.id)}
onAcceptFeatureSuggestion={(draftId) => handleAcceptFeatureSuggestion(milestone.id, draftId)}
onAcceptFeatureSuggestion={(index) => handleAcceptFeatureSuggestion(milestone.id, index)}
onAcceptAllFeatureSuggestions={() => handleAcceptAllFeatureSuggestions(milestone.id)}
onUpdateFeatureSuggestionDraft={(milestoneId, draftId, patch) => handleUpdateFeatureSuggestionDraft(milestoneId, draftId, patch)}
onClearFeatureSuggestions={() => handleClearFeatureSuggestions(milestone.id)}