Skip to content

Conversation

@nielslyngsoe
Copy link
Member

@nielslyngsoe nielslyngsoe commented Nov 7, 2025

The Fix I(Niels) did here is not the right solution #20759

The `name` observer, the result of the method, should get the name of the first active variant. Making it reactive to the active variant, meaning variant-ID cannot be resolved in the method, but as part of the observable.

As well getName, should get the active (most left) variant and gives the name of that.

There might be an architectural challenge in this as the awareness of active variants is located in the Split View Context. — Please avoid spaghetti relations between these, maybe it not posible to make it happen without a mess, then we should back out and look for other sensible solutions.

Copilot AI review requested due to automatic review settings November 7, 2025 14:04
@nielslyngsoe nielslyngsoe enabled auto-merge (squash) November 7, 2025 14:05
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 improves the name() method in the content detail workspace context by adding a consistent fallback behavior for when no variant ID is provided.

  • The name() method now defaults to the invariant variant when no variantId is specified, aligning it with the behavior of setName() and setPropertyValue() methods
  • Removes optional chaining on variantId.compare() since the variable is now guaranteed to be defined

@nielslyngsoe nielslyngsoe marked this pull request as draft November 10, 2025 12:02
auto-merge was automatically disabled November 10, 2025 12:02

Pull request was converted to draft

@nielslyngsoe nielslyngsoe added state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks and removed state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks labels Nov 10, 2025
@azure-devops-sync azure-devops-sync bot changed the title Content Workspace: if name method is given no variant-id it should fallback to invariant Continue work of this PR Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/sprint-candidate We're trying to get this in a sprint at HQ in the next few weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants