fix: reverted the easy creation flow to the old, modal based approach#6449
Conversation
WalkthroughReplaces the inline CreateUntitledRequest trigger in RequestTabs with an IconPlus button that opens the new request modal; test suites and helpers were updated to use a new createRequest API creating explicitly named requests via a dialog/modal flow. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/bruno-app/src/components/RequestTabs/index.js (1)
182-190: Consider formatting consistency and accessibility.The implementation is functionally correct. Two optional improvements:
Formatting: For consistency with other icons in this file (lines 127, 177), consider single-line formatting since there are only 3 props.
Accessibility: Add an
aria-labelto improve screen reader support.🔎 Suggested improvements:
- <div className="flex items-center cursor-pointer short-tab"> - { - activeCollection && ( - <IconPlus - size={18} - strokeWidth={1.5} - onClick={() => setNewRequestModalOpen(true)} - /> - ) - } - </div> + <div className="flex items-center cursor-pointer short-tab"> + {activeCollection && ( + <IconPlus + size={18} + strokeWidth={1.5} + onClick={() => setNewRequestModalOpen(true)} + aria-label="Create new request" + /> + )} + </div>
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/bruno-app/src/components/RequestTabs/index.js(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-app/src/components/RequestTabs/index.js
🧠 Learnings (1)
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/RequestTabs/index.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - macOS
- GitHub Check: Unit Tests
…d the usage of createUntitledRequest
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
tests/request/encoding/curl-encoding.spec.ts (2)
17-60: Consider usingtest.stepfor improved test reporting.Both test cases would benefit from wrapping logical steps in
test.stepblocks to improve readability of generated reports, as recommended in the coding guidelines.Example refactor for the first test:
test('Should generate code with proper URL encoding for unencoded input', async ({ page, createTmpDir }) => { const collectionName = 'unencoded-test-collection'; const requestName = 'curl-encoding-unencoded'; - // Use plus icon button in new workspace UI - await page.getByTestId('collections-header-add-menu').click(); - await page.locator('.tippy-box .dropdown-item').filter({ hasText: 'Create collection' }).click(); - await page.getByLabel('Name').fill(collectionName); - const locationInput = page.getByLabel('Location'); - if (await locationInput.isVisible()) { - await locationInput.fill(await createTmpDir(collectionName)); - } - await page.locator('.bruno-modal').getByRole('button', { name: 'Create', exact: true }).click(); + await test.step('Create collection with safe mode enabled', async () => { + await page.getByTestId('collections-header-add-menu').click(); + await page.locator('.tippy-box .dropdown-item').filter({ hasText: 'Create collection' }).click(); + await page.getByLabel('Name').fill(collectionName); + const locationInput = page.getByLabel('Location'); + if (await locationInput.isVisible()) { + await locationInput.fill(await createTmpDir(collectionName)); + } + await page.locator('.bruno-modal').getByRole('button', { name: 'Create', exact: true }).click(); - await expect(page.locator('#sidebar-collection-name').filter({ hasText: collectionName })).toBeVisible(); - await page.locator('#sidebar-collection-name').filter({ hasText: collectionName }).click(); - await page.getByLabel('Safe Mode').check(); - await page.getByRole('button', { name: 'Save' }).click(); + await expect(page.locator('#sidebar-collection-name').filter({ hasText: collectionName })).toBeVisible(); + await page.locator('#sidebar-collection-name').filter({ hasText: collectionName }).click(); + await page.getByLabel('Safe Mode').check(); + await page.getByRole('button', { name: 'Save' }).click(); + }); - // Create a new request using the dialog/modal flow - await createRequest(page, requestName, collectionName, { url: 'http://base.source?name=John Doe' }); + await test.step('Create request with unencoded URL', async () => { + await createRequest(page, requestName, collectionName, { url: 'http://base.source?name=John Doe' }); + await page.locator('.collection-item-name').filter({ hasText: requestName }).first().click(); + }); - // Click the request in the sidebar - await page.locator('.collection-item-name').filter({ hasText: requestName }).first().click(); - - await page.locator('#send-request .infotip').first().click(); - - await expect(page.getByRole('dialog')).toBeVisible(); - await expect(page.getByRole('dialog').locator('.bruno-modal-header-title')).toContainText('Generate Code'); - - const codeEditor = page.locator('.editor-content .CodeMirror').first(); - await expect(codeEditor).toBeVisible(); - - const generatedCode = await codeEditor.textContent(); - - expect(generatedCode).toContain('http://base.source/?name=John%20Doe'); + await test.step('Verify URL encoding in generated code', async () => { + await page.locator('#send-request .infotip').first().click(); + + await expect(page.getByRole('dialog')).toBeVisible(); + await expect(page.getByRole('dialog').locator('.bruno-modal-header-title')).toContainText('Generate Code'); + + const codeEditor = page.locator('.editor-content .CodeMirror').first(); + await expect(codeEditor).toBeVisible(); + + const generatedCode = await codeEditor.textContent(); + expect(generatedCode).toContain('http://base.source/?name=John%20Doe'); + });Also applies to: 62-105
24-37: Consider extracting duplicate collection setup logic.The collection creation and safe mode configuration logic is duplicated between both tests. Consider extracting this into a helper function in the test utils for better maintainability.
Also applies to: 69-82
tests/collection/moving-requests/tag-persistence.spec.ts (1)
2-44: LGTM! Solid refactor to named requests with tag verification.The migration to
createRequestwith a loop for creating multiple named requests is clean and maintains good test structure. The use of constants (collectionName,requestUrl,tagName,requestNames) improves readability and maintainability.Optional: Consider reducing
page.waitForTimeout()usage.The new loop introduces several
page.waitForTimeout()calls (lines 37, 40, 43). Per the coding guidelines, consider using Playwright's built-in wait mechanisms where possible:Example improvement
- await page.waitForTimeout(200); await locators.tags.input().fill(tagName); await locators.tags.input().press('Enter'); - await page.waitForTimeout(200); await expect(locators.tags.item(tagName)).toBeVisible();The
expect(...).toBeVisible()already waits for the element, potentially making the explicit timeouts redundant.tests/response/large-response-crash-prevention.spec.ts (1)
14-39: Consider using test.step for better test reports.The test could benefit from wrapping logical sections in
test.stepblocks to improve readability of generated reports, as recommended in the coding guidelines.🔎 View suggested refactor
test('Show appropriate warning for responses over 10MB', async ({ page, createTmpDir }) => { const collectionName = 'size-warning-test'; const requestName = 'large-response'; - // Create collection - await createCollection(page, collectionName, await createTmpDir(collectionName), { openWithSandboxMode: 'safe' }); + await test.step('Create collection and request', async () => { + await createCollection(page, collectionName, await createTmpDir(collectionName), { openWithSandboxMode: 'safe' }); - // Create request using the dialog/modal flow - await createRequest(page, requestName, collectionName, { - url: 'https://samples.json-format.com/employees/json/employees_50MB.json' + await createRequest(page, requestName, collectionName, { + url: 'https://samples.json-format.com/employees/json/employees_50MB.json' + }); }); - // Send request - const sendButton = page.getByTestId('send-arrow-icon'); - await sendButton.click(); + await test.step('Send request', async () => { + const sendButton = page.getByTestId('send-arrow-icon'); + await sendButton.click(); + }); - // Verify warning appears - await expect(page.getByText('Large Response Warning')).toBeVisible({ timeout: 60000 }); - - // Verify warning content - await expect(page.getByText('Handling responses over')).toBeVisible(); - await expect(page.getByText('could degrade performance')).toBeVisible(); - - // Verify action button - await expect(page.getByRole('button', { name: 'View', exact: true })).toBeVisible(); + await test.step('Verify large response warning', async () => { + await expect(page.getByText('Large Response Warning')).toBeVisible({ timeout: 60000 }); + await expect(page.getByText('Handling responses over')).toBeVisible(); + await expect(page.getByText('could degrade performance')).toBeVisible(); + await expect(page.getByRole('button', { name: 'View', exact: true })).toBeVisible(); + }); });
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
tests/collection/create/create-collection.spec.ts(2 hunks)tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts(5 hunks)tests/collection/moving-requests/tag-persistence.spec.ts(3 hunks)tests/request/encoding/curl-encoding.spec.ts(3 hunks)tests/response/large-response-crash-prevention.spec.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
tests/request/encoding/curl-encoding.spec.tstests/collection/create/create-collection.spec.tstests/collection/moving-requests/cross-collection-drag-drop-request.spec.tstests/response/large-response-crash-prevention.spec.tstests/collection/moving-requests/tag-persistence.spec.ts
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/request/encoding/curl-encoding.spec.tstests/collection/create/create-collection.spec.tstests/collection/moving-requests/cross-collection-drag-drop-request.spec.tstests/response/large-response-crash-prevention.spec.tstests/collection/moving-requests/tag-persistence.spec.ts
🧠 Learnings (2)
📚 Learning: 2025-12-16T07:16:08.934Z
Learnt from: sanish-bruno
Repo: usebruno/bruno PR: 6090
File: tests/scripting/hooks/init-user-data/ui-state-snapshot.json:1-8
Timestamp: 2025-12-16T07:16:08.934Z
Learning: For e2e tests in the bruno repository: Collections that are shared between CLI and UI tests (comprehensive test suites testing core functionality) should be placed in `packages/bruno-tests/` to avoid duplication. The `tests/**/fixtures/collection` pattern should be used for test-specific collections that test particular UI behaviors or are specific to a single test file.
Applied to files:
tests/collection/create/create-collection.spec.tstests/collection/moving-requests/cross-collection-drag-drop-request.spec.tstests/response/large-response-crash-prevention.spec.tstests/collection/moving-requests/tag-persistence.spec.ts
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Use consistent patterns and helper utilities where they improve clarity. Prefer shared test utilities over copy-pasted setup code, but only when it actually reduces complexity
Applied to files:
tests/collection/moving-requests/tag-persistence.spec.ts
🧬 Code graph analysis (4)
tests/request/encoding/curl-encoding.spec.ts (1)
tests/utils/page/actions.ts (1)
createRequest(718-718)
tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts (1)
tests/utils/page/actions.ts (2)
createCollection(717-717)createRequest(718-718)
tests/response/large-response-crash-prevention.spec.ts (1)
tests/utils/page/actions.ts (2)
createCollection(717-717)createRequest(718-718)
tests/collection/moving-requests/tag-persistence.spec.ts (1)
tests/utils/page/actions.ts (2)
createRequest(718-718)selectRequestPaneTab(736-736)
🔇 Additional comments (7)
tests/request/encoding/curl-encoding.spec.ts (1)
2-2: LGTM - Migration to modal-based request creation.The shift from
createUntitledRequesttocreateRequestwith named parameters correctly aligns with the PR objective to revert to the modal-based approach. The new API signaturecreateRequest(page, requestName, collectionName, { url })properly supports the dialog/modal flow for request creation.Also applies to: 40-40, 85-85
tests/collection/create/create-collection.spec.ts (1)
2-31: LGTM! Clean migration to the new request creation API.The refactor to use
createRequestwith named constants (collectionName,requestName) improves test maintainability and aligns well with the modal-based creation flow. All references are consistently updated.tests/collection/moving-requests/tag-persistence.spec.ts (1)
46-69: LGTM! Drag-drop verification correctly uses named requests.The update to use named request locators (
request-1,request-3) for the drag-drop operation and subsequent verification is correct and more explicit than the previous untitled approach.tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts (2)
2-54: LGTM! Clean cross-collection drag-drop test with named requests.The refactor to use
createRequestwith therequestNameconstant makes the test more explicit and maintainable. The updated selectors correctly locate the request by name within the collection containers.
56-103: LGTM! Duplicate request error scenario correctly updated.The test properly creates requests with the same name (
duplicate-request) in both collections and verifies that the drag-drop operation fails with the expected error. The selectors are correctly updated to locate named requests in both source and target collections.tests/response/large-response-crash-prevention.spec.ts (2)
2-2: LGTM! Migration to modal-based request creation is correct.The changes properly migrate from
createUntitledRequesttocreateRequest, aligning with the PR objective to revert to modal-based request creation. The new API signature explicitly requires a request name and collection name, and the test correctly provides both.Also applies to: 16-16, 21-24
22-24: Confirm thatcreateRequesthelper defaults to HTTP request type.The
requestTypeparameter has been removed fromCreateRequestOptions(now only containsurlandinFolder). The function implicitly defaults to HTTP by invoking the "New Request" menu item, which the UI defaults to HTTP request type. This test's expectation to send an HTTP request is correct.
…easy-request-creation
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
packages/bruno-app/src/components/RequestTabs/index.js (1)
13-13: Remove unusedCreateUntitledRequestimport.This import is no longer used since the component now uses
IconPluswith theNewRequestmodal.
🧹 Nitpick comments (4)
packages/bruno-app/src/components/RequestTabs/index.js (1)
5-5: Consolidate@tabler/iconsimports.
IconPluson line 14 should be merged with the existing import on line 5 to keep imports tidy.🔎 Suggested fix:
-import { IconChevronRight, IconChevronLeft } from '@tabler/icons'; +import { IconChevronRight, IconChevronLeft, IconPlus } from '@tabler/icons'; ... -import { IconPlus } from '@tabler/icons';Also applies to: 14-14
tests/collection/moving-requests/tag-persistence.spec.ts (2)
29-29: Consider reducingwaitForTimeoutcalls.Per coding guidelines, prefer Playwright's built-in waiting mechanisms over fixed timeouts. The 1000ms wait on line 29 seems particularly long. Consider replacing with explicit locator waits where possible (e.g., waiting for a specific element state after save).
Also applies to: 37-37, 40-40, 43-43
11-70: Consider usingtest.stepfor better report readability.Per coding guidelines,
test.stephelps generate easier-to-read reports. The test has clear logical phases (setup, create requests, add tags, move, verify) that would benefit from step wrapping.Example:
await test.step('Create collection and requests', async () => { // creation logic }); await test.step('Add tags to requests', async () => { // tagging logic }); await test.step('Move request and verify tag persistence', async () => { // move and verify logic });tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts (1)
26-30: Fragile parent selector pattern.Using
.locator('..')to traverse to parent depends on the exact DOM structure. If the markup changes, this will break silently. Consider extracting a more robust locator helper inbuildCommonLocatorsthat encapsulates this pattern.Example approach:
// In locators.ts collectionContainer: (name: string) => page.locator('.collection-container').filter({ has: page.locator('.collection-name', { hasText: name }) })
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/bruno-app/src/components/RequestTabs/index.js(2 hunks)tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts(5 hunks)tests/collection/moving-requests/tag-persistence.spec.ts(3 hunks)tests/response/large-response-crash-prevention.spec.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/response/large-response-crash-prevention.spec.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
tests/collection/moving-requests/tag-persistence.spec.tspackages/bruno-app/src/components/RequestTabs/index.jstests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/collection/moving-requests/tag-persistence.spec.tstests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts
🧠 Learnings (3)
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Use consistent patterns and helper utilities where they improve clarity. Prefer shared test utilities over copy-pasted setup code, but only when it actually reduces complexity
Applied to files:
tests/collection/moving-requests/tag-persistence.spec.ts
📚 Learning: 2025-12-16T07:16:08.934Z
Learnt from: sanish-bruno
Repo: usebruno/bruno PR: 6090
File: tests/scripting/hooks/init-user-data/ui-state-snapshot.json:1-8
Timestamp: 2025-12-16T07:16:08.934Z
Learning: For e2e tests in the bruno repository: Collections that are shared between CLI and UI tests (comprehensive test suites testing core functionality) should be placed in `packages/bruno-tests/` to avoid duplication. The `tests/**/fixtures/collection` pattern should be used for test-specific collections that test particular UI behaviors or are specific to a single test file.
Applied to files:
tests/collection/moving-requests/tag-persistence.spec.tstests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-app/src/components/RequestTabs/index.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
- GitHub Check: Unit Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - macOS
🔇 Additional comments (3)
packages/bruno-app/src/components/RequestTabs/index.js (1)
178-186: LGTM with minor accessibility consideration.The implementation is clean and consistent with the existing icon styling. Consider adding
role="button"andtabIndex={0}with anonKeyDownhandler for keyboard accessibility, though this can be deferred.tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts (2)
10-51: LGTM - Test logic is clear and assertions are comprehensive.The test properly verifies cross-collection drag-and-drop with explicit named requests. Good use of visibility checks before and after the operation.
53-100: Good error path coverage.Solid test for the duplicate-name scenario with proper verification that both collections retain their original requests after a failed move.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/collection/moving-requests/tag-persistence.spec.ts (1)
121-121: Same cross-platform issue withMeta+sin second test.This line also needs to use
ControlOrMeta+sfor cross-platform compatibility.🔎 Suggested fix:
- await page.keyboard.press('Meta+s'); + await page.keyboard.press('ControlOrMeta+s');
♻️ Duplicate comments (1)
tests/collection/moving-requests/tag-persistence.spec.ts (1)
40-40: Cross-platform keyboard shortcut issue.
Meta+sonly works on macOS. UseControlOrMeta+sfor cross-platform compatibility.🔎 Suggested fix:
- await page.keyboard.press('Meta+s'); + await page.keyboard.press('ControlOrMeta+s');
🧹 Nitpick comments (4)
tests/collection/create/create-collection.spec.ts (2)
10-42: Consider wrapping logical steps intest.stepfor clearer reports.Per the coding guidelines, using
test.stepimproves report readability. This test has clear logical phases (collection creation, request creation, URL setting, send request, verify response) that would benefit from grouping.🔎 Example structure:
test('Create collection and add a simple HTTP request', async ({ page, createTmpDir }) => { const collectionName = 'test-collection'; const requestName = 'ping'; + await test.step('Create a new collection', async () => { await page.getByTestId('collections-header-add-menu').click(); await page.locator('.tippy-box .dropdown-item').filter({ hasText: 'Create collection' }).click(); await page.getByLabel('Name').click(); await page.getByLabel('Name').fill(collectionName); await page.getByLabel('Name').press('Tab'); const locationInput = page.locator('.bruno-modal').getByLabel('Location'); if (await locationInput.isVisible()) { await locationInput.fill(await createTmpDir(collectionName)); } await page.locator('.bruno-modal').getByRole('button', { name: 'Create', exact: true }).click(); await page.locator('#sidebar-collection-name').filter({ hasText: collectionName }).click(); + }); + await test.step('Create a new request', async () => { await createRequest(page, requestName, collectionName); + }); // ... additional steps });
23-24: Add an assertion after collection creation to ensure it succeeded.Before proceeding to create a request, verify the collection was actually created. This improves test reliability and provides a clearer failure point.
🔎 Suggested fix:
await page.locator('.bruno-modal').getByRole('button', { name: 'Create', exact: true }).click(); + await expect(page.locator('#sidebar-collection-name').filter({ hasText: collectionName })).toBeVisible(); await page.locator('#sidebar-collection-name').filter({ hasText: collectionName }).click();tests/request/encoding/curl-encoding.spec.ts (1)
17-58: Consider extracting shared setup into a helper or usingtest.step.Both tests share nearly identical collection/request creation code. This duplication could be reduced with a shared helper function or by using a parameterized test approach. Additionally, wrapping logical steps in
test.stepwould improve report readability per coding guidelines.Also applies to: 60-101
tests/collection/moving-requests/tag-persistence.spec.ts (1)
27-27: Reducepage.waitForTimeout()usage where possible.Per coding guidelines, minimize
waitForTimeoutcalls when locators can be found using existingexpect()assertions. Several of these waits could potentially be replaced with explicit visibility checks or removed if the preceding actions already ensure readiness.🔎 Example improvements:
- await page.waitForTimeout(1000); + await expect(locators.sidebar.collection(collectionName)).toBeVisible(); // Create three requests via the dialog/modal flow, then add a tag to each const requestNames = ['request-1', 'request-2', 'request-3']; for (const requestName of requestNames) { await createRequest(page, requestName, collectionName, { url: requestUrl }); await locators.sidebar.request(requestName).click(); await locators.tabs.requestTab(requestName).waitFor({ state: 'visible' }); await selectRequestPaneTab(page, 'Settings'); - await page.waitForTimeout(200); await locators.tags.input().fill(tagName); await locators.tags.input().press('Enter'); - await page.waitForTimeout(200); await expect(locators.tags.item(tagName)).toBeVisible(); await page.keyboard.press('ControlOrMeta+s'); - await page.waitForTimeout(200); }Also applies to: 35-41, 65-66
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
tests/collection/create/create-collection.spec.ts(2 hunks)tests/collection/moving-requests/tag-persistence.spec.ts(3 hunks)tests/request/encoding/curl-encoding.spec.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
tests/request/encoding/curl-encoding.spec.tstests/collection/create/create-collection.spec.tstests/collection/moving-requests/tag-persistence.spec.ts
tests/**/**.*
⚙️ CodeRabbit configuration file
tests/**/**.*: Review the following e2e test code written using the Playwright test library. Ensure that:
Follow best practices for Playwright code and e2e automation
Try to reduce usage of
page.waitForTimeout();in code unless absolutely necessary and the locator cannot be found using existingexpect()playwright callsAvoid using
page.pause()in codeUse locator variables for locators
Avoid using test.only
Use multiple assertions
Promote the use of
test.stepas much as possible so the generated reports are easier to readEnsure that the
fixtureslike the collections are nested inside thefixturesfolderFixture Example*: Here's an example of possible fixture and test pair
. ├── fixtures │ └── collection │ ├── base.bru │ ├── bruno.json │ ├── collection.bru │ ├── ws-test-request-with-headers.bru │ ├── ws-test-request-with-subproto.bru │ └── ws-test-request.bru ├── connection.spec.ts # <- Depends on the collection in ./fixtures/collection ├── headers.spec.ts ├── persistence.spec.ts ├── variable-interpolation │ ├── fixtures │ │ └── collection │ │ ├── environments │ │ ├── bruno.json │ │ └── ws-interpolation-test.bru │ ├── init-user-data │ └── variable-interpolation.spec.ts # <- Depends on the collection in ./variable-interpolation/fixtures/collection └── subproto.spec.ts
Files:
tests/request/encoding/curl-encoding.spec.tstests/collection/create/create-collection.spec.tstests/collection/moving-requests/tag-persistence.spec.ts
🧠 Learnings (2)
📚 Learning: 2025-12-16T07:16:08.934Z
Learnt from: sanish-bruno
Repo: usebruno/bruno PR: 6090
File: tests/scripting/hooks/init-user-data/ui-state-snapshot.json:1-8
Timestamp: 2025-12-16T07:16:08.934Z
Learning: For e2e tests in the bruno repository: Collections that are shared between CLI and UI tests (comprehensive test suites testing core functionality) should be placed in `packages/bruno-tests/` to avoid duplication. The `tests/**/fixtures/collection` pattern should be used for test-specific collections that test particular UI behaviors or are specific to a single test file.
Applied to files:
tests/collection/create/create-collection.spec.tstests/collection/moving-requests/tag-persistence.spec.ts
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Use consistent patterns and helper utilities where they improve clarity. Prefer shared test utilities over copy-pasted setup code, but only when it actually reduces complexity
Applied to files:
tests/collection/moving-requests/tag-persistence.spec.ts
🧬 Code graph analysis (2)
tests/request/encoding/curl-encoding.spec.ts (1)
tests/utils/page/actions.ts (1)
createRequest(849-849)
tests/collection/moving-requests/tag-persistence.spec.ts (1)
tests/utils/page/actions.ts (2)
createRequest(849-849)selectRequestPaneTab(867-867)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Playwright E2E Tests
- GitHub Check: CLI Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: Unit Tests
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
🔇 Additional comments (3)
tests/request/encoding/curl-encoding.spec.ts (1)
37-41: LGTM on the request creation and sidebar interaction flow.Good use of the new
createRequesthelper with the URL option, followed by a sidebar click using the named request. The.first()selector is appropriate for disambiguation.tests/collection/moving-requests/tag-persistence.spec.ts (2)
28-42: Good use of loop for request creation with tagging.Clean approach using a for-loop to create multiple named requests and apply tags consistently. This is more maintainable than duplicated code blocks.
44-67: LGTM on the drag-and-drop and verification logic.The move operation and subsequent tag persistence verification are well structured. Good use of explicit locator variables and visibility assertions.
Description
This PR reverts the changes made for easy request creation from the Collection Tabs.
Contribution Checklist:
Summary by CodeRabbit
Style
Tests
✏️ Tip: You can customize this high-level summary in your review settings.