Repository navigation
fix(ui): refresh MCP app colors after lazy themes load - #160565
Conversation
Notify theme subscribers after a deferred palette applies even when mascot and hat stay unchanged. Preserve immediate preferences, coalesce synchronous publication, and retain generation and disposal fences. Co-authored-by: vyctorbrzezowski <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 2:19 PM ET / 18:19 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch makes the Control UI notify mounted MCP apps when a lazily loaded theme palette applies and adds five timing and lifecycle regression cases. Merge readiness✅ Ready for maintainer review The bug remains in current main. This focused PR has credible visual proof and no identified blocking defect. The previous draft-status blocker is resolved. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI theme owner reads appearance preferences and applies a palette when its stylesheet is ready. Mounted MCP apps receive the resolved colors through theme notifications and AppBridge context updates. flowchart LR
A[Appearance selection] --> B[Theme owner]
B --> C{Stylesheet ready?}
C -->|No| D[Lazy palette load]
D --> E[Apply palette]
C -->|Yes| E
B --> F[Preference notice]
E --> G[Palette notice]
F --> H[MCP app context]
G --> H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -4, Tests +99. Total +95 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep palette-ready publication in the theme owner so mounted apps receive refreshed computed colors while stale or disposed selections remain ignored. Do we have a high-confidence way to reproduce the issue? Yes. On current main, select an unloaded Tide palette while an MCP app is mounted; the source omits the palette-ready notification when branding stays the same. This review did not execute that flow. Is this the best way to solve the issue? Yes. The change uses the existing theme subscription and AppBridge context path while retaining the generation and disposal guards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3a3ce2be2277. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash auto-merge.
|
Notify theme subscribers after a deferred palette applies even when mascot and hat stay unchanged. Preserve immediate preferences, coalesce synchronous publication, and retain generation and disposal fences. Co-authored-by: vyctorbrzezowski <[email protected]>
What Problem This Solves
Fixes already-open MCP apps keeping the previous palette when a newly selected Control UI theme finishes loading.
User Impact
Embedded apps update their backgrounds, text, borders, and status colors when the selected palette is ready, without requiring a resize or reopening the app.
Why This Change Was Made
Notify theme subscribers after deferred palette application even when the mascot and hat stay unchanged. Immediate preference updates, synchronous notification coalescing, stale-generation/disposal guards, and the existing MCP token adapter are preserved.
Evidence
Actual Control UI components and AppBridge with the canonical mocked Gateway and a synthetic MCP protocol fixture, not an authenticated external MCP server. The first Tide stylesheet response was held and released while the same app remained mounted; no resize occurred.
Before
After
#ffffffafter the host became Tide dark; it now receives dark mode and#161d25. Mounted identities stayed unchanged and resize count remained zero.Requested by @vyctorbrzezowski as part of the Control UI theme-drift audit.
Work sessions