Repository navigation
fix(web): sidebar follows the active thread after history navigation #23519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5854dbf
fix(web): sidebar reveals the active thread after back/forward naviga…
juliusmarminge 3843854
fix(web): sidebar reveals the active thread after returning from Sett…
juliusmarminge a39cce2
test(web): add synthetic sidebar navigation fixtures
juliusmarminge 32099f6
fix(web): sidebar reveal survives drawer remounts and late rows
juliusmarminge 2c84c27
fix(web): sidebar scrolls to the open thread after a remount
juliusmarminge 2d95414
test(web): extend synthetic sidebar capture fixtures
juliusmarminge a0462df
test(web): handle URL inputs in sidebar snapshot replay
juliusmarminge 8bc79af
test(web): seed rendered navigation transcripts and settled tail
juliusmarminge 1c7322e
fix(web): returning from Settings keeps the sidebar project scope
juliusmarminge 6f09fcc
Merge main into fix/issue-16534
juliusmarminge ab95d44
chore(lint): knip ignores injected sidebar fixture scripts
juliusmarminge a923574
fix(web): sidebar reveal waits for search to clear and the row to mount
juliusmarminge 1d04ab0
fix(fixtures): align sidebar replay across shell transports
juliusmarminge 6de1d63
fix(fixtures): preserve callable Date in sidebar capture clock
juliusmarminge 18bb128
fix(tooling): analyze injected sidebar fixtures as Knip entries
juliusmarminge cc2ac60
fix(tooling): preserve replay shell sequence continuity
juliusmarminge 44215da
fix(fixtures): guard settled replay expansion without source
juliusmarminge a9dcdf3
fix(fixtures): translate shell resume cursors after replay
juliusmarminge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Owned by AppSidebarLayout because the narrow drawer and Settings unmount the | ||
| // thread sidebar without changing the route. Only a route change requests a | ||
| // reveal that may widen the project scope, so a scope chosen while one thread | ||
| // stays open survives a remount. Scroll position does not survive one. | ||
| // | ||
| // A null key is not an observation: leaving Settings commits the router's | ||
| // location before its matches, so the sidebar's first render can read no | ||
| // thread params. Recording that would make the same thread look new. | ||
| export interface SidebarRouteReveal { | ||
| observedKey: string | null; | ||
| pendingKey: string | null; | ||
| } | ||
|
|
||
| export function pendingSidebarRouteReveal( | ||
| reveal: SidebarRouteReveal, | ||
| routeKey: string | null, | ||
| ): string | null { | ||
| if (routeKey === null) return null; | ||
| if (reveal.observedKey !== routeKey) { | ||
| reveal.observedKey = routeKey; | ||
| reveal.pendingKey = routeKey; | ||
| } | ||
| return reveal.pendingKey; | ||
| } | ||
|
|
||
| export function completeSidebarRouteReveal(reveal: SidebarRouteReveal): void { | ||
| reveal.pendingKey = null; | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| These fixtures reconstruct synthetic sidebar projections and client reset inputs. | ||
| They never start a provider or read personal application data. Projection-only | ||
| fixtures prove rendering/navigation, not event-sourced backend behavior. | ||
|
|
||
| Generate with `python3 scripts/fixtures/issue-16534/seed.py --output /tmp/sidebar-seed | ||
| --variant all`. Stop the isolated server before applying reset-threads.sql, | ||
| archive-unrelated-threads.sql, hide-v1-threads.sql, hide-unrelated-projects.sql, | ||
| projects.sql, threads.sql, messages.sql, turn-items.sql, transcript-runs.sql, | ||
| transcript-messages.sql and transcript-turn-items.sql, in that order, with the documented | ||
| `t3-sqlite-state.ts exec` helper, once per file. Never target the live T3 home. | ||
|
|
||
| `all` includes two eight-thread projects, forty spacers, child/grandchild/fork | ||
| lineage and synthetic markdown navigation messages. Other variants isolate shelf, | ||
| archive and lineage states. `fixture.json` records deterministic clock/settings. | ||
| The replay option records stopped synthetic shell representations for working, | ||
| status and delayed arrival without spawning providers. `replay.js` transforms | ||
| only real shell frames before the real RPC decoder/reducer receives them; delayed | ||
| shell frames are released explicitly through `__sidebarReplay.release()`. | ||
|
|
||
| Install bootstrap.js and replay.js as identical pre-module scripts in the served | ||
| HTML only for capture. Remove both before committing or switching checkouts. | ||
| Use a fresh navigation, never document.write over an evaluated module graph. | ||
| Configure `sessionStorage['sidebar-capture-config']` with `{storage, replay}`. | ||
| Clear only projection caches (shell/thread/vcs-refs in t3code:connection-runtime) | ||
| from a same-origin inert document before navigating to the app. Preserve auth. | ||
| Timers and performance.now remain native; only Date is frozen. Record the exact | ||
| injection externally with the artifacts. | ||
|
|
||
| For grouping, initialize the three synthetic /tmp/triage-16534-{A,B,Spacer} | ||
| paths as git repositories with the same synthetic origin, then use repository | ||
| grouping and an explicit separate override for Spacer. No network fetch needed. | ||
| All navigation links are synthetic t3-thread links rendered by the real client. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| (() => { | ||
| const NativeDate = Date, | ||
| epoch = NativeDate.parse("2026-10-22T00:00:00.000Z"); | ||
| globalThis.Date = new Proxy(NativeDate, { | ||
| apply() { | ||
| return new NativeDate(epoch).toString(); | ||
| }, | ||
| construct(target, args, newTarget) { | ||
| return Reflect.construct(target, args.length ? args : [epoch], newTarget); | ||
| }, | ||
| get(target, property, receiver) { | ||
| return property === "now" ? () => epoch : Reflect.get(target, property, receiver); | ||
| }, | ||
| }); | ||
| globalThis.__sidebarCaptureClock = { | ||
| epoch, | ||
| readyState: document.readyState, | ||
| moduleScripts: document.querySelectorAll('script[type="module"]').length, | ||
| }; | ||
| const config = JSON.parse(sessionStorage.getItem("sidebar-capture-config") || "{}"); | ||
| for (const [key, value] of Object.entries(config.storage || {})) | ||
| localStorage.setItem(key, typeof value === "string" ? value : JSON.stringify(value)); | ||
| })(); |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.