Skip to content

feat(web): drop the legacy sidebar mode, matching upstream - #671

Merged
lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/restore-labs-legacy-section
Nov 9, 2026
Merged

lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/restore-labs-legacy-section

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Upstream's Labs cleanup (https://redirect.github.com/pingdotgg/t3code/pull/33131, 521ac7c) removed the legacySidebarEnabled setting. LastCode still carried the legacy sidebar, and the carry replay dropped the mount of its Legacy settings section, so knip failed lastcode/main CI on the unused LegacyFeaturesSection export. The owner decided LastCode drops the legacy mode too: the LastCode sidebar is the one we iterate on.

This removes the legacy sidebar mode only. The LastCode sidebar and the rest of the legacy-sidebar carry group stay.

Changes

  • Delete LegacySidebar.tsx, its slot in AppSidebarLayout, LegacyFeaturesSection and its settings search entry.
  • Drop legacySidebarEnabled from the client settings schema and patch, as upstream did. useBoringSidebarEnabled, which nothing called, and toggleUpstreamSidebar go with it.
  • resolveSidebarMode returns lastcode or inbox (the v2 sidebar).
  • Update the tree button, the LastCode sidebar setting's description, and the user docs (thread-sidebar.md, keybindings.md).

Decisions

  • Saved legacy opt-ins: settings still decode; the stale key is dropped like any unknown key (covered in settings.test.ts). Those users land on the v2 sidebar, which works, and the tree button reaches LastCode in one click. I did not add a migration straight to LastCode, matching upstream's plain removal.
  • Tree button and sidebar.mode.toggle with LastCode on: unchanged. They hide or show LastCode for the session without writing settings.
  • Tree button and sidebar.mode.toggle with LastCode off: they turn the LastCode sidebar setting on, because it is the only other sidebar left. Turning the setting off in Settings → LastCode → Appearance returns to v2. The button always says "LastCode sidebar".
  • Legacy-prefixed LastCode settings: legacySidebarScale, legacySidebarThreadGroupingStyle and compactLegacySidebarStatuses belong to the LastCode sidebar, so they keep their names. Renaming them would need a persisted-settings migration.
  • Desktop settings import: no code change was needed; its tests no longer set or expect the removed key.
  • Mobile: it never read the setting.
  • Carry groups: the mode removal is Carry-Group: legacy-sidebar. Deleting LegacySidebar.tsx and the "Sidebar (legacy)" search entry is a separate incubator commit, because Incubator contributions edit that file and add that entry after the Legacy Sidebar group replays. A single commit conflicted in CI's same-base carry compilation.

Proof

  • lastcode/main CI fails knip at 138c010. Here vp run check:changed origin/lastcode/main passes format, lint, both knip passes, typecheck (36 packages), tests (234) and React compiler.
  • Focused tests pass: sidebarMode, useSettings, chatRouteCommands, contracts settings, desktop LastCodeSettingsImport and DesktopClientSettings (172).
  • Quick CI passed for 8d9d70be0cf; the current head has the same tree, split into two commits.
  • scripts/lastcode-carry-ci.ts validates the carry assignments and same-base compiled tree locally for e653a33.

Local review: 1 round with gpt-6.1-terra (xhigh), approved.

Follow-ups from review (nits, not fixed here): two rapid toggle presses while an earlier settings write is still queued can both opt in instead of the second hiding LastCode; shouldChooseNewThreadProject is used only by its test (already true on lastcode/main).

Opus 5.5 in Claude Code via T3 Code.

🤖 Generated with Claude Code

