@@ -6,6 +6,7 @@ import styles from "./assistant.module.scss";
66export default function openAIAssistantPage ( ) {
77 // References
88 const profileBtnRef = new Ref ( ) ;
9+ const historySidebarRef = new Ref ( ) ;
910
1011 // States
1112 let currentProfile = "ask" ; // Default to ask profile
@@ -42,6 +43,10 @@ export default function openAIAssistantPage() {
4243 handleProfileSwitch ( profile ) ;
4344 } ;
4445
46+ const toggleHistorySidebar = ( ) => {
47+ historySidebarRef . classList . toggle ( "hidden" ) ;
48+ } ;
49+
4550 const aiAssistantContainer = (
4651 < div className = "chat-container" >
4752 { /* Header */ }
@@ -52,7 +57,11 @@ export default function openAIAssistantPage() {
5257 < span className = "btn-text" > New Chat</ span >
5358 </ button >
5459 < div className = "separator" > </ div >
55- < button className = "btn btn-sm btn-outline" id = "toggle-history-btn" >
60+ < button
61+ onclick = { toggleHistorySidebar }
62+ className = "btn btn-sm btn-outline"
63+ id = "toggle-history-btn"
64+ >
5665 < i className = "icon historyrestore" > </ i >
5766 < span className = "btn-text" > History</ span >
5867 </ button >
@@ -80,7 +89,11 @@ export default function openAIAssistantPage() {
8089 { /* Main content */ }
8190 < div className = "chat-main" >
8291 { /* Chat history sidebar */ }
83- < div className = "chat-sidebar hidden" id = "chat-sidebar" >
92+ < div
93+ className = "chat-sidebar hidden"
94+ id = "chat-sidebar"
95+ ref = { historySidebarRef }
96+ >
8497 < div className = "sidebar-header" >
8598 < h3 className = "sidebar-title" > CHAT HISTORY</ h3 >
8699 < button className = "btn btn-icon" >
0 commit comments