This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
javascripts/discourse/services
stylesheets/modules/ai-bot-conversations Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,13 @@ export default class AiConversationsSidebarManager extends Service {
216216 const now = Date . now ( ) ;
217217 const fresh = [ ] ;
218218
219+ const todaySection = {
220+ name : "today" ,
221+ title : i18n ( "discourse_ai.ai_bot.conversations.today" ) ,
222+ links : new TrackedArray ( ) ,
223+ } ;
224+ fresh . push ( todaySection ) ;
225+
219226 this . topics . forEach ( ( t ) => {
220227 const postedAtMs = new Date ( t . last_posted_at || now ) . valueOf ( ) ;
221228 const diffDays = Math . floor ( ( now - postedAtMs ) / 86400000 ) ;
@@ -233,13 +240,16 @@ export default class AiConversationsSidebarManager extends Service {
233240 dateGroup = key ;
234241 }
235242
236- let sec = fresh . find ( ( s ) => s . name === dateGroup ) ;
243+ let sec ;
244+ if ( dateGroup === "today" ) {
245+ sec = todaySection ;
246+ } else {
247+ sec = fresh . find ( ( s ) => s . name === dateGroup ) ;
248+ }
249+
237250 if ( ! sec ) {
238251 let title ;
239252 switch ( dateGroup ) {
240- case "today" :
241- title = i18n ( "discourse_ai.ai_bot.conversations.today" ) ;
242- break ;
243253 case "last-7-days" :
244254 title = i18n ( "discourse_ai.ai_bot.conversations.last_7_days" ) ;
245255 break ;
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ body.has-ai-conversations-sidebar {
2323 }
2424 }
2525
26+ // we always have the "today" section rendered at the top of the sidebar but hide it when empty
27+ .sidebar-section [data-section-name = " today" ]:has (.ai-bot-sidebar-empty-state ) {
28+ display : none ;
29+ }
30+
2631 .sidebar-toggle-all-sections {
2732 display : none ;
2833 }
You can’t perform that action at this time.
0 commit comments