[PR #5837] feat: add import in new tab option for cURL imports #5375

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5837
Author: @chhaviG22
Created: 2/4/2026
Status: 🔄 Open

Base: mainHead: feat/improve-curl-import-ux


📝 Commits (4)

  • 5ebc254 feat: add import in new tab option for cURL imports
  • c1f4bfd Merge branch 'main' into feat/improve-curl-import-ux
  • c385265 code refactored
  • 557c8bc Merge branch 'main' into feat/improve-curl-import-ux

📊 Changes

2 files changed (+57 additions, -6 deletions)

View changed files

📝 packages/hoppscotch-common/locales/en.json (+4 -1)
📝 packages/hoppscotch-common/src/components/http/ImportCurl.vue (+53 -5)

📄 Description

Closes #5836

This PR addresses the UX issue where importing a cURL command automatically overwrites the active tab's content without warning, potentially causing data loss. Users now have explicit control over where imported cURL commands are placed.

What's changed

  • Added two-button interface in the cURL import modal:
  • "Import in New Tab" (primary button) - Creates a new tab with the imported request
  • "Import in Active Tab" (secondary button) - Replaces current tab content
  • Implemented input validation for empty/whitespace-only cURL commands
  • New tabs created from imports are marked as unsaved (isDirty: true)
  • Preserved request ID and name when importing to active tab
  • Added translation keys to en.json:
  • import.import_in_new_tab
  • import.import_in_active_tab
  • error.empty_curl
  • Maintained existing error handling for invalid cURL formats
  • Both import actions include analytics logging
Screenshot 2026-02-04 at 9 45 30 AM

🔄 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/5837 **Author:** [@chhaviG22](https://github.com/chhaviG22) **Created:** 2/4/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/improve-curl-import-ux` --- ### 📝 Commits (4) - [`5ebc254`](https://github.com/hoppscotch/hoppscotch/commit/5ebc25444636c98afe59197fb87d818c11510a26) feat: add import in new tab option for cURL imports - [`c1f4bfd`](https://github.com/hoppscotch/hoppscotch/commit/c1f4bfdf44063af9968c854233207ed249e7a1da) Merge branch 'main' into feat/improve-curl-import-ux - [`c385265`](https://github.com/hoppscotch/hoppscotch/commit/c3852655b07dc2322d4ae4f268be2290001b60b0) code refactored - [`557c8bc`](https://github.com/hoppscotch/hoppscotch/commit/557c8bc322d061ae254cfcde1c8a3d9b40916525) Merge branch 'main' into feat/improve-curl-import-ux ### 📊 Changes **2 files changed** (+57 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/locales/en.json` (+4 -1) 📝 `packages/hoppscotch-common/src/components/http/ImportCurl.vue` (+53 -5) </details> ### 📄 Description Closes #5836 This PR addresses the UX issue where importing a cURL command automatically overwrites the active tab's content without warning, potentially causing data loss. Users now have explicit control over where imported cURL commands are placed. **What's changed** - [x] Added two-button interface in the cURL import modal: - "Import in New Tab" (primary button) - Creates a new tab with the imported request - "Import in Active Tab" (secondary button) - Replaces current tab content - [x] Implemented input validation for empty/whitespace-only cURL commands - [x] New tabs created from imports are marked as unsaved (isDirty: true) - [x] Preserved request ID and name when importing to active tab - [x] Added translation keys to en.json: - import.import_in_new_tab - import.import_in_active_tab - error.empty_curl - [x] Maintained existing error handling for invalid cURL formats - [x] Both import actions include analytics logging <img width="574" height="426" alt="Screenshot 2026-02-04 at 9 45 30 AM" src="https://github.com/user-attachments/assets/6f9767f4-cb79-4677-b19d-a09392a88caa" /> --- <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#5375
No description provided.