Fix dialog rendering in 8 components after Angular 20→21 migration#637
Draft
Fix dialog rendering in 8 components after Angular 20→21 migration#637
Conversation
…tion Agent-Logs-Url: https://github.com/highperformancecoder/minsky/sessions/389c4ed5-35a1-4764-b3b5-4a07521b0e86 Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix change detection in summary component after Angular migration
Fix dialog rendering in 8 components after Angular 20→21 migration
Apr 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After the Angular 20→21 migration, async backend calls in
ngOnInitresolve outside Angular's zone, silently breaking change detection and leaving dialogs blank on first open.Fix pattern
Components fixed
Missing
ChangeDetectorRefentirely — added injection +detectChanges()call:summary.component.ts— end of asyncngOnInitnew-pub-tab.component.ts— after asyncsetValueinngOnInitpen-styles.component.ts— end of async IIFE inngOnInitdimensions.component.ts— end of async IIFE inngOnInit(insideisElectronguard)edit-user-function.component.ts— end ofupdateFormValues()cli-input.component.ts— end of asyncngOnInitAlready had
ChangeDetectorRefbut never calleddetectChanges()— added call only:connect-database.component.tsravel-select-horizontal-dim.component.tsOriginal prompt
Problem
After the Angular 20→21 migration in the develop branch, several dialogs are not rendering properly because async backend calls in
ngOnInitresolve outside Angular's zone, preventing change detection from updating the UI.Two examples have already been fixed:
The fix pattern is:
ChangeDetectorReffrom@angular/coreprivate cdRef: ChangeDetectorRefthis.cdRef.detectChanges()after async backend calls complete inngOnInitComponents to Fix
Apply the same fix to the following components that have
ngOnInitwith async backend calls but don't properly trigger change detection:Components missing ChangeDetectorRef entirely:
gui-js/libs/ui-components/src/lib/summary/summary.component.tsdetectChanges()at the end ofngOnInitgui-js/libs/ui-components/src/lib/new-pub-tab/new-pub-tab.component.tspubTab.name()detectChanges()at the end of the async block inngOnInitgui-js/libs/ui-components/src/lib/pen-styles/pen-styles.component.tsdetectChanges()at the end of the async block inngOnInitgui-js/libs/menu/src/lib/edit/dimensions/dimensions.component.tsdetectChanges()at the end of the async block inngOnInitgui-js/libs/ui-components/src/lib/edit-user-function/edit-user-function.component.tsdetectChanges()at the end ofupdateFormValues()gui-js/libs/ui-components/src/lib/cli-input/cli-input.component.tsdetectChanges()at the end ofngOnInitComponents with ChangeDetectorRef but not calling detectChanges():
gui-js/libs/ui-components/src/lib/connect-database/connect-database.component.tsthis.cdRef.detectChanges()call at the end ofngOnInitgui-js/libs/ui-components/src/lib/ravel-select-horizontal-dim/ravel-select-horizontal-dim.component.tsthis.cdRef.detectChanges()call at the end ofngOnInitExample Fix Pattern
Based on the existing fixes in commits 0296c3a and aa6b5f5:
Testing
After applying the fixes, test each dialog to ensure:
Additional Notes
gui-jsthat need the same fixgui-jsthat implementOnInitand make async callsThe following is the prior conversation context from the user's chat exploration (may be truncated):
User: In the develop branch, which features Angular 20->21 migration, some of the dialogs are not rendering. Two examples have been found - the about box, and the pick-slices dialog. The solution is to inject the ChangeDetectorRef object as seen in commits aa6b5f5 and 0296c3a.
Please audit the code base under gui-js for any other dialogs that might have the same problem.
Assistant: I'll help you audit the codebase for other dialogs that might have the same rendering issue after the Angular 20->21 migration. Let me first examine the commits you mentioned to understand the fix pattern, then search for similar dialogs that may need the same solution.
Assistant: Now I understand the pattern. Both com...
This pull request was created from Copilot chat.
This change is