feat: Add ability to copy the payload while in interactive listen payload view - #313
Merged
Conversation
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 |
…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
approved these changes
Jul 30, 2026
leggetter
left a comment
Collaborator
There was a problem hiding this comment.
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.
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.
No description provided.