fix(calm-hub-ui): render object property values as JSON in node sidebar#2747
Merged
jpgough-ms merged 1 commit intoJun 25, 2026
Conversation
String(value) on a nested object yields [object Object]; use a PropertyValue component that pretty-prints objects/arrays with JSON.stringify.
aamanrebello
approved these changes
Jun 25, 2026
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.
Description
Fixes #2745. Interface
propertiesfields whose values are nested objects rendered as[object Object]in the visualizer node/interface sidebar becauseString({...})was used to coerce all values to a display string.Introduces a
PropertyValuecomponent that pretty-prints objects and arrays as indented JSON in a<pre>block, while preserving existingString()behaviour for primitives andnull.Type of Change
Affected Components
calm-hub-ui/)Commit Message Format ✅
fix(calm-hub-ui): render object property values as JSON in node sidebarTesting
Regression tests added to
detail-components.test.tsx:PropertiesSection— nested object renders as JSON (not[object Object])PropertiesSection— array value renders as JSONPropertiesSection—nullvalue still renders as"null"InterfacesSection— exactrate-limitshape from the issue renders as JSONChecklist
Code review notes
Two findings from pre-PR review worth tracking:
JSON.stringifyhas no try/catch — circular refs would crash the sidebar; CALM data from the REST API is always JSON-safe but a defensive guard could be added as follow-up.<pre>blocks in theflex justify-betweeninterface card rows will expand the row height for object values — intentional given the chosen pretty-print style, but worth a visual check on narrow viewports.