Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(chat): smooth worktree setup status #8922

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/8922/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

What changed

Creating a thread with a new worktree could make the timeline jump and leave a "Received 2 updates" group above the running turn.

Web setup now uses a fixed-height status line: shimmering "Setting up worktree…" changes to "Working for…" when the turn starts. The normal Thinking marker then appears below, until assistant content or live tool activity replaces it. Its space stays reserved during setup so the handoff does not shift the timeline. The draft stays mounted through setup and keeps its timeline position when navigation completes.

Routine setup notices are omitted from the web and mobile work logs. Setup errors stay visible. Mobile shows the pending label in its workspace controls. Both shimmer implementations respect reduced motion.

UI changes

The same completed thread on the base version and this branch:

BeforeAfter
Setup notices remain in historyRoutine setup notices are removed

Successful worktree setup recording: a real checkout, the shimmer-to-timer handoff with Thinking, and the completed response. The fixture briefly pauses checkout so the transition is visible.

Failed worktree setup recording: a Git checkout hook deliberately exits with an error. Setup feedback clears, the error remains, and the original prompt returns to an editable draft with Send available.

Ordinary turn before its first response: a current-checkout turn shows the working timer and Thinking immediately, then the response.

Failed checkout screenshot

Checkout error with the original prompt restored

Validation

  • Focused web and mobile tests cover setup error retention, draft promotion, timeline anchoring, and composer behavior. Two server startup-ordering tests passed.
  • The Thinking follow-up passed 49 timeline logic tests and 38 timeline component tests, including empty assistant placeholders, content/tool handoff, and stable-row updates.
  • Targeted lint and formatting passed. React Doctor found no new issues in the changed code.
  • Web, mobile, and client-runtime typechecks passed.
  • Real browser runs verified successful checkout, checkout failure, an ordinary turn before its first response, and history after reload. The status block kept the same position and height through setup, the first Thinking state, and navigation to the thread. The setup shimmer unmounts at handoff.
  • Mobile verification covered logic tests and typechecking; the recordings show the web client.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk Changes draft promotion timing and timeline row derivation, which affect first-send and worktree flows; behavior is covered by new tests but navigation edge cases are user-visible.

Overview Improves worktree setup so chat stays visually stable: one fixed-height status line shimmers “Setting up worktree…” (web timeline and mobile new-task workspace controls), then hands off to “Working for…” when the turn starts. The composer footer no longer shows a separate “Preparing worktree…” label.

Draft → thread navigation waits until the server has something meaningful to show: the first turn has startedAt, or the session ends in error / stopped / interrupted. That keeps the draft mounted through checkout/setup instead of promoting too early.

Work logs on web and mobile drop routine setup-script.requested / setup-script.started noise via shared isWorktreeSetupActivity; error-toned setup failures still appear in the feed.

The active-turn working row no longer always shows a placeholder “Thinking” line—only when there’s no assistant text and no live tool activity—reducing extra rows at setup-to-turn transitions. Timeline anchoring uses CHAT_TIMELINE_ANCHOR_OFFSET (24px) so promotion preserves scroll position.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4b10ed5401355ff9f3e3f0d9bf1c6981b7ba0a64. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Smooth worktree setup status across mobile and web chat UI

  • Delays draft-to-server thread promotion until the first turn starts or setup ends in an error/stop/interruption, so the draft stays mounted during worktree setup
  • Replaces workspace controls on mobile and working timeline rows on web with a shimmering 'Setting up worktree…' status during setup, hiding the elapsed timer and thinking indicator
  • Filters routine setup-script.requested and setup-script.started activities from derived work logs unless they are error-toned, via new isWorktreeSetupActivity helper in presentation.ts
  • Introduces ActivityShimmerOverlay and increases timeline anchor offset from 16 to 24 in timelineScrollAnchoring.ts
  • Risk: resolveDraftPromotionNavigationTarget signature changes from boolean to serverThread object; callers in ChatView.logic.ts and _chat.draft.$draftId.tsx are updated but out-of-tree consumers would break
Macroscope summarized 4b10ed5.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 20769c12-fd52-4451-b0a4-c95043d4049e

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Warning

      Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.3 KiB13.3 KiB−29 B (−0.2%)15.1 KiB✅
      CodexThread snapshot wire6.9 KiB6.9 KiB+1 B (+0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.4 KiB6.4 KiB−30 B (−0.5%)7.8 KiB✅
      CodexLive turn WebSocket decoded55.6 KiB55.5 KiB−44 B (−0.1%)66.4 KiB✅
      CodexLive turn messages109−1 (−10.0%)21✅
      ClaudeTotal thread wire13.3 KiB13.3 KiB+55 B (+0.4%)15.1 KiB✅
      ClaudeThread snapshot wire6.9 KiB6.9 KiB−2 B (−0.0%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.4 KiB6.4 KiB+57 B (+0.9%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded56.4 KiB56.4 KiB+88 B (+0.2%)66.4 KiB✅
      ClaudeLive turn messages911+2 (+22.2%)21✅

      Baseline: bba79cc · PR result: 4b10ed5 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 109.4 KiB
      • Claude decoded thread snapshot: 110.1 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    4. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor Bugbot Autofix is [ON](https://www.cursor.com/dashboard/bugbot), but a cloud agent failed to start. Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0e6f80ece3a87584f8e161d93d8f7ff6347bfdeb. Configure [here](https://www.cursor.com/dashboard/bugbot).
      apps/web/src/components/ChatView.logic.ts line 125Resolvedby juliusmarminge
    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — The change improves worktree setup feedback, but it also changes draft promotion timing, shared activity filtering, and timeline rendering/scroll anchoring across web and mobile. Because these interconnected production paths have a broader behavioral surface than a small isolated UI fix, human review is warranted.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    6. Reviewed the web UI changes for shared-component/Tailwind ownership and visual behavior. Three findings, one of which is a concrete duplicated-status inconsistency introduced by this patch.

      Posted via Macroscope — UI Consistency
    7. juliusmarminge merged thisef84bc9

    8. juliusmarminge closed this

Sign in to join this conversation.