Repository navigation
fix(web): sidebar shortcut browser tests no longer reach the live server - #217
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
T3-26. Two Sidebar shortcut browser tests fail on the fork's main, and so does "keeps the search query…" in
Sidebar.search.browser.test.tsx. All three stop where Ctrl+Shift+] should move from thread-a to thread-b.Cause
The sidebar code was never the problem. Agents run inside the live T3 service and inherit
T3CODE_PORT=3773. Inapps/web/vite.config.ts, the Vite dev proxy targets that port, and the browser-test server is built from the same config. So the test app's/apiand/.well-knownrequests went to the live server, not to the in-process fake environment. The sidebar's thread rows then carried the live server's environment id (406d8596…), while the route used the fake idenvironment-render. Thread navigation looks up the current row byenvironmentId:threadId, never found it, and did nothing.Proof, on unchanged fork main:
T3CODE_PORTset, both shortcut tests fail. Temporary logging showed the row keys were406d8596…:thread-aand the route key wasenvironment-render:thread-a.env -u T3CODE_PORT, both tests pass.That also explains why upstream "passes": it ran without that variable.
Fix
Upstream already fixed this in pingdotgg#46738 (
facc02ea36), which the fork hasn't merged yet. This PR cherry-picks it: Vite skips the dev proxy whenmode === "test". It doesn't touch the tests or the app's runtime behaviour. When the fork next merges upstream, that commit is already applied.Proof
vp test run src/components/Sidebar.shortcuts.browser.test.tsx src/components/Sidebar.search.browser.test.tsxwithT3CODE_PORT=3773still set: 2 files, 3 tests pass ("leaves thread shortcuts…", "waits on thread navigation shortcuts while a confirmation dialog is open", "keeps the search query…").vp run devwith this worktree's own.t3state and three Replay threads. With Gamma selected, Ctrl+Shift+] went to Beta, then Alpha. Ctrl+Shift+[ went back to Beta.Tests
None added. The three existing tests are the regression tests, and they now pass.
Decisions
Sidebar.tsx. The task brief suspected fork sidebar changes. The diagnosis above rules them out: with the proxy disabled, the fork's sidebar passes unchanged.Checks passed on 4dd85a3 (
vp run check:changed origin/main: format, lint, knip, typecheck).Built by Claude Opus 5.5 in Claude Code (T3 Code factory worker).
🤖 Generated with Claude Code