Render GitHub profile image in workbench#319510
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the workbench “Accounts” action (activity bar + title bar) to render a GitHub avatar image when the user is signed in with a GitHub account, and fall back to the default accounts icon otherwise.
Changes:
- Add an
<img>element to the Accounts activity item and dynamically toggle between codicon vs. avatar rendering. - Add CSS rules for the new avatar container class in the activity bar and title bar.
- Preload the avatar URL and only switch to the avatar once the image loads successfully.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css | Styles the account avatar image in the title bar action toolbar. |
| src/vs/workbench/browser/parts/globalCompositeBar.ts | Adds avatar DOM + image loading logic for the Accounts activity item. |
| src/vs/workbench/browser/parts/activitybar/media/activityaction.css | Styles the avatar container and prevents text-label padding rules from applying to the avatar container. |
|
Right now agents window doesn’t show the profile image if we logged in using the enterprise github copilot account @hawkticehurst @TylerLeonhardt |
Thanks for the heads up. Once this is merged I can toss up another PR that adds enterprise support to agents window |
|
@hawkticehurst the enterprise avatar URLs cannot be statically constructed and require an API request that we should likely cache in some way. Just a heads up. Here's an example https://github.com/microsoft/vscode-copilot/pull/6340 We already calculate the enterprise url in defaultAccount so reusing that when possible would be good |
Oh amazing, thank you for the heads up! I've converted this PR to draft and will make that change on Monday |
In alignment with agents window start rendering GitHub profile image instead of default user icon in VS Code core when logged into GitHub account.
Fallback to default user icon when logged out or logged into other non-GitHub accounts.