Skip to content

Variant workspace breadcrumb item parentheses #19599

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

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 Copilot AI review requested due to automatic review settings June 23, 2025 15:09
Copy link
Contributor

@Copilot 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)';

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.

1 participant