Skip to content

fix: reverted the easy creation flow to the old, modal based approach#6449

Merged
sid-bruno merged 4 commits intousebruno:mainfrom
chirag-bruno:fix/revert-easy-request-creation
Dec 19, 2025
Merged

fix: reverted the easy creation flow to the old, modal based approach#6449
sid-bruno merged 4 commits intousebruno:mainfrom
chirag-bruno:fix/revert-easy-request-creation

Conversation

@chirag-bruno
Copy link
Collaborator

@chirag-bruno chirag-bruno commented Dec 18, 2025

Description

This PR reverts the changes made for easy request creation from the Collection Tabs.

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Summary by CodeRabbit

  • Style

    • Request tabs now use a compact plus-icon button to open the new-request modal, replacing the previous inline untitled-request control.
  • Tests

    • End-to-end tests updated to create and reference explicitly named requests via the dialog/modal flow; creation, drag-and-drop, tagging, encoding, and large-response tests now operate on named requests and collection-scoped selectors.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Walkthrough

Replaces 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

Cohort / File(s) Summary
Request Tab UI Update
packages/bruno-app/src/components/RequestTabs/index.js
Removed inline CreateUntitledRequest; added IconPlus import from @tabler/icons; rendered an IconPlus (size 18, strokeWidth 1.5) that calls setNewRequestModalOpen(true) on click; modal state preserved.
Tests — createRequest migration
tests/collection/create/create-collection.spec.ts, tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts, tests/collection/moving-requests/tag-persistence.spec.ts, tests/request/encoding/curl-encoding.spec.ts, tests/response/large-response-crash-prevention.spec.ts
Replaced createUntitledRequest with createRequest; introduced collectionName/requestName variables; switched creation flows from untitled/dropdown to named dialog/modal creation; updated selectors and assertions to target named requests and collection-scoped items.
Test helpers / exports changed
tests/utils/page (and imports across tests)
Public helper renamed/updated: createUntitledRequest(page, { ... })createRequest(page, requestName, collectionName, { ... }); imports adjusted accordingly across test files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect packages/bruno-app/src/components/RequestTabs/index.js to confirm modal open trigger is identical in behavior (click, keyboard, and ARIA focus) to the previous flow.
  • Verify tests/utils/page implements the new createRequest signature and that all test callers were updated (no remaining createUntitledRequest imports).
  • Review updated test selectors (collection-scoped request lookups) for robustness and flakiness risks (sidebar rendering, timing).

Possibly related PRs

Suggested reviewers

  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

A tiny plus where text once sat,
One click and modal greets the chat.
Tests now name the requests they play,
Dialogs steady the old display.
Small change, bright click — pipelines sway. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: reverting easy request creation to a modal-based approach, which is reflected across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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:

  1. Formatting: For consistency with other icons in this file (lines 127, 177), consider single-line formatting since there are only 3 props.

  2. Accessibility: Add an aria-label to 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

📥 Commits

Reviewing files that changed from the base of the PR and between 678fa88 and 58d871d.

📒 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() not func ()
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

@pull-request-size pull-request-size bot added size/L and removed size/S labels Dec 18, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
tests/request/encoding/curl-encoding.spec.ts (2)

17-60: Consider using test.step for improved test reporting.

Both test cases would benefit from wrapping logical steps in test.step blocks 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 createRequest with 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.step blocks 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

📥 Commits

Reviewing files that changed from the base of the PR and between 58d871d and d87cf9f.

📒 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() not func ()
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.ts
  • tests/collection/create/create-collection.spec.ts
  • tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts
  • tests/response/large-response-crash-prevention.spec.ts
  • tests/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture 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.ts
  • tests/collection/create/create-collection.spec.ts
  • tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts
  • tests/response/large-response-crash-prevention.spec.ts
  • tests/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.ts
  • tests/collection/moving-requests/cross-collection-drag-drop-request.spec.ts
  • tests/response/large-response-crash-prevention.spec.ts
  • tests/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 createUntitledRequest to createRequest with named parameters correctly aligns with the PR objective to revert to the modal-based approach. The new API signature createRequest(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 createRequest with 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 createRequest with the requestName constant 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 createUntitledRequest to createRequest, 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 that createRequest helper defaults to HTTP request type.

The requestType parameter has been removed from CreateRequestOptions (now only contains url and inFolder). 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/bruno-app/src/components/RequestTabs/index.js (1)

13-13: Remove unused CreateUntitledRequest import.

This import is no longer used since the component now uses IconPlus with the NewRequest modal.

🧹 Nitpick comments (4)
packages/bruno-app/src/components/RequestTabs/index.js (1)

5-5: Consolidate @tabler/icons imports.

IconPlus on 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 reducing waitForTimeout calls.

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 using test.step for better report readability.

Per coding guidelines, test.step helps 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 in buildCommonLocators that 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

📥 Commits

Reviewing files that changed from the base of the PR and between d87cf9f and af98769.

📒 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() not func ()
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.ts
  • packages/bruno-app/src/components/RequestTabs/index.js
  • tests/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture 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.ts
  • tests/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.ts
  • tests/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" and tabIndex={0} with an onKeyDown handler 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 with Meta+s in second test.

This line also needs to use ControlOrMeta+s for 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+s only works on macOS. Use ControlOrMeta+s for 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 in test.step for clearer reports.

Per the coding guidelines, using test.step improves 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 using test.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.step would improve report readability per coding guidelines.

Also applies to: 60-101

tests/collection/moving-requests/tag-persistence.spec.ts (1)

27-27: Reduce page.waitForTimeout() usage where possible.

Per coding guidelines, minimize waitForTimeout calls when locators can be found using existing expect() 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

📥 Commits

Reviewing files that changed from the base of the PR and between af98769 and fca8f36.

📒 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() not func ()
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.ts
  • tests/collection/create/create-collection.spec.ts
  • tests/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 existing expect() playwright calls

  • Avoid using page.pause() in code

  • Use locator variables for locators

  • Avoid using test.only

  • Use multiple assertions

  • Promote the use of test.step as much as possible so the generated reports are easier to read

  • Ensure that the fixtures like the collections are nested inside the fixtures folder

    Fixture 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.ts
  • tests/collection/create/create-collection.spec.ts
  • tests/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.ts
  • tests/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 createRequest helper 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.

@sid-bruno sid-bruno merged commit e4e17b0 into usebruno:main Dec 19, 2025
8 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jan 27, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants