Commit 7f3abbf
authored
fix: request name reverts after renaming an open request panel (#24)
## 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
- [x] `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 panel1 parent 60b1c73 commit 7f3abbf
2 files changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
343 | 346 | | |
344 | 347 | | |
345 | 348 | | |
| |||
0 commit comments