Skip to content

The Viewer's disabled server list keeps its theme instead of turning white (#4683) - #4685

Merged
erikdarlingdata merged 3 commits into
devfrom
feature/4683-viewer-serverlist-disabled-theme
Sep 29, 2026
Merged

erikdarlingdata merged 3 commits into
devfrom
feature/4683-viewer-serverlist-disabled-theme

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Closes #4683.

Why

While the store is unavailable, ApplyStoreUnavailableShell disables the store-dependent sidebar entries, including ServerList (#4649 for #4648). The stock (Aero2) ListBox template's IsEnabled=False trigger sets its inner border Bd to #FFFFFF (Background) and #D9D9D9 (BorderBrush) by TargetName, which beats the list's own Background="{DynamicResource BackgroundDarkBrush}". So the disabled list was a solid white box in Dark, Light and Cool Breeze. A style-level IsEnabled trigger can't fix that, so the fix has to carry the template.

What changes

  • Themes/DarkTheme.xaml, LightTheme.xaml, CoolBreezeTheme.xaml (Viewer): a new implicit ListBox style (no key, placed after ComboBoxItem, before TabControl). It sets only Template: a copy of the upstream Aero2 template (Border Bd with the three TemplateBindings, Padding 1, SnapsToDevicePixels, ScrollViewer Focusable=False with Padding bound, ItemsPresenter, and the IsGrouping / IsVirtualizingWhenGrouping MultiTrigger). The only difference is the disabled trigger: it no longer touches Background or BorderBrush and only sets Opacity 0.5. The stock theme style still supplies every other ListBox default.
  • ServerList.IsEnabled = false is unchanged (a screen reader still reports it unavailable; no IsHitTestVisible). MainWindow.xaml and MainWindow.xaml.cs are untouched.
  • New Darling.Tests/ViewerDisabledListBoxThemeTests.cs (STA, renders with RenderTargetBitmap).
  • DocCommentHygieneTests: removed the ListBox entry from UnresolvedCrefTargets. It was bounded because no C# spelled ListBox; the new test does, so the census (compared for equality) required deleting it.

Test plan

  • RED on today's code (tests written first, run before the theme edit): 9 of 9 fail. Disabled interior renders #FFFFFF in all three themes: Dark expected #1A1C21, Light expected #F8F8FA, Cool Breeze expected #DEE8F2 (each the theme's BackgroundDarkBrush at 0.5 over the window background). Light's BackgroundDarkBrush is #F0F2F5, not white, so Light does go RED (5 to 8 levels per channel against a tolerance of 2).
  • GREEN after the theme edit: ViewerDisabledListBoxThemeTests 9 of 9 (generic disabled ListBox x3 themes, the real ServerList element parsed from MainWindow.xaml x3, enabled list pixel-identical to the stock template x3).
  • The enabled-equals-stock check is not vacuous: mutating the Dark style's Padding="1" to "0" fails it (3210 bytes differ); restored. It also asserts the disabled renders differ, so a style that never reaches the list can't pass.
  • Darling.Tests classes starting Viewer or containing StoreUnavailable: 2007 total, 0 failed, 127 skipped.
  • ThemeCompletenessTests (Darling), Viewer4629Tests, ViewerStoreUnavailableShellTests: pass (45 with the new class). Lite.Tests ThemeParityLiteDarlingTests and ThemeCompletenessTests: 5 of 5.
  • After merging origin/dev (4c6dfe1), full Darling.Tests: 16710 total, 0 failed, 1047 skipped, 1 not run. Builds: Darling.Tests and Lite.Tests, 0 warnings.
  • Not run: the live PostgreSQL tests (no PostgreSQL rig; they skip). No app launched, so no screenshot of the real window; the render checks stand in.

Other ListBoxes and Lite

The Viewer has six: ServerList (MainWindow), ServerCheckList (ManageTagsWindow), and DatabaseFilterList, WaitTypesList, MemoryClerksList, PerfmonCountersList (ViewerServerTab). None sets its own Style or Template, so all pick up the new style; enabled they render as before. No .cs sets IsEnabled on the last five, and no XAML binding, ElementName or style trigger reaches them (every IsEnabled in ViewerServerTab.xaml is on a menu item or button). One more disabled path found: ManageTagsWindow sets root.IsEnabled = false on the whole content on a read-only seat (ManageTagsWindow.xaml.cs:120), so ServerCheckList inherited disabled and showed the same white box; it now dims with its own BackgroundBrush. Not screenshot-verified. PerformanceMonitor.Ui has no ListBox. Lite has the same six (ServerListView, ServerCheckList, and four in ServerTab.xaml). No code or binding disables any of them (the only IsEnabled writes in its MainWindow files are on context-menu items and the import button), and Lite's theme files are unchanged, so Lite needs no change.

Decisions to double check

  • Opacity 0.5: the sidebar buttons use DarkButton, which swaps ViewerDisabledBgBrush / ViewerDisabledTextBrush and has no opacity to match. The theme's own disabled controls (implicit Button, AccentButton, SuccessButton, PasswordBox) all use 0.5. One number per theme file, plus DisabledOpacity in the test.
  • The disabled trigger sets no BorderBrush, so the list keeps its own (ServerList carries the themed BorderBrush); the stock #D9D9D9 is gone. A list that sets no BorderBrush keeps the stock #ABADB3 in both states.

CHANGELOG

SECTION: Fixed
ENTRY:

…d of stock white (#4683)

The stock ListBox template's disabled trigger paints its inner border white by TargetName, so the sidebar server list (disabled while the store is unavailable, #4648) rendered as a solid white box in every theme. Each Viewer theme now has an implicit ListBox style carrying a copy of the stock template whose disabled trigger only dims (Opacity 0.5, the theme's own disabled dimming). Render checks per theme cover the disabled list, the shipped ServerList, and an enabled list matching the stock template pixel for pixel.
…spell ListBox in C# (#4683)

The bound listed ListBox as a cref target no C# spelled. ViewerDisabledListBoxThemeTests now does, so the three doc-comment sites resolve, and the census compares the bounded set for equality, so the entry goes.
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review September 29, 2026 00:21
@erikdarlingdata
erikdarlingdata merged commit 9f409d9 into dev Sep 29, 2026
26 of 30 checks passed
@erikdarlingdata
erikdarlingdata deleted the feature/4683-viewer-serverlist-disabled-theme branch September 29, 2026 00:24
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