Repository navigation
fix(description): bulk edit round trip looses description information - #8595
Conversation
WalkthroughBulk editing now preserves per-item metadata, response example updates retain incoming fields, and placeholder visibility and styling respond to row state, runtime changes, and theme values. ChangesEditing state preservation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
Pull request overview
Updates how “Description” placeholders are shown across several request/bulk-edit editors so that placeholders only appear on truly empty rows/fields (and stay blank when a row already has primary data like name/value/file path).
Changes:
- Adjusts description placeholder conditions to only show on the last empty row in bulk-edit style tables.
- Refines File Body description placeholder logic to avoid showing “Description” when a file path already exists.
- Adds CodeMirror placeholder option updates when the
placeholderprop changes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/bruno-app/src/components/RequestPane/FileBody/index.js | Only shows “Description” placeholder when both file path and description are empty. |
| packages/bruno-app/src/components/MultiLineEditor/index.js | Updates CodeMirror placeholder dynamically when the React prop changes. |
| packages/bruno-app/src/components/EnvironmentVariablesTable/index.js | Restricts description placeholder to the last empty row only. |
| packages/bruno-app/src/components/EditableTable/descriptionColumn.js | Restricts bulk-edit description placeholder to the last empty row only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/BulkEditor/index.js`:
- Around line 22-26: Update the withPreservedMeta mapping to associate each
parsed item’s metadata by matching its name in originalParamsRef.current first,
and use the current index only when no name match exists. Preserve the existing
description and annotations defaults while ensuring inserted or reordered rows
retain the correct metadata.
In `@packages/bruno-app/src/components/EditableTable/descriptionColumn.js`:
- Line 30: Use trim-aware emptiness checks for both placeholder conditions: in
packages/bruno-app/src/components/EditableTable/descriptionColumn.js lines
30-30, treat whitespace-only value as empty; in
packages/bruno-app/src/components/RequestPane/FileBody/index.js lines 165-165,
apply the same behavior to param.description. Align both with the existing
EnvironmentVariablesTable definition.
🪄 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: 50392d0e-98e7-40cf-b337-0d08030cf3ba
📒 Files selected for processing (7)
packages/bruno-app/src/components/BulkEditor/index.jspackages/bruno-app/src/components/EditableTable/descriptionColumn.jspackages/bruno-app/src/components/EnvironmentVariablesTable/index.jspackages/bruno-app/src/components/MultiLineEditor/index.jspackages/bruno-app/src/components/RequestPane/FileBody/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js
13bbc87 to
138243c
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/bruno-app/src/components/AiChatSidebar/index.js (1)
265-273: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove
ipcRendererexistence check.Based on learnings, in the Bruno Electron renderer code, assume
window.ipcRendereris always available and skip existence checks.♻️ Proposed refactor
useEffect(() => { - const { ipcRenderer } = window; - if (!ipcRenderer) return; - const unsub = ipcRenderer.on('main:ai-status-changed', (status) => { + const unsub = window.ipcRenderer.on('main:ai-status-changed', (status) => { setAvailableModels(status?.availableModels || []); }); return () => unsub(); }, []);🤖 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/AiChatSidebar/index.js` around lines 265 - 273, Update the useEffect handling main:ai-status-changed to remove the window.ipcRenderer existence guard and use ipcRenderer directly, while preserving the subscription cleanup and available-model state update.Source: Learnings
packages/bruno-electron/src/ipc/ai/index.js (1)
96-123: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueInline the
broadcastStatusabstraction.As per coding guidelines, avoid abstractions unless identical code is used in more than three places.
broadcastStatusis currently only utilized twice and should be inlined.♻️ Proposed refactor
- const broadcastStatus = (status) => { - if (mainWindow?.webContents && !mainWindow.webContents.isDestroyed()) { - mainWindow.webContents.send('main:ai-status-changed', status); - } - }; - ipcMain.handle('renderer:get-ai-status', async () => buildStatus()); ipcMain.handle('renderer:set-ai-api-key', async (_event, { providerId, apiKey }) => { assertKnownProvider(providerId); const trimmed = typeof apiKey === 'string' ? apiKey.trim() : ''; if (!trimmed) { throw new Error('API key cannot be empty'); } aiKeyStore.setKey(providerId, trimmed); clearSdkCache(); const status = buildStatus(); - broadcastStatus(status); + if (mainWindow?.webContents && !mainWindow.webContents.isDestroyed()) { + mainWindow.webContents.send('main:ai-status-changed', status); + } return status; }); ipcMain.handle('renderer:clear-ai-api-key', async (_event, { providerId }) => { assertKnownProvider(providerId); aiKeyStore.clearKey(providerId); clearSdkCache(); const status = buildStatus(); - broadcastStatus(status); + if (mainWindow?.webContents && !mainWindow.webContents.isDestroyed()) { + mainWindow.webContents.send('main:ai-status-changed', status); + } return status; });🤖 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-electron/src/ipc/ai/index.js` around lines 96 - 123, Remove the two-use broadcastStatus helper and inline its guarded mainWindow.webContents.send('main:ai-status-changed', status) logic directly in the renderer:set-ai-api-key and renderer:clear-ai-api-key handlers after buildStatus(). Preserve the existing destruction check and status broadcasting behavior.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.
Nitpick comments:
In `@packages/bruno-app/src/components/AiChatSidebar/index.js`:
- Around line 265-273: Update the useEffect handling main:ai-status-changed to
remove the window.ipcRenderer existence guard and use ipcRenderer directly,
while preserving the subscription cleanup and available-model state update.
In `@packages/bruno-electron/src/ipc/ai/index.js`:
- Around line 96-123: Remove the two-use broadcastStatus helper and inline its
guarded mainWindow.webContents.send('main:ai-status-changed', status) logic
directly in the renderer:set-ai-api-key and renderer:clear-ai-api-key handlers
after buildStatus(). Preserve the existing destruction check and status
broadcasting behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a05f99db-cffb-4aeb-9b66-31050e1b5255
📒 Files selected for processing (10)
packages/bruno-app/src/components/AIAssist/StyledWrapper.jspackages/bruno-app/src/components/AiChatSidebar/index.jspackages/bruno-app/src/components/BulkEditor/index.jspackages/bruno-app/src/components/EditableTable/descriptionColumn.jspackages/bruno-app/src/components/EnvironmentVariablesTable/index.jspackages/bruno-app/src/components/MultiLineEditor/index.jspackages/bruno-app/src/components/RequestPane/FileBody/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.jspackages/bruno-electron/src/ipc/ai/index.js
🚧 Files skipped from review as they are similar to previous changes (4)
- packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js
- packages/bruno-app/src/components/BulkEditor/index.js
- packages/bruno-app/src/components/EnvironmentVariablesTable/index.js
- packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js
db904d7 to
8aa4535
Compare
and annotations fix(BulkEditor): preserve hidden metadata during bulk edit roundtrip fix(ai): refresh chat sidebar model status when provider keys change (usebruno#8581) * fix(ai): refresh chat sidebar model status when provider keys change * Added the cropping related issue fix in AI Assist fix(BulkEditor): enhance metadata preservation during bulk edit roundtrip fix(styled-wrapper): update placeholder styles to use theme variables reset
8aa4535 to
96a0fe3
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/bruno-app/src/components/SingleLineEditor/StyledWrapper.js (1)
38-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the extra whitespace in this declaration.
Keep the formatting minimal:
opacity: ${(props) => ...}rather than introducing two spaces afteropacity:. The semicolon can remain.As per coding guidelines, avoid unnecessary whitespace-only diffs.
🤖 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/SingleLineEditor/StyledWrapper.js` at line 38, Remove the extra whitespace after the opacity property’s colon in the styled declaration within StyledWrapper, keeping the existing value expression and semicolon unchanged.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.
Nitpick comments:
In `@packages/bruno-app/src/components/SingleLineEditor/StyledWrapper.js`:
- Line 38: Remove the extra whitespace after the opacity property’s colon in the
styled declaration within StyledWrapper, keeping the existing value expression
and semicolon unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 3cc66c9c-14de-4ec6-a64d-3903d77dec56
📒 Files selected for processing (11)
packages/bruno-app/src/components/BulkEditor/index.jspackages/bruno-app/src/components/CodeEditor/StyledWrapper.jspackages/bruno-app/src/components/EditableTable/StyledWrapper.jspackages/bruno-app/src/components/EditableTable/descriptionColumn.jspackages/bruno-app/src/components/EnvironmentVariablesTable/index.jspackages/bruno-app/src/components/MultiLineEditor/StyledWrapper.jspackages/bruno-app/src/components/MultiLineEditor/index.jspackages/bruno-app/src/components/RequestPane/FileBody/index.jspackages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.jspackages/bruno-app/src/components/SingleLineEditor/StyledWrapper.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js
🚧 Files skipped from review as they are similar to previous changes (7)
- packages/bruno-app/src/components/EditableTable/StyledWrapper.js
- packages/bruno-app/src/components/CodeEditor/StyledWrapper.js
- packages/bruno-app/src/components/MultiLineEditor/StyledWrapper.js
- packages/bruno-app/src/components/EditableTable/descriptionColumn.js
- packages/bruno-app/src/providers/ReduxStore/slices/collections/exampleReducers.js
- packages/bruno-app/src/components/ResponseExample/ResponseExampleResponsePane/ResponseExampleResponseHeaders/index.js
- packages/bruno-app/src/components/BulkEditor/index.js
Description
BRU-3847
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