Skip to content

Chat view: introduce session title and back button (fix #277537)#278874

Merged
bpasero merged 34 commits intomainfrom
hawkticehurst/chat-titles
Dec 3, 2025
Merged

Chat view: introduce session title and back button (fix #277537)#278874
bpasero merged 34 commits intomainfrom
hawkticehurst/chat-titles

Conversation

@hawkticehurst
Copy link
Member

@hawkticehurst hawkticehurst commented Nov 21, 2025

Resolves #277537

Changes include:

  • When activity bar is in Default position, a new "secondary title bar" is appended below the primary title bar
    • When the Show Labels configuration is set, the secondary title will use the format: "CUSTOM TITLE"
    • When the Show Icons configuration is set, the secondary title will use the format: "CHAT: CUSTOM TITLE"
    • When multiple views are rendered in the chat view pane the secondary bar will not be rendered and instead follow the same conventions used for Top, Bottom, and Hidden positions (listed below)
  • When activity bar is in Top, Bottom, or Hidden positions the primary title will be updated (no secondary bar rendered)
    • The primary title will use the format: "CHAT: CUSTOM TITLE"
  • When waiting for a new chat title to be generated the secondary bar will not be rendered and/or the CHAT label will be the fallback default text
  • An arrow icon button is included next to generated title that will bring you back to the empty chat view state

Default position with labels (secondary title bar IS rendered WITHOUT chat prefix):

Screenshot 2025-11-21 at 7 30 48 PM

Default position with icons (secondary title bar IS rendered WITH chat prefix):

Screenshot 2025-11-21 at 7 30 59 PM

Top position (secondary title bar IS NOT rendered):

Screenshot 2025-11-21 at 7 39 18 PM

Bottom/Hidden positions (secondary title bar IS NOT rendered):

Screenshot 2025-11-21 at 7 39 10 PM

Default, Top, Bottom/Hidden positions with multiple views (secondary title bar IS NOT rendered):

Screenshot 2025-11-21 at 7 32 26 PM Screenshot 2025-11-21 at 7 33 11 PM Screenshot 2025-11-21 at 7 33 29 PM

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds AI-generated chat session titles to VS Code's chat interface. When a chat session has a custom title (generated by AI or set manually), it is displayed in a secondary title bar below the main "Chat" title. The feature also includes a "Back to Chat" button to clear the current session and start fresh.

Key Changes

  • Added a secondary title display mechanism that shows AI-generated titles or "Generating title..." state
  • Integrated with the chat model's setCustomTitle event to update the title dynamically
  • Created a new menu location (ChatSecondaryTitleMenuId) with a "Back to Chat" action

@hawkticehurst hawkticehurst marked this pull request as ready for review November 22, 2025 00:53
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 22, 2025
Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

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

I think the title shouldn't wrap
Image

if (!title) {
return undefined;
}
return title.startsWith('Chat: ') ? title : `Chat: ${title}`;
Copy link
Member

Choose a reason for hiding this comment

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

When does the chatmodel title start with 'Chat: '? Would that be a localized string, and should the 'Chat: ' in this method be localized?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oop yes this should totally be localized. Thank you for the catch.

Also, the "Chat: " prefix will be rendered when:

  • The activity bar is in the Top, Bottom, Hidden positions
  • The activity bar is in the Default position AND the Show Icons config set
  • The activity bar is in any position AND there are multiple views being rendered in the chat view pane

The "Chat: " prefix will NOT be rendered when:

  • The activity bar is in the Default position AND the Show Labels config set

The idea (in theory) was to include the "Chat: " prefix as a sort of method of way finding –– it becomes easier to contextualize what the custom titles represent. Without it could become confusing, especially in configurations like when the activity bar in the hidden position:

Screenshot 2025-11-21 at 5 49 31 PM

And then the idea for not including the Chat prefix when the activity bar is in the Default position and the Show Labels config set is due to redundant "Chat" text right next to each other. Looks weird/off.

Screenshot 2025-11-21 at 8 48 43 PM

Copy link
Member

Choose a reason for hiding this comment

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

But if I'm understanding the code correctly, you're operating on the chatmodel title, not the view title, so I don't think there will be a case where the title already is prefixed with "chat:"

@roblourens
Copy link
Member

I don't think people will like the shift down when the title gets generated, but I assume things are all still in flux

@hawkticehurst
Copy link
Member Author

I don't think people will like the shift down when the title gets generated, but I assume things are all still in flux

Yeah I'm guessing the same, but tis indeed in flux. Perhaps we can leave that one to the scream test and then adjust based on whatever feedback we get.

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

I am not at all an owner of the chatViewPane.ts file, but when I look at the before and after, I find the change makes the rather simple chatViewPane.ts quite complex. Is there any chance we could encapsulate this logic into a separate file that then chatViewPane.ts simply depends on, just to separate concerns?
Having looked at chatWidget.ts, I think there we really missed the opportunity to keep the file readable (not just for humans but also AI!). The smaller the file, I think the easier to make changes in the future.

As for the UX: its a bit jarring that a chat at first does not have a title and then only later gets a title, which in turn pushes the chat down. I wonder if we can invent some generic title that then later is replaced? I am also not 100% sure about using all uppercase, at least when the title is above the chat and not part of the view title.

@bpasero bpasero self-assigned this Nov 25, 2025
@bpasero bpasero modified the milestones: November 2025, On Deck Nov 25, 2025
@bpasero bpasero modified the milestones: On Deck, November 2025 Dec 3, 2025
@bpasero bpasero changed the title Add AI generated chat session titles Chat view: introduce session title and back button (fix #277537) Dec 3, 2025
bpasero
bpasero previously approved these changes Dec 3, 2025
@bpasero bpasero enabled auto-merge (squash) December 3, 2025 10:56
@bpasero bpasero merged commit 302c914 into main Dec 3, 2025
28 checks passed
@bpasero bpasero deleted the hawkticehurst/chat-titles branch December 3, 2025 11:27
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat view: introduce session title and back button

5 participants