Show recent chat sessions in the AI Chat Welcome screen#16894
Show recent chat sessions in the AI Chat Welcome screen#16894cdamus wants to merge 19 commits intoeclipse-theia:masterfrom
Conversation
packages/ai-ide/src/browser/chat-sessions-welcome-message-provider.tsx
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
Refactor the welcome provider as a ContributionProvider extension point with the main welcome content as the prime contribution. Part of eclipse-theia#16562 Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
18d7eac to
9c68fb7
Compare
Show up to three rows of cards for the most recent chats in the persistent store, if the store is enabled and has chats to show, along with a "Browse all chats..." link. Let the user configure the number of rows to show or choose not to show any recent chats. Fixes eclipse-theia#16562 Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
9c68fb7 to
7739d9b
Compare
ndoschek
left a comment
There was a problem hiding this comment.
Thank you Christian, this is awesome! The code looks great to me, and it looks and works perfectly! ✨
The Card component in core is a nice reusable addition.
I just added a few minor comments inline and some follow-up ideas below.
Possible follow-ups:
- Back/home button in chat header: Add a button (e.g.,
codicon('arrow-left')) to the chat view toolbar/header that navigates back to the welcome screen. We already can do that via the +, but I think this could would be a intuitive and easy addition. - Session state indicator on cards: Show active vs. idle state.
ChatSessionMetadataalready hasisActive, so we could add a small colored dot or badge on the card icon and/or a simple label like "Running..." in the subtitle alongside the timestamp. - Rich tooltip via
HoverService: On card hover, it would be nice to show a more detailed tooltip like the last request/response snippet, agent used, message count for example.HoverServicesupports markdown or even rich HTML.
packages/ai-chat-ui/src/browser/chat-tree-view/chat-view-tree-widget.tsx
Outdated
Show resolved
Hide resolved
packages/ai-ide/src/browser/chat-sessions-welcome-message-provider.tsx
Outdated
Show resolved
Hide resolved
|
Thanks so much @ndoschek for such a thorough and helpful review! I'll take a crack at the follow-up items below.
I agree, this will be very handy now that we have chat history in the welcome.
Yup, especially as now we'll have that convenient return path 😀
Yeah, what's shown at the moment isn't really so helpful. |
- do not sort arrays in place where it's unnecessary - don't encourage more than 6 rows of chat cards - use a more subtle theme colour for the divider between contributions to the welcome screen - remove dead code Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Showing: - the last request or response message with suitable formatting - name of the agent involved - number of back-and-forth exchanges in the chat - date and time of the last message Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
And align the icons to the top. Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
|
Hi @ndoschek I've pushed some new commits to address your specific comments (except my open questions) and to implement your suggested improvements. The latter in particular I think have really made this a well-rounded feature!
|
|
@ndoschek With the addition of navigation buttons the toolbar in the chat view is getting fairly crowded. Do you think it would make sense to move a couple of items into ellipsis menu? At least the extraction to a separate window and probably also the item that opens JSON settings seem like ones we might not reach for as much as the others. |
ndoschek
left a comment
There was a problem hiding this comment.
Thank you Christian, the updates look great, I love how this turned out! The navigation, rich hover tooltips, and active badges are really nice additions. 🎉
One observation on the active session badge: the blue dot currently checks whether the session appears anywhere in the navigation history rather than whether it's the currently active session. This means that after starting New Chats a few times, it can happen that previously visited sessions get badged, and the navigation contains something like: welcome > new chat 1 > welcome > new chat 2 > welcome > new chat 3.
Is this intended? I find this a little confusing especially having the welcome screens multiple times in the history. The arrow titles indicate back/forward navigation, so it matches, but I would like to know what you think about this.
A couple of related thoughts (follow-ups):
- The multiple blue dots visually remind me of "unread" indicators. It could be interesting to actually use this pattern in the future, e.g., extending/using the AgentCompletionNotificationService to detect whether the user has seen the last message in a session, and flagging unread chats accordingly.
- It would also be nice to indicate on the card whether a chat is currently still running (i.e., still generating a response), so the user can tell at a glance which sessions are active vs. idle.
- It would be nice to support editing (rename) and removing chats directly from the cards. Currently this is only possible via the quick input item buttons and isn't exposed as a standalone command. Extracting those into proper commands and adding action buttons to the cards (e.g., on hover) would be a nice improvement.
packages/ai-ide/src/browser/chat-sessions-welcome-message-provider.tsx
Outdated
Show resolved
Hide resolved
That's a great idea, thanks! Yes I think those two are good candidates! |
Using an inner container with auto margins because justify-content: center does not work with a flex column that has scrolling overflow in the y direction. Incidentally fix disabled contents missing their dividers. Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
- use more variables where available for consistency - pop the hover to the left Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Replace the blue dot which was meant to indicate that a chat is active with an indicator that the agent in the chat is working. The blue dot looked like an unread state but it only meant that the chat was reachable by history navigation (it could not reflect a session's actual `isActive` state because that is only true when the chat view is showing that session, which a priori cannot happen when the Welcome page is active. Incidentally fixed a mistyping of an event prop in the ChatService interface. This is an incompatible API change but it could not have worked as intended because the signature was not compatible with the actual type of the emitter event function. Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Includes factoring out Commands for rename and delete and introducing a new SessionRenamedEvent to ensure that relevant UI components such as the Welcome screen can learn about such changes. Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
|
Hi @ndoschek I think we really have a pretty lit solution, now. This is a veritable chat dashboard! I've pushed a bunch of new commits, implementing amongst other things an activity indicator showing on chats that have agents busy working on a response: Besides that, I did actually implement the blue dot as a proper unread state: when an agent has finished its response, the blue dot will light up to show that there's an unread message. BTW I went with a fixed 8px size for the dot instead of calculating it from the theme padding because I don't think it should scale with padding. Apart from that, I've addressed other specific comments, including the vertical centring problem, popping up the hover to the left (or right), and adding action buttons for renaming and deleting chats in the cards. More can be provided by extensions via a new contribution point. I've decided that perhaps reorganizing existing actions in the AI Chat view toolbar would best be deferred to a follow-up ticket as it could be controversial. |
Now that we show persisted-only chats in the Welcome view, we need deletion events to tell us to remove the cards. Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
ndoschek
left a comment
There was a problem hiding this comment.
Thank you so much for the updates, Christian, this is so great! I had to test it right away, and it’s really awesome to see how this evolved 😄
The dashboard feel and the activity indicator + unread state work very well together. 👏
Also +1 to deferring the toolbar reorganization to a follow-up.
I’ve left a few very minor comments inline, but nothing substantial, overall this is fantastic!
One final question from earlier regarding navigation: when we’re in a chat and create a new session, we’re taken back to the welcome screen, and that becomes another entry in the navigation history. Would it be possible to treat “create new session” more like a back operation in terms of history handling? That might help avoid sequences like welcome > new chat 1 > welcome > new chat 2 > welcome > new chat 3. Wdyt? But we can of course also do that in a (real ;) ) follow up!
Really great work on this! Thanks again ✨
packages/ai-ide/src/browser/chat-sessions-welcome-message-provider.tsx
Outdated
Show resolved
Hide resolved
| {actionButtons ? ( | ||
| <div className="theia-Card-footer"> | ||
| {subtitle && <span className="theia-Card-footer-time">{subtitle}</span>} | ||
| <div className="theia-Card-footer-actions"> |
packages/ai-ide/src/browser/chat-sessions-welcome-message-provider.tsx
Outdated
Show resolved
Hide resolved
Oh, sorry, yeah I think I missed the significance of that. Absolutely right. The welcome screen in this case is really just a placeholder for a new chat so when we create a new chat from Welcome then that new chat should replace Welcome in the history. Otherwise we're clicking a card to navigate to an existing chat, which then should just push that on the history. |
- fix grid columns detection in the card layout - use the same loading spinner as in the chat view for activity - badge the card icon for unread messages - add missing dependency to use-effect - guard against hover popup after unmount - focus outlines of action buttons in the cards can be clipped Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
- when creating a new session from the New Chat command, replace the welcome screen as placeholder with the new session when it happens - purge a session from the navigation history when it's deleted Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
|
Thanks @ndoschek for your patience and your continuing excellent feedback. I've pushed a couple of commits that should address your last concerns and also a problem I observed in which the grid layout of the cards would freak out when it's on the edge of showing the scrollbar. Oh, and also this: |




What it does
Shows recent chat sessions from persistent storage as cards in the Welcome screen of the AI Chat view to get the user started by resuming a previous chat, if applicable. Clicking a card resumes that chat. A "Browse all chats..." link is provided to open the quick picker to see the full history of persisted chats.
A new preference in the Settings lets the user choose the number of rows of cards to show. The default is 3 rows. A value of 0 suppresses the showing of chats in the welcome screen. A maximum of 10 rows seems to me to be plenty and is typical of recents lists in most document-based applications, but is strictly unnecessary; I can remove the limit if reviewers would prefer not to have one.
🆕 The recent session cards seemed likely to be a UI pattern that might be repeated in other "welcome" or overview type content in Theia and Theia-based applications so a simple
Cardcomponent is introduced in Core on which the session cards are based.How to test
For best test coverage, make sure that you have some sessions in the global store (via the global storage scope preference for chat sessions) that are different to what you might have in any workspace.
Follow-ups
Consider moving the "Move View to Secondary Window" and "Set Session Settings" actions from the AI Chat view toolbar into the ellipsis menu to reduce crowding of the toolbar.
Breaking changes
This PR changes the type of the
ChatSession::onSessionEventprop from theEventfunction type defined in VSCode's language server API to theEventfunction type from Theia that clearly was intended. Although these types are incompatible and therefore this may seem like a breaking change, it was actually the wrong type previously because the actual event object was anEmitter::event. So it could not have been used correctly by clients previously.Attribution
None.
Review checklist
nlsservice (for details, please see the Internationalization/Localization section in the Coding Guidelines)Reminder for reviewers