Skip to content

feat: add transient in-memory requests with grace-period resurrection#12

Open
chirag-bruno wants to merge 5 commits intousebruno:mainfrom
chirag-bruno:feature/transient-requests
Open

feat: add transient in-memory requests with grace-period resurrection#12
chirag-bruno wants to merge 5 commits intousebruno:mainfrom
chirag-bruno:feature/transient-requests

Conversation

@chirag-bruno
Copy link
Copy Markdown
Collaborator

Adds a "+" action on each collection row to create HTTP/GraphQL/gRPC/WS requests that live only in Redux + a standalone WebviewPanel — no file is written until the user explicitly saves.

  • transient-manager creates typed items with virtual pathnames under {collection}/.bruno/transient/ so scripts resolve relative paths
  • dedicated transient-request-panel with protocol-colored icons that reflect dirty state
  • custom folder-picker (QuickPick) constrained to the collection root with a request-name input step
  • Cmd+S keybinding + beforeunload guard so dirty transient requests cannot silently disappear
  • draft middleware debounces and syncs transient item state to the extension host so the latest edits survive panel disposal
  • onDidDispose shows a progress-bar notification; cancelling resurrects the panel with the synced state, otherwise the item is cleaned up
  • autosave and saveRequest skip transient items (explicit save only)

Adds a "+" action on each collection row to create HTTP/GraphQL/gRPC/WS
requests that live only in Redux + a standalone WebviewPanel — no file
is written until the user explicitly saves.

- transient-manager creates typed items with virtual pathnames under
  {collection}/.bruno/transient/ so scripts resolve relative paths
- dedicated transient-request-panel with protocol-colored icons that
  reflect dirty state
- custom folder-picker (QuickPick) constrained to the collection root
  with a request-name input step
- Cmd+S keybinding + beforeunload guard so dirty transient requests
  cannot silently disappear
- draft middleware debounces and syncs transient item state to the
  extension host so the latest edits survive panel disposal
- onDidDispose shows a progress-bar notification; cancelling resurrects
  the panel with the synced state, otherwise the item is cleaned up
- autosave and saveRequest skip transient items (explicit save only)
cchirag added 2 commits April 14, 2026 13:28
Broadcasting main:trigger-save to all webviews caused the transient
save flow to fire even when the user was focused on a regular editor.
Track the last-active editor webview via onDidChangeViewState and send
the save trigger only to that webview.
27 tests covering item creation for all request types (HTTP, GraphQL,
gRPC, WebSocket), auto-incrementing names, file extension selection,
pathname generation for Unix/Windows, and counter reset.
panel.onDidDispose(() => {
// stateManager.removeWebview(panel.webview);
// transientPanels.delete(itemUid);
// transientItems.delete(itemU`id);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm -f

{
location: vscode.ProgressLocation.Notification,
title: `"${itemName}" closed — discarding…`,
cancellable: true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change button text to undo

cchirag added 2 commits April 14, 2026 15:54
Replace nested setTimeout hacks in transient-request-panel with an
event-driven handshake: the webview retries until the collection exists
in Redux, dispatches addTransientRequest, then sends transient:item-ready
back so the extension host can safely send main:set-view.

Switch the resurrection notification from withProgress (hardcoded
"Cancel" label) to showInformationMessage with an "Undo" button.

Fix gRPC/WS URL changes being silently dropped in requestUrlChanged
reducer — the URL was only set inside a 'params' in draft.request guard
which gRPC requests don't satisfy. Now set draft.request.url
unconditionally for all request types.
Transient items were included in getTotalRequestCountInCollection and
getRequestItemsForCollectionRun, causing them to appear in runner
counts and execution lists. Filter them out with isTransient checks.
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.

3 participants