[Versions] Add the Properties section (#3627) - #3912
Conversation
Show versioned data-object properties in the Versions view (single and comparison), following the approach from PR #2822: - Add a `properties` section synthesized in getPropertiesData, ordered after system data. Text -> input, bool -> checkbox rendered through the existing DataComponent; element references (asset/document/object) keep their type and render as a clickable manyToOneRelation-style element tag inside a read-only input via the new PropertyElementLink component. - Properties participate in version comparison/diff highlighting for free via the existing isEqual-based pipeline. - Introduce a shared PropertyType enum (and ELEMENT_REFERENCE_PROPERTY_TYPES) in the properties tab constants, used by the properties type select and the version view instead of duplicated magic strings. - Add the version.category.title.properties translation key. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add version.category.title.properties for de, es, fr, it, no and sv. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Verdict: Needs changes. Adds versioned data-object properties to single and comparison views.
Changes:
- Synthesizes a Properties version section with type-specific rendering.
- Adds read-only element-reference links and shared property types.
- Localizes the new section across supported locales.
Assessment:
- Both single and comparison views use the updated formatter (
details-functions.ts:98-121). - Changes are additive and located in the owning version/property modules.
- Three correctness issues remain: translated custom keys, duplicate inherited/own keys being collapsed, and incomplete metadata diffing.
- No regression tests were added for the formatting or rendering behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
translations/studio.sv.yaml |
Adds Swedish title. |
translations/studio.no.yaml |
Adds Norwegian title. |
translations/studio.it.yaml |
Adds Italian title. |
translations/studio.fr.yaml |
Adds French title. |
translations/studio.es.yaml |
Adds Spanish title. |
translations/studio.en.yaml |
Adds English title. |
translations/studio.de.yaml |
Adds German title. |
properties-container.tsx |
Uses shared property types. |
property-types.ts |
Defines property type constants. |
details-functions.ts |
Adds properties to version data. |
property-element-link.tsx |
Renders element-reference properties. |
object-versions-fields-view.tsx |
Displays the Properties section. |
versionConstants.ts |
Adds the Properties category. |
Own and inherited properties that share a key no longer collapse into a single row: getUniqFieldKey now folds ownership into the field identity, so neither entry is dropped when the entries are keyed into a Map. Property change detection compares the versioned attributes (type, inheritable, inherited, config, description) via a dedicated comparisonValue instead of only the data value, so attribute-only changes are detected. The shared version-data hook prefers this precomputed isModifiedValue flag; assets keep the rendered-value fallback. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
assets/js/src/core/modules/data-object/editor/shared-tab-manager/tabs/versions/components/object-versions-fields-view/object-versions-fields-view.tsx:70
- Custom property keys must be shown literally. Calling
t(key)means a valid key such asopenornameis replaced by the locale's UI translation, so the version view no longer identifies the actual property. Keep translation for class-field titles, but bypass it for the Properties breadcrumb.
const isSystemDataField = breadcrumbKey === VersionCategoryName.SYSTEM_DATA
const textValue = isSystemDataField ? t(`version.${key}`) : t(key)
assets/js/src/core/modules/data-object/editor/shared-tab-manager/tabs/versions/details-functions.ts:110
- A property's type can differ between the compared snapshots (for example, after deleting and recreating the same key). Although the type is compared, the table row retains only the main version's
fieldData, so both values are rendered with this onefieldtype; an asset-to-text change can therefore render the text side as an empty element link, and the inverse renders the relation object as text. Preserve the field type per version and select it while rendering each version value.
} else if (ELEMENT_REFERENCE_PROPERTY_TYPES.includes(property.type)) {
fieldtype = property.type
When a property row differs in comparison mode, show a tooltip icon next to its name listing the non-value attributes that changed (type, inheritable, config, description, ...). The attribute list is derived dynamically from comparisonValue, so a difference caused by an attribute rather than the rendered value is explained instead of looking like an unexplained highlight. Adds the version.changed-attributes translation key to all locales. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|



What
Adds a Properties section to the Data Object Versions view (single and comparison), so versioned object properties are visible and diffable.
Closes #3627. Follow-up to #2822 and follows its approach.
How
getPropertiesDatasynthesizes apropertiessection (ordered after System Data).text→input,bool→checkboxrender through the existingDataComponent; element references (asset/document/object) render as a clickable manyToOneRelation-style element tag inside a read-only input via the newPropertyElementLinkcomponent.isEqual-based pipeline.PropertyTypeenum (+ELEMENT_REFERENCE_PROPERTY_TYPES) in the properties tab constants, used by the properties type select and the version view instead of duplicated magic strings.version.category.title.propertiestranslation key for all locales (en, de, es, fr, it, no, sv).Scope
Data objects only —
AssetVersion/DocumentVersiondon't exposepropertiesover the API, so assets/documents are out of scope here (would require a backend change).Testing
tsc --noEmit: clean🤖 Generated with Claude Code