Introduce Variant Context#19334
Merged
nielslyngsoe merged 13 commits intorelease/16.0from May 16, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a standalone variant context to support upcoming culture‐aware search features in document and media pickers by decoupling variant logic from the language module.
- Integrates variant context updates in the app language context.
- Refactors the document item data resolver to consume variant context and perform async updates for variant aware values.
- Introduces new variant context files and updates existing property dataset contexts to utilize variant context.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/packages/language/global-contexts/app-language.context.ts | Updates to incorporate variant context updates when language changes. |
| src/packages/documents/documents/item/document-item-data-resolver.ts | Refactors resolver to use an async pattern for updating variant aware values via the new variant context. |
| src/packages/core/workspace/workspace-property-dataset/invariant-workspace-property-dataset-context.ts | Updates to initialize the variant context and set the variant id. |
| src/packages/core/variant/* | New context, token, and constant files to support variant functionality. |
| src/packages/core/property/property-dataset/property-dataset-base-context.ts | Integrates variant context usage during variant id initialization. |
| src/packages/content/content/property-dataset-context/element-property-dataset.context.ts | Incorporates variant context when setting the variant id for element property datasets. |
nielslyngsoe
approved these changes
May 16, 2025
|
This pull request has been mentioned on Umbraco community forum. There might be relevant details there: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PR introduces a
UMB_VARIANT_CONTEXT, laying the groundwork for another PR to add culture-aware search to document/media pickers.I have chosen a solution for the context that is as standalone as possible. I wanted to avoid having any dependencies from the variant module to the language module, as that would introduce an illegal import. I believe this is the most flexible solution.
This PR currently utilizes the new context within the
UmbDocumentItemDataResolverclass, which is responsible for displaying the correct document name/state, etc., in the tree, pickers, and other places that reference a document.How to test: