[PR #6000] feat(history): save and preview response in REST history #5459

Open
opened 2026-03-17 02:53:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/6000
Author: @AbishekRaj2007
Created: 3/16/2026
Status: 🔄 Open

Base: mainHead: feat/history-response-saving


📝 Commits (1)

  • 03eaad8 feat(history): save and preview response in REST history

📊 Changes

9 files changed (+254 additions, -4 deletions)

View changed files

📝 packages/hoppscotch-common/assets/scss/styles.scss (+6 -0)
📝 packages/hoppscotch-common/locales/en.json (+9 -0)
📝 packages/hoppscotch-common/src/components/app/PaneLayout.vue (+3 -3)
📝 packages/hoppscotch-common/src/components/history/Personal.vue (+13 -0)
📝 packages/hoppscotch-common/src/components/history/rest/Card.vue (+10 -0)
packages/hoppscotch-common/src/components/history/rest/ResponsePreview.vue (+125 -0)
📝 packages/hoppscotch-common/src/newstore/history.ts (+27 -1)
📝 packages/hoppscotch-common/src/newstore/settings.ts (+8 -0)
📝 packages/hoppscotch-common/src/pages/settings.vue (+53 -0)

📄 Description

What's changed

Adds opt-in saving of response body and headers alongside REST history entries, with an inline preview modal to revisit them without re-sending the request.

New features

  • Save response in history — a new toggle in Settings captures the response body and headers at execution time for every REST request
  • Response preview modal — each history card shows an eye icon (when saved data exists) that opens a modal displaying the status code, headers, and pretty-printed body
  • Configurable limits — two new settings control the behaviour:
    • Max history entries (default: 50, max: 500)
    • Max response size per entry in KB (default: 100 KB) — responses larger than this are silently skipped to avoid bloat

Files changed

File Change
history/rest/ResponsePreview.vue New modal component — renders status, headers, and body
history/rest/Card.vue Adds eye-icon button that emits show-response when saved data exists
history/Personal.vue Mounts the preview modal and wires up the show-response handler
newstore/history.ts Extends RESTHistoryEntry with responseBody / responseHeaders; populates them based on settings
newstore/settings.ts Adds SAVE_RESPONSE_IN_HISTORY, MAX_HISTORY_COUNT, MAX_HISTORY_ENTRY_SIZE_KB
pages/settings.vue New History section in Settings UI with toggle and number inputs
locales/en.json New i18n strings for all added UI

Notes

  • The feature is opt-in — disabled by default, no behaviour change for existing users
  • Responses exceeding the configured size limit are silently skipped to prevent storage bloat
  • No migration needed; new fields on RESTHistoryEntry are optional

Summary by cubic

Adds opt-in saving of REST responses to history with a modal preview so you can revisit status, headers, and body without re-sending. Off by default; no change for existing users.

  • New Features
    • Settings toggle to save response body and headers in history.
    • Preview saved responses from history cards (status, headers, prettified body).
    • Limits: max history entries (default 50, max 500) and per-entry response size (default 100 KB). Larger responses are skipped.

Written for commit 03eaad8f31. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/6000 **Author:** [@AbishekRaj2007](https://github.com/AbishekRaj2007) **Created:** 3/16/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/history-response-saving` --- ### 📝 Commits (1) - [`03eaad8`](https://github.com/hoppscotch/hoppscotch/commit/03eaad8f31985110bd39440f06343007b7e09b1d) feat(history): save and preview response in REST history ### 📊 Changes **9 files changed** (+254 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/assets/scss/styles.scss` (+6 -0) 📝 `packages/hoppscotch-common/locales/en.json` (+9 -0) 📝 `packages/hoppscotch-common/src/components/app/PaneLayout.vue` (+3 -3) 📝 `packages/hoppscotch-common/src/components/history/Personal.vue` (+13 -0) 📝 `packages/hoppscotch-common/src/components/history/rest/Card.vue` (+10 -0) ➕ `packages/hoppscotch-common/src/components/history/rest/ResponsePreview.vue` (+125 -0) 📝 `packages/hoppscotch-common/src/newstore/history.ts` (+27 -1) 📝 `packages/hoppscotch-common/src/newstore/settings.ts` (+8 -0) 📝 `packages/hoppscotch-common/src/pages/settings.vue` (+53 -0) </details> ### 📄 Description ## What's changed Adds opt-in saving of response body and headers alongside REST history entries, with an inline preview modal to revisit them without re-sending the request. ## New features - **Save response in history** — a new toggle in Settings captures the response body and headers at execution time for every REST request - **Response preview modal** — each history card shows an eye icon (when saved data exists) that opens a modal displaying the status code, headers, and pretty-printed body - **Configurable limits** — two new settings control the behaviour: - **Max history entries** (default: 50, max: 500) - **Max response size per entry in KB** (default: 100 KB) — responses larger than this are silently skipped to avoid bloat ## Files changed | File | Change | |------|--------| | `history/rest/ResponsePreview.vue` | New modal component — renders status, headers, and body | | `history/rest/Card.vue` | Adds eye-icon button that emits `show-response` when saved data exists | | `history/Personal.vue` | Mounts the preview modal and wires up the `show-response` handler | | `newstore/history.ts` | Extends `RESTHistoryEntry` with `responseBody` / `responseHeaders`; populates them based on settings | | `newstore/settings.ts` | Adds `SAVE_RESPONSE_IN_HISTORY`, `MAX_HISTORY_COUNT`, `MAX_HISTORY_ENTRY_SIZE_KB` | | `pages/settings.vue` | New History section in Settings UI with toggle and number inputs | | `locales/en.json` | New i18n strings for all added UI | ## Notes - The feature is **opt-in** — disabled by default, no behaviour change for existing users - Responses exceeding the configured size limit are silently skipped to prevent storage bloat - No migration needed; new fields on `RESTHistoryEntry` are optional <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds opt-in saving of REST responses to history with a modal preview so you can revisit status, headers, and body without re-sending. Off by default; no change for existing users. - **New Features** - Settings toggle to save response body and headers in history. - Preview saved responses from history cards (status, headers, prettified body). - Limits: max history entries (default 50, max 500) and per-entry response size (default 100 KB). Larger responses are skipped. <sup>Written for commit 03eaad8f31985110bd39440f06343007b7e09b1d. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5459
No description provided.