Conversation
Add a purple/violet theme that automatically activates on March 8 for International Women's Day and reverts on March 9. Changes: - Add InternationalWomensDay to UiTheme enum with 'iwd' CSS data-theme - Add HolidayThemeHelper for testable date detection and theme mapping - MainLayout auto-applies IWD theme on first render + periodic timer detects midnight crossings (into/out of March 8) - Users can change theme in Settings to dismiss the holiday override - ConnectionSettings.Load() sanitizes IWD from persisted settings - Fix pre-existing CS0126 in CreateSessionAsync early-return path - 18 new tests covering date detection, theme mapping, and guards Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add _disposed flag and check in OnHolidayTimerTick to prevent callbacks
after component disposal (timer race condition)
- Move _lastHolidayCheck and HolidayThemeDismissed mutations inside
InvokeAsync for correct Blazor synchronization context (thread safety)
- Add try/catch with Console.Error.WriteLine logging to holiday activation path
- Replace bare catch {} with catch (Exception ex) + logging in revert path
- Wrap SetTheme in Settings.razor with try/catch and show error status on failure
- Resolve merge conflict in PolyPilot.Tests.csproj (include both HolidayThemeHelper
and MarkdownRenderer compile links)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On March 8, PolyPilot automatically switches to a purple/violet International Women's Day theme. The theme reverts on March 9.
Behavior
ConnectionSettings.Load()sanitizes itChanges
ConnectionSettings.cs: AddInternationalWomensDaytoUiThemeenum; guard inLoad()HolidayThemeHelper.cs: Static helper withIsInternationalWomensDay(),GetActiveHolidayTheme(),GetDataThemeString()— all accept optional DateTime for testabilityMainLayout.razor: Holiday theme auto-activation on first render + 60-second timer for date transitionsSettings.razor: IWD cases in all theme switch expressions; sets dismiss flag when user changes awayCopilotService.cs:HolidayThemeDismissedin-memory flagapp.css: Full[data-theme="iwd"]CSS theme with purple/violet paletteCreateSessionAsyncearly-return pathTests
18 new tests in
HolidayThemeTests.cscovering:GetActiveHolidayThemereturns IWD or null)UiThemevaluesTest results: 1717 passed, 1 pre-existing failure (PlatformHelperTests unrelated)