Fixes the random Test Web 2 failure CommandPalette.browser.test.tsx > highlights the first project when New thread in... opens from the root list (PR #8 both attempts, PR #4 run 43233261391, PR #6 run 43218151901; 4 of the 11 finished Test Web 2 runs).
Cause (test, not component). Browser test files run one after another in the same browser context and share one origin's localStorage. A file that leaves t3code:last-used-project:v1 pointing at a project that this test does not list hides the default "New thread in " row. "New thread in..." is then the first row, already highlighted, so the test's ArrowDown moves past it to "Go to file" and the data-highlighted wait times out (the 15 s failure in CI). Whether it fails depends on which files the shard runs before it in the same worker, which is why it looked random and never failed when run alone.
Fix. Upstream's own fix, cherry-picked unchanged: pingdotgg/t3code 5fae2b5 (pingdotgg#35107, 2026-11-12), which is newer than the fork's upstream base dc032d7. setup() removes the remembered project before each test. Upstream had the same flake, so this goes away for the fork the next time it follows upstream as well; this PR only gets it sooner.
Repro, locally.
- Without the fix: the file alone had 0 failures in over 100 runs (idle, under 20× CDP CPU throttling, with the run held 7 s after the key), so load and timing are not the cause. Writing the leaked key in a
beforeEach, as an earlier file does: 20/20 fail, with the same assertion as CI.
- With the fix and the same leaked key injected: 0/50 fail. Unmodified file: 3/3 runs pass.
Lint and format are clean for the file. Known red on fork PRs from fork main (Lint, schema check) is fixed by #8, not here.
General vs project
General: a test fix taken from upstream, nothing specific to this fork.
🤖 Generated with Claude Code