refactor: replace button elements with new Button component#6512
Conversation
WalkthroughReplaced native HTML Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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: 0
🧹 Nitpick comments (1)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RunCollectionItem/index.js (1)
84-101: Consider usingtype="button"for non-form buttons.The buttons use
type="submit"but aren't inside a form element. While this doesn't break functionality (onClick handlers still fire), it's semantically incorrect. Consider usingtype="button"for all action buttons that rely on explicit onClick handlers outside form contexts.🔎 Suggested fix
- <Button type="button" color="secondary" variant="ghost" onClick={onClose} className="mr-3"> + <Button color="secondary" variant="ghost" onClick={onClose} className="mr-3"> Cancel </Button> { isCollectionRunInProgress ? ( - <Button type="submit" onClick={handleViewRunner}> + <Button onClick={handleViewRunner}> View Run </Button> ) : ( <> - <Button type="submit" disabled={shouldDisableRecursiveFolderRun} onClick={() => onSubmit(true)} className="mr-3"> + <Button disabled={shouldDisableRecursiveFolderRun} onClick={() => onSubmit(true)} className="mr-3"> Recursive Run </Button> - <Button type="submit" disabled={shouldDisableFolderRun} onClick={() => onSubmit(false)}> + <Button disabled={shouldDisableFolderRun} onClick={() => onSubmit(false)}> Run </Button> </> ) }Note: The Button component defaults to
type="button", so these explicit type attributes can be omitted entirely.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
packages/bruno-app/src/components/RequestPane/GrpcQueryUrl/GrpcurlModal/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/CloneCollectionItem/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RenameCollectionItem/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RunCollectionItem/index.jspackages/bruno-app/src/components/Sidebar/NewFolder/index.jspackages/bruno-app/src/components/Sidebar/NewRequest/index.js
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/bruno-app/src/components/Sidebar/NewRequest/index.js
- packages/bruno-app/src/components/Sidebar/NewFolder/index.js
🧰 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/RequestPane/GrpcQueryUrl/GrpcurlModal/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RenameCollectionItem/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RunCollectionItem/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/CloneCollectionItem/index.js
🧠 Learnings (2)
📚 Learning: 2025-12-02T09:45:31.709Z
Learnt from: sid-bruno
Repo: usebruno/bruno PR: 6266
File: packages/bruno-app/src/components/ResponsePane/ResponseCopy/index.js:38-38
Timestamp: 2025-12-02T09:45:31.709Z
Learning: In the ResponseCopy component (packages/bruno-app/src/components/ResponsePane/ResponseCopy/index.js), the copy button is intentionally disabled using `!response.data` to prevent copying stream resets which result in empty strings.
Applied to files:
packages/bruno-app/src/components/RequestPane/GrpcQueryUrl/GrpcurlModal/index.js
📚 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/RequestPane/GrpcQueryUrl/GrpcurlModal/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RenameCollectionItem/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RunCollectionItem/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/CloneCollectionItem/index.js
🧬 Code graph analysis (4)
packages/bruno-app/src/components/RequestPane/GrpcQueryUrl/GrpcurlModal/index.js (1)
packages/bruno-app/src/ui/Button/index.js (1)
Button(4-79)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RenameCollectionItem/index.js (1)
packages/bruno-app/src/ui/Button/index.js (1)
Button(4-79)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RunCollectionItem/index.js (4)
packages/bruno-app/src/ui/Button/index.js (1)
Button(4-79)packages/bruno-app/src/components/Sidebar/NewRequest/index.js (1)
onSubmit(262-262)packages/bruno-app/src/components/Sidebar/Collections/Collection/CloneCollection/index.js (1)
onSubmit(85-85)packages/bruno-app/src/components/Sidebar/Collections/Collection/RenameCollection/index.js (1)
onSubmit(42-42)
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/CloneCollectionItem/index.js (1)
packages/bruno-app/src/ui/Button/index.js (1)
Button(4-79)
⏰ 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: SSL Tests - Windows
- GitHub Check: Unit Tests
- GitHub Check: SSL Tests - Linux
- GitHub Check: SSL Tests - macOS
- GitHub Check: CLI Tests
- GitHub Check: Playwright E2E Tests
🔇 Additional comments (3)
packages/bruno-app/src/components/RequestPane/GrpcQueryUrl/GrpcurlModal/index.js (1)
9-9: LGTM! Button component properly integrated.The refactor correctly replaces the native button with the Button component. The icon prop with conditional rendering (
copied ? <IconCheck /> : <IconCopy />) is valid and preserves the original toggle behavior.Also applies to: 43-48
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RenameCollectionItem/index.js (1)
18-18: LGTM! Form submission behavior preserved.The button replacements correctly maintain form behavior. Cancel button uses
type="button"to prevent form submission, while Rename button usestype="submit"to trigger the formik handler.Also applies to: 220-225
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/CloneCollectionItem/index.js (1)
17-17: LGTM! Form integration correct.The button replacements properly integrate with the Formik form. Cancel uses
type="button"with explicit onClick, and Clone usestype="submit"to trigger form submission.Also applies to: 202-207
* chore: playwright fix (#6507) * chore: update responsive tab's more icon (#6509) * refactor: replace button elements with new Button component (#6512) * refactor: replace button elements with new Button component * chore: fix button size for consistency --------- Co-authored-by: Bijin A B <bijin@usebruno.com> * feat: `collection-level` and `app-level` proxy settings updates (#6514) * feat: collection and app proxy settings updates * fix: opencollection proxy config export and import * fix: coderabbit review fixes * chore: fix minor runtime warnings (#6518) --------- Co-authored-by: Sanjai Kumar <161328623+sanjaikumar-bruno@users.noreply.github.com> Co-authored-by: lohit <lohit@usebruno.com>
BRU-2404