(rsg) Implemented ProgressDialog node#899
Conversation
|
There was a problem hiding this comment.
Pull request overview
This pull request implements the ProgressDialog SceneGraph node, which displays a simple dialog with a title and an animated busy spinner to indicate loading or progress states. The implementation extends the Dialog base class and integrates a BusySpinner component, following the established patterns for SceneGraph dialog nodes.
Changes:
- Implemented ProgressDialog node class that extends Dialog with a BusySpinner
- Registered ProgressDialog in NodeFactory and updated exports
- Updated documentation to reflect the new node implementation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/extensions/scenegraph/nodes/ProgressDialog.ts | New ProgressDialog class implementation with BusySpinner integration, resolution-aware sizing, and element positioning |
| src/extensions/scenegraph/nodes/index.ts | Added ProgressDialog export and removed "Not yet implemented" comment from enum |
| src/extensions/scenegraph/factory/NodeFactory.ts | Registered ProgressDialog in the node factory for instantiation |
| docs/limitations.md | Updated documentation to include ProgressDialog in the list of implemented dialog nodes |
Comments suppressed due to low confidence (2)
src/extensions/scenegraph/nodes/ProgressDialog.ts:78
- The updateChildren method is missing several field copy operations that are present in similar dialog implementations. Comparing with PinDialog.updateChildren() (lines 183-193), this method should also copy message-related and icon-related fields for consistency, even though these elements are hidden by default. This ensures that if a developer sets these fields after construction, they will be properly processed. Add the following field copy operations after line 67:
- copyField for icon uri (similar to PinDialog line 174)
- copyField for message text, color, and font (similar to PinDialog lines 183, 192-193)
This maintains consistency with other Dialog subclasses and ensures proper field synchronization.
const width = this.getValueJS("width") as number;
if (width) {
this.background.setValue("width", new Float(width));
this.width = width;
}
this.copyField(this.background, "uri", "backgroundUri");
this.copyField(this.title, "text", "title");
this.copyField(this.title, "color", "titleColor");
this.copyField(this.title, "font", "titleFont");
this.copyField(this.divider, "uri", "dividerUri");
// Set dialog height and reposition elements
const newY = (this.sceneRect.height - this.height) / 2;
const offsetY = newY - this.dialogTrans[1];
this.dialogTrans[1] = newY;
this.background.setTranslation(this.dialogTrans);
this.background.setValue("height", new Float(this.height));
this.title.setTranslationOffset(0, offsetY);
this.divider.setTranslationOffset(0, offsetY);
this.spinner.setTranslationOffset(0, offsetY);
}
}
src/extensions/scenegraph/nodes/ProgressDialog.ts:78
- The updateChildren method doesn't handle the buttons field, unlike other Dialog subclasses (see PinDialog lines 204-212, Dialog lines 249-257). While ProgressDialog typically doesn't show buttons, since it extends Dialog which exposes button-related fields (buttons, buttonGroup, etc.), the updateChildren method should handle these fields for consistency. If buttons are intentionally not supported, consider either:
- Adding button handling logic similar to PinDialog/Dialog for consistency with the base class
- Or document that buttons are not supported for ProgressDialog
This ensures the dialog behaves predictably if a developer attempts to set the buttons field.
const width = this.getValueJS("width") as number;
if (width) {
this.background.setValue("width", new Float(width));
this.width = width;
}
this.copyField(this.background, "uri", "backgroundUri");
this.copyField(this.title, "text", "title");
this.copyField(this.title, "color", "titleColor");
this.copyField(this.title, "font", "titleFont");
this.copyField(this.divider, "uri", "dividerUri");
// Set dialog height and reposition elements
const newY = (this.sceneRect.height - this.height) / 2;
const offsetY = newY - this.dialogTrans[1];
this.dialogTrans[1] = newY;
this.background.setTranslation(this.dialogTrans);
this.background.setValue("height", new Float(this.height));
this.title.setTranslationOffset(0, offsetY);
this.divider.setTranslationOffset(0, offsetY);
this.spinner.setTranslationOffset(0, offsetY);
}
}



No description provided.