Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

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:

  • Added loading state with <uui-loader> spinner to document and media create modals
  • Loader displays on modal open until API fetch completes
  • Applied consistent pattern to both document-create-options-modal.element.ts and media-create-options-modal.element.ts

Implementation:

@state()
private _loading = true;

async #retrieveAllowedDocumentTypesOf(unique: string | null, parentContentUnique: string | null) {
  const { data } = await this.#documentTypeStructureRepository.requestAllowedChildrenOf(unique, parentContentUnique);
  if (data) {
    this._allowedDocumentTypes = data.items;
  }
  this._loading = false;
}

#renderDocumentTypes() {
  if (this._loading) {
    return html`<div id="loader"><uui-loader></uui-loader></div>`;
  }
  // ... render types or empty state
}

Testing:

  1. Open Content section in Umbraco backoffice
  2. Click Create button on any node
  3. Observe loading spinner displays immediately
  4. Spinner disappears when document types load
  5. Repeat for Media section to verify consistency

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.org
    • Triggering command: curl -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

This section details on the original issue you should resolve

<issue_title>'Create' options no indication it's loading when it's slow</issue_title>
<issue_description>### Which Umbraco version are you using?

16.3.4

Bug summary

The 'Create' menu, which shows a list of all possible content types you can create a node for is sometimes really slow to load. But there is no indication that it's loading.

Specifics

I have a long 'create' menu and sometimes it's a bit slow. Now that is not the issue I'm raising here, because it happends sometimes when the cache hasn't been properly loaded or when I'm in debug mode.

However, there is no feedback that the create menu is loading at all. It just shows the message that there are no allowed document types:

Image

When it's slow, it sometimes takes 10 seconds to load the menu and even I as a developer have wondered a few times if I broke something, only for it suddenly pop up with to the correct options:

Image

I usually tend to forgive small UX things because I know it will get better. However, in this case, it's really bad design. If I got caught out by this a few times, editors definitely will as well.

Steps to reproduce

Expected result / actual result

Ideally, the create menu should never be slow, but when it is (when the cache is not yet loaded, bad network conditions etc), it should at least show a loading message or icon instead of the message that there are no document types that can be created.</issue_description>

<agent_instructions>Add a element, in the modal of src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/document-create-options-modal.element.ts
while awaiting the load of options</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@NguyenThuyLan Same problem in v17.0.0-rc2 @nielslyngsoe We in general have not been good at implementing loaders, this should be farily available to implement and therefor I marked this as up-for-grabs.

Its a good first timer contribution, so if you like to learn how to do things in the new front-end of Umbraco then this is a good specific task to resolve.</comment_new>


💡 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.

Co-authored-by: nielslyngsoe <6791648+nielslyngsoe@users.noreply.github.com>
Copilot AI changed the title [WIP] Add loading indicator for Create menu in Umbraco Add loading indicator to Create menu modals Nov 17, 2025
Copilot AI requested a review from nielslyngsoe November 17, 2025 12:40
Copilot finished work on behalf of nielslyngsoe November 17, 2025 12:40
Copy link
Member

@nielslyngsoe nielslyngsoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, thanks!

@nielslyngsoe nielslyngsoe marked this pull request as ready for review November 17, 2025 12:53
Copilot AI review requested due to automatic review settings November 17, 2025 12:53
@nielslyngsoe nielslyngsoe enabled auto-merge (squash) November 17, 2025 12:53
@nielslyngsoe nielslyngsoe changed the title Add loading indicator to Create menu modals Document Create Modal: Add loading indicator to Create options (fix #20817) Nov 17, 2025
Copilot finished reviewing on behalf of nielslyngsoe November 17, 2025 12:54
Copy link
Contributor

Copilot AI left a 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Create' options no indication it's loading when it's slow

2 participants