-
-
Notifications
You must be signed in to change notification settings - Fork 82
feat: add loading and error widget support for StacNetworkWidget #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Add optional loadingWidget and errorWidget fields to StacNetworkWidget to allow custom widgets to be displayed during network request states. - Add loadingWidget and errorWidget as optional StacWidget? fields - Update StacNetworkWidgetParser to parse and pass widgets to Stac.fromNetwork - Update documentation with examples showing loading and error states
WalkthroughThe PR adds optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| return Stac.fromNetwork( | ||
| context: context, | ||
| request: model.request, | ||
| loadingWidget: model.loadingWidget != null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have some default loading widget
Description
This PR adds support for custom loading and error widgets in the
StacNetworkWidget. Users can now provide optionalloadingWidgetanderrorWidgetproperties that will be displayed during the network request lifecycle.Changes:
loadingWidgetanderrorWidgetas optionalStacWidget?fields toStacNetworkWidgetStacNetworkWidgetParserto parse these widgets and pass them toStac.fromNetworkas builder functionsExample Usage:
{ "type": "networkWidget", "request": { "actionType": "networkRequest", "url": "https://example.com/data", "method": "get" }, "loadingWidget": { "type": "center", "child": { "type": "circularProgressIndicator" } }, "errorWidget": { "type": "center", "child": { "type": "text", "data": "Failed to load" } } }Related Issues
Closes #243
Type of Change
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.