remove hotkey nodejs runtime dependency#9727
Conversation
a4a2491 to
c21471e
Compare
✅ Circular References ReportGenerated at: 2026-03-24T06:32:57.259Z Summary
Click to view all circular references in PR (74)Click to view all circular references in base branch (74)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
There was a problem hiding this comment.
Pull request overview
This PR (INS-2231) removes direct Node.js runtime coupling from hotkey/platform logic by introducing a unified platform accessor that works in both Electron renderer (via preload) and Node contexts.
Changes:
- Added
common/platform.tsand updated hotkey-related code to use boolean platform flags instead of callingprocess.platform/isMac(). - Exposed
process.platformto the renderer viawindow.app.process.platformin the preload layer and updated global typings accordingly. - Updated component docs to include
Dropdownin the live scope and added initialDropdowndocumentation.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/insomnia/types/global.d.ts | Extends window.app typing to include process.platform for renderer-safe platform detection. |
| packages/insomnia/src/ui/components/hotkey.tsx | Switches macOS detection to the new common/platform boolean export. |
| packages/insomnia/src/ui/components/base/input.tsx | Adjusts internal imports for Button/Icon and minor className ordering. |
| packages/insomnia/src/entry.preload.ts | Exposes process.platform through window.app.process.platform. |
| packages/insomnia/src/common/platform.ts | New unified platform module (renderer via preload, main via Node process). |
| packages/insomnia/src/common/hotkeys.ts | Migrates platform checks to boolean flags and moves displayModifierKey here. |
| packages/insomnia/src/common/constants.ts | Re-routes getAppPlatform()/`isMac |
| packages/insomnia-component-docs/src/theme/ReactLiveScope/index.ts | Adds Dropdown to the ReactLive scope for documentation examples. |
| packages/insomnia-component-docs/docs/Components/dropdown.mdx | Adds initial Dropdown docs page (needs alignment with actual component API). |
Comments suppressed due to low confidence (1)
packages/insomnia/src/common/hotkeys.ts:246
joinHotKeysuseskeys.join(' ')on macOS, but the JSDoc forconstructKeyCombinationDisplaysays that whenmustUsePlusis false on Mac, the characters will be “next to each other”. Either update the join logic to avoid inserting spaces, or adjust the documentation so behavior and docs match.
function joinHotKeys(mustUsePlus: boolean, keys: string[]) {
if (!mustUsePlus && isMac) {
return keys.join(' ');
}
return keys.join(' + ');
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
INS-2231
remove
processdependency from render processprocess.platformin preload scriptTODO: