Skip to content

Theme Tokens, Density, IDE Presets, and Rider Sample Integration#1047

Merged
wieslawsoltes merged 4 commits intomasterfrom
feature/theme-presets-density-rider-switch
Feb 12, 2026
Merged

Theme Tokens, Density, IDE Presets, and Rider Sample Integration#1047
wieslawsoltes merged 4 commits intomasterfrom
feature/theme-presets-density-rider-switch

Conversation

@wieslawsoltes
Copy link
Copy Markdown
Owner

PR Summary: Theme Tokens, Density, IDE Presets, and Rider Sample Integration

Branch

  • feature/theme-presets-density-rider-switch

Base

  • master (origin/master)

Goal

Deliver a full Dock theme modernization pass with:

  • semantic/tokenized theme resources,
  • density support for Fluent/Simple Dock themes,
  • reusable IDE presets (VS Code + Rider, light/dark, plus default reset presets),
  • comprehensive theme unit coverage,
  • expanded DocFX documentation,
  • Rider sample integration that uses shared presets and supports runtime light/dark switching.

Commits

  1. 75df4db50 feat(themes): add density-aware fluent/simple theme resources
  2. 0574b87f3 test(themes): add coverage for density, presets, and semantic tokens
  3. 7653bc242 docs(themes): add token, preset, and migration documentation
  4. 64924b898 feat(sample-rider): use shared rider presets and add theme switch menu

Detailed Change List

1) Theme Core and Resource System

Implemented density-aware and tokenized theme infrastructure across Fluent/Simple Dock themes.

Key updates:

  • Added shared density enum:
    • src/Dock.Avalonia/Themes/DockDensityStyle.cs
  • Added runtime density switching plumbing:
    • src/Dock.Avalonia.Themes.Fluent/DockFluentTheme.axaml
    • src/Dock.Avalonia.Themes.Fluent/DockFluentTheme.axaml.cs
    • src/Dock.Avalonia.Themes.Simple/DockSimpleTheme.axaml
    • src/Dock.Avalonia.Themes.Simple/DockSimpleTheme.axaml.cs
  • Added compact density dictionaries:
    • src/Dock.Avalonia.Themes.Fluent/DensityStyles/Compact.axaml
    • src/Dock.Avalonia.Themes.Simple/DensityStyles/Compact.axaml
  • Expanded and normalized semantic token usage across controls and accents:
    • src/Dock.Avalonia.Themes.Fluent/Accents/Fluent.axaml
    • src/Dock.Avalonia.Themes.Simple/Accents/Simple.axaml
    • Multiple Fluent control theme files under:
      • src/Dock.Avalonia.Themes.Fluent/Controls/*.axaml

2) IDE Presets (Reusable Avals)

Added token-only preset dictionaries for Fluent and Simple themes.

Fluent presets:

  • src/Dock.Avalonia.Themes.Fluent/Presets/Ide/Default.axaml
  • src/Dock.Avalonia.Themes.Fluent/Presets/Ide/VsCodeDark.axaml
  • src/Dock.Avalonia.Themes.Fluent/Presets/Ide/VsCodeLight.axaml
  • src/Dock.Avalonia.Themes.Fluent/Presets/Ide/RiderLight.axaml
  • src/Dock.Avalonia.Themes.Fluent/Presets/Ide/RiderDark.axaml

Simple presets:

  • src/Dock.Avalonia.Themes.Simple/Presets/Ide/Default.axaml
  • src/Dock.Avalonia.Themes.Simple/Presets/Ide/VsCodeDark.axaml
  • src/Dock.Avalonia.Themes.Simple/Presets/Ide/VsCodeLight.axaml
  • src/Dock.Avalonia.Themes.Simple/Presets/Ide/RiderLight.axaml
  • src/Dock.Avalonia.Themes.Simple/Presets/Ide/RiderDark.axaml

Notes:

  • Presets are token dictionaries, not full template forks.
  • Default.axaml provides a runtime-switchable reset target back to base token mappings.

3) Unit Test Coverage

Added dedicated unit tests for token contract, preset loading, and density behavior.

New tests:

  • tests/Dock.Avalonia.Themes.UnitTests/ThemeSemanticTokenContractTests.cs
  • tests/Dock.Avalonia.Themes.UnitTests/ThemePresetLoadTests.cs
  • tests/Dock.Avalonia.Themes.UnitTests/ThemeDensityStyleTests.cs
  • tests/Dock.Avalonia.Themes.UnitTests/ThemeDensityControlSizingTests.cs
  • tests/Dock.Avalonia.Themes.UnitTests/ThemeResourceIsolationCollection.cs

Coverage focus:

  • semantic token availability/contract,
  • preset load/resource resolution,
  • compact vs normal density behavior,
  • control sizing/token-driven metrics validation.

4) Documentation (DocFX)

Added full theme/token/preset docs and toc integration.

Docs:

  • docfx/articles/dock-theme-design-tokens.md
  • docfx/articles/dock-theme-semantic-tokens.md
  • docfx/articles/dock-theme-ide-presets.md
  • docfx/articles/dock-theme-fluent.md
  • docfx/articles/dock-theme-simple.md
  • docfx/articles/dock-theme-token-migration.md
  • docfx/articles/toc.yml

Documentation covers:

  • token taxonomy and semantics,
  • preset usage and layering order,
  • density modes,
  • migration guidance from previous token patterns.

5) Rider Sample Integration

Removed dependency on custom Dock token overrides for Dock chrome where possible and wired shared Rider presets.

Updated sample:

  • samples/DockReactiveUIRiderSample/App.axaml
    • Uses theme dictionaries (Light, Dark, Default) and merges Rider preset files from Dock Fluent theme package.
  • Runtime theme switching:
    • samples/DockReactiveUIRiderSample/ViewModels/MainWindowViewModel.cs
      • added SwitchToLightThemeCommand, SwitchToDarkThemeCommand, IsDarkTheme, IsLightTheme
    • samples/DockReactiveUIRiderSample/Views/MainView.axaml
      • added View -> Theme -> Rider Light / Rider Dark menu actions
  • Updated sample views to DynamicResource for Rider brushes so runtime variant changes propagate correctly:
    • samples/DockReactiveUIRiderSample/Views/MainWindow.axaml
    • samples/DockReactiveUIRiderSample/Views/Documents/EditorDocumentView.axaml
    • samples/DockReactiveUIRiderSample/Views/Tools/*.axaml

Validation

Executed:

  • dotnet test tests/Dock.Avalonia.Themes.UnitTests/Dock.Avalonia.Themes.UnitTests.csproj -v minimal
    • Result: Passed (34/34)
  • dotnet build samples/DockReactiveUIRiderSample/DockReactiveUIRiderSample.csproj -v minimal
    • Result: Succeeded (existing AOT/ReactiveUI warnings remain)

Note:

  • A parallel verification run produced transient Avalonia resource-resolution errors; serial rerun succeeded.

@wieslawsoltes wieslawsoltes merged commit 541d652 into master Feb 12, 2026
9 checks passed
@wieslawsoltes wieslawsoltes deleted the feature/theme-presets-density-rider-switch branch February 12, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant