Skip to content

Re-subscribe theme updates on attach for symmetric lifecycle#71

Open
VPDPersonal wants to merge 1 commit into
feature/serialize-reference-dropdownfrom
fix/theme-stylesheet-attach-detach-symmetry
Open

Re-subscribe theme updates on attach for symmetric lifecycle#71
VPDPersonal wants to merge 1 commit into
feature/serialize-reference-dropdownfrom
fix/theme-stylesheet-attach-detach-symmetry

Conversation

@VPDPersonal

Copy link
Copy Markdown
Owner

Summary

  • Make AddAspidThemeStyleSheets subscribe to AspidThemeSettings.Changed on AttachToPanelEvent (re-applying the current override there) instead of once at build time, and unsubscribe on DetachFromPanelEvent.
  • Fixes live theme updates breaking after any detach -> reattach (Inspector foldout collapse/expand, ListView row recycling) and the static-event leak for elements that are built but never attached.

Notes for review

  • Re-applying the override inside OnThemeChanged on attach is idempotent: it removes the previously applied sheet (if any) before re-reading and re-adding the current override, so repeated attach/detach cycles do not stack duplicate style sheets.
  • Mirrors the attach/detach-symmetric pattern already used by IdStructUIToolkitPropertyDrawer.

Linked issues

Refs #49 - addresses review finding #49 (comment)

@VPDPersonal VPDPersonal added type: fix Bug fix status: needs-review Ready for review area: editor Editor-only code labels Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: editor Editor-only code status: needs-review Ready for review type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant