Skip to content

feat: Add ability to copy the payload while in interactive listen payload view - #313

Merged
leggetter merged 2 commits into
mainfrom
feat/copy-payload
Jul 30, 2026
Merged

feat: Add ability to copy the payload while in interactive listen payload view#313
leggetter merged 2 commits into
mainfrom
feat/copy-payload

Conversation

@alexbouchardd

Copy link
Copy Markdown
Contributor

No description provided.

@leggetter

Copy link
Copy Markdown
Collaborator

🔍 Review in progress — a few refinements coming: preserve original ordering for request headers and body (in both the details display and the copied output), auto-clear the "Copied …" status after a timeout, a README note on the Linux/BSD xclip/xsel requirement, and removing the duplicated instruction hint. Will follow up with details.

…hint

Follow-up refinements to the interactive listen details copy feature so the
copied output is faithful and the UI stays clean.

Preserve original ordering of request headers and JSON body, in both the
details display and the copied output.
  Why: previously headers came from a Go map (random iteration order, so the
  copied block differed run-to-run) and the body was pretty-printed via
  Unmarshal+MarshalIndent (which sorts keys alphabetically). Either way the
  copied payload no longer matched what was actually received, which breaks
  eyeballing, diffing and replaying a request.
  How: decode headers in-order with a json.Decoder token stream instead of a
  map; pretty-print the body with json.Indent, which reformats whitespace
  without reordering keys.

Auto-clear the "Copied …" status after a 5s timeout.
  Why: the confirmation previously stuck in the action bar indefinitely until
  the details view was reopened, so it went stale and misrepresented state.
  How: schedule a tea.Tick to reset the status, tagged with a generation
  counter so a rapid second copy supersedes the first and an older timer can
  never clear a newer confirmation.

Drop the duplicated instructions hint from the top of the scrollable details
content.
  Why: the same hint already renders in the always-visible action bar, so the
  top copy was redundant and cost a line of content that scrolled away anyway.

Document that clipboard copy needs xclip or xsel on Linux/BSD.
  Why: atotto/clipboard shells out to those on Linux/BSD (macOS uses pbcopy and
  Windows uses the Win32 API, both built in), so without one installed the copy
  fails; the README now sets that expectation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016QCuRsTPjpi6hbu9WSaE5J

@leggetter leggetter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the copy-payload changes plus the follow-up refinements (order preservation, 5s auto-clear with generation guard, hint dedupe, README note). Verified end-to-end against a live listen session and full test suite is green. LGTM.

@leggetter
leggetter merged commit 57eaa04 into main Jul 30, 2026
14 of 16 checks passed
@leggetter
leggetter deleted the feat/copy-payload branch July 30, 2026 09:02
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.

2 participants