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

Automatically collapse long context values #58573

Closed
Tracked by #52911
asherLZR opened this issue Oct 23, 2023 · 6 comments · Fixed by #66153
Closed
Tracked by #52911

Automatically collapse long context values #58573

asherLZR opened this issue Oct 23, 2023 · 6 comments · Fixed by #66153
Labels
Product Area: Issues Sync: Jira Apply to auto-create a Jira shadow ticket

Comments

@asherLZR
Copy link

asherLZR commented Oct 23, 2023

Problem Statement

Doing Sentry.setContext('title', { value }), if it goes beyond a certain length, we want value to be collapsed in the UI and not truncated. Otherwise a long array could take up a page of space on the screen. Could we have this configurable as an option to setContext?

Solution Brainstorm

No response

Product Area

Issues

┆Issue is synchronized with this Jira Improvement by Unito

@getsantry
Copy link
Contributor

getsantry bot commented Oct 23, 2023

Assigning to @getsentry/support for routing ⏲️

@getsantry
Copy link
Contributor

getsantry bot commented Oct 23, 2023

Routing to @getsentry/product-owners-issues for triage ⏲️

@roggenkemper
Copy link
Member

hi! just to clarify - you're asking for the ability to collapse/expand the value field in the UI if potentially the value is too long instead of being truncated?

@asherLZR
Copy link
Author

asherLZR commented Dec 5, 2023

Yes exactly. A long value field taking up almost a full page is difficult to read. Ideally it could be collapsed with a preview of the first x number of lines, with the ability to expand it if necessary.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Dec 5, 2023
@lobsterkatie
Copy link
Member

Thanks for the confirmation. This would really be two changes:

  1. SDKs would need to not truncate the data before it's sent. Depending on the size of the data, this may or may not be possible. (Generally, that truncation happens to keep both individual context items and the full payload from exceeding the maximum allowable sizes.)

  2. We'd need to build partial collapsing into the UI.

We've filed it as a feature request. If we decide to pursue it, we'll let you know!

@malwilley
Copy link
Member

This sounded familiar, so I searched around and found... an issue I made but was closed due to inactivity! #48480

I think the issue here is not about truncation, since the event still has valid json to display, but that arrays are not being collapsed when they should.

See here for a screenshot of it in action

We won't add collapsing as an SDK option, but we can certainly collapse long array values by default.

aliu39 pushed a commit that referenced this issue Mar 6, 2024
)

Fixes #58573,
#48480

Previously, objects/arrays were only collapsible after they reached
maxDefaultDepth. The major change here is that now each level is
collapsible

- Each level is now always collapsible. Before, objects/arrays were only
collapsible after a certain depth
- Arrays/objects begin collapsed when there are more than 5 items, in
addition to when they are at a certain depth
- Changed the appearance and location of the toggle buttons to better
match commonly-used json viewers
- Added `n items` preview text for collapsed objects/arrays (which is
clickable!)
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Product Area: Issues Sync: Jira Apply to auto-create a Jira shadow ticket
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants