fix(web): keep the no-project action in place while connecting #48016 (GitHub #48015)
main fromrefs/pull/48015/head·opened View on GitHubProblem#
Open a new thread while its environment is connecting. The “or start without a project” link appears only after the server reports its scratch folder, pushing the draft headline up by 32 px. The empty-project screen also hides the action during that wait.
Change#
Reserve the hint row when rendering the draft. Both screens show the no-project action disabled with a “Connecting…” hint while the target is being resolved. A usable scratch folder enables the action. A connected server that omits the folder hides it. An already usable fallback environment can still start a thread immediately.
Scope#
Fixes #47955 in the shared web and desktop renderer.
Verification#
- Ran both versions in Chromium on Windows with the same delayed configuration. The old headline moved 32 px. The fixed headline stayed in place across connecting, ready, and unsupported states. Both screens disabled the action while waiting and hid it for the unsupported server.
- All 36 focused tests passed, including scratch routing, the draft project picker, and the command palette.
vp run check:changedpassed. The four changed React files also passed their individual compiler coverage checks. - The Linux Electron package from the report was not exercised.
| Before connection completes on main | Before connection completes with this fix |
|---|---|
Both actions after connection completes
The recording shows the same configuration arriving in both versions.
https://github.com/user-attachments/assets/fdde6e78-4b52-492c-865e-7ed10a61c108
Implemented with GPT-6.2 Astra (xhigh) in the Codex harness, running in T3 Code.
- 1
WhiteZeek(GitHub profile, opens in a new tab) linked this to fix #47955
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved at
3e5bc19Macroscope's review found this PR approvable — The no-project action stays visible with a connecting hint while environments load, reducing layout movement. Existing guards prevent starting without a ready target, and scratch-project operations remain unchanged.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review.
Walkthrough
-
The scratch-project hook now selects a target environment and reports when selection is pending. The no-project actions use that state to show a connecting label, indicate the pending state, and start a thread only when an environment is available.
Changes: Scratch target and no-project actions
Layer / File(s) Summary Resolve scratch target state
apps/web/src/hooks/useScratchProject.ts,apps/web/src/hooks/useScratchProject.test.tsThe hook adds scratchTarget, which selects a ready environment and reports pending state based on catalog readiness and candidate environments. Tests cover connection phases and environment configuration.Render pending no-project actions
apps/web/src/components/NoProjectsHero.tsx,apps/web/src/components/chat/DraftHeroHeadline.tsx,apps/web/src/components/ui/button.tsxBoth hero components use the target’s environment ID and pending state to control the no-project action. Pending actions show “Connecting…” and use aria-disabled. Inline button styles now apply a not-allowed cursor and reduced opacity toaria-disabledbuttons.Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
chenxin-yan,saphid
Merge Risk:
Minimal · up to3e5bc-
The no-project action now stays in place while the environment connects and is disabled with a "Connecting…" hint. No concrete merge-blocking risk was established.
Pre-merge checks:
4-
Check name Status Explanation Title check The title "fix(web): keep the no-project action in place while connecting" matches the main change. The PR reserves the hint row so the no-project action stays visible and disabled with a "Connecting…… Description check The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section states the bug and the layout shift. The Change section explains the fix and the dis… Linked Issues check Issue #47955requires that the no-project line not pop in or shift the headline, and that it show disabled or pending while the environment connects. It hides only after a connected server reports no …Out of Scope Changes check All changed files connect to the #47955objective. DraftHeroHeadline.tsx and NoProjectsHero.tsx apply the pending and hidden states to the two screens. useScratchProject.ts adds thescratchTargetpe…Full details: Title check
-
Explanation
The title "fix(web): keep the no-project action in place while connecting" matches the main change. The PR reserves the hint row so the no-project action stays visible and disabled with a "Connecting…" hint while the target environment connects, which prevents the 32 px layout shift. The title is specific, uses a conventional commit prefix, and names the affected area (web).
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section states the bug and the layout shift. The Change section explains the fix and the disabled and hidden states. The Scope section links issue
#47955and says the fix covers the shared web and desktop renderer. The Verification section lists the Chromium-on-Windows manual checks, 36 passing focused tests, and thevp run check:changedrun, and it states that the Linux Electron package was not exercised. It includes before/after screenshots and a recording, and it names the model and harness used. The template's comment asks for a conventional commit title and for the change to be explained as a fix for a bug, which the description does.
Full details: Linked Issues check
-
Explanation
Issue
#47955requires that the no-project line not pop in or shift the headline, and that it show disabled or pending while the environment connects. It hides only after a connected server reports no scratch root.At the reviewed head, apps/web/src/components/chat/DraftHeroHeadline.tsx always renders the
<p className="mt-2 flex h-6 ...">row. The formerscratchWorkspaceRoot === null ? nullgate is gone. Whilependingis true, the link shows the text "Connecting…" in its tooltip, setsaria-disabled, andstartScratchreturns false becausescratchTargetEnvironmentIdis null. The link is hidden only whenpendingis false and no scratch target exists. The PR summary states the same behavior for NoProjectsHero.tsx, which covers the Start without a project button. The summary says useScratchProject.ts returnspendingonly while the catalog is not ready or a primary, fallback, or sole environment is connecting, reconnecting, or missing server config. It also says a usable fallback target starts a thread immediately. The test changes in useScratchProject.test.ts cover these states. The PR reports manual Chromium checks and 36 passing focused tests. Those reports are not re-run here, so the result rests on the code and summary evidence.
Full details: Out of Scope Changes check
-
Explanation
All changed files connect to the
#47955objective. DraftHeroHeadline.tsx and NoProjectsHero.tsx apply the pending and hidden states to the two screens. useScratchProject.ts adds thescratchTargetpending logic that both screens use. button.tsx addsaria-disabledstyling so the disabled inline button is visibly disabled. useScratchProject.test.ts covers the new target and pending states. The removed assertion onscratchEnvironmentId(null)follows from the new selection logic. No change was found that is unrelated to the issue. One minor point was not verified: thearia-disabled:opacity-64class in button.tsx is a non-standard opacity value. This does not affect the scope verdict.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 52682d1
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
cad627e5-9184-416b-aab7-ee29050ebdbc
Commits-
Reviewing files that changed from the base of the PR and between 52682d10f93e0f4f1741d14908304dad8f7fd22d and 3e5bc19645d9e7208668b176c4aab8a657b9ed31.
Files selected for processing: 5-
apps/web/src/components/NoProjectsHero.tsxapps/web/src/components/chat/DraftHeroHeadline.tsxapps/web/src/components/ui/button.tsxapps/web/src/hooks/useScratchProject.test.tsapps/web/src/hooks/useScratchProject.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
-
juliusmarminge added labelstakeover:in-progress
juliusmarminge added labelstakeover:needs-julius
juliusmarminge removed labelstakeover:in-progress
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes