feat: add sync indicator for branch changes in chat widget#297933
feat: add sync indicator for branch changes in chat widget#297933
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a synchronization indicator to the chat widget that displays the number of changes to pull and push for the current Git branch. The indicator appears next to the branch picker and is only visible when working with a local target and when the selected branch has changes to sync with its upstream.
Changes:
- Introduces a new
SyncIndicatorclass that monitors Git repository state and displays ahead/behind counts - Integrates the sync indicator into the chat widget alongside the existing branch picker
- Adds CSS styling for the sync indicator component
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/sessions/contrib/chat/browser/syncIndicator.ts | New component that renders a sync button with ahead/behind counts and executes git sync command |
| src/vs/sessions/contrib/chat/browser/newChatViewPane.ts | Integrates sync indicator into chat widget, managing its visibility and repository state |
| src/vs/sessions/contrib/chat/browser/media/chatWelcomePart.css | Adds styling for sync indicator layout and spacing |
|
|
||
| private _repository: IGitRepository | undefined; | ||
| private _selectedBranch: string | undefined; | ||
| private _visible = true; |
There was a problem hiding this comment.
The initial visibility should be false rather than true. The sync indicator is set to visible only when the target is local (line 177 in newChatViewPane.ts), but this initialization assumes it should be visible by default, which could cause it to briefly appear before being hidden when the default target is not local.
| private _visible = true; | |
| private _visible = false; |
No description provided.