Repository navigation
fix: save and restore map style, projection and overlays - #4
Open
knightmare2600 wants to merge 1 commit into
Open
knightmare2600 wants to merge 1 commit into
knightmare2600 wants to merge 1 commit into
Conversation
user-preferences.example.json has shipped MapStyle, MapProjection and MapOverlays since the map overhaul, but nothing read them: the map always started on Earth at Night / Flat / Day-Night, and Save-UserPreferences rewrote the file with a fixed key set, deleting the three keys on the first save. There is no save on window close (it minimises to the tray), so map changes were never persisted. - Save-UserPreferences now writes MapStyle, MapProjection and MapOverlays from the current toolbar state. - The style and projection pickers and the ten overlay toggles save when changed, as the exchange toggles already do. - Saved settings are applied straight after the pickers are populated, before change handlers are attached, so start-up does not redraw the map once per toggle. - New Private/Get-MapPreferenceState resolves the saved values. Unknown styles/projections fall back to the defaults; overlay names with no toggle (e.g. 'TimeLine' from the original example file) are ignored; an empty MapOverlays list means all overlays off; a missing key keeps the XAML defaults. - PSExchangeClock.psm1 now dot-sources Private/*.ps1 (not exported). - Pester tests in Tests/MapPreferences.Tests.ps1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 9, 2026
This branch has not been deployed
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
Map style, projection and overlay choices are now saved and restored. Before, they were never read on start-up and were deleted from the preferences file on the first save.
The bug
user-preferences.example.jsonhas shippedMapStyle,MapProjectionandMapOverlayssince the map overhaul (commit 9949738), but nothing reads them. The map always started on Earth at Night / Flat / Day-Night.Save-UserPreferencesrewrites the file from a fixed set of keys, so the three map keys were dropped on the first save.The fix
Save-UserPreferenceswritesMapStyle,MapProjectionandMapOverlaysfrom the current toolbar state.Private/Get-MapPreferenceState.ps1resolves the saved values:TimeLinefrom the original example file) are ignored;MapOverlayslist means all overlays off;DayNight,TimeZoneBands,PoliticalBorders,TimeZoneBoundaries,Earthquakes,Volcanoes,NaturalEvents,ConflictZones,SubmarineCables,PowerPlants.Infrastructure this PR introduces
PSExchangeClock.psm1now also dot-sourcesPrivate/*.ps1, which are not exported (the exported command list is unchanged).Tests/(run withInvoke-Pester ./Tests). feat: add Nasdaq Copenhagen (XCSE) as a supported exchange #5 builds on both.Checks
Lintworkflow already fails onmainbefore this change — PSScriptAnalyzer reports 120 Warning-level findings there (e.g. run 36486962685). This PR adds no new findings (compared by rule, file and message againstmain), so a red Lint check here is the pre-existing state.[Unreleased]. The PRs in this series are independent where possible, so whichever merges second will have a trivial conflict in that section — keep both entries.This is one of a series of small PRs (fixes and features kept separate so you can pick and choose): #2 countdown hours · #3 Refresh button · #4 map preferences · #5 Nasdaq Copenhagen · #6 OMXC25 · #7 FX DKK/SEK · #8 København clock · #9 FTSE 100 · #10 ETF labels.
🤖 Generated with Claude Code