feat(web): add request headres draft controller#107
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0bc304af05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR introduces a Request Workspace feature — a tabbed panel embedded in the HTTP editor that lets users view query params, edit request headers inline (with save/discard draft semantics), and inspect the request body. The implementation spans a new The overall architecture is clean and the draft lifecycle (dirty tracking, concurrent-save guard, partial-failure handling) is well-tested. A couple of issues worth addressing before merge:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant HeadersPanel as RequestWorkspaceHeadersPanel
participant Controller as useRequestHeaderDraftController
participant Editing as applyRequestEditsToContent
participant Workspace as WorkspaceStore
User->>HeadersPanel: Edit / Add / Remove header
HeadersPanel->>Controller: onHeaderChange / onAddHeader / onRemoveHeader
Controller->>Controller: setDraftHeaders(), markDirty()
User->>HeadersPanel: Click Save
HeadersPanel->>Controller: onSave()
Controller->>Controller: isSaving() guard check
Controller->>Editing: applyRequestEditsToContent(content, index, url, draftHeaders)
Editing-->>Controller: { ok: true, content: rewritten }
Controller->>Workspace: setFileContent(rewritten)
Controller->>Workspace: saveFile(path)
Workspace-->>Controller: resolved
Controller->>Controller: setIsDirty(false)
Controller->>Workspace: reloadRequests(path)
Controller->>Controller: refetchRequestDetails()
User->>HeadersPanel: Click Discard
HeadersPanel->>Controller: onDiscard()
Controller->>Controller: setDraftHeaders(clone(sourceHeaders)), setIsDirty(false)
Last reviewed commit: e15d675 |
Summary
This PR introduces a Request Workspace feature that adds a new tabbed interface for viewing and editing HTTP request details directly within the editor. Users can now inspect request parameters, modify headers with a live draft mode, and view request body information.