Fix workbench theme switcher against current and upcoming SharpConsoleUI#36
Merged
woksin merged 1 commit intoJun 20, 2026
Merged
Conversation
843a1d3 to
e21e47e
Compare
The Help-menu and keyboard theme switchers built themes by concrete type (new ClassicTheme(), new ModernGrayTheme()) and by reflective type name (SharpConsoleUI.Plugins.DeveloperTools.DevDarkTheme). SharpConsoleUI's upcoming release removes ClassicTheme, moves DevDarkTheme out of the library, and replaces the process-global static ThemeRegistry with a per-instance windowSystem.ThemeRegistryService. Referencing any of those types directly compiles against only one version. Resolve everything at runtime through a new WorkbenchThemes helper so the same source compiles and runs against both versions. Theme application uses the version-stable ThemeStateService.SwitchTheme(name). The three primary F9/F10/F11 slots are resolved per version: on the current package they keep the original Modern Gray / Classic / Dev Dark behaviour; on the next release, where Classic and Dev Dark no longer exist, they map to Modern Gray / Forest / Crimson. The Help menu also gains a "More Themes" submenu listing every registered theme, and the keyboard-shortcuts overlay reflects whichever primary themes are active. The reflection bridge is temporary and scoped to the 2.4.78 -> 2.4.79 transition; once the dependency is pinned to 2.4.79+ it can be simplified to direct ThemeRegistryService calls.
e21e47e to
80e065b
Compare
woksin
approved these changes
Jun 20, 2026
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
The Chronicle Workbench theme switcher built themes by concrete type
(
new ClassicTheme(),new ModernGrayTheme()) and by reflective typename (
SharpConsoleUI.Plugins.DeveloperTools.DevDarkTheme). The upcomingSharpConsoleUI release removes
ClassicTheme, movesDevDarkThemeout ofthe library, and replaces the static
ThemeRegistrywith a per-instancewindowSystem.ThemeRegistryService— so the current code stops compilingagainst it.
This resolves the theme API at runtime through a small reflection bridge,
so the same source compiles and runs against both the current package
and the next release. The package reference is unchanged.
Changed
WorkbenchThemeshelper that usesthe version-stable
ThemeStateService.SwitchTheme(name)and resolves thetheme catalogue from whichever registry the running version exposes
(per-instance
ThemeRegistryService, falling back to the staticThemeRegistry) via reflection.package keeps the original Modern Gray / Classic / Dev Dark; the next
release maps to Modern Gray / Forest / Crimson (Classic and Dev Dark
no longer exist there). The Help menu gains a More Themes submenu
listing every registered theme, and the keyboard-shortcuts overlay
reflects the active primary themes.