Skip to content

[Bug]: T3 Code on iPad: project added on a T3 Connect environment does not show in New Task → Choose project #8049

Description

@luisefigueroa

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Closest related tickets are different problems: #7926 (non-git worktree default after add), #5785 (skip picker to last project), #4869 (iOS add-project path input reset), #4188 (desktop same-repo grouping).

Area

apps/mobile

Steps to reproduce

  1. On the host machine, publish the T3 Code server with T3 Connect (t3 connect link or the desktop T3 Connect flow) so it appears as a cloud environment.
  2. On iPad, open the T3 Code app (not the hosted web app in Safari).
  3. Sign in and connect to that T3 Connect environment. On iPad this is split view: thread list on the left, detail on the right.
  4. Tap New task (compose / square.and.pencil in the header). iPad presents the New Task sheet.
  5. On Choose project, tap + (Add project) in the sheet header.
  6. In Add Project, pick that T3 Connect environment and add a folder on the host (Local folder), or clone a repo onto it.
  7. Confirm add succeeds (no error; the sheet tries to continue into a new-task draft).
  8. Stay in the T3 Code iPad app. Open New task again and look at Choose project.
  9. On the same host, open the T3 Code web UI and look at the project list.

Expected behavior

The folder just added from the iPad app is a row in iPad New Task → Choose project, so a new thread can be started in it. Web and iPad should agree after a successful add.

Actual behavior

Add from the iPad app does create the project on the host. The host web UI lists it.

On iPad, Choose project still shows only the previous projects. A new thread can be created, but not in the project that was just added from this iPad.

The failure is the iPad new-task picker, not add-on-server.

Impact

Minor bug or occasional failure

Version or commit

main @ b4be33f07 (code investigation). Reproduced by the reporter on iPad against a T3 Connect environment.

Environment

  • Client: T3 Code iOS app on iPad (regular-width / split view), signed in to a T3 Connect environment
  • Server: T3 Code on the connected machine (web UI on that server shows the project)
  • Provider: n/a

Logs or stack traces

n/a

Workaround

None confirmed on iPad. Try force-quitting T3 Code and opening New task again (stale shell session). If the new folder is another checkout of a repo already on that environment, look for an existing row whose subtitle is N workspaces rather than a new title.

Investigation

Add is not failing. iPad project.create is persisted. Host web UI reads the orchestration projection.

iPad Choose project is not a live project query. It renders the in-memory shell snapshot, grouped by repository (default "repository"), as projectScopes in the New Task sheet (NewTaskFlowProviderNewTaskRouteScreen).

I did not reproduce this on a physical iPad in this investigation. Likely causes, in order:

1. After add, the iPad draft bounces back to Choose project before the snapshot has the new id

What you see on iPad: Add project succeeds, the sheet jumps toward a draft, then you are back on Choose project without the new row.

After add, the app resets onto NewTaskDraft with the new projectId and does not insert that project into the local snapshot. project.create success only means the command was accepted. The list updates later, on project-upserted (T3 Connect relay + 50ms coalesce + git identity resolve).

If that id is missing and any other project exists, the draft treats it as a vanished share destination and replaces back to Choose project.

Files

  • apps/mobile/src/features/projects/AddProjectScreen.tsx (useCreateProjectCommonActions.reset to NewTaskDraft)
  • apps/mobile/src/features/threads/NewTaskDraftScreen.tsx (isReturningToProjectPicker / requestedInitialProjectAvailable)
  • apps/mobile/src/features/threads/NewTaskRouteScreen.tsx (iPad sheet Choose project)
  • apps/mobile/src/Stack.tsx (NewTaskSheet on iOS: form sheet, detent 0.92)

2. Live shell event dropped while the iPad T3 Connect session stays up

What you see on iPad: After add, and after opening New task again later (without force-quit), still missing. Host web UI (fresh snapshot) has it.

project.created is sent as project-upserted only after getProjectShellById, which also resolves git identity. Two failures → event dropped. iPad keeps the T3 Connect websocket and does not reload HTTP shellSnapshot until a new RPC session. Force-quit would distinguish this.

Files

  • apps/server/src/ws.ts (projectUpsertOrRemove, retryShellProjectionRead)
  • apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts (getProjectShellByIdrepositoryIdentityResolver.resolve)
  • packages/client-runtime/src/state/shell.ts (HTTP snapshot only on new session)
  • packages/client-runtime/src/state/shellReducer.ts

3. Repository grouping on the iPad picker

What you see on iPad: No new title on Choose project. An existing row may say N workspaces. One tap does not let you pick the new checkout (getProjectScopeSelectionTarget).

Default grouping is "repository". A second checkout of the same remote collapses. Host web UI still lists the physical project.

Files

  • apps/mobile/src/state/project-grouping.logic.ts
  • packages/client-runtime/src/state/projectGrouping.ts
  • apps/mobile/src/features/threads/new-task-project-selection.ts
  • apps/mobile/src/features/threads/NewTaskRouteScreen.tsx (row + N workspaces subtitle)

Suggested small fix

  1. After add on iPad: wait until the new id is in useProjects(), or insert an optimistic shell project, then open the draft. Do not bounce to Choose project only because the snapshot is late.
  2. Use isReturningToProjectPicker only for vanished share destinations, not for a project this iPad flow just created.
  3. If getProjectShellById fails, do not drop project.created; retry or refresh HTTP snapshot on the still-open T3 Connect session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions