Repository navigation
Fix Cmd+W crash in About window - #1149
Conversation
|
🚨 SLOP COP 🚨 · I am SlopCop. I will review this pull request now. I will check security, code quality, performance, architecture, duplication, and practical test coverage. I will follow the stated review rules. |
| const submenu = fileMenu?.submenu as MenuItemConstructorOptions[]; | ||
| const closeWindow = submenu.find((item) => item.label === "Close Window"); | ||
|
|
||
| closeWindow?.click?.({} as never, null as never, {} as never); |
There was a problem hiding this comment.
🚨 slopcop/review — Add a test for the existing undefined route.
This new branch must keep null separate from undefined. The undefined value reaches closeWindowOrSideTab, which closes detached DevTools. This test covers only null. Add a second call with undefined. Assert that the callback receives undefined. Also assert that the native action does not run.
There was a problem hiding this comment.
Fixed in b746744. The new regression test verifies that undefined reaches the detached DevTools callback and does not use the native panel action.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
ELI5
The About box received the wrong close message. This change sends the normal Mac close message. It is like using the correct key.
Review result
I found one low-risk test gap. I found no blocking problem.
- Security: The fixed native selector accepts no user input. The change adds no permission, process, storage, network, or IPC boundary.
- Code quality: The test covers
null, but it does not protect the existingundefinedroute for detached DevTools. I left an inline comment. - Performance: The normal route adds one constant-time check. The change adds no listener, timer, loop, retained object, or repeated allocation.
- Architecture: A project search found no duplicate native-close action. The direct native action fits this small Mac-only boundary.
- Validation: The desktop suite passed all 32 files and 230 tests. The forced desktop type check passed.
git diff --checkpassed. - CI: All active GitHub checks passed, including the macOS package smoke check.
Dev-browser cannot control the native macOS About panel. A web dev server cannot exercise this route, so I did not claim browser E2E coverage.
A manual native check should open About, press Cmd+W, and confirm the app stays open.
Closes get-bb#1100. ## Summary - handle the null window value that Electron sends for native panels - send the native macOS close action for the About panel - preserve the existing app-window and detached DevTools close paths - add a regression test for the null window case ## Tests - pnpm exec turbo run test typecheck --filter=@bb/desktop --force - 230 desktop tests passed - desktop type check passed
Closes #1100.
Summary
Tests