Skip to content

feat(devtools-ui): add Payload tab to inspector panel#47

Merged
ryanbas21 merged 3 commits into
mainfrom
feat/inspector-payload-tab
May 13, 2026
Merged

feat(devtools-ui): add Payload tab to inspector panel#47
ryanbas21 merged 3 commits into
mainfrom
feat/inspector-payload-tab

Conversation

@ryanbas21
Copy link
Copy Markdown
Owner

Summary

  • Extracts 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 (requestBody or responseBody)
  • Each body section includes a copy-to-clipboard button reusing existing CopyToClipboard msg and fv-copy-btn styling
  • Headers tab now shows only URL, method, and header data

Files changed

File Change
Types.elm Added PayloadTab variant to InspectorTab union
Inspector.elm Conditional tab button, payload content view with copy buttons, removed bodies from HeadersTab
Update.elm PayloadTab fallback in SelectEvent — reverts to HeadersTab when no bodies exist
panel.css .payload-section and .payload-header styles

Test plan

  • cd packages/devtools-ui && npx elm make src/Main.elm --output=/dev/null — compiles ✅
  • Load extension, select a network request with body data → "Payload" tab appears
  • Select a request without body data → no "Payload" tab
  • Click copy button on request/response body → clipboard contains formatted JSON
  • Headers tab no longer shows body content

🤖 Generated with Claude Code

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>
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

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 PayloadTab variant to the InspectorTab union type
  • Conditional Payload tab button — inserted between Headers and Cookies, only shown when the network event has requestBody or responseBody
  • Move body display to Payload tab with viewPayloadSection helper providing a section header and copy button
  • Tab fallback in SelectEvent handler — reverts to HeadersTab when the selected event lacks body data
  • CSS.payload-section and .payload-header layout styles

Summary | 4 files | 1 commit | base: mainfeat/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

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run𝕏

Comment thread packages/devtools-ui/src/src/Inspector.elm
Comment thread packages/devtools-ui/src/src/Inspector.elm Outdated
@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented May 13, 2026

Addressed both review comments on PR #47. Changes pushed to feat/inspector-payload-tab:

  1. Payload tab positioning — moved from mid-bar (between Headers/Cookies) to the right-edge conditional group (after SdkStateTab, before CollectorsTab) for consistent tab-bar behavior.
  2. Label deduplicationJsonTree.view now receives "" as label since the .sect-hdr already renders it.

Elm compilation passes, both threads resolved.

Task list (7/7 completed)
  • Checkout PR feat(devtools-ui): add Payload tab to inspector panel #47 branch
  • Fetch review comments for review #4283857131
  • Address Thread 1: Move Payload tab to right-edge conditional group
  • Address Thread 2: Remove duplicate label in viewPayloadSection
  • Quality check (compile Elm + review diff), commit, and push
  • Reply to review comments and resolve threads
  • Report progress

Pullfrog  | View workflow run | via Pullfrog𝕏

@ryanbas21
Copy link
Copy Markdown
Owner Author

@pullfrog approve or request changes.

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

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 PayloadTab variant to InspectorTab — new union variant in Types.elm
  • Conditional Payload tab button — appears only for Network events with requestBody or responseBody, placed after the fixed tabs (Headers, Cookies, CORS, SDK State) and before conditional tabs (Collectors, Session, etc.)
  • Payload content view — new viewPayloadSection helper renders a labeled section with a JSON copy button and JsonTree display; replaces the old body sections that were inline in HeadersTab
  • Tab fallback on event switchSelectEvent falls back to HeadersTab when switching to an event without body data while PayloadTab is active, matching the pattern used by OidcTab, ConfigTab, and other conditional tabs
  • CSS for .payload-section and .payload-header — flexbox layout with space-between alignment for the header row

Summary | 4 files | 2 commits | base: mainfeat/inspector-payload-tab

Types.elm · Inspector.elm · Update.elm · panel.css

Pullfrog  | View workflow run𝕏

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ryanbas21 ryanbas21 merged commit 428f442 into main May 13, 2026
1 check passed
@ryanbas21 ryanbas21 deleted the feat/inspector-payload-tab branch May 13, 2026 20:56
@github-actions github-actions Bot mentioned this pull request May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant