-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Segments: The experience of working with Segments and Segmented Blocks #20358
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
Segments: The experience of working with Segments and Segmented Blocks #20358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Enhances the variant handling for segmented fields so that matching variants across cultures/segments get variant entries and correct hint/validation badges. Introduces a flat-mapper to traverse nested property values (e.g., blocks) to determine required variant entries.
- Ensures variant entries are created across matching cultures/segments based on entered values.
- Adds a Property Value Flat Mapper with tests and updates manifests to use forEditorAlias for resolvers.
- Improves UI badges and variant selector hints; minor performance tweak in block list editor updates.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Web.UI/Umbraco.Web.UI.sln | Adds a nested solution file for Umbraco.Web.UI. |
| src/Umbraco.Web.UI/Segments.cs | Adds a custom ISegmentService override and composer; returns a paged list of sample segments. |
| workspace-split-view-variant-selector.element.ts | Adds sub-variant hint propagation and renders badges inline; minor refactor with isExpanded. |
| property-value-resolver/types.ts | Extends resolver API type with optional manifest; imports resolver manifest type. |
| property-value-flat-mapper.controller.ts | New controller to flatten/map nested property values via registered resolvers. |
| property-value-flat-mapper.controller.test.ts | Tests for the flat-mapper controller and resolver wiring. |
| property-value-flat-mapper/index.ts | Barrel export for the flat-mapper controller. |
| core/property/index.ts | Exposes the flat-mapper from the property package. |
| badge.element.ts | Adds inline-mode styling; adjusts anchor usage for badge positioning. |
| content-detail-workspace-base.ts | Ensures variants exist across cultures/segments based on inner values; fixes language variant lookup; typing clean-up. |
| content-data-manager.ts | Adds ensureVariantsData to batch-ensure variant scaffold entries. |
| block-list property editor files | Avoids redundant value sets using jsonStringComparison; updates manifests to forEditorAlias. |
| block-grid property editor files | Updates manifests to forEditorAlias. |
Fixes issue where variant inner values of invariant properties(Block Level Variants) does not trigger a Variant-Entry to be made.
As well improves the logic that ensures Variant Entries, so it distributes the knowledge to Variants that matches the values being entered.
This means when editing a Segmented fields (Shared across cultures) then the Matching variant on all Cultures will get a Variant-Entry and appear as something that has data (Not greyed out)
Same for Culture-varying fields, they would match all Segment-Variants on same culture.
As well hint/validation-badges has been updated to work for Segment-Variants: