Fix snapshot diff viewer highlights and diff panel#7081
Fix snapshot diff viewer highlights and diff panel#7081
Conversation
…panel - Use persistentHighlight and clearHighlight() from flow-renderer so highlights persist until the user navigates and stale glows are cleared - Use allChanges option so all changed nodes get highlight() entries - Skip highlighting for config nodes (no canvas presence); show "Global Config" / "Flow Config" badge in navigation bar - Detect config nodes by absence of x/y coordinates - Ignore w/h in computeDiff (computed by Node-RED, not user data) - Add "Simple view" toggle to hide position (x, y) changes - Add word wrap and Prettify/Raw toggles in the diff panel - Resolve group (g) property to display name; capitalize labels - Add g to compact props set Closes #7062
d40cb37 to
eaa9a9e
Compare
IGNORED_PROPS was only applied in computeDiff for changed nodes but not when expanding all properties for added/deleted nodes in the grouped changes view.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7081 +/- ##
=======================================
Coverage 76.29% 76.29%
=======================================
Files 405 405
Lines 20348 20348
Branches 4895 4895
=======================================
Hits 15525 15525
Misses 4823 4823
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Steve-Mcl
left a comment
There was a problem hiding this comment.
couple of minor points
Steve-Mcl
left a comment
There was a problem hiding this comment.
actually add the review items this time :doh:
| const v1 = this.stringify(this.value1) | ||
| const v2 = this.stringify(this.value2) | ||
| looksLikeJson (v) { | ||
| if (typeof v === 'string' && v.length > 2) { |
There was a problem hiding this comment.
[] is 2 characters. {} is 2 characters. Both are valid JSON.
| looksLikeJson (v) { | ||
| if (typeof v === 'string' && v.length > 2) { | ||
| const c = v[0] | ||
| return c === '{' || c === '[' |
There was a problem hiding this comment.
This would fail if spaces are present. Also, I would test if the last character matches the opposite bracket.
| return false | ||
| }, | ||
| tryPrettify (v) { | ||
| if (typeof v === 'string' && v.length > 2 && (v[0] === '{' || v[0] === '[')) { |
There was a problem hiding this comment.
Why repeat code & not use the looksLikeJson function?
Summary
persistentHighlightandclearHighlight()from flow-renderer so highlights persist until navigation and stale glows are clearedallChangesoption so all changed nodes gethighlight()entriesx/ycoordinates — works for all node packagesw/hincomputeDiff(computed by Node-RED at render time)g) property to display name; capitalize labelsDepends on FlowFuse/flow-renderer#94
Closes #7062
Test plan