Repository navigation
feat: replace send button with Send/Cancel buttons on request url - #7675
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughReplaces inline send/cancel icons with a new SendButton component, moves border and border-radius from top-level wrappers into inner input containers ( Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant UI as QueryUrl/WsQueryUrl Component
participant Btn as SendButton
participant API as Network/API
User->>UI: click Send
UI->>Btn: invoke onSend (or onCancel)
Btn->>API: initiate request / send cancel
API-->>Btn: response / cancel ack
Btn-->>UI: update isLoading / status
UI-->>User: render updated state and response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/bruno-app/src/components/RequestPane/WsQueryUrl/index.js (1)
194-203: Test ID inconsistency between WebSocket and HTTP request buttons.The WebSocket Send button uses
data-testid="run-button"while the HTTP QueryUrl component usesdata-testid="send-arrow-icon". Consider unifying these test IDs for consistency—tests targeting both request types will need different selectors otherwise.♻️ Suggested unification
<Button size="sm" variant="filled" color="primary" - data-testid="run-button" + data-testid="send-arrow-icon" onClick={handleRunClick} className="ml-2 send-btn" >🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/bruno-app/src/components/RequestPane/WsQueryUrl/index.js` around lines 194 - 203, The WebSocket Send Button in WsQueryUrl (the Button rendered with onClick={handleRunClick}) uses data-testid="run-button" which is inconsistent with the HTTP QueryUrl component; change that attribute to match the HTTP test id (data-testid="send-arrow-icon") so both request types share the same selector for tests; update the data-testid on the Button element in WsQueryUrl/index.js (the Send button tied to handleRunClick) accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/bruno-app/src/components/RequestPane/WsQueryUrl/index.js`:
- Around line 194-203: The WebSocket Send Button in WsQueryUrl (the Button
rendered with onClick={handleRunClick}) uses data-testid="run-button" which is
inconsistent with the HTTP QueryUrl component; change that attribute to match
the HTTP test id (data-testid="send-arrow-icon") so both request types share the
same selector for tests; update the data-testid on the Button element in
WsQueryUrl/index.js (the Send button tied to handleRunClick) accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dd035b39-b2bd-4334-9fbd-8f6a6cf17b57
📒 Files selected for processing (7)
packages/bruno-app/src/components/RequestPane/QueryUrl/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/QueryUrl/index.jspackages/bruno-app/src/components/RequestPane/WsQueryUrl/StyledWrapper.jspackages/bruno-app/src/components/RequestPane/WsQueryUrl/index.jstests/collection/create/create-collection.spec.tstests/environments/multiline-variables/read-multiline-environment.spec.tstests/response-examples/create-example.spec.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/bruno-app/src/components/RequestPane/QueryUrl/index.js`:
- Around line 410-448: Rename or remove the misleading id "send-request" that
wraps the Generate Code / Save Request icons and add explicit data-testid
attributes to the actionable icons so tests target them directly; specifically,
update the wrapper around IconCode and IconDeviceFloppy (where
handleGenerateCode and onSave are invoked, and saveShortcut/hasChanges are used)
to remove or rename id="send-request" and add data-testid="generate-code-button"
to the IconCode container and data-testid="save-request-button" to the
IconDeviceFloppy container; leave the SendButton component (which already has
testId="send-arrow-icon") as the send control.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 70a550ca-f89d-4a87-b854-8f1e9ce19379
📒 Files selected for processing (3)
packages/bruno-app/src/components/RequestPane/QueryUrl/index.jspackages/bruno-app/src/components/RequestPane/SendButton/index.jspackages/bruno-app/src/components/RequestPane/WsQueryUrl/index.js
✅ Files skipped from review due to trivial changes (1)
- packages/bruno-app/src/components/RequestPane/SendButton/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/bruno-app/src/components/RequestPane/WsQueryUrl/index.js
… test compatibility
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/bruno-app/src/components/RequestPane/QueryUrl/index.js (1)
410-429:⚠️ Potential issue | 🟡 MinorAdd explicit test IDs for Generate Code and Save Request actions.
These controls are still only discoverable via
.infotip+ positional selectors, which is brittle for Playwright and already causing downstream selector coupling.♻️ Proposed fix
<div className="flex items-center h-full mx-2 gap-3" id="request-actions"> <div title="Generate Code" className="infotip" + data-testid="generate-code-button" onClick={(e) => { handleGenerateCode(e); }} > @@ <div title="Save Request" className="infotip" + data-testid="save-request-button" onClick={(e) => { e.stopPropagation(); if (!hasChanges) return; onSave(); }} >As per coding guidelines: "Add
data-testidto testable elements for Playwright."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/bruno-app/src/components/RequestPane/QueryUrl/index.js` around lines 410 - 429, Add explicit data-testid attributes to the two action controls so Playwright can reliably target them: add data-testid="generate-code-button" to the Generate Code element that calls handleGenerateCode and data-testid="save-request-button" to the Save Request element that calls onSave (both are inside the div with id="request-actions" and have className "infotip"); ensure the attributes are placed on the same clickable container elements that contain IconCode and the save UI so tests don't need positional selectors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/bruno-app/src/components/RequestPane/QueryUrl/index.js`:
- Around line 410-429: Add explicit data-testid attributes to the two action
controls so Playwright can reliably target them: add
data-testid="generate-code-button" to the Generate Code element that calls
handleGenerateCode and data-testid="save-request-button" to the Save Request
element that calls onSave (both are inside the div with id="request-actions" and
have className "infotip"); ensure the attributes are placed on the same
clickable container elements that contain IconCode and the save UI so tests
don't need positional selectors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 951e5c13-6e38-4e36-ae59-6bfffb8ec368
📒 Files selected for processing (5)
docs/playwright-testing-guide.mdpackages/bruno-app/src/components/RequestPane/QueryUrl/index.jstests/collection/create/create-collection.spec.tstests/utils/page/actions.tstests/utils/page/locators.ts
✅ Files skipped from review due to trivial changes (1)
- tests/utils/page/actions.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/collection/create/create-collection.spec.ts
…ebruno#7675) * feat: replace request send icon with Send/Cancel buttons --------- Co-authored-by: naman-bruno <[email protected]>
Description
Replaces the arrow / cancel icons on the HTTP , GraphQL and WebSocket URL bars with labeled Send and Cancel buttons.
JIRA
Screenshots
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit