You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(Diff display): Segment rules diff showing up as [Object object] - #8910
In this PR, we remove the if (E2E) branch from DiffString, add an assertDiffString test helper, and fix the [object Object] segment rules diff display.
How did you test this code?
Ran segment-test.pw.ts and versioning-tests.pw.ts locally.
DiffString rendered raw `old-value`/`new-value` divs when E2E was set,
so Playwright never exercised the diff users actually see.
Always render the real diff inside a `diff-string` wrapper, and have
`compareVersion` assert against the diff's removed and added lines.
Audit log diff values now support arrays and objects. The sanitiser formats object values as indented JSON. DiffString compares and renders sanitised values. End-to-end helpers check diff rows, and a segment test verifies that an updated rule displays 19 rather than [object Object].
The structured audit display change has no established production blocker. The comparison helper needs follow-up for structured and multiline inputs; stronger segment and tab-visibility assertions would improve regression protection.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
khvn26
changed the title
refactor(Diff): Render the real diff in DiffString under E2E
fix(Diff display): Segment rules diff showing up as [Object object]
Nov 9, 2026
DiffString turned values into strings with a template literal, so JSON
fields like segment `rules_data` became `[object Object]` on both
sides of the diff, which then collapsed as unchanged.
Format arrays and objects as indented JSON via
`Utils.sanitiseDiffString`, which DiffString now uses instead of its
own copy, and compare the formatted text.
Contributes to #8867
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: bde222ee-7a55-48a5-a8bf-aa4de1fbbfda
Commits
Reviewing files that changed from the base of the PR and between b72d4d9 and a01d57d.
Files selected for processing: 3
frontend/e2e/helpers/e2e-helpers.playwright.ts
frontend/e2e/tests/segment-test.pw.ts
frontend/web/components/diff/DiffString.tsx
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
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
fixfront-endIssue related to the React Front End Dashboard
3 participants
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.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Contributes to #8867
In this PR, we remove the
if (E2E)branch fromDiffString, add anassertDiffStringtest helper, and fix the[object Object]segment rules diff display.How did you test this code?
Ran
segment-test.pw.tsandversioning-tests.pw.tslocally.