Repository navigation
fix/request - Binary body type - show warning on file not exists in system - #8276
rajashreehj-bruno wants to merge 3 commits into
Conversation
|
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 due to trivial changes (1)
Walkthrough
ChangesMissing file warning in FilePickerEditor
Sequence DiagramsequenceDiagram
participant FilePickerEditor
participant existsSync
participant StyledWrapper
participant Tooltip
FilePickerEditor->>existsSync: check each resolved filePath
existsSync-->>FilePickerEditor: true / false per path
FilePickerEditor->>FilePickerEditor: setHasMissingFiles(true/false)
FilePickerEditor->>StyledWrapper: apply has-warning class
FilePickerEditor->>StyledWrapper: render warning SVG icon
FilePickerEditor->>Tooltip: render warning tooltip (warningTooltipId)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/bruno-app/src/components/FilePickerEditor/index.js (1)
145-183:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd
data-testidto the warning UI elements and use them in tests.The warning icon/tooltip are directly test-targeted UI, but they currently rely on CSS class selectors. Please add stable
data-testidattributes for the selected row warning state, warning icon, and warning tooltip anchor/content.As per coding guidelines, “Add
data-testidto testable elements for Playwright in React components.”🤖 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 `@packages/bruno-app/src/components/FilePickerEditor/index.js` around lines 145 - 183, Add stable data-testid attributes to the warning UI elements for test targeting. Add data-testid to the warning icon SVG element (currently rendered when hasMissingFiles is true), and add data-testid to the Tooltip component that displays the warning message. These attributes will enable reliable Playwright test targeting instead of relying on CSS class selectors, making the tests more maintainable and aligned with the coding guidelines.Source: Coding guidelines
🤖 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.
Inline comments:
In `@packages/bruno-app/src/components/FilePickerEditor/index.js`:
- Around line 39-42: The filename extraction logic in the filenames mapping uses
OS-specific separator detection which fails when paths contain mixed separators
(such as relative paths on Windows that include forward slashes). Instead of
splitting only on the OS-determined separator, modify the split operation to
handle both forward slashes and backslashes as valid path separators, or use a
cross-platform basename utility function that naturally handles both separator
types. This ensures the extracted filename is correct regardless of the
separator used in the input path.
In `@packages/bruno-app/src/components/FilePickerEditor/StyledWrapper.js`:
- Around line 79-97: Replace the hardcoded hex color values in the has-warning,
warning-icon, and warning-tooltip style blocks with theme tokens from
props.theme. The background color (`#BB931B1A`) for has-warning and
warning-tooltip, the icon color (`#BB931B`) for warning-icon, and the text color
(`#856404`) for warning-tooltip should all be mapped to appropriate theme color
tokens using the props.theme object to ensure the styles respect the
application's theme system and remain consistent across different themes.
---
Outside diff comments:
In `@packages/bruno-app/src/components/FilePickerEditor/index.js`:
- Around line 145-183: Add stable data-testid attributes to the warning UI
elements for test targeting. Add data-testid to the warning icon SVG element
(currently rendered when hasMissingFiles is true), and add data-testid to the
Tooltip component that displays the warning message. These attributes will
enable reliable Playwright test targeting instead of relying on CSS class
selectors, making the tests more maintainable and aligned with the coding
guidelines.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7eaa6344-af97-43f9-8fd4-3ef2ddd5ecef
📒 Files selected for processing (4)
packages/bruno-app/src/components/FilePickerEditor/StyledWrapper.jspackages/bruno-app/src/components/FilePickerEditor/index.jstests/request/binary-file/binary-file-missing-warning.spec.tstests/request/binary-file/fixtures/binary-file-missing-warning.yml
e65f0ec to
133700b
Compare
|
Worked upon #8753 |
Jira link: https://usebruno.atlassian.net/browse/BRU-3118
Description
When a request has binary/file body type and if the file doesn't exist in the system, then it shows a warning message to the user.
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit