Skip to content

Conversation

@leekelleher
Copy link
Member

Description

Reworks the parentheses usage for the breadcrumb items on a variant (document) workspace.

It was previously if you were on a variant document, the breadcrumbs would wrap each invariant ancestor name with parentheses, including the document-root.

The parentheses will be added to unnamed variant ancestor items.
(for semantics)
Saves on the string allocation.
Copilot AI review requested due to automatic review settings June 23, 2025 15:09
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 reworks the breadcrumb item naming and URL logic for variant workspaces so that only invariant ancestors are wrapped in parentheses.

  • Updated import organization and type separation for better clarity.
  • Refactored the logic for determining the variant name and breadcrumb URL construction.
  • Added the "last-item" attribute to the final breadcrumb item for improved UI indication.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-breadcrumb/workspace-variant-menu-breadcrumb/workspace-variant-menu-breadcrumb.element.ts Refactored variant name resolution and URL generation for variant breadcrumbs.
src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-breadcrumb/workspace-menu-breadcrumb/workspace-menu-breadcrumb.element.ts Simplified URL generation for menu breadcrumbs and added final item designation.
Comments suppressed due to low confidence (2)

src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-breadcrumb/workspace-variant-menu-breadcrumb/workspace-variant-menu-breadcrumb.element.ts:100

  • [nitpick] The parameter name 'variantId' might be misleading since it represents a variant object; consider renaming it to 'variant' for improved clarity.
			const variant = structureItem.variants.find((variantId) => this._workspaceActiveVariantId?.compare(variantId));

src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-breadcrumb/workspace-variant-menu-breadcrumb/workspace-variant-menu-breadcrumb.element.ts:113

  • [nitpick] The fallback label '(#general_unknown)' differs from the previous fallback 'Unknown' used earlier; consider unifying the fallback text for consistency.
		return structureItem.variants?.[0]?.name ?? '(#general_unknown)';

@madsrasmussen madsrasmussen added the category/ux User experience label Jun 24, 2025
@madsrasmussen madsrasmussen merged commit 0a7a922 into main Jun 24, 2025
28 checks passed
@madsrasmussen madsrasmussen deleted the v16/bugfix/variant-breadcrumb-parentheses branch June 24, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants