Adding a block list item with only a single option available still opens the catalog. Is this intended?

When I create a new block list data type with “inline mode” turned off, and I click the “Add …” button, it still brings up the catalog to select which type of block even though there is only one available. Here’s an image after creating a fresh install and adding a couple properties:

I narrowed the issue to here in src/Umbraco.Web.UI.Client/src/packages/block/block-list/context/block-list-entries.context.ts

    getPathForCreateBlock(index: number) {
		const pathBuilder = this._catalogueRouteBuilderState.getValue();
		if (!pathBuilder) return undefined;

		if (!this._manager) return undefined;
		const blockTypes = this._manager.getBlockTypes();
		if (blockTypes.length === 1) {
			if (this._manager.getInlineEditingMode()) {
				return undefined;
			}
		}

		return pathBuilder?.({ view: 'create', index: index });
	}

Why does it skip creating the path only for the inline editing mode? I would think if there is only one option it should just skip that screen for both options. Is this intentional or a bug?

I am constrained to not using inline mode because of a separate issue: Newly added block renders empty until collapse/expand in nested block list · Issue #22444 · umbraco/Umbraco-CMS · GitHub

Hi @gsapp-mar

Welcome to the forum!

It looks intentional rather than a bug, but I’d agree it’s a bit odd.

That single-block shortcut only fires when inline editing is on. The catch is that in default mode the create route is also what opens the editing overlay - so if it returned undefined there like it does for inline, you’d add the block but nothing would open, and you’d be stuck with a second click to edit it.

Inline mode doesn’t have that problem because editing happens in place, so there’s nothing to open and skipping straight to insert is fine.

The button does at least change to “Add {block name}” with a single type, but you still get that pointless catalogue screen. Annoying, agreed.

Might be worth raising separately - feels like the shortcut could work in default mode too if it just opened the overlay for the one block automatically.

Justin