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

feat(issue-details): Improved UI for viewing object/array values #66153

Merged
merged 5 commits into from Mar 6, 2024

Conversation

malwilley
Copy link
Member

@malwilley malwilley commented Mar 1, 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!)

Before:

CleanShot 2024-03-01 at 10 53 57

After:

CleanShot 2024-03-04 at 09 13 06

And here's an example of the new auto-collapse behavior helping out when context values are very large:

CleanShot 2024-03-04 at 09 14 12

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 1, 2024
@malwilley malwilley force-pushed the malwilley/feat/structured-data-obj-array-ui branch from f4dcaf9 to 1b1c7c7 Compare March 1, 2024 21:34
@malwilley malwilley requested review from vuluongj20 and a team March 1, 2024 21:37
@malwilley malwilley marked this pull request as ready for review March 1, 2024 21:37
@vuluongj20
Copy link
Member

Can we make the toggles less prominent (perhaps with just the icon and no button formatting) and only appear on hover?

depth,
maxDefaultDepth,
}: CollapsibleValueProps) {
const numChildren = Children.count(children);
Copy link
Member

Choose a reason for hiding this comment

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

what

Copy link
Member

Choose a reason for hiding this comment

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

@malwilley
Copy link
Member Author

@vuluongj20 agree that the toggle buttons make it look a bit busy. Went ahead and removed the background and border, it looks like this (a lot better!):

CleanShot 2024-03-01 at 16 08 21

I tried hiding the buttons until hover, but it left gaps that didn't look very good:

CleanShot 2024-03-01 at 15 48 30

IMO keeping the buttons all the time isn't so bad now that they are less emphasized. What do you think?

@vuluongj20
Copy link
Member

Ahh yea I agree with you about the gaps. Let's merge the current version then! 🚀

@malwilley malwilley merged commit bf0ebfe into master Mar 6, 2024
39 checks passed
@malwilley malwilley deleted the malwilley/feat/structured-data-obj-array-ui branch March 6, 2024 00:30
Copy link

sentry-io bot commented Mar 6, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ React ErrorBoundary Error: The object can not be found here. removeChild([native code]) View Issue
  • ‼️ NotFoundError: Node.removeChild: The node to be removed is not a child of this node _GenericDiscoverQuery(app/utils/discover/generi... View Issue
  • ‼️ NotFoundError: Node.removeChild: The node to be removed is not a child of this node unmountHostComponents(react-dom/cjs/react-dom.p... View Issue
  • ‼️ NotFoundError: Node.removeChild: The node to be removed is not a child of this node onResizeObserver(app/components/events/interfac... View Issue

Did you find this useful? React with a 👍 or 👎

aliu3ntry pushed a commit that referenced this pull request 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 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically collapse long context values
3 participants