Skip to content

fix(theming): Keep focused NumberBox/ComboBox text readable in dark theme (6.x port of #24091) - #25789

Merged
Xiaoy312 merged 2 commits into
servicing/6.8from
dev/agzi/dark-theme-6x-port-6.8
Oct 28, 2026
Merged

Xiaoy312 merged 2 commits into
servicing/6.8from
dev/agzi/dark-theme-6x-port-6.8

Conversation

@agneszitte

Copy link
Copy Markdown
Member

GitHub Issue: Related to #24021

Manual 6.x port of #24091 to servicing/6.8. It replaces the straight backport #25764, which was reverted by #25787 because it didn't build on 6.x.

PR Type:

🐞 Bugfix

What changed? 🚀

On Skia, text typed into a focused NumberBox or editable ComboBox rendered black in dark theme. Two commits:

  1. fix(theming): Re-apply the #24091 dark focused text fix: the master fix exactly as it was cherry-picked in fix(theming): focused NumberBox/ComboBox text is black in dark theme (backport #24091) #25764, including the runtime tests in Given_ElementTheme.

  2. fix(theming): Reach theming state via the store on 6.x: on master, DependencyObject is a class that holds the theming members. On 6.x it is still an interface and those members live on DependencyObjectStore, so the new code reaches them through IDependencyObjectStoreProvider.Store:

    • GetVisualStateSetterResolutionTheme reads the parent's IsProcessingThemeWalk, WalkTheme and GetTheme() from the parent's store.
    • ResourceResolver.ApplyVisualStateSetter calls the helper on the setter target's store.

    4 lines changed; same behavior as master's fix.

Validation

🤖 Generated with Claude Code

agneszitte and others added 2 commits October 28, 2026 01:00
Brings back the backport of #24091
exactly as it was on master: keep focused NumberBox / editable ComboBox
text readable in dark theme. It was first backported in
#25764 and reverted by
#25787 because it did not build.

This commit alone still does not build on 6.x: on master DependencyObject
is a class, on 6.x the theming state lives on DependencyObjectStore. The
next commit adapts it.

Related to #24021

Co-authored-by: Andres Pineda <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On master, DependencyObject is a class that holds the theming members.
On 6.x it is still an interface, and those members live on
DependencyObjectStore, so reach them through
IDependencyObjectStoreProvider.Store:

- GetVisualStateSetterResolutionTheme reads the parent's
  IsProcessingThemeWalk, WalkTheme and GetTheme() from the parent's store.
- ResourceResolver.ApplyVisualStateSetter calls the helper on the setter
  target's store.

Same behavior as master's fix.

Related to #24021

Co-authored-by: Andres Pineda <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @agneszitte's task in 3m 55s —— View job


Claude's Review

  • Gather context (PR description, diff, changed files)
  • Understand the request (code review per AGENTS.md rules)
  • Review DependencyObjectStore.Theming.cs changes
  • Review FrameworkElement.Theming.cs changes
  • Review ResourceResolver.cs changes
  • Review runtime tests in Given_ElementTheme.cs
  • Post inline findings (none found)
  • Post summary verdict

Verdict: ✅ No blocking issues found

Findings by severity: 0 critical, 0 major, 0 minor. No inline comments posted.

What was checked

  • Store indirection correctness (the 6.x-specific port): traced every new member reached through IDependencyObjectStoreProvider.Store in GetVisualStateSetterResolutionTheme() (DependencyObjectStore.Theming.cs:545-574) and in ResourceResolver.ApplyVisualStateSetter (ResourceResolver.cs:456-459) — Parent, IsProcessingThemeWalk, WalkTheme, GetTheme(), GetCurrentHighestValuePrecedence, ActualInstance all exist on 6.x's DependencyObjectStore with matching signatures, so the indirection is a faithful mechanical port, not a behavior change.
  • Type/pattern correctness: Theme is internal enum Theme : byte, and (Parent as IDependencyObjectStoreProvider)?.Store.GetTheme() lifts to Theme? via the ?. chain, so is null or Theme.None (line 567) compiles and behaves as intended.
  • #if UNO_HAS_ENHANCED_LIFECYCLE gating: confirmed the symbol is only defined for WASM and Skia (Uno.CrossTargetting.targets:74,78), matching the PR's claim that native Android/iOS/Reference compilation is unaffected by the new mid-walk/no-walk branches.
  • using var ... = cond ? scope : default; idiom in InnerUpdateResourceBindingsUnsafe (line 953) mirrors the identical pattern already present at lines 871/898 of the same file — not a new/risky idiom.
  • Runtime tests: the 4 new tests under #region Focused text input in dark theme (issue #24021) use existing, already-referenced test helpers (ThemeHelper.UseApplicationDarkTheme, RequiresFullWindow, FindFirstDescendant overloads, GitHubWorkItem), none are skipped/[Ignore]d, and they include a positive control (AssertFocusedStateResolvedDark) to avoid a false-positive pass. Platform scoping (Skia-only for 3 tests, Skia+NativeWasm for the 4th) looks deliberate given the differing visual tree between Skia's text-rendering internals and native WASM/DOM.
  • Commit messages and PR title follow Conventional Commits; no event/DP/async pattern changes to flag.

Caveat

I verified the ported logic by static tracing against 6.x's current API surface (compiles structurally, matches documented intent) rather than by diffing directly against master's #24091/#25764 source, since only servicing/6.8 is checked out in this environment. The PR author reports local builds of Uno.UI.Skia.csproj/Uno.UI.Wasm.csproj succeed; I did not re-run a full build or the runtime tests here. Recommend waiting for CI (including the new runtime tests) before merging, as the PR description already requests.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@Xiaoy312 Xiaoy312 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@Xiaoy312
Xiaoy312 merged commit 127fb6a into servicing/6.8 Oct 28, 2026
42 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/agzi/dark-theme-6x-port-6.8 branch October 28, 2026 20:18
@agneszitte

Copy link
Copy Markdown
Member Author

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/6.7

✅ Backports have been created

Details

agneszitte added a commit that referenced this pull request Oct 28, 2026
…6.7/pr-25789

fix(theming): Keep focused NumberBox/ComboBox text readable in dark theme (6.x port of #24091) (backport #25789)
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.

3 participants