Skip to content

feat: tabbed response viewer, actions, and safer Restore in History - #25

Merged
slverma merged 10 commits into
mainfrom
feat/history-response-viewer
Jul 29, 2026
Merged

feat: tabbed response viewer, actions, and safer Restore in History#25
slverma merged 10 commits into
mainfrom
feat/history-response-viewer

Conversation

@slverma

@slverma slverma commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Description

Summary

  • Adds a tabbed response viewer (Body/Headers/Cookies) to History entries, in both the standalone History panel and the request editor's History tab, replacing a small <pre> block capped at 240px.
  • Adds Copy, Download, and Open-in-Editor actions to the History response viewer, matching the live Response panel; wires the same backend handling into the standalone History panel (previously only the request editor supported these).
  • Replaces the unexplained one-click "Restore" button with a tooltip explaining what it does and a confirmation dialog before it overwrites the current request's saved state.
  • Fixes several layout bugs surfaced during manual testing: a flexbox height-collapse that made the Monaco body editor render blank, long header names running into their values with no gap (now stacks name above value), the truncation notice showing vague text instead of exact stored-vs-original sizes, the sidebar's "New Collection" button disappearing instead of shrinking at narrow widths, missing hover tooltips for truncated sidebar labels, and a "folder" vs "Collection" wording mismatch in the New Collection prompt.

Why

The History response body was cramped, had no way to inspect headers/cookies side by side with actions, and "Restore" silently overwrote request state with no explanation — all called out directly as UX gaps. The layout fixes were found via manual verification in the Extension Development Host after the initial implementation, since VS Code's webview CSP and CSS particulars can't be caught by type-checking alone.

Changes

  • src/utils/responseFileActions.ts (new): shared download/open-in-editor logic, used by both RequestEditorProvider and HistoryEditorProvider.
  • src/webview/components/HistoryResponseViewer.tsx (new): tabbed response viewer with actions, reused by both History surfaces.
  • src/webview/components/ConfirmDialog.tsx (new): generic confirm/cancel modal, used by the Restore flow.
  • src/webview/components/HistoryEntryList.tsx, src/webview/history/*, src/webview/request/HistoryTab.tsx: wiring for the above.
  • src/webview/history/styles.css, src/webview/request/styles.css: response-viewer sizing, confirm-dialog styles, header-row layout fixes.
  • src/webview/sidebar/*: narrow-width fixes for the header action buttons and tree row labels.
  • package.json, src/extension.ts, src/providers/SidebarProvider.ts: "Create Collection" wording fix.
  • docs/superpowers/specs/2026-07-29-history-response-viewer-design.md, docs/superpowers/plans/2026-07-29-history-response-viewer.md: design spec and implementation plan.

Test plan

  • Expand a History entry (both the standalone History panel and a request's History tab) and confirm Body/Headers/Cookies tabs render, the body area is no longer cramped, and Copy/Download/Open-in-Editor all work in both surfaces.
  • Confirm the Monaco body editor actually renders (not blank) in the standalone History panel specifically — this needed a CSP change that only a real build can verify.
  • Expand an entry with a truncated body and confirm the notice shows concrete stored/original sizes.
  • Expand an entry with a long header name/value (e.g. access-control-allow-origin) and confirm it wraps cleanly instead of overflowing.
  • Click Restore, confirm the tooltip and confirmation dialog appear, Cancel does nothing, Confirm restores as before.
  • Resize the sidebar narrow and confirm "New Collection" shrinks/truncates with a tooltip instead of disappearing, and long folder/request names show a title tooltip.
  • Click "New Collection" and confirm the prompt says "Enter Collection name".

slverma and others added 10 commits July 29, 2026 13:22
Covers enlarging/tabbing the History response body, adding Copy/Download/Open-in-Editor actions to it, and adding a tooltip + confirmation dialog to the Restore button.
…d helper

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…lone History panel

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…story entries

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…meta in History panel

Fixes four issues found in final review of the History response viewer:
enable Monaco in the standalone History webview (missing config import
and CSP directives), restore the JSON-editor base CSS in the history
bundle, correct truncation-notice wording to not imply it's always the
response body, and bring back the statusText/size line that was dropped
when the response section was replaced with HistoryResponseViewer. Also
merges a duplicate helper import in HistoryEntryList.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The Body/Headers/Cookies viewer reused flex:1 sizing from the live Response
panel, which only works because that panel gets a JS-set pixel height from
an ancestor. History has no such bounded ancestor, so the same rules
collapsed the Monaco body editor to zero height and let long header names
(e.g. access-control-allow-origin) run into their values with no gap.
Also makes the truncation notice report exact stored-vs-original sizes
instead of a generic message, using the marker HistoryManager already
embeds in truncated fields.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
.btn-primary ("New Collection") and the folder/request tree labels are
flex items that defaulted to min-width: auto, so none of them could
shrink below their content's natural width. In a narrow sidebar the
header row overflowed past .sb's overflow: hidden, hiding the New
Collection button instead of shrinking it; tree labels had ellipsis CSS
but nothing to reveal the truncated text.

Fixes: label now truncates with an ellipsis and gets a hover tooltip
(wrapping it in the shared Tooltip component required a matching fix,
since Tooltip's own wrapper div — not the button — is the real flex
item here); folder/request names get a native title attribute so the
full name is still discoverable on hover.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The webview's New Collection button and the equivalent
restlab.createFolder command palette entry both create a root-level
folder, which the rest of the UI calls a "Collection" (empty-state text,
button label). The input prompt and command title still said "folder",
which was confusing since it doesn't match what's being created.
Subfolder creation and renaming keep their existing wording — those are
a different, correctly-named concept.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@slverma
slverma merged commit b3aa131 into main Jul 29, 2026
1 check passed
slverma pushed a commit that referenced this pull request Jul 29, 2026
## 1.9.0 (2026-07-29)

* feat: tabbed response viewer, actions, and safer Restore in History (#25) ([b3aa131](b3aa131)), closes [#25](#25)
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