Skip to content

feat: Response actions (copy, download, clear, change layout) with responsive collapse (BRU-3765) - #16

Merged
arpit-bruno merged 6 commits into
usebruno:mainfrom
vasharma05-bruno:bru-3765-response-actions
Jul 30, 2026
Merged

feat: Response actions (copy, download, clear, change layout) with responsive collapse (BRU-3765)#16
arpit-bruno merged 6 commits into
usebruno:mainfrom
vasharma05-bruno:bru-3765-response-actions

Conversation

@vasharma05-bruno

@vasharma05-bruno vasharma05-bruno commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What

Wires up the playground Response pane action buttons and makes them responsive.

Actions

  • Copy: copies the response text (raw data in preview mode, otherwise the formatted output for the selected format), with a transient "copied" state
  • Download: downloads the response body as a file; filename derived from Content-Disposition, the URL path, or a content-type → extension fallback
  • Clear: clears the response for the active item
  • Change Layout: toggles the request/response split orientation (ephemeral, session-only override of the responsive default)
  • Copy + Download are also surfaced on the Large Response Warning banner

Responsive collapse

Ports bruno-app's tab-bar behavior: the actions render as inline buttons when the tab bar's right slot has room and collapse into a kebab (⋯) menu when the pane is too narrow, so the response tabs stay usable. ActionIcon now forwards its ref so the (Tippy-based) menu anchors correctly.

Other

  • Optimized response-formatting hot paths: the large-response banner no longer stringifies the withheld body on mount (lazy copy), and formatResponse avoids a redundant base64 decode / full UTF-8 conversion for base64/hex modes

Testing

  • Unit: 1008/1008 pass (npm run test:run)
  • E2E: response-actions and response-body Playwright specs pass (send-mocked, run against a worktree-local server); response-actions verified with --repeat-each=3 (no flakiness)
  • Lint: clean on changed files (pre-existing repo warnings unchanged)

@vasharma05-bruno vasharma05-bruno changed the title Response pane actions (copy, download, clear, change layout) with responsive collapse (feat): Response actions (copy, download, clear, change layout) with responsive collapse (BRU-3765) Jul 29, 2026
@vasharma05-bruno vasharma05-bruno changed the title (feat): Response actions (copy, download, clear, change layout) with responsive collapse (BRU-3765) feat: Response actions (copy, download, clear, change layout) with responsive collapse (BRU-3765) Jul 29, 2026
@vasharma05-bruno
vasharma05-bruno force-pushed the bru-3765-response-actions branch 2 times, most recently from 5f422ab to c494df5 Compare July 29, 2026 12:54
@vasharma05-bruno
vasharma05-bruno marked this pull request as ready for review July 29, 2026 12:54
@vasharma05-bruno
vasharma05-bruno force-pushed the bru-3765-response-actions branch 2 times, most recently from c03e28b to e1149ff Compare July 29, 2026 19:16
…out)

Add a response-actions toolbar to the response pane with copy, download,
clear, and change-layout controls, collapsing into a menu when the pane
is narrow. Wire the large-response banner to the same copy/download
actions alongside the existing warning icon and view control.

Copy mirrors bruno-app: disabled when the response has no text body, and
never writes "undefined" to the clipboard. Response bodies decode from
their base64 buffer before formatting so the JSON view never shows raw
base64. Downloads type the bytes as Uint8Array for Blob construction.
@vasharma05-bruno
vasharma05-bruno force-pushed the bru-3765-response-actions branch from e1149ff to 734b90f Compare July 29, 2026 19:37
…-3765)

Large responses withheld base64Data (only their display formatting is
deferred behind the reveal warning), which left the Large Response Warning
banner's Download/Copy actions permanently disabled. Extract base64 for
large bodies too; keep skipping it only for small plain-text/SVG bodies
that already carry their own bytes.
Comment thread packages/bruno-api-docs/e2e/components/playground/response-pane.component.ts Outdated
Comment thread packages/bruno-api-docs/src/ui/Tabs/Tabs.tsx Outdated
@sachin-bruno

sachin-bruno commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

One more comment regarding the UI: this looks a bit odd to me. The code editor is using a 16px font size, whereas the maximum font size used across the Bruno app and the docs is 13px.

image

Additionally, the response and actions popups use a 13px font size, while the rest of the UI (buttons, tabs, etc.) uses 12px. Can we keep the popup font size at 12px as well for consistency?

Please cross verify this with Ankita.

@vasharma05-bruno

Copy link
Copy Markdown
Contributor Author

Hi @sachin-bruno, as per findings, and our discussion, the font size of the editor is 12px only. In the above screenshot, this is a preview mode of HTML, which means the above content is being rendered in an iframe, and hence we can't/ shouldn't change the font size inside iframe.

Thanks!

…es (BRU-3765)

The response tab overflow split budgeted against the right slot's LIVE width,
which changes as the trailing actions block collapses to a kebab or expands to
inline buttons; that collapse decision in turn depended on the split, so the two
fed back on each other and oscillated at a boundary — remounting the "⋯ more"
button every frame (a 30s e2e hang after the right section was slimmed down).

Budget the split against the right slot's MODELED expanded width, and key the
collapse decision to the container width vs the whole tab row rather than the
split's own visible/overflow result, so neither output feeds its own input.
Observe only the container, matching bruno-app's ResponsiveTabs.

Also harden the response-body re-render e2e with a layout-agnostic tab-switch
helper (waits for the switch to settle), and add test ids to the response-actions
wrapper so the e2e POM targets them instead of CSS classes.
@arpit-bruno
arpit-bruno merged commit 25dea73 into usebruno:main Jul 30, 2026
2 checks passed
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.

3 participants