-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Document Create Modal: Add loading indicator to Create options (fix #20817) #20857
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: main
Are you sure you want to change the base?
Conversation
Co-authored-by: nielslyngsoe <[email protected]>
nielslyngsoe
left a comment
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.
Well done, thanks!
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.
Pull Request Overview
This PR adds loading indicators to Create menu modals for documents and media to prevent confusion when API responses are slow. Previously, users would see the "no allowed types" error message immediately while data was being fetched, making it difficult to distinguish between loading states and actual permission errors.
Key changes:
- Added
<uui-loader>spinner with loading state management to both document and media create modals - Loader displays until API fetch completes, then shows either allowed types or empty state message
- Consistent implementation pattern across both modal types with centered loader styling
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| document-create-options-modal.element.ts | Added loading state and loader display logic for document create modal |
| media-create-options-modal.element.ts | Added loading state and loader display logic for media create modal |
| document-item-data-resolver.ts | Added JSDoc comments to utility functions |
| split-panel.element.ts | Fixed indentation in #setPosition method |
| icon-picker-modal.element.ts | Reformatted color list mapping for better readability |
| context-provide.decorator.ts | Added JSDoc parameter documentation |
| context-consume.decorator.ts | Added JSDoc parameter documentation |
| array-state.ts | Added JSDoc parameter documentation |
| property-editor-data-source/collection/data/types.ts | Removed unnecessary eslint disable comments |
| Multiple manifest files | Reordered imports (auto-formatting) |
| Multiple element files | Reordered imports (auto-formatting) |
Prerequisites
This fixes the issue where the Create menu shows "no allowed document types" message instead of a loading indicator during slow API responses.
Description
The Create menu modals for documents and media showed the "no allowed types" error message immediately on open while fetching allowed types from the API. During slow responses (cold cache, debug mode, poor network), this confused users who couldn't distinguish between loading state and actual permission errors.
Changes:
<uui-loader>spinner to document and media create modalsdocument-create-options-modal.element.tsandmedia-create-options-modal.element.tsImplementation:
Testing:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
iojs.orgcurl -q --fail --compressed -L -s REDACTED -o -(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.