feat(devtools-ui): add Payload tab to inspector panel#47
Conversation
Extract request/response bodies from the Headers tab into a dedicated "Payload" tab (matching Chrome DevTools naming). The tab only appears when a network event has body data, and each section includes a copy button for easy clipboard export. The Headers tab now shows only URL, method, and header data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
TL;DR — Extracts request/response body display from the Headers tab into a dedicated Payload tab, matching Chrome DevTools naming. The tab appears only when body data is present and includes copy-to-clipboard buttons.
Key changes
- Add
PayloadTabvariant to theInspectorTabunion type - Conditional Payload tab button — inserted between Headers and Cookies, only shown when the network event has
requestBodyorresponseBody - Move body display to Payload tab with
viewPayloadSectionhelper providing a section header and copy button - Tab fallback in
SelectEventhandler — reverts toHeadersTabwhen the selected event lacks body data - CSS —
.payload-sectionand.payload-headerlayout styles
Summary | 4 files | 1 commit | base: main ← feat/inspector-payload-tab
The logic is sound and the implementation correctly mirrors existing conditional-tab patterns (Collectors, Session, Config, OIDC). The three suggestions below are UX polish — the core functionality works.
Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:
packages/devtools-ui/src/src/Inspector.elm:164-189(RIGHT) — start_line 164 (RIGHT) is not inside a diff hunk
|
Addressed both review comments on PR #47. Changes pushed to
Elm compilation passes, both threads resolved. Task list (7/7 completed)
|
|
@pullfrog approve or request changes. |
There was a problem hiding this comment.
No new issues found.
TL;DR — Extracts request/response bodies from the Headers tab into a dedicated Payload tab (matching Chrome DevTools naming). The tab only appears when the network event has body data. Each body section gains a copy-to-clipboard button reusing the existing CopyToClipboard msg and fv-copy-btn styling.
Key changes
- Add
PayloadTabvariant toInspectorTab— new union variant inTypes.elm - Conditional Payload tab button — appears only for Network events with
requestBodyorresponseBody, placed after the fixed tabs (Headers, Cookies, CORS, SDK State) and before conditional tabs (Collectors, Session, etc.) - Payload content view — new
viewPayloadSectionhelper renders a labeled section with a JSON copy button andJsonTreedisplay; replaces the old body sections that were inline in HeadersTab - Tab fallback on event switch —
SelectEventfalls back toHeadersTabwhen switching to an event without body data whilePayloadTabis active, matching the pattern used byOidcTab,ConfigTab, and other conditional tabs - CSS for
.payload-sectionand.payload-header— flexbox layout with space-between alignment for the header row
Summary | 4 files | 2 commits | base: main ← feat/inspector-payload-tab
Types.elm · Inspector.elm · Update.elm · panel.css
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Summary
requestBodyorresponseBody)CopyToClipboardmsg andfv-copy-btnstylingFiles changed
Types.elmPayloadTabvariant toInspectorTabunionInspector.elmUpdate.elmPayloadTabfallback inSelectEvent— reverts toHeadersTabwhen no bodies existpanel.css.payload-sectionand.payload-headerstylesTest plan
cd packages/devtools-ui && npx elm make src/Main.elm --output=/dev/null— compiles ✅🤖 Generated with Claude Code