Skip to content

sessions: Preserve background layouts per color scheme - #333873

Merged
TylerLeonhardt merged 3 commits into
mainfrom
tyleonha/fix-theme-specific-background-layouts
Sep 1, 2026
Merged

sessions: Preserve background layouts per color scheme#333873
TylerLeonhardt merged 3 commits into
mainfrom
tyleonha/fix-theme-specific-background-layouts

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

  • store dark- and light-theme Agents chat background image layouts independently
  • reload the active layout when the color theme changes
  • keep image and layout preferences machine-local and excluded from Settings Sync
  • update accessibility help to clarify that layout changes apply to the current color theme

Fixes #333690

Testing

  • npm run transpile-client
  • .\scripts\test.bat --run src\vs\sessions\services\chatBackground\test\browser\chatBackgroundService.test.ts (11 passing)
  • npm run eslint -- src\vs\sessions\services\chatBackground\browser\chatBackgroundService.ts src\vs\sessions\services\chatBackground\test\browser\chatBackgroundService.test.ts src\vs\sessions\contrib\chat\browser\chat.contribution.ts

Visual verification

Verified in an isolated native Agents window:

  1. Dark Modern image set to Right.
  2. Light Modern image set to Left.
  3. Switching back to Dark Modern restored Right.

Light Modern — Left

Light Modern background image aligned left

Dark Modern — Right Restored

Dark Modern background image aligned right after switching back from Light Modern

Copilot AI balanced review requested due to automatic review settings September 1, 2026 21:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Existing preferences are lost, and cancelling a preview after a theme switch can restore the wrong layout.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 High severity · 1 Medium severity

New issues introduced by this change (2)
Severity Finding
High severity src/​vs/​sessions/​services/​chatBackground/​browser/​chatBackgroundService.ts — Reading only the two new keys drops every existing chat.agentSessions.backgroundImageLayout
Medium severity src/​vs/​sessions/​services/​chatBackground/​browser/​chatBackgroundService.ts — A color-theme change can occur while the layout quick pick is open (for example, through automatic…
What changed in this PR

Splits Agents chat background layouts by color scheme and reloads them on theme changes.

Changes:

  • Adds machine-local dark/light layout settings.
  • Reloads layouts when themes change.
  • Updates tests and accessibility guidance.
File Description
chatBackgroundService.ts Implements scheme-specific layouts.
chatBackgroundService.test.ts Tests persistence and theme switching.
chat.contribution.ts Registers the new settings.
sessionsChatAccessibilityHelp.ts Clarifies layout scope.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

TylerLeonhardt and others added 2 commits September 1, 2026 15:14
Store and restore dark and light Agents chat background image layouts independently. Keep layout persistence machine-local alongside the corresponding image settings and cover theme switching and preview restoration.

Fixes #333690

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore the configured layout for the color scheme that is active when the background layout picker is cancelled. This avoids applying a stale preview if automatic theme detection switches schemes while the picker is open.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TylerLeonhardt
TylerLeonhardt force-pushed the tyleonha/fix-theme-specific-background-layouts branch from 8ae3418 to 2e68e85 Compare September 1, 2026 22:16
Keep cancellation tied to the layout captured when the picker opens instead of exposing configuration restoration through the background service.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TylerLeonhardt
TylerLeonhardt marked this pull request as ready for review September 1, 2026 22:33
@TylerLeonhardt
TylerLeonhardt enabled auto-merge (squash) September 1, 2026 22:33
@TylerLeonhardt
TylerLeonhardt merged commit 9107861 into main Sep 1, 2026
40 checks passed
@TylerLeonhardt
TylerLeonhardt deleted the tyleonha/fix-theme-specific-background-layouts branch September 1, 2026 22:51
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Background layout preferences aren't specific to light or dark modes

3 participants