Skip to content

Commit 172c323

Browse files
committed
Fix multiple UI bugs
- Remove unused action chip button from InlineContentPreview - Disable new chat button during content generation (ChatHistory sidebar) - Enforce single product selection (max 1, min 1 to proceed) - Add helper text when no product selected
1 parent 89bfde0 commit 172c323

4 files changed

Lines changed: 18 additions & 30 deletions

File tree

content-gen/src/app/frontend/src/App.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,11 @@ function App() {
457457
setSelectedProducts(prev => {
458458
const isSelected = prev.some(p => (p.sku || p.product_name) === (product.sku || product.product_name));
459459
if (isSelected) {
460-
return prev.filter(p => (p.sku || p.product_name) !== (product.sku || product.product_name));
460+
// Deselect - but user must have at least one selected to proceed
461+
return [];
461462
} else {
462-
return [...prev, product];
463+
// Single selection mode - replace any existing selection
464+
return [product];
463465
}
464466
});
465467
}, []);
@@ -670,6 +672,7 @@ function App() {
670672
onSelectConversation={handleSelectConversation}
671673
onNewConversation={handleNewConversation}
672674
refreshTrigger={historyRefreshTrigger}
675+
isGenerating={isLoading}
673676
/>
674677
</div>
675678
)}

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@ interface ChatHistoryProps {
2626
onSelectConversation: (conversationId: string) => void;
2727
onNewConversation: () => void;
2828
refreshTrigger?: number; // Increment to trigger refresh
29+
isGenerating?: boolean; // True when content generation is in progress
2930
}
3031

3132
export function ChatHistory({
3233
currentConversationId,
3334
currentMessages = [],
3435
onSelectConversation,
3536
onNewConversation,
36-
refreshTrigger = 0
37+
refreshTrigger = 0,
38+
isGenerating = false
3739
}: ChatHistoryProps) {
3840
const [conversations, setConversations] = useState<ConversationSummary[]>([]);
3941
const [isLoading, setIsLoading] = useState(true);
@@ -218,13 +220,15 @@ export function ChatHistory({
218220
</Link>
219221
)}
220222
<Link
221-
onClick={onNewConversation}
223+
onClick={isGenerating ? undefined : onNewConversation}
222224
style={{
223225
display: 'flex',
224226
alignItems: 'center',
225227
gap: '8px',
226228
fontSize: '13px',
227-
color: tokens.colorNeutralForeground1,
229+
color: isGenerating ? tokens.colorNeutralForegroundDisabled : tokens.colorNeutralForeground1,
230+
cursor: isGenerating ? 'not-allowed' : 'pointer',
231+
pointerEvents: isGenerating ? 'none' : 'auto',
228232
}}
229233
>
230234
<Compose20Regular />

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -383,30 +383,6 @@ export function InlineContentPreview({
383383
</div>
384384
)}
385385

386-
{/* Action Chip - for quick follow-up requests */}
387-
{image_content?.image_url && (
388-
<div
389-
className="action-chip"
390-
onClick={() => onActionChipClick?.('Create an other image with same paint color, but a modern kitchen area, with no text on it')}
391-
style={{
392-
display: 'inline-flex',
393-
alignItems: 'center',
394-
gap: '6px',
395-
padding: '10px 16px',
396-
borderRadius: '20px',
397-
backgroundColor: tokens.colorBrandBackground2,
398-
color: tokens.colorBrandForeground1,
399-
fontSize: '13px',
400-
cursor: 'pointer',
401-
border: `1px solid ${tokens.colorBrandStroke1}`,
402-
transition: 'all 0.15s ease-in-out',
403-
marginBottom: '16px',
404-
}}
405-
>
406-
Create an other image with same paint color, but a modern kitchen area, with no text on it
407-
</div>
408-
)}
409-
410386
<Divider style={{ margin: '16px 0' }} />
411387

412388
{/* User guidance callout for compliance status */}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,16 @@ export function ProductReview({
9797
appearance="primary"
9898
icon={<Sparkle20Regular />}
9999
onClick={onConfirm}
100-
disabled={isAwaitingResponse}
100+
disabled={isAwaitingResponse || products.length === 0}
101101
size="small"
102102
>
103103
Generate Content
104104
</Button>
105+
{products.length === 0 && (
106+
<Text size={200} style={{ color: tokens.colorNeutralForeground3, alignSelf: 'center' }}>
107+
Select a product to continue
108+
</Text>
109+
)}
105110
</div>
106111
)}
107112

0 commit comments

Comments
 (0)