Skip to content

feat(import): hide File Format option and default collections to Open… - #8247

Merged
naman-bruno merged 5 commits into
usebruno:mainfrom
ravindra-bruno:feat/bru-3518
Jun 17, 2026
Merged

naman-bruno merged 5 commits into
usebruno:mainfrom
ravindra-bruno:feat/bru-3518

Conversation

@ravindra-bruno

@ravindra-bruno ravindra-bruno commented Jun 12, 2026 •

Copy link
Copy Markdown
Collaborator

…Collection BRU-3518

Summary by CodeRabbit

  • Refactor
    • Simplified the collection import process by removing the file format selection option. Collections now automatically use a standardized default format for all imports, including ZIP imports.

Having the option to select ‘File Format’ is confusing for an end user. OpenCollection is our default standard, we should not allow for easy creation of Bru collections going forward.

What is the Bug?

Hide the "File Format" option in the Import Collection flow. Imports now always use OpenCollection (YAML) by default.

Steps to Reproduce

  1. Open the Import Collection dialog.
  2. Pick a collection to import.
  3. Notice the "File Format" dropdown letting you choose OpenCollection vs BRU.

Expected Behavior

No File Format option collections just import as OpenCollection (YAML).

Actual Behavior

The File Format dropdown shows up and lets users pick BRU, which we are removing as we moving towards the yaml format

Fixed one:
Screenshot 2026-06-12 at 3 44 50 PM

Summary by CodeRabbit

  • Improvements
    • Updated the import collection dialog to render advanced settings inside a dedicated overlay.
    • For non-ZIP imports, the “File Format” selector is now controlled by an expandable “Options” dropdown, defaulting to YAML, with the toggle updating its label as the selector appears/disappears.
    • Refined styling for the advanced options caret to match the app theme.
  • Tests
    • Added Playwright coverage for the Options toggle, verifying show/hide behavior and switching between supported file formats during import.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b41c4acc-a5a0-462d-8827-38155d6869cd

📥 Commits

Reviewing files that changed from the base of the PR and between 4c9a316 and 658963b.

📒 Files selected for processing (1)
  • tests/import/postman/import-file-format-options.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/import/postman/import-file-format-options.spec.ts

Walkthrough

The ImportCollectionLocation component now wraps the modal in a Portal and moves the file format selector behind a collapsible "Options" dropdown for non-ZIP imports. A new showFileFormat state controls visibility of the selector, and a dedicated dropdown ref manages toggling. The modal footer conditionally renders the "Options" control only for non-ZIP imports, and E2E tests validate the toggle behavior.

Changes

File Format Options Toggle

Layer / File(s) Summary
Toggle state, refs, and styling
packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.js, packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/StyledWrapper.js
A new showFileFormat state and dropdown-related refs are introduced to manage the Options toggle. CSS styling for .advanced-options with a .caret element is added to the wrapper.
Portal import and Options dropdown component
packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.js
The Portal component is imported and an ImportOptions forwardRef component is created as the dropdown trigger. A dropdown creation handler initializes the ref for hiding the dropdown before toggling file format visibility.
Modal rendering with conditional Options control
packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.js
The modal is wrapped in Portal and StyledWrapper, a conditional footerLeft "Options" dropdown is added for non-ZIP imports to toggle showFileFormat, and the file format select visibility is now controlled by the showFileFormat state.
E2E test for Options toggle and file format selection
tests/import/postman/import-file-format-options.spec.ts
Playwright spec validates that the file format selector is hidden by default, becomes visible when Options is toggled, defaults to YAML, can switch to BRU, and hides when toggled off with appropriate label changes.

Sequence Diagram

sequenceDiagram
  participant User
  participant Modal
  participant OptionsDropdown
  participant FileFormatSelect

  User->>OptionsDropdown: Click "Show File Format"
  OptionsDropdown->>OptionsDropdown: Toggle showFileFormat state
  alt showFileFormat true
    OptionsDropdown->>FileFormatSelect: Render selector
    User->>FileFormatSelect: Change format (yml/bru)
  else showFileFormat false
    OptionsDropdown->>FileFormatSelect: Hide selector
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • usebruno/bruno#7017: Both PRs modify ImportCollectionLocation's file format selector state—this PR adds the "Options/Show File Format" toggle controlling selector visibility, while the other PR changes the default collectionFormat value.
  • usebruno/bruno#7063: Both PRs conditionally hide/show the file format selector in ImportCollectionLocation based on import mode (ZIP vs non-ZIP).
  • usebruno/bruno#6533: Both PRs modify the import-collection UI flow in ImportCollectionLocation/index.js around file format selection state and conditional display of the format selector.

Suggested labels

size/M

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno
  • sid-bruno

Poem

🎛️ Behind an Options door, the formats now hide,
Portal-wrapped modals glide side by side,
Show or conceal with a toggle's light touch,
Import flows polished, we're shipping it much! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main feature: hiding the File Format option and defaulting collections to OpenCollection format, which directly aligns with the PR's primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@pull-request-size pull-request-size Bot added size/L and removed size/M labels Jun 15, 2026

@gopu-bruno gopu-bruno left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could add tests for new Options toggle, rest LGTM.

@utkarsh-bruno utkarsh-bruno left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you just optional chaining as null checks just to be safe ?

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
tests/import/postman/import-file-format-options.spec.ts (2)

41-52: ⚡ Quick win

Scope the test-id selector to the modal.

Line 47 uses page.getByTestId() which searches the entire page. Scoping to locationModal improves isolation and prevents false matches if the same test id appears elsewhere.

♻️ Proposed fix
       await locationModal.getByRole('button', { name: 'Options' }).click();
-      const toggle = page.getByTestId('show-file-format-toggle');
+      const toggle = locationModal.getByTestId('show-file-format-toggle');
       await expect(toggle).toHaveText('Hide File Format');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/import/postman/import-file-format-options.spec.ts` around lines 41 -
52, The test-id selector for 'show-file-format-toggle' is using
page.getByTestId() which searches the entire page instead of being scoped to the
locationModal. Change page.getByTestId('show-file-format-toggle') to
locationModal.getByTestId('show-file-format-toggle') to limit the search to the
modal context, improving test isolation and preventing false matches if the same
test id appears elsewhere on the page.

32-39: ⚡ Quick win

Scope the test-id selector to the modal.

Line 34 uses page.getByTestId() which searches the entire page. Scoping to locationModal improves isolation and prevents false matches if the same test id appears elsewhere.

♻️ Proposed fix
     await test.step('Options toggle reveals the File Format selector defaulting to OpenCollection (YAML)', async () => {
       await locationModal.getByRole('button', { name: 'Options' }).click();
-      await page.getByTestId('show-file-format-toggle').click();
+      await locationModal.getByTestId('show-file-format-toggle').click();
 
       const formatSelect = locationModal.locator('`#format`');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/import/postman/import-file-format-options.spec.ts` around lines 32 -
39, The test step uses page.getByTestId('show-file-format-toggle') which
searches the entire page, but it should be scoped to the locationModal to
improve test isolation and prevent false matches if the same test id exists
elsewhere. Change the page.getByTestId('show-file-format-toggle').click() call
to use locationModal.getByTestId('show-file-format-toggle').click() instead to
scope the selector to the modal context where the 'Options' button was just
clicked.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/import/postman/import-file-format-options.spec.ts`:
- Around line 41-52: The test-id selector for 'show-file-format-toggle' is using
page.getByTestId() which searches the entire page instead of being scoped to the
locationModal. Change page.getByTestId('show-file-format-toggle') to
locationModal.getByTestId('show-file-format-toggle') to limit the search to the
modal context, improving test isolation and preventing false matches if the same
test id appears elsewhere on the page.
- Around line 32-39: The test step uses
page.getByTestId('show-file-format-toggle') which searches the entire page, but
it should be scoped to the locationModal to improve test isolation and prevent
false matches if the same test id exists elsewhere. Change the
page.getByTestId('show-file-format-toggle').click() call to use
locationModal.getByTestId('show-file-format-toggle').click() instead to scope
the selector to the modal context where the 'Options' button was just clicked.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 750ccebe-9d8d-49ca-8b39-eb4c58d329a6

📥 Commits

Reviewing files that changed from the base of the PR and between ef95bcd and 885a5c3.

📒 Files selected for processing (3)
  • packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/StyledWrapper.js
  • packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.js
  • tests/import/postman/import-file-format-options.spec.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/StyledWrapper.js

@utkarsh-bruno utkarsh-bruno left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good

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.

4 participants