Skip to content

fix: request name reverts after renaming an open request panel - #24

Merged
slverma merged 1 commit into
mainfrom
feat/fix-request-rename-sync
Jul 20, 2026
Merged

fix: request name reverts after renaming an open request panel#24
slverma merged 1 commit into
mainfrom
feat/fix-request-rename-sync

Conversation

@slverma

@slverma slverma commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Description

Problem

If a request panel is open and you rename that request from the sidebar, sending (or saving) the request afterward silently restores the old name.

Root cause

SidebarProvider.renameRequest persists the new name to storage and updates the panel title via RequestEditorProvider.updatePanelTitle, but never notifies the already-open webview. The webview's React state keeps the stale name in its config object. Both "Send Request" and "Save" post that full config back to the extension host, which writes it straight to storage and the sidebar tree — so the stale name overwrites the rename.

Fix

updatePanelTitle now also posts a requestRenamed message to the webview. RequestContext.tsx handles it by updating config.name in state, keeping the webview in sync so subsequent saves carry the correct name.

Files changed

  • src/providers/RequestEditorProvider.ts
  • src/webview/request/RequestContext.tsx

Test plan

  • npx tsc --noEmit passes
  • Manual: open a request, rename it via the sidebar context menu, then click Send — confirm the name stays renamed in both the sidebar and the panel title
  • Manual: rename, then click Save — confirm the name persists after reopening the panel

Renaming a request from the sidebar updated storage and the panel
title but never told the already-open webview, so its stale in-memory
name got posted back and reverted the rename on the next Send/Save.
@slverma
slverma merged commit 7f3abbf into main Jul 20, 2026
1 check passed
slverma pushed a commit that referenced this pull request Jul 20, 2026
## <small>1.8.1 (2026-07-20)</small>

* fix: request name reverts after renaming an open request panel (#24) ([7f3abbf](7f3abbf)), closes [#24](#24)
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