Found while chasing the flaky browser test ChatView.browser.tsx > shows create-folder affordances for missing project paths (fails intermittently in CI, e.g. PR #109 runs; passes most local runs).
An instrumented run captured the actual failure state: after clicking the "Local folder" item in the Sources view, the palette element is unmounted entirely (document.querySelector('[data-testid="command-palette"]') returns null) instead of switching to the path input. The click isn't lost — it dismisses the palette.
Working theory: a click that lands in the first frames after the item renders hits a close-by-default select path before the item's keep-open/submenu wiring is in effect. If so this is reproducible by a fast user, not just tests: open add-project, click "Local folder" quickly, palette closes.
Suggested angle: make submenu-opening items keep-open by construction (derive from the item definition rather than a handler wired later), then the flaky test should stabilize without test-side retries. Note for whoever picks this up: naive test-side re-clicking makes things worse — once the palette is dismissed there is nothing to re-click, and a second click during the transition can toggle state (tried and reverted on the PR #109 branch).
Found while chasing the flaky browser test
ChatView.browser.tsx > shows create-folder affordances for missing project paths(fails intermittently in CI, e.g. PR #109 runs; passes most local runs).An instrumented run captured the actual failure state: after clicking the "Local folder" item in the Sources view, the palette element is unmounted entirely (
document.querySelector('[data-testid="command-palette"]')returns null) instead of switching to the path input. The click isn't lost — it dismisses the palette.Working theory: a click that lands in the first frames after the item renders hits a close-by-default select path before the item's keep-open/submenu wiring is in effect. If so this is reproducible by a fast user, not just tests: open add-project, click "Local folder" quickly, palette closes.
Suggested angle: make submenu-opening items keep-open by construction (derive from the item definition rather than a handler wired later), then the flaky test should stabilize without test-side retries. Note for whoever picks this up: naive test-side re-clicking makes things worse — once the palette is dismissed there is nothing to re-click, and a second click during the transition can toggle state (tried and reverted on the PR #109 branch).