Skip to content

Conversation

@seregamorph
Copy link
Contributor

Default visual representation of MergedContextConfiguration fields is not pretty friendly for visual comparison (which is assumed by the tool itself). This change suggests simple prototype how this can be implemented by using:

  • ordering for elements that are compared as Set collection
  • pretty formatting of collections
  • using <pre> tag in the HTML

Sample new representation (pay attention to contextCustomizers field value):
Screenshot 2025-07-20 at 18 20 45

Now this can be easily compared in text editor:
Screenshot 2025-07-20 at 18 21 37

Note that using <pre> also has disadvantages for long toString representations

@seregamorph seregamorph marked this pull request as draft July 20, 2025 16:24
@rieckpil
Copy link
Contributor

thanks a lot for the PR @seregamorph 😌 Do you plan to add more code to the PR (I can see it's a draft) - happy to merge it!

My current plan is to also add a visual comparison feature in report with some JS help where one can compare context X with Y.

@seregamorph
Copy link
Contributor Author

Yep, I just wanted to align with you, if this is a right direction to move. Will try to finish this soon then.

@rieckpil
Copy link
Contributor

rieckpil commented Jul 22, 2025

Yes, please go ahead 👍

@seregamorph
Copy link
Contributor Author

I will get back to this soon (sorry, had to switch focus on another activities)

@rieckpil
Copy link
Contributor

rieckpil commented Aug 8, 2025

(there's no rush)

@seregamorph seregamorph changed the title Preformatted ordered values to simplify comparison [PoC] Preformatted ordered values to simplify comparison Aug 10, 2025
@seregamorph
Copy link
Contributor Author

Please take a look. Please pay attention there is a toString conversion which may look verbose, but actually may be pretty helpful for the sake of visual comparison:
Screenshot 2025-08-10 at 21 53 32

BTW properties are not listed, only their count - this also may be confusing for UI user while comparing two context configurations

@sonarqubecloud
Copy link

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.

2 participants