Skip to content

Commit e4f40e1

Browse files
committed
Fix: Show missing key areas in brief review message
When the agent says 'I've captured X of 9 key areas', now lists which areas are missing (e.g., 'You are missing: Target Audience, Key Message, Tone and Style, etc.') Added fieldLabels mapping and missingFields calculation to display user-friendly names of the fields that still need to be provided.
1 parent ddb103b commit e4f40e1

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

content-gen/src/app/frontend/src/components/BriefReview.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ const briefFields: { key: keyof CreativeBrief; label: string; prefix?: string }[
2121
{ key: 'cta', label: 'Call to Action', prefix: '• ' },
2222
];
2323

24+
// Mapping of field keys to user-friendly labels for the 9 key areas
25+
const fieldLabels: Record<keyof CreativeBrief, string> = {
26+
overview: 'Overview',
27+
objectives: 'Objectives',
28+
target_audience: 'Target Audience',
29+
key_message: 'Key Message',
30+
tone_and_style: 'Tone and Style',
31+
deliverable: 'Deliverable',
32+
timelines: 'Timelines',
33+
visual_guidelines: 'Visual Guidelines',
34+
cta: 'Call to Action',
35+
};
36+
2437
export function BriefReview({
2538
brief,
2639
onConfirm,
@@ -32,6 +45,7 @@ export function BriefReview({
3245
'tone_and_style', 'deliverable', 'timelines', 'visual_guidelines', 'cta'
3346
];
3447
const populatedFields = allFields.filter(key => brief[key]?.trim()).length;
48+
const missingFields = allFields.filter(key => !brief[key]?.trim());
3549

3650
return (
3751
<div className="message assistant" style={{
@@ -274,6 +288,8 @@ export function BriefReview({
274288
{populatedFields < 5 ? (
275289
<>
276290
I've captured <strong>{populatedFields}</strong> of 9 key areas. Would you like to add more details?
291+
You are missing: <strong>{missingFields.map(f => fieldLabels[f]).join(', ')}</strong>.
292+
<br /><br />
277293
You can tell me things like:
278294
<ul style={{ margin: '8px 0 0 0', paddingLeft: '20px' }}>
279295
<li>"The target audience should be homeowners aged 35-55"</li>

0 commit comments

Comments
 (0)