Skip to content

Commit bb3c856

Browse files
committed
feat: Add chat history toggle button and SamplePrompt icon
- Added toggle button in header to show/hide chat history panel - Replaced Fluent UI icons with SamplePrompt.png for suggestion cards - Added vite-env.d.ts for image import type declarations
1 parent 5b98cb5 commit bb3c856

4 files changed

Lines changed: 71 additions & 32 deletions

File tree

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

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ import { useState, useCallback, useEffect, useRef } from 'react';
22
import {
33
Text,
44
Avatar,
5+
Button,
6+
Tooltip,
57
tokens,
68
} from '@fluentui/react-components';
9+
import {
10+
History24Regular,
11+
History24Filled,
12+
} from '@fluentui/react-icons';
713
import { v4 as uuidv4 } from 'uuid';
814

915
import { ChatPanel } from './components/ChatPanel';
@@ -51,6 +57,9 @@ function App() {
5157
// Trigger for refreshing chat history
5258
const [historyRefreshTrigger, setHistoryRefreshTrigger] = useState(0);
5359

60+
// Toggle for showing/hiding chat history panel
61+
const [showChatHistory, setShowChatHistory] = useState(true);
62+
5463
// Abort controller for cancelling ongoing requests
5564
const abortControllerRef = useRef<AbortController | null>(null);
5665

@@ -594,12 +603,22 @@ function App() {
594603
Contoso
595604
</Text>
596605
</div>
597-
<Avatar
598-
name={userId || 'User'}
599-
initials={getUserInitials()}
600-
color="colorful"
601-
size={36}
602-
/>
606+
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
607+
<Tooltip content={showChatHistory ? 'Hide chat history' : 'Show chat history'} relationship="label">
608+
<Button
609+
appearance="subtle"
610+
icon={showChatHistory ? <History24Filled /> : <History24Regular />}
611+
onClick={() => setShowChatHistory(!showChatHistory)}
612+
aria-label={showChatHistory ? 'Hide chat history' : 'Show chat history'}
613+
/>
614+
</Tooltip>
615+
<Avatar
616+
name={userId || 'User'}
617+
initials={getUserInitials()}
618+
color="colorful"
619+
size={36}
620+
/>
621+
</div>
603622
</header>
604623

605624
{/* Main Content */}
@@ -626,15 +645,17 @@ function App() {
626645
</div>
627646

628647
{/* Chat History Sidebar - RIGHT side */}
629-
<div className="history-panel">
630-
<ChatHistory
648+
{showChatHistory && (
649+
<div className="history-panel">
650+
<ChatHistory
631651
currentConversationId={conversationId}
632652
currentMessages={messages}
633653
onSelectConversation={handleSelectConversation}
634654
onNewConversation={handleNewConversation}
635-
refreshTrigger={historyRefreshTrigger}
636-
/>
637-
</div>
655+
refreshTrigger={historyRefreshTrigger}
656+
/>
657+
</div>
658+
)}
638659
</div>
639660
</div>
640661
);

content-gen/src/frontend/src/components/WelcomeCard.tsx

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import {
33
Text,
44
tokens,
55
} from '@fluentui/react-components';
6-
import {
7-
Image24Regular,
8-
TextBulletList24Regular,
9-
Sparkle24Regular,
10-
} from '@fluentui/react-icons';
6+
import SamplePromptIcon from '../styles/images/SamplePrompt.png';
117

128
// Copilot-style hexagon icon
139
function CopilotIcon() {
@@ -35,30 +31,26 @@ function CopilotIcon() {
3531
}
3632

3733
interface SuggestionCard {
38-
icon: React.ReactNode;
3934
title: string;
4035
description: string;
4136
prompt: string;
4237
}
4338

4439
const suggestions: SuggestionCard[] = [
4540
{
46-
icon: <TextBulletList24Regular />,
47-
title: 'Create a marketing campaign',
41+
title: 'Generate ad copy and image ideas for a Facebook campaign promoting Paint for Home Décor.',
4842
description: 'Generate compelling copy for your next campaign',
49-
prompt: 'I need to create a marketing campaign for a new product launch targeting young professionals.',
43+
prompt: 'Generate ad copy and image ideas for a Facebook campaign promoting Paint for Home Décor.',
5044
},
5145
{
52-
icon: <Image24Regular />,
53-
title: 'Generate visual content',
54-
description: 'Create images for social media or ads',
55-
prompt: 'Generate a hero image for our summer sale campaign featuring outdoor products.',
46+
title: 'Summarize my creative brief and suggest mood, audience, and image style for the campaign.',
47+
description: 'Summarize your creative brief for better insights',
48+
prompt: 'Summarize my creative brief and suggest mood, audience, and image style for the campaign.',
5649
},
5750
{
58-
icon: <Sparkle24Regular />,
59-
title: 'Draft a creative brief',
60-
description: 'Build a comprehensive creative brief',
61-
prompt: 'Help me create a creative brief for a holiday marketing campaign with the objective of increasing brand awareness.',
51+
title: 'Create a multi-modal content plan with visuals and captions based on brand guidelines.',
52+
description: 'Create a content plan with visuals and captions',
53+
prompt: 'Create a multi-modal content plan with visuals and captions based on brand guidelines.',
6254
},
6355
];
6456

@@ -155,19 +147,24 @@ export function WelcomeCard({ onSuggestionClick }: WelcomeCardProps) {
155147
gap: 'clamp(8px, 1.5vw, 12px)',
156148
}}>
157149
<div style={{
158-
color: tokens.colorBrandForeground1,
159150
display: 'flex',
160151
alignItems: 'center',
161152
justifyContent: 'center',
162153
width: 'clamp(32px, 5vw, 40px)',
163154
height: 'clamp(32px, 5vw, 40px)',
164155
minWidth: '32px',
165156
minHeight: '32px',
166-
backgroundColor: tokens.colorBrandBackground2,
167-
borderRadius: '8px',
168157
flexShrink: 0,
169158
}}>
170-
{suggestion.icon}
159+
<img
160+
src={SamplePromptIcon}
161+
alt="Sample prompt"
162+
style={{
163+
width: '100%',
164+
height: '100%',
165+
objectFit: 'contain'
166+
}}
167+
/>
171168
</div>
172169
<div style={{ minWidth: 0, flex: 1 }}>
173170
<Text
4.82 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/// <reference types="vite/client" />
2+
3+
declare module '*.png' {
4+
const value: string;
5+
export default value;
6+
}
7+
8+
declare module '*.jpg' {
9+
const value: string;
10+
export default value;
11+
}
12+
13+
declare module '*.jpeg' {
14+
const value: string;
15+
export default value;
16+
}
17+
18+
declare module '*.svg' {
19+
const value: string;
20+
export default value;
21+
}

0 commit comments

Comments
 (0)