Skip to content

Fix panel interaction-state border restoration - #1502

Open
PaperHammer (PaperHammer) wants to merge 1 commit into
microsoft:mainfrom
PaperHammer:fix/panel-border-state-restoration
Open

PaperHammer (PaperHammer) wants to merge 1 commit into
microsoft:mainfrom
PaperHammer:fix/panel-border-state-restoration

Conversation

@PaperHammer

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1474, which added panel border modifier support and interaction-state border restoration.

This fixes two remaining cases on Grid, StackPanel, and RelativePanel:

  • When the normal border brush is null, hover-out leaves the hover brush visible instead of restoring the original transparent appearance.
  • When the normal border brush changes on the same mounted panel while the pointer is outside it, the next hover-out restores the old brush instead of the updated one.

Changes

  • Capture the current normal border brush immediately before applying an interaction border override.
  • Restore the saved brush on exit, including null local values.
  • Clear the temporary local value when the normal brush was originally unset.
  • Extend the existing panel border selftest to cover both cases across all three panel types.

The regression tests verify that updates reuse the same native control, the hover brush is applied, and hover-out restores the expected normal brush. The null-brush case also checks that the temporary local value is released.

Validation

  • Against unmodified main at 4cd639795f7974af2018c99797d79d6c93edbd56, the regression assertions fail in 9 places across the three panel types.
  • With this fix, all corresponding regression assertions pass.
  • All 31 related selftest fixtures pass:
    • Panel border fixture: 1
    • Interaction-state fixtures: 6
    • Existing panel border fixtures: 3
    • Animation combination fixtures: 21
  • Release selftest-host build passes with 0 warnings and 0 errors.
  • git diff --check passes.

Tests run against real WinUI controls and use the existing internal hook to drive hover transitions without synthesizing pointer input.

Scope

No public API changes. Updating normal properties during an active hover, interaction-configuration removal cleanup, and animation cleanup are deferred to separate follow-up work.

This branch has not been deployed

No deployments
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