test(desktop): decide the WorkHub popup close in the main process #5918
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 231 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.326
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5918"
general
weight: 0.35
M4n5ter
Fixes #5917.
This is a test-only change to
apps/desktop/e2e/workhub-layout.spec.ts. The spec closed the Workbar's native menu in two round trips. First it read the renderer'saria-expanded, then it calledclosePopupin a separate main-process evaluate. Linux can auto-dismiss that popup in between, andclosePopupon a dead popup crashes the main process. The test then fails with "Target page … has been closed" or "session closed". That happened on #5906 and #5902, and both passed on rerun.Change
Menu.prototype.popupprobe now also subscribes to the menu'smenu-will-closeevent and records whether the popup is still open.closePopupin the same task, so a dismissal can no longer land between the check and the call.expect(addPanel).not.toHaveAttribute('aria-expanded', 'true')still pins the renderer state afterwards.closePopup.Verification
format:checkpass, and so doescheck:e2e-budget(34 tests in 20 files). Type-checking the spec reports no errors in the changed lines.menu-will-closearrives in the same main-thread task as the native teardown, so that it closes the window fully rather than narrowing it, rests on Electron dispatching the event synchronously from the menu-closed callback. CI on this PR exercises the spec on Linux.AI use
Diagnosed and written with Claude Code; the commit carries a
Co-Authored-Bytrailer.🤖 Generated with Claude Code