Conversation
WalkthroughKeyboard shortcut handling was adjusted: CodeEditor disables replace shortcuts in read-only mode; Keybindings updated Windows-reserved combos; RequestTab routes dotenv-prefixed environment saves via a window event; NewRequest wires the Request URL editor's run action to form submission. (50 words) Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant RequestTab
participant Window
participant Redux
User->>RequestTab: Trigger save (environment-settings)
alt UID starts with "dotenv:"
RequestTab->>Window: dispatch Event("dotenv-save")
Window-->>RequestTab: Event handled externally
else Non-dotenv UID
RequestTab->>Redux: dispatch saveEnvironment(variables, uid, collectionUid)
Redux-->>RequestTab: save result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
packages/bruno-app/src/components/RequestTabs/RequestTab/index.js (1)
224-238:⚠️ Potential issue | 🟠 MajorHandle global dotenv saves in the shortcut path too.
Line 237 still always dispatches
saveGlobalEnvironment(...). For aglobal-environment-settingstab with adotenv:UID,Cmd/Ctrl+Swill bypass the new custom save flow even though the save-and-close path already routes those drafts throughdotenv-save. Please mirror the same prefix check here so both save paths stay consistent.Suggested fix
} else if (tab.type === 'global-environment-settings') { if (globalEnvironmentDraft) { const { environmentUid, variables } = globalEnvironmentDraft; - dispatch(saveGlobalEnvironment({ variables, environmentUid })); + if (environmentUid?.startsWith('dotenv:')) { + window.dispatchEvent(new Event('dotenv-save')); + } else { + dispatch(saveGlobalEnvironment({ variables, environmentUid })); + } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/bruno-app/src/components/RequestTabs/RequestTab/index.js` around lines 224 - 238, The save keybinding path (useKeybinding handler) ignores dotenv global drafts: update the branch handling tab.type === 'global-environment-settings' to mirror the environment-settings flow by extracting { environmentUid, variables } from globalEnvironmentDraft and checking if environmentUid?.startsWith('dotenv:'); if it does, fire the same window.dispatchEvent(new Event('dotenv-save')) used elsewhere, otherwise continue to dispatch(saveGlobalEnvironment({ variables, environmentUid })); this ensures both Cmd/Ctrl+S and save-and-close use the dotenv-save flow for dotenv UIDs.packages/bruno-app/src/components/Preferences/Keybindings/index.js (1)
220-239:⚠️ Potential issue | 🟠 MajorDon’t widen Windows-only reservations into the Linux path.
Because Line 15 maps every non-mac platform to
'windows', these new entries will be rejected on Linux too. That meansalt+space,f11,ctrl+y, etc. become unavailable there even though this table is meant to describe Windows-specific reservations. Please split Linux into its own reserved set before expanding this list.As per coding guidelines, Bruno is a cross-platform Electron desktop app that runs on macOS, Windows, and Linux. Ensure that all code is OS-agnostic.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/bruno-app/src/components/Preferences/Keybindings/index.js` around lines 220 - 239, The current reserved shortcut set named windows (built via comboSignature) is being applied to all non-mac platforms; create a separate linux reserved set (e.g., linux: new Set([...]) using comboSignature for Linux-specific entries) and update the platform-to-reserved-set mapping (the logic that currently maps every non-mac platform to 'windows') so Linux uses the new 'linux' set while Windows continues to use 'windows'; ensure comboSignature references remain unchanged and only the reserved sets and platform selection logic are adjusted so Linux shortcuts like alt+space, f11, ctrl+y are not incorrectly rejected.packages/bruno-app/src/components/CodeEditor/index.js (1)
76-88:⚠️ Potential issue | 🟠 MajorUpdate
extraKeyswhenreadOnlychanges to keep Cmd/Ctrl-H binding in sync.Lines 87-88 compute the replace binding once at mount. When
readOnlyflips after mount, line 262 only updates thereadOnlyoption—the key binding remains stale. Add anextraKeysupdate in the same conditional block:Example fix
if (this.props.readOnly !== prevProps.readOnly && this.editor) { this.editor.setOption('readOnly', this.props.readOnly); this.editor.setOption('extraKeys', { ...this.editor.getOption('extraKeys'), 'Cmd-H': this.props.readOnly ? false : 'replace', 'Ctrl-H': this.props.readOnly ? false : 'replace', }); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/bruno-app/src/components/CodeEditor/index.js` around lines 76 - 88, The Cmd-H/Ctrl-H key bindings in extraKeys are only set at mount and become stale when readOnly changes; update the CodeMirror extraKeys whenever readOnly flips by, inside the existing readOnly-change block that uses this.editor, calling this.editor.getOption('extraKeys') to merge current keys and then this.editor.setOption('extraKeys', merged) with 'Cmd-H' and 'Ctrl-H' set to this.props.readOnly ? false : 'replace' (keep the existing this.editor.setOption('readOnly', this.props.readOnly') call).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/bruno-app/src/components/CodeEditor/index.js`:
- Around line 76-88: The Cmd-H/Ctrl-H key bindings in extraKeys are only set at
mount and become stale when readOnly changes; update the CodeMirror extraKeys
whenever readOnly flips by, inside the existing readOnly-change block that uses
this.editor, calling this.editor.getOption('extraKeys') to merge current keys
and then this.editor.setOption('extraKeys', merged) with 'Cmd-H' and 'Ctrl-H'
set to this.props.readOnly ? false : 'replace' (keep the existing
this.editor.setOption('readOnly', this.props.readOnly') call).
In `@packages/bruno-app/src/components/Preferences/Keybindings/index.js`:
- Around line 220-239: The current reserved shortcut set named windows (built
via comboSignature) is being applied to all non-mac platforms; create a separate
linux reserved set (e.g., linux: new Set([...]) using comboSignature for
Linux-specific entries) and update the platform-to-reserved-set mapping (the
logic that currently maps every non-mac platform to 'windows') so Linux uses the
new 'linux' set while Windows continues to use 'windows'; ensure comboSignature
references remain unchanged and only the reserved sets and platform selection
logic are adjusted so Linux shortcuts like alt+space, f11, ctrl+y are not
incorrectly rejected.
In `@packages/bruno-app/src/components/RequestTabs/RequestTab/index.js`:
- Around line 224-238: The save keybinding path (useKeybinding handler) ignores
dotenv global drafts: update the branch handling tab.type ===
'global-environment-settings' to mirror the environment-settings flow by
extracting { environmentUid, variables } from globalEnvironmentDraft and
checking if environmentUid?.startsWith('dotenv:'); if it does, fire the same
window.dispatchEvent(new Event('dotenv-save')) used elsewhere, otherwise
continue to dispatch(saveGlobalEnvironment({ variables, environmentUid })); this
ensures both Cmd/Ctrl+S and save-and-close use the dotenv-save flow for dotenv
UIDs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d47697ff-ab72-4ee2-bb46-cfe87c6163a8
📒 Files selected for processing (4)
packages/bruno-app/src/components/CodeEditor/index.jspackages/bruno-app/src/components/Preferences/Keybindings/index.jspackages/bruno-app/src/components/RequestTabs/RequestTab/index.jspackages/bruno-app/src/components/Sidebar/NewRequest/index.js
Description
JIRA
Also fixes : #7347
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
Bug Fixes
New Features