Skip to content

feat(api-client): unsaved-changes dot and Cmd+S save in place - #421

Merged
itsmeakhil merged 1 commit into
mainfrom
feat/api-client-dirty-save
Nov 11, 2026
Merged

itsmeakhil merged 1 commit into
mainfrom
feat/api-client-dirty-save

Conversation

@itsmeakhil

Copy link
Copy Markdown
Owner

Summary

Phase A, item A8 of the API Client plan.

  • A tab opened from a collection, or saved into one, now remembers which request it belongs to (source and savedFingerprint on the tab).
  • While a tab differs from what was saved, a dot replaces its close button; the X comes back on hover. Undoing the edit clears the dot.
  • ⌘S overwrites that request in place, in both normal and folder-of-YAML collections. On a new tab, or one whose request was deleted, it opens the Save dialog. A failed save keeps the dot, so the next ⌘S retries.
  • Clicking a request that is already open focuses its tab.
  • Duplicated tabs are unlinked copies. Editing the URL no longer renames a saved request's tab.

Behaviour change: folder defaults are applied at send time

Opening a request used to copy its folder's default headers, auth and scripts into the tab. If ⌘S saved that back, the folder defaults would be written into the request and folder scripts would run twice. Now withFolderDefaults merges them when sending, copying cURL and generating code. The trade-off is that inherited headers no longer appear in the tab's Headers list.

Fixes along the way

  • "Save as" now keeps pre-request and test scripts, timeout and the cookie-jar setting. Before, they were dropped.
  • ⌘S does not write saved examples or comments. A tab can hold stripped copies of example bodies when storage runs low, and saving them back would wipe the stored ones. Form-data file contents lost the same way are taken from the stored request instead of being blanked.
  • OAuth2 tokens inherited from a folder are no longer written back into the tab when refreshed.

Not in this PR

  • No "unsaved changes" warning when closing a dirty tab (edits are still kept across reloads).
  • New tabs that were never saved don't show a dot.

Test plan

  • tsc --noEmit passes
  • Full jest suite passes (122 suites), including new saved-request tests for the dirty check, save patch and folder defaults
  • The 2 new strings are translated into all 27 locales
  • Tauri: send a request from a folder with default headers and confirm they are sent
  • Tauri: edit, see the dot, press ⌘S, confirm the dot clears and the change is still there after reopening
  • Tauri: click an already-open request in the sidebar and confirm its tab is focused
  • Tauri: ⌘S on a new tab opens Save; after saving, edit + ⌘S updates the same request

🤖 Generated with Claude Code

Tabs opened from (or saved into) a collection now remember their
request. A dot replaces the close button while the tab differs from
what was saved; Cmd+S overwrites that request in place (DB and folder
collections), or opens Save for drafts and requests deleted since.
Failed saves keep the dot so the next Cmd+S retries.

- Folder defaults (headers/auth/scripts) are merged at send, cURL copy
  and codegen time via withFolderDefaults instead of being baked into
  the tab on load, so saving never writes them back into the request.
- Opening a request that is already open focuses its tab.
- Save-as now keeps pre-request/test scripts, timeout and cookie-jar
  setting. Examples and comments are not written by Cmd+S (tabs may hold
  quota-stripped copies); stripped form-data file bytes are restored
  from the stored request.
- Duplicated tabs are unlinked drafts; URL edits no longer rename a
  saved request's tab.
- saveRequest resolves with success; patchFolder generalised to
  patchItem, adding updateRequest.
- i18n: shortcuts.saveRequest, tabBar.unsavedChanges in all 27 locales.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
mydevtools-tech Ready Ready Preview Nov 10, 2026 4:08am UTC

@itsmeakhil
itsmeakhil merged commit ebc3dfa into main Nov 11, 2026
2 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview — bed5797d Deployed Nov 10, 2026 by vercel[bot]
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