Skip to content

Swapping the theme-text provider empties the stock-palette cache (#3577 review follow-up) - #3617

Merged
erikdarlingdata merged 1 commit into
devfrom
fix/3577-stock-palette-cache
Sep 18, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
fix/3577-stock-palette-cache

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Follow-up to #3606 (arm B of #3577), for the one non-blocking note its final LGTM carried: ThemeManager.StockPalette caches the twelve stock colors by theme name, and that cache outlived a swap of ThemeManager.ThemeXamlTextProvider. In the app the provider is set once at startup and the trap never fires; in a test that installs its own theme text and then asks for the stock palette, the previous provider's answer would have come back silently.

The provider is now a property whose setter empties the cache, with the reason in its doc comment. Pinned by StockPalette_FollowsTheProvider_WhenTheProviderIsSwapped in Lite.Tests/ThemeColorOverrideTests: two providers, two different accents, the palette follows the swap.

PerformanceMonitor.Ui and Lite.Tests build -c Release -p:EnableWindowsTargeting=true with 0 warnings. No behaviour change in either app. CHANGELOG.md untouched — this rides under #3606's entry.

… review follow-up)

Non-blocking note on #3606: ThemeManager.StockPalette caches by theme
name and the cache outlived a swap of ThemeXamlTextProvider, so a test
that installed its own theme text could be handed the previous
provider's palette silently. The setter now clears the cache; in the app
the provider is set once and the clear never runs. Pinned by
StockPalette_FollowsTheProvider_WhenTheProviderIsSwapped.
@erikdarlingdata
erikdarlingdata enabled auto-merge (squash) September 18, 2026 17:12
@claude

claude Bot commented Sep 18, 2026

Copy link
Copy Markdown

Reviewed. This is a small, well-scoped fix: ThemeXamlTextProvider becomes a property whose setter clears s_stockPalettes, so a provider swap can no longer leave a stale cached palette behind. Confirmed:

  • ThemeManager lives in the shared PerformanceMonitor.Ui project referenced by Lite, Darling's viewer, and the deprecated Dashboard — so there's no Lite/Darling parity drift possible here, it's one code path for all three.
  • The new test (StockPalette_FollowsTheProvider_WhenTheProviderIsSwapped) actually pins the behavior described: two providers, two accents, the palette follows the swap.
  • No SQL, no I/O/security-relevant surface touched, no behavior change on the app's real startup path (provider is set once there, so the Clear() is a no-op in production).

No issues found.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM — verified the property setter correctly clears the stock-palette cache on provider swap, confirmed ThemeManager is shared (no Lite/Darling parity risk), and reviewed the new pinning test.

@erikdarlingdata
erikdarlingdata merged commit fa0d15c into dev Sep 18, 2026
8 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/3577-stock-palette-cache branch September 18, 2026 17:27
erikdarlingdata added a commit that referenced this pull request Sep 19, 2026
…spliced once

Fifty-nine PRs merged to dev today across the coordinator's lanes and the wave-2
worker's; each lane returned its entry to a buffer instead of touching this file,
so that fifty-plus PRs did not each rebase the same twenty lines. This is the one
splice. Every entry is one line (the archiver's compact() and the pins read them
that way); riders fold into their parent's entry (#3599 under #3590, #3619 under
#3611, #3623 under #3616, #3640 under #3633; #3617 test-only and #3661 re-cut as
#3666 carry none); #3657's entry is in because it MERGED to dev - the twin to main
is what is still pending.

[Unreleased] gains a `### Added` above `### Fixed` (Keep-a-Changelog order) for the
six new capabilities: per-user theme colours (#3606 / #3577 arm B), routed alert
families (#3668 / #3598), the PostgreSQL logging audit tool (#3643 / #3607), the
service-side wait sampler (#3645 / #3604), and the log-event classifier with its
temp-file / autovacuum parser families (#3646 / #3601, #3664 / #3602 #3603). The
other forty-eight are honesty fixes to existing surfaces and append to `### Fixed`
after the wave-1 bullets, in PR-number order.

Thirty-six reference definitions added for the issues the new entries cite and the
index did not yet define; the [Unreleased] group is one ascending run again, which
moves [#3557] into its slot (the one deleted line). Nothing under ## [3.8.0] or
older is touched; the archive script was not run. One editorial touch: the #3585
entry ended in a dangling "Darling" and now reads "Darling only." (the tool exists
only in the Darling MCP host).

tools/changelog/changelog_archive.py verify: all PASS (1420 bold entries, floor
1,329; 1,358 distinct refs resolve; CRLF throughout; 356,539 bytes under the
750 KiB ceiling). ChangelogIndexAndArchiveTests: 5/5 pass via a net10.0 harness.
erikdarlingdata added a commit that referenced this pull request Sep 19, 2026
…spliced once (#3672)

Fifty-nine PRs merged to dev today across the coordinator's lanes and the wave-2
worker's; each lane returned its entry to a buffer instead of touching this file,
so that fifty-plus PRs did not each rebase the same twenty lines. This is the one
splice. Every entry is one line (the archiver's compact() and the pins read them
that way); riders fold into their parent's entry (#3599 under #3590, #3619 under
#3611, #3623 under #3616, #3640 under #3633; #3617 test-only and #3661 re-cut as
#3666 carry none); #3657's entry is in because it MERGED to dev - the twin to main
is what is still pending.

[Unreleased] gains a `### Added` above `### Fixed` (Keep-a-Changelog order) for the
six new capabilities: per-user theme colours (#3606 / #3577 arm B), routed alert
families (#3668 / #3598), the PostgreSQL logging audit tool (#3643 / #3607), the
service-side wait sampler (#3645 / #3604), and the log-event classifier with its
temp-file / autovacuum parser families (#3646 / #3601, #3664 / #3602 #3603). The
other forty-eight are honesty fixes to existing surfaces and append to `### Fixed`
after the wave-1 bullets, in PR-number order.

Thirty-six reference definitions added for the issues the new entries cite and the
index did not yet define; the [Unreleased] group is one ascending run again, which
moves [#3557] into its slot (the one deleted line). Nothing under ## [3.8.0] or
older is touched; the archive script was not run. One editorial touch: the #3585
entry ended in a dangling "Darling" and now reads "Darling only." (the tool exists
only in the Darling MCP host).

tools/changelog/changelog_archive.py verify: all PASS (1420 bold entries, floor
1,329; 1,358 distinct refs resolve; CRLF throughout; 356,539 bytes under the
750 KiB ceiling). ChangelogIndexAndArchiveTests: 5/5 pass via a net10.0 harness.
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.

1 participant