Skip to content

πŸ—οΈ Forge: Style Infrastructure Parity Integration#288

Open
tedd wants to merge 1 commit into
mainfrom
forge-style-parity-18247157550888493731
Open

πŸ—οΈ Forge: Style Infrastructure Parity Integration#288
tedd wants to merge 1 commit into
mainfrom
forge-style-parity-18247157550888493731

Conversation

@tedd

@tedd tedd commented Jun 25, 2026

Copy link
Copy Markdown
Owner

πŸ’‘ Hypothesis: The TUI framework lacked standard Style infrastructure and the precise WPF DependencyProperty value precedence (Local > Trigger > Style > Inherited > Default). This prevented declarative UI themes and generated incorrect states when local overrides collided with active triggers or styles.

🎯 Execution:

  • Engineered the Style class supporting collections of Setter and TriggerBase.
  • Registered StyleProperty as a core dependency property on UIElement.
  • Intercepted StyleProperty changes to automatically extract, evaluate, and apply direct style setters.
  • Refactored DependencyObject state management to include discrete _styleValues and _styleTriggerValues dictionaries alongside existing local and template trigger values.
  • Rewrote GetValue, SetValue, and override tracking mechanics to accurately resolve properties based on strict WPF hierarchical precedence rules.
  • Avoided ThreadStatic traps during recursive layout evaluation to ensure deterministic thread safety.

πŸ“Š Functional Impact: The framework now fully supports standard WPF-isomorphic style application, visual state modification, and accurate dependency property value resolution, significantly closing the gap for declarative XAML scenarios.

πŸ”¬ Verification Protocol:

  1. Instantiate a component (e.g. Control).
  2. Apply a Style containing a Setter and a Trigger.
  3. Verify that the Style setter value correctly reflects in the property getter.
  4. Manually set a local override and confirm the local value masks the style value.
  5. Mutate the property governed by the Trigger, verify the active trigger supersedes the style setter, and ensure clearing the trigger correctly falls back to either the local override (if set) or the base style setter. All behaviors are validated in StyleTests.cs.

PR created automatically by Jules for task 18247157550888493731 started by @tedd

- Implements `Style` class containing Setters and Triggers.
- Registers `StyleProperty` on `UIElement` and handles property changes.
- Refactors `DependencyObject` property evaluation logic to respect strict XAML value precedence: Local > Template Trigger > Style Trigger > Style Setter > Inherited > Default.
- Ensures concurrent thread safety without using ThreadStatic in recursive event paths.
- Adds `StyleTests` validation covering local vs trigger vs style overrides.

Co-authored-by: tedd <493224+tedd@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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