@lastobelus
lastobelus force-pushed the lastcode/restore-labs-legacy-section branch from 2a0e9c5 to 8d9d70b Compare November 9, 2026 16:53
@lastobelus lastobelus changed the title fix(web): Labs settings show the Legacy sidebar switch again feat(web): drop the legacy sidebar mode, matching upstream Nov 9, 2026
@lastobelus
lastobelus marked this pull request as ready for review November 9, 2026 16:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T17:02:34.577789Z e653a33 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 8d9d70be0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lastobelus and others added 2 commits November 9, 2026 09:59
Upstream's Labs cleanup
(https://redirect.github.com/pingdotgg/t3code/pull/33131) removed the
legacySidebarEnabled setting. LastCode still carried the legacy sidebar
and its Legacy settings section, whose mount the carry replay dropped, so
knip failed lastcode/main on the unused LegacyFeaturesSection export.

Remove the legacy mode instead of re-mounting it. The sidebar resolves to
LastCode or the v2 sidebar. With LastCode on, the tree button and
sidebar.mode.toggle still hide it for the session; with LastCode off they
turn it on, since it is the only other sidebar. A saved legacy opt-in is
ignored when settings decode, so those users land on the v2 sidebar. The
LastCode sidebar's scale, grouping and compact-status settings keep their
legacy-prefixed names.

Carry-Group: legacy-sidebar
Carry-Upstream: https://redirect.github.com/pingdotgg/t3code/pull/33131 (521ac7c)
Carry-Observation: Aligns with the upstream Labs cleanup, which removed legacySidebarEnabled; LastCode keeps only its own sidebar alongside upstream's v2 sidebar.

Co-Authored-By: Claude <[email protected]>
The legacy sidebar mode is gone, so nothing renders LegacySidebar.tsx and
the "Sidebar (legacy)" settings search entry points at a removed switch.

Carry-Group: incubator
Carry-Upstream: https://redirect.github.com/pingdotgg/t3code/pull/33131 (521ac7c)
Carry-Observation: Incubator contributions edit LegacySidebar.tsx and add the legacy-sidebar search entry after the Legacy Sidebar group replays, so removing them must replay with Incubator; the mode removal itself is in Legacy Sidebar.

Co-Authored-By: Claude <[email protected]>
@lastobelus
lastobelus force-pushed the lastcode/restore-labs-legacy-section branch from 8d9d70b to e653a33 Compare November 9, 2026 17:00
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: e653a333a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit 3861197 into lastcode/main Nov 9, 2026
20 checks passed
@lastobelus
lastobelus deleted the lastcode/restore-labs-legacy-section branch November 9, 2026 17:19
lastobelus added a commit that referenced this pull request Nov 9, 2026
Every server start ran a full storage cleanup sweep immediately: worktree removal plus dependency and generated-build cleanup and the saved-workspace passes. That competes with launch-time Git work, and each relaunch restarts the full sweep from scratch. In one incident, three relaunches in about a minute each started a fresh full sweep alongside the launch Git burst. Traces also couldn't say which caller or Git command a `runGitCommand` span came from.

## Fix
- **No sweep at launch.** The first automatic sweep runs one interval (1 hour) after start, then hourly as before. Settings changes, thread deletions and provider-session stops still request sweeps immediately, and manual cleanup is unchanged. The delay is a `FirstAutomaticSweepDelay` reference. The test fixture sets it to zero so the existing sweep tests keep starting on activation.
- **Git spans name their work.** `runGitCommand` spans record `git.operation` (the caller's operation name) and `git.subcommand`. Full arguments are never recorded, nor is anything not shaped like a subcommand, because they can carry remote URLs or `-c` / `--config-env` values.

## Decisions
- A deleted worktree that cleanup kept before a restart now waits for the first hourly sweep. The list of such worktrees lives in memory, and rebuilding it immediately would need a launch-time sweep, which this change removes on purpose.
- The bulk of a sweep's cost, repeated walks of `node_modules` and worktrees for open-file evidence, is out of scope here and handled in a separate PR.

## Proof
- `storageCleanup.test.ts`, "automatically removes an eligible archived thread checkout an hour after launch": with the production default it checks that at 59 minutes there is no report, no worktree inventory and the worktree is still present, and at 60 minutes it expects the removal. It fails with the delay removed or with the default set to zero, and passes with the change.
- `storageCleanup.test.ts` and `GitVcsDriverCore.test.ts` pass (596 tests). `GeneratedDependencies.test.ts` passes (162 tests); its worker-burst cases now start the first sweep on activation, because they test bursts during that sweep.
- `vp run check:changed origin/lastcode/main` passes (format, lint, typecheck, changed tests). Knip's exports pass failed on the earlier base because of `LegacyFeaturesSection`; #671 removed it, and this PR is rebased onto that.

Local review: 2 rounds with gpt-6.1-terra (xhigh), approved.

🤖 Generated with [Claude Code](https://claude.com/claude-code) (Claude Opus 5.5 in T3 Code)

Carry-Source-Ref: refs/lastcode/carry-sources/pr-672/771ebe31c367d62a62d6acf333ed24f742432640
Carry-Source-Base: 3861197
Carry-Source-Head: 771ebe3
lastobelus added a commit that referenced this pull request Nov 9, 2026
Storage cleanup's consumer proof re-walked the same trees within one process inventory. On a 356-worktree sweep, `WorktreeConsumers.processPathsUseRoot` dominated the time. When a captured file can't be resolved by name, which is normal for deleted-but-open files, each query does a full no-follow `lstat` walk of its target. `GeneratedDependencies.removeBatch` asked the same fresh inventory about `<worktree>/node_modules` and then about the whole worktree, walking both. The final guards then repeated this for each fresh capture. Each query also ran `realpath` on every inventory path, about 11.8k paths of which only about 4k were unique.

Changes:
- **One walk answers nested roots.** Walk evidence now records where each matched object or socket was found. In the same `TargetObservation` (keyed by inventory), a query for a root nested in an already-walked root is answered from that walk. The nested subtree's directory tokens and the root's canonical path are revalidated first. The answer matches a fresh walk: a successful ancestor walk visited every object a nested walk would, on the same device and within the same limits. If no ancestor walk is usable, the root is walked as before.
- **One observation per fresh capture.** Dependency and build removal proofs create one observation for each fresh capture and query the worktree before its nested root. Every final proof still captures a fresh inventory and never uses the sweep's observation. Each dependency removal now walks each root at most once per capture, down from up to 7 walks per candidate to 4.
- **`realpath` deduped within each query.** Results are not reused across queries: an existing test requires a path that becomes unresolvable later to fall back to identity proof.
- Dependency use is still recorded when the broader worktree proof fails.

Proof: new tests count walks per capture in `WorktreeConsumers`, `GeneratedDependencies` and `GeneratedBuilds`. They fail on `lastcode/main` and pass here. The usage-recording test failed before its fix. Focused suites pass (389 tests); `check:changed` passes apart from the base-branch `LegacyFeaturesSection` knip failure being fixed in #671; local Quick CI passed.

Follow-up: F1. Deduping `realpath` within one query can, in a sub-second race, skip re-resolving a duplicate name that changed between its entries. The reviewer rated it a nit, and I declined it.

Local review: 2 rounds with gpt-6.1-terra (xhigh), approved.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Carry-Source-Ref: refs/lastcode/carry-sources/pr-673/e86a0b598fcf702b579927f74ee95b3c2bbc5116
Carry-Source-Base: dcf3275
Carry-Source-Head: e86a0b5
lastobelus added a commit that referenced this pull request Nov 15, 2026
## Problem

The carry-set ELI5 still described the August proposal, not the carry replay that has been the production path since 2026-09-05. The glossary and nightly workflow kept rollout-era lines: carry tooling "does not yet replace the nightly replay", files shared by several groups go to Incubator, a post-publication carry check that in fact runs only after historical-mode publications, and retirement criteria for historical replay. Refs #720.

## Change

- **ELI5** (`doc/design/2026-08-29__downstream-carry-set-eli5.html`): rewritten to describe carry replay as built. Each commit names its group with a `Carry-Group` trailer. A publication folds the PR squashes merged since the last one into six group commits on the old nightly, then replays only those six onto the new nightly with `rerere` off. It also covers the deferred-promotion exception to the tree check, conflict recovery, historical rollback, and what changed from the proposal.
- **Glossary**: describes the current carry set; the group order now includes Build & CI; a fix that edits lines a later group changed must move to that group; carry replay has no path ownership; the ELI5 link no longer says "proposal".
- **Nightly workflow**: the shadow check runs only after historical-mode publications; historical replay is an explicit rollback, not a pending retirement; `--reconstruct` only reproduces the bootstrap generation; the dashboard's replayed-commit count is normally 6.

## Scope

Documentation only, no behaviour change. Tracks #720 without closing it. The smoke gate description in the nightly workflow is left to another PR.

## Verification

- Checked each claim against `scripts/lastcode-carry-*.ts`, `scripts/lastcode-checkpoint.ts`, `scripts/lastcode-merge.ts`, the manifest and published tags. This covered contribution counts (2,256 in total, 1,015 in Incubator, 122 of 252 Upstream bugfixes without `Carry-Upstream`), `Fork-Commits-Rebased: 6` on every carry checkpoint tag, the first carry tag at 2026-09-05 18:23 PT, checkpoint 4449 folding #671–#688, checkpoint 3717's cross-base compile, and the trailers on #708 and #671.
- Corrected three errors in the rewrite before review: PR #708's groups, a claim that Incubator work can be retagged out, and the "carry patch" wording.
- `check:changed`: typecheck (41 packages) and the context-budget test pass, and formatting passes after `vp fmt`. The HTML tags are balanced.
- Quick CI deferred to GitHub because local capacity was busy, so there is no local receipt.

Local review: 3 rounds with GPT-6.1 Terra (xhigh) and Claude Opus 5.5 (xhigh), approved. Final-round nits were fixed afterwards.

Written with Claude Opus 5.5 in the Claude Code harness. Reviewed with GPT-6.1 Terra in Codex and Claude Opus 5.5.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Carry-Source-Ref: refs/lastcode/carry-sources/pr-725/a1e38bf562fb6faa8738a13d219d20f9925c657b
Carry-Source-Base: 99486a3
Carry-Source-Head: a1e38bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant