Skip to content

feat(vue-vuetify): improve mixed and additional property editors - #2610

Open
kchobantonov wants to merge 4 commits into
eclipsesource:masterfrom
kchobantonov:feat/vue-vuetify-mixed-additional-properties
Open

feat(vue-vuetify): improve mixed and additional property editors#2610
kchobantonov wants to merge 4 commits into
eclipsesource:masterfrom
kchobantonov:feat/vue-vuetify-mixed-additional-properties

Conversation

@kchobantonov

Copy link
Copy Markdown
Contributor

Summary

This PR improves the Vue Vuetify handling of mixed-type and dynamic additional properties.

It adds a tree-based editor for object and array values while keeping primitive values editable through the existing mixed renderer. The implementation is scoped to the Vue Vuetify package.

Changes

  • Add a split-pane tree/detail view for mixed object and array values.
  • Support navigating, renaming, and deleting dynamic additional properties from the tree.
  • Use the same property-name validation for renaming through:
    • the Additional Properties component
    • the mixed-renderer tree
  • Validate renamed properties against:
    • existing property names
    • propertyNames
    • applicable patternProperties
  • Preserve the property value and its type when renaming.
  • Correctly update mixed renderers when an additional property’s value type changes.
  • Avoid mutating the provided JSON Schema while preparing renderer schemas.
  • Support property names containing brackets while rejecting dots, which are JSON Forms path separators.
  • Add translated labels, tooltips, accessibility labels, generated array-item labels, and validation errors.
  • Add splitpanes to the Vue Vuetify peer and development dependencies.

Validation

  • Added tests for dynamic property-name validation and translation handling.
  • Added coverage for additional-property value type changes.

@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit 0cab8c1
🔍 Latest deploy log https://app.netlify.com/projects/jsonforms-examples/deploys/6a823ac95bde7a00092d4394
😎 Deploy Preview https://deploy-preview-2610--jsonforms-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kchobantonov

Copy link
Copy Markdown
Contributor Author

@sdirix please review

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 84.286%. remained the same — kchobantonov:feat/vue-vuetify-mixed-additional-properties into eclipsesource:master

@EclipseSourceAI EclipseSourceAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Autonomous AI review.

This review was done by an AI agent and therefore may contain mistakes. Feel free to ignore any comment you disagree with. Noting why helps, since replies are read and taken into account in follow-up reviews.

Resolving all AI comments does not lead to an automatic approval. A maintainer still needs to review and sign off on the overall architecture and design.

To get an updated review after pushing changes, a maintainer may re-request a review from this account.

Running in Eclipse Enclave, submitted via review-guard-mcp

Reworks mixed-type and dynamic additionalProperties editing in @jsonforms/vue-vuetify: object/array mixed values now get a splitpanes tree + detail editor, nested mixed controls navigate into that tree instead of nesting renderers, and property renaming is added both in the tree and in the Additional Properties editor.

The extraction of src/util/dynamicProperties.ts is the strongest part: findPropertySchema and getPropertyNameSchema come straight out of AdditionalProperties.vue and are now shared by both rename paths, with unit tests. The non-mutating schema preparation in createMixedRenderInfos and replacing the JSON.stringify descriptor-rebuild check with haveAdditionalPropertyNamesChanged are both real fixes.

Where to focus:

  • getPathAncestorNodeIds in MixedRenderer.vue mixes up absolute and relative paths, so "reveal in tree" never expands ancestors when the mixed control's own path is non-empty (the normal additionalProperties case). Reproduced in the running example app on both the Additional Properties and Mixed Object examples.
  • Making splitpanes a required peer dependency plus re-implementing its base CSS in VSplitpanes.sass is a packaging decision that deserves an explicit call.
  • MixedRenderer.vue is now ~1600 lines; the pure tree-building layer would be better off in src/util where it can be tested.

pnpm test, pnpm lint, pnpm type-check and the full pnpm build all pass on the merged branch, and the CSS output includes the splitpanes rules.

Comment thread packages/vue-vuetify/src/complex/MixedRenderer.vue
Comment thread packages/vue-vuetify/src/complex/components/AdditionalProperties.vue Outdated
Comment thread packages/vue-vuetify/src/complex/MixedRenderer.vue
Comment thread packages/vue-vuetify/package.json
Comment on lines +19 to +22
parentPath: string,
propertyName: string,
): string => (parentPath ? `${parentPath}.${propertyName}` : propertyName);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always dot-joining is right for core's current path handling, since resolveData and setDataAt split purely on . (setData.ts#L31), whereas core's compose drops the separator when the segment starts with [ (path.ts#L29). The downside is that a [foo] property created here won't resolve in material/vanilla/angular, which all still use composePaths. Fixing compose in core would make bracket support work everywhere instead of just this renderer set.

Comment thread packages/vue-vuetify/src/complex/MixedRenderer.vue Outdated
Comment thread packages/vue-vuetify/src/complex/MixedRenderer.vue Outdated
Comment thread packages/vue-vuetify/src/complex/MixedRenderer.vue Outdated
Comment on lines +1129 to +1143
const treeNodes = computed(() =>
showTreeView.value
? buildTreeFromData(
input.control.value.data,
resolvedSchema.value ?? input.control.value.schema,
input.control.value.rootSchema,
input.control.value.path,
vuetifyControl.computedLabel.value,
input.control.value.enabled,
input.control.value.readonly,
showPrimitivesInTree.value,
mixedTranslations.itemLabel,
)
: [],
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

treeNodes depends on control.data, so every keystroke in the detail pane rebuilds the whole tree and each node runs cloneDeep + cleanSchema (twice for arrays, via prepareArraySchema). Fine for the example data, but it could get noticeable on larger objects; caching per node path or keying the rebuild on the data shape rather than the value would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants