Skip to content

Comments

Show recent chat sessions in the AI Chat Welcome screen#16894

Open
cdamus wants to merge 19 commits intoeclipse-theia:masterfrom
cdamus:feature/16562-show-chat-sessions
Open

Show recent chat sessions in the AI Chat Welcome screen#16894
cdamus wants to merge 19 commits intoeclipse-theia:masterfrom
cdamus:feature/16562-show-chat-sessions

Conversation

@cdamus
Copy link
Contributor

@cdamus cdamus commented Jan 28, 2026

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 Card component 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.

  • Launch Theia and pick a chat from the cards in the Welcome screen.
  • Launch Theia and hit the "Browse all chats..." link in the Welcome screen.
  • With the Welcome screen open, play with the chat session storage preferences. See what the effects are of
    • toggling global/workspace scope
    • changing the number of rows of recent chats to show (especially the zero value)
  • switch workspaces
  • close the workspace (to see global chat storage)
  • etc.

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::onSessionEvent prop from the Event function type defined in VSCode's language server API to the Event function 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 an Emitter::event. So it could not have been used correctly by clients previously.

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

None.

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Jan 28, 2026
@ndoschek ndoschek self-requested a review February 3, 2026 10:54
@cdamus cdamus marked this pull request as draft February 3, 2026 13:11
@cdamus

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>
@cdamus cdamus force-pushed the feature/16562-show-chat-sessions branch from 18d7eac to 9c68fb7 Compare February 13, 2026 19:39
@cdamus cdamus marked this pull request as ready for review February 13, 2026 19:45
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>
@cdamus cdamus force-pushed the feature/16562-show-chat-sessions branch from 9c68fb7 to 7739d9b Compare February 13, 2026 19:54
Copy link
Member

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. ChatSessionMetadata already has isActive, 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. HoverService supports markdown or even rich HTML.

@cdamus
Copy link
Contributor Author

cdamus commented Feb 19, 2026

Thanks so much @ndoschek for such a thorough and helpful review! I'll take a crack at the follow-up items 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 an intuitive and easy addition.

I agree, this will be very handy now that we have chat history in the welcome.

  • Session state indicator on cards: Show active vs. idle state. ChatSessionMetadata already has isActive, 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.

Yup, especially as now we'll have that convenient return path 😀

  • 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. HoverService supports markdown or even rich HTML.

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>
Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
@cdamus
Copy link
Contributor Author

cdamus commented Feb 19, 2026

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!

CleanShot 2026-02-19 at 15 52 06

@cdamus cdamus requested a review from ndoschek February 19, 2026 21:58
@cdamus
Copy link
Contributor Author

cdamus commented Feb 20, 2026

@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.

Copy link
Member

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Image

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):

  1. 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.
  2. 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.
  3. 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.

@ndoschek
Copy link
Member

@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.

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>
@cdamus
Copy link
Contributor Author

cdamus commented Feb 20, 2026

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:

CleanShot 2026-02-20 at 12 50 58

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.

@cdamus cdamus requested a review from ndoschek February 20, 2026 17:49
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>
Copy link
Member

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ✨

{actionButtons ? (
<div className="theia-Card-footer">
{subtitle && <span className="theia-Card-footer-time">{subtitle}</span>}
<div className="theia-Card-footer-actions">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The focus border of those two buttons cannot be shown properly on the bottom, maybe a little height/width adjustment could help? But totally optional though, not a real issue :)

Image

@cdamus
Copy link
Contributor Author

cdamus commented Feb 20, 2026

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!

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>
@cdamus
Copy link
Contributor Author

cdamus commented Feb 20, 2026

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:

CleanShot 2026-02-20 at 15 56 19

@cdamus cdamus requested a review from ndoschek February 20, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting on reviewers

Development

Successfully merging this pull request may close these issues.

AI Persistence: Show Persisted Sessions in Chat View

2 participants