Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: "or start without a project" pops in seconds after opening a new thread (hidden while the environment connects) #47955

Openalscwha2(GitHub profile, opens in a new tab) opened this issue 0 comments

What happens

On desktop (v0.1.13, Linux), when I open a new thread, the draft hero first shows only the project prompt. A few seconds later the "or start without a project" link appears under it. Until then there is no way to start a no-project thread and no sign that one is coming. When the line shows up, the headline jumps, so the screen looks like it changed after it had already loaded.

Why

In apps/web/src/components/chat/DraftHeroHeadline.tsx, the whole <p> holding the link is rendered only when scratchWorkspaceRoot !== null:

{scratchWorkspaceRoot === null ? null : (
  <p className="mt-2 flex h-6 ...">{isScratchDraft ? projectSelector : orStartWithoutProject}</p>
)}

scratchWorkspaceRoot comes from availableScratchWorkspaceRoot() (packages/client-runtime/src/operations/projects.ts), which returns null unless the environment's connection phase is "connected" and its serverConfig has arrived with scratchWorkspaceRoot. While the environment is still connecting, the value is null, so the option and the row both disappear. NoProjectsHero has the same gating for its "Start without a project" button.

So "not connected yet" and "this environment can't offer a scratch folder" look the same to the user, and the UI switches from one to the other once the connection finishes.

Expected

  • Reserve the h-6 row from the start so the headline doesn't shift.
  • While the target environment is still connecting (and is expected to offer a scratch root), render "or start without a project" disabled or pending, with a tooltip such as "Connecting…", or let a click queue until the connection is ready.
  • Hide it only when the environment is connected and reports no scratchWorkspaceRoot.

Repro

  1. Launch the desktop app, or let the local environment reconnect.
  2. Start a new thread right away (Ctrl/Cmd+N).
  3. The hero shows without the "or start without a project" line, which appears a few seconds later and pushes the layout around.
  1. tanstack-source added labelsbug

Sign in to join this conversation.