Add json viewer and update content layout#121
Add json viewer and update content layout#121Kaveh-ap wants to merge 3 commits intoalexbrazier:masterfrom
Conversation
…unctionality - Updated Header component to support collapsible behavior with toggle functionality. - Modified RequestDetails component to utilize collapsible headers for request and response bodies. - Adjusted styles for better presentation and usability. - Introduced compact prop in RequestDetails for improved layout control.
…or RequestDetails - Added BodyViewer component to handle JSON and text content display with collapsible functionality. - Enhanced RequestDetails component to support initial expansion states for request and response headers and bodies. - Updated README to document new features and usage examples for initial expansion controls.
|
@alexbrazier @Kaveh-ap |
|
@Kaveh-ap Can we also add a search bar to search text in response body, it will help a lot to search for specific things in large payload or response |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54ea0753ea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| testID="header-text" | ||
| <TouchableOpacity | ||
| testID="header-toggle" | ||
| accessibilityRole="button" |
There was a problem hiding this comment.
Use button role only for collapsible headers
The header title is always rendered inside a TouchableOpacity with accessibilityRole="button", even when collapsible is false and no onPress is provided. In those non-collapsible cases, assistive technologies will announce an actionable control that does nothing, which is an accessibility regression for screen-reader users. Make the button role/press behavior conditional so static headers are exposed as plain text headers.
Useful? React with 👍 / 👎.
Summary
Add a
BodyViewercomponent for displaying request/response bodies with JSON tree viewing and text fallback, plus initial expansion controls throughoutRequestDetails.Motivation
Changes
BodyViewerTextInputfor large content rendering reliability.dataprop to bypass parsing and render prepared JSON.initialRequestHeadersExpanded?: boolean(default:true)initialResponseHeadersExpanded?: boolean(default:true)initialRequestBodyExpanded?: boolean(default:true)initialResponseBodyExpanded?: boolean(default:true)BodyViewerfor request/response bodies with collapsible sections.▼/▶shows only whencollapsible.Usage
If you want to directly render JSON data:
UI/UX
TextInputfor large content stability.Backward Compatibility
Testing
Performance
contentis a string anddataisn’t provided.Screenshots/GIFs