Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JSON for table values only for objects #2168

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

bobrik
Copy link
Contributor

@bobrik bobrik commented Feb 16, 2024

Without this numbers are treated as json, which styles them with an offset:

image

With this change applied:

image

It's possible that there's a better solution for this.

Which problem is this PR solving?

https://github.com/jaegertracing/jaeger-ui/pull/1724/files#r1491924866

How was this change tested?

Manually tested.

Checklist

@bobrik bobrik requested a review from a team as a code owner February 16, 2024 04:13
@bobrik bobrik requested review from joe-elliott and removed request for a team February 16, 2024 04:13
@bobrik bobrik mentioned this pull request Feb 16, 2024
4 tasks
Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a150319) 96.57% compared to head (fba6b14) 96.57%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2168   +/-   ##
=======================================
  Coverage   96.57%   96.57%           
=======================================
  Files         254      254           
  Lines        7620     7629    +9     
  Branches     1921     1925    +4     
=======================================
+ Hits         7359     7368    +9     
  Misses        261      261           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yurishkuro
Copy link
Member

I actually like that it shows numbers differently

@bobrik
Copy link
Contributor Author

bobrik commented Feb 16, 2024

I can understand the improvement from the numbers having a different color, but a random offset is not something you see in any software showing tables. It just looks broken to me.

@yurishkuro
Copy link
Member

I think the way to fix the offset would be via changing the styling, not the business logic.

@bobrik
Copy link
Contributor Author

bobrik commented Feb 17, 2024

The styling we apply to the table cell is based on the json-markup-child class, which is logically wrong, as the table cell is not a child of any json, because there is no json there to begin with:

image

The margin style is applied to the actual json children to provide the tree structure, so if you drop it, you're left with this:

image

Without my change numbers are nested into json-markup-number, while strings aren't, because they have their own condition branch that rightfully bypasses treating them as json.

@bobrik
Copy link
Contributor Author

bobrik commented Feb 17, 2024

With the latest changes:

image

yurishkuro
yurishkuro previously approved these changes Feb 17, 2024
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

Thanks!

@yurishkuro yurishkuro added the changelog:bugfix-or-minor-feature 🐞 Bug fixes, Minor Improvements label Feb 17, 2024
@yurishkuro
Copy link
Member

looks like the existing test cases are missing a case for boolean value, can you add it?

Without this numbers are treated as json, which styles them with an offset.

Signed-off-by: Ivan Babrou <github@ivan.computer>
@bobrik
Copy link
Contributor Author

bobrik commented Feb 17, 2024

Sure, added.

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

🎉

@yurishkuro yurishkuro merged commit 6ec807f into jaegertracing:main Feb 18, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:bugfix-or-minor-feature 🐞 Bug fixes, Minor Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants