Repository navigation
fix(web): thread shortcuts work with the narrow sidebar closed #23568
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
Open
juliusmarminge
wants to merge
5
commits into
main
Choose a base branch
from
fix/issue-21789
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+142
−8
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
836121a
fix(web): thread shortcuts work while the narrow sidebar sheet is closed
juliusmarminge cee69f8
fix(web): hidden sidebar sheet no longer skews row motion or the toggle
juliusmarminge 4d3e3d9
test(web): add a synthetic sidebar evidence fixture
juliusmarminge ae52758
test(web): sidebar evidence seeder refuses a hardlinked live database
juliusmarminge 448a0fc
test(web): sidebar evidence seeder replaces only its exact fixture rows
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| #!/usr/bin/env python3 | ||
| """Seed synthetic sidebar projections in a stopped, isolated, initialized T3 home. | ||
|
|
||
| Usage: python3 scripts/seed-sidebar-evidence.py --base-dir /tmp/sidebar-proof/.t3 \ | ||
| --workspace /tmp/sidebar-proof/workspace [--empty] | ||
|
|
||
| Start the server once to migrate an empty isolated home, then stop it first. | ||
| Restart with T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD=false so startup does not | ||
| create an unrelated project and fourth thread. | ||
| This fixture creates no event history and must not prove backend behavior. | ||
| Use identical workspace, settings, bindings and a fixed browser clock for pairs. | ||
| """ | ||
|
|
||
| import argparse | ||
| import json | ||
| import os | ||
| from pathlib import Path | ||
| import sqlite3 | ||
|
|
||
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser(description=__doc__) | ||
| parser.add_argument("--base-dir", type=Path, required=True) | ||
| parser.add_argument("--workspace", type=Path, required=True) | ||
| parser.add_argument("--empty", action="store_true") | ||
| args = parser.parse_args() | ||
| base = args.base_dir.resolve() | ||
| if base == (Path.home() / ".t3").resolve() or (base / "userdata").is_symlink(): | ||
| parser.error("Use a copied, isolated home, never the live T3 home.") | ||
| db = base / "userdata/statev2.sqlite" | ||
| if db.is_symlink(): | ||
| parser.error("The isolated database must be a copy, never a symlink.") | ||
| if not db.is_file(): | ||
| parser.error("Initialize an empty isolated home with the server first.") | ||
| try: | ||
| is_live_db = db.samefile(Path.home() / ".t3/userdata/statev2.sqlite") | ||
| except FileNotFoundError: | ||
| is_live_db = False | ||
| if is_live_db: | ||
| parser.error("The isolated database must be a copy, never a hardlink.") | ||
| runtime_file = base / "userdata/server-runtime.json" | ||
| if runtime_file.is_file(): | ||
| runtime = json.loads(runtime_file.read_text()) | ||
| try: | ||
| os.kill(runtime["pid"], 0) | ||
| except ProcessLookupError: | ||
| pass | ||
| else: | ||
| parser.error("Stop the isolated server before seeding its database.") | ||
| workspace = args.workspace.resolve(strict=True) | ||
| if not workspace.is_dir(): | ||
| parser.error("Workspace must be a directory.") | ||
|
|
||
| with sqlite3.connect(db) as connection: | ||
| # Refuse existing work, including runnable effects, rather than clearing it. | ||
| for table in ( | ||
| "orchestration_v2_projection_messages", | ||
| "orchestration_v2_projection_runs", | ||
| "orchestration_v2_projection_runtime_requests", | ||
| "orchestration_v2_effect_outbox", | ||
| "scheduled_tasks", | ||
| ): | ||
| if connection.execute(f"SELECT count(*) FROM {table}").fetchone()[0]: | ||
| parser.error(f"Expected empty synthetic state: {table} is populated.") | ||
| project, project_title = "shortcut-fixtures", "Shortcut fixtures" | ||
| # Only rows this script writes may be replaced; match them exactly. | ||
| if connection.execute( | ||
| "SELECT count(*) FROM orchestration_v2_projection_threads WHERE NOT " | ||
| "(thread_id IN ('shortcut-fixture-1','shortcut-fixture-2','shortcut-fixture-3') " | ||
| "AND project_id IS ?)", | ||
| (project,), | ||
| ).fetchone()[0]: | ||
| parser.error("Refusing to replace nonfixture threads.") | ||
| if connection.execute( | ||
| "SELECT count(*) FROM projection_projects " | ||
| "WHERE NOT (project_id IS ? AND title IS ?)", | ||
| (project, project_title), | ||
| ).fetchone()[0]: | ||
| parser.error("Refusing to replace nonfixture projects.") | ||
|
|
||
| clock = "2026-10-22T08:00:00.000Z" | ||
| connection.execute("DELETE FROM orchestration_v2_projection_threads") | ||
| connection.execute("DELETE FROM projection_projects") | ||
| connection.execute( | ||
| "INSERT INTO projection_projects " | ||
| "(project_id,title,workspace_root,scripts_json,created_at,updated_at) " | ||
| "VALUES (?,?,?,?,?,?)", | ||
| (project, project_title, str(workspace), "[]", clock, clock), | ||
| ) | ||
| for index, title in enumerate(() if args.empty else ("Alpha", "Beta", "Gamma"), 1): | ||
| thread = f"shortcut-fixture-{index}" | ||
| payload = dict( | ||
| id=thread, projectId=project, title=f"Thread {title}", | ||
| createdBy="system", creationSource="server", | ||
| providerInstanceId="codex", | ||
| modelSelection=dict(instanceId="codex", model="gpt-6-astra"), | ||
| runtimeMode="full-access", interactionMode="default", | ||
| branch=None, worktreePath=None, pullRequests=[], | ||
| activeProviderThreadId=None, forkedFrom=None, | ||
| lineage=dict(parentThreadId=None, relationshipToParent=None, rootThreadId=thread), | ||
| createdAt=clock, updatedAt=clock, lastVisitedAt=clock, | ||
| archivedAt=None, deletedAt=None, settledOverride=None, settledAt=None, | ||
| snoozedUntil=None, snoozedAt=None, activeOrderKey=str(index), | ||
| ) | ||
| connection.execute( | ||
| "INSERT INTO orchestration_v2_projection_threads " | ||
| "(thread_id,project_id,title,default_provider,provider_instance_id," | ||
| "runtime_mode,interaction_mode,created_at,updated_at,payload_json) " | ||
| "VALUES (?,?,?,?,?,?,?,?,?,?)", | ||
| (thread, project, payload["title"], "codex", "codex", "full-access", | ||
| "default", clock, clock, json.dumps(payload)), | ||
| ) | ||
| print(f"Seeded {0 if args.empty else 3} synthetic stopped threads in {db}") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
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.