feat: show request and response headers side by side in Headers tab (v1.0.68)#339
Merged
Merged
Conversation
…v1.0.68)
Previously the Headers tab only displayed response headers. Request
headers (Authorization, Content-Type, User-Agent, custom headers defined
in the .http file) were never shown in the notebook renderer.
Changes:
- renderer.tsx: replace the single-column TableTab for headers with a
new HeadersPanel component that renders two equal-width columns side
by side — "Request Headers" on the left and "Response Headers" on the
right. Each column has a clear uppercase title. If either side has no
headers, it shows "None" in italic. The tab's visibility check now
accounts for either side having headers.
Added two new sub-components:
- HeadersTable: renders a header/value table for a given headers map
- HeadersPanel: the two-column flex layout wrapping two HeadersTable instances
- response.ts: added `request_headers?: Headers` to
DothttpExecuteResponse to type the new field returned by the server.
- style.css: added .headers-panel (flex row), .headers-column (flex: 1),
.headers-title (bold uppercase label with bottom border), and
.headers-empty (italic "None" placeholder) styles.
- package.json: bump version to 1.0.68
Depends on dothttp-req v0.0.44a33 which adds `request_headers` to the
execute response payload (the actual headers sent on the wire via
requests.PreparedRequest).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
renderer.tsx: Replace the single-columnTableTabfor headers with a newHeadersPanelcomponent that renders two equal-width columns side by side — Request Headers on the left, Response Headers on the right. Each column has a clear uppercase title. If either side has no headers, it shows "None" in italic. Added two sub-components:HeadersTable(renders a header/value table) andHeadersPanel(the two-column flex layout).response.ts: Addedrequest_headers?: HeaderstoDothttpExecuteResponseto type the new field returned by the server.style.css: Added.headers-panel(flex row),.headers-column(flex: 1),.headers-title(bold uppercase label with bottom border), and.headers-empty(italic "None" placeholder) styles.package.json: Bump version to1.0.68.Why
Previously the Headers tab only showed response headers. Request headers — including
Authorization,Content-Type, custom headers from the.httpfile, and auto-added headers likeUser-Agent— were never visible. This makes it much easier to debug requests by seeing both sides at a glance.Depends on
dothttp-req v0.0.44a33 (PR #426) which adds
request_headersto the execute response payload.Test plan