Repository navigation
feat(import): hide File Format option and default collections to Open… - #8247
Conversation
…Collection (BRU-3518)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe 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 ChangesFile Format Options Toggle
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
gopu-bruno
left a comment
There was a problem hiding this comment.
Could add tests for new Options toggle, rest LGTM.
utkarsh-bruno
left a comment
There was a problem hiding this comment.
Can you just optional chaining as null checks just to be safe ?
There was a problem hiding this comment.
🧹 Nitpick comments (2)
tests/import/postman/import-file-format-options.spec.ts (2)
41-52: ⚡ Quick winScope the test-id selector to the modal.
Line 47 uses
page.getByTestId()which searches the entire page. Scoping tolocationModalimproves 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 winScope the test-id selector to the modal.
Line 34 uses
page.getByTestId()which searches the entire page. Scoping tolocationModalimproves 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
📒 Files selected for processing (3)
packages/bruno-app/src/components/Sidebar/ImportCollectionLocation/StyledWrapper.jspackages/bruno-app/src/components/Sidebar/ImportCollectionLocation/index.jstests/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
…tion/index.js Co-authored-by: Utkarsh <[email protected]>
…Collection BRU-3518
Summary by CodeRabbit
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
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:

Summary by CodeRabbit