Repository navigation
feat: add copy-all button to export full network request details - #268
Conversation
Adds a "Copy All" action to the network request detail screen's TopAppBar, alongside the existing per-section copy buttons. Copies method, URL, status, timing, both header sets, and both bodies (JSON pretty-printed when detected) as a single plain-text block via NetworkRequest.toClipboardText(). Resolves item 2 of #256.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe network detail screen now copies either the request URL or complete request data. Clipboard output includes formatted metadata, headers, bodies, and errors. Shared content-type detection supports case-insensitive headers across detail and HTML rendering. ChangesNetwork request clipboard export
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @Manabu-GT's task in 3m 52s —— View job Code Review: Copy-all button for network request details
Clean, well-scoped feature. The One correctness bug worth fixing before merge, plus a few smaller items. Findings
#1 is the one that matters. Two related details: for HTTP errors the interceptor stores the response body in Smaller notes
ValidationI could not run |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 034d9ba3dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Qodana for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
…s review feedback (#268) - toClipboardText() no longer drops response headers/body when error is set: the OkHttp interceptor populates error for any HTTP status >= 400 while still capturing the response, so a 404/500 - the case most worth sharing - was silently exporting no response data. - Content-Type header lookups are now case-insensitive (shared Map<String, String>.contentType() helper, also adopted by HtmlReportBuilder and the three pre-existing exact-match lookups in NetworkRequestDetailScreen), since HTTP/1.1 typically capitalizes the header while HTTP/2 lowercases it. - Cap each body at 64KB when building clipboard text, to bound a single ClipData and avoid TransactionTooLargeException on large bodies. - Build the clipboard text off the main thread (new suspend-producer overload of copyToClipboard) instead of synchronously in the onClick handler. - Exported timestamp now includes the date (formatClipboardTimestamp, shared with LogEntry's clipboard export) instead of a bare wall-clock time. - Renamed the URL-only top-bar button's content description to "Copy URL" so it reads distinctly next to "Copy all". - Extracted the top bar's actions into NetworkRequestDetailActions, fixing the detekt LongMethod failure on NetworkRequestDetailScreen (62 lines, threshold 60) that broke CI. - Added test coverage for the HTTP-error-with-response-data case, capitalized Content-Type detection, and body truncation.
Summary
Add a "Copy All" button to the network request detail screen that exports the complete request/response transaction as formatted plain text, suitable for sharing or debugging.
Changes
New utility function
NetworkRequest.toClipboardText()that formats the full network transaction (overview, headers, body, or error) as plain textUI enhancement to
NetworkRequestDetailScreenString resource added for the new button's content description (
debugoverlay_copy_all)Comprehensive test coverage with 4 test cases covering:
Implementation Details
The formatting function builds a structured text output with:
https://claude.ai/code/session_01A5yvCH5EjpW2JdJZ1ggiTY
Summary by CodeRabbit
New Features
Bug Fixes