[Bug]: Mobile New task on iPhone always defaults to the oldest project#25391

opened17d agobyDdenley

Area

apps/mobile

Steps to reproduce

  1. Have several projects on a connected environment.
  2. On an iPhone (compact layout), go to the thread list.
  3. Tap the compose / New task button.

Expected behavior

The new task starts somewhere predictable and sensible. Before #23467, compact layouts opened the project picker. There are several reasonable defaults (see below), and any of them would be better than the current one.

Actual behavior

The new draft always opens in the oldest project on the environment, whatever project you last used or were looking at.

On iPhone, New task is only available from the thread list. At that point no thread is open, so newTaskDestination has no current project and falls back to projects[0]. useProjects() isn't sorted for recency: it follows the server's project order (ORDER BY created_at ASC), so projects[0] is the first project ever created.

Where it came from

newTaskDestination (apps/mobile/src/features/threads/new-task-project-selection.ts) was added in #23467:

  • 1e20a0875 ("open split-view drafts directly without a push") introduced it with the first-project fallback only in split view. Compact layouts still went to the picker:
    ts
    1return usesSplitView && project ? { screen: "NewTaskDraft", ... } : { screen: "NewTask" };
  • 7f45dbadb ("use the thread screen for new drafts") dropped the usesSplitView && check while switching to the Thread draft route, and renamed the parameter to _usesSplitView. Since then, compact layouts get the same "current project, else projects[0]" behavior as iPad.

That second step may well have been intentional ("always open a ready-to-type draft"). The leftover unused parameter, and the fact that the compact test only covers the case with a current project, made me think it might not have been. Either way, the fallback to the oldest project looks unconsidered on both layouts.

Possible fixes

These are suggestions only; I don't have a strong view on which is right:

  • Most recently used project. projectScopes in NewTaskFlowProvider is already sorted by updated_at, so the fallback could use that order instead of the raw list. This looks like the smallest change and also improves the iPad fallback.
  • No project / scratch, where that's available on the environment.
  • Bring back the project picker in compact layouts (restore the usesSplitView condition). This is probably the most debatable, since it adds a step before you can type.

Impact

Minor bug or occasional failure. You can change the project from the draft, but it's easy to miss, and then the task runs in an unrelated repo.

Version or commit

Read against main @ 572cf742. Seen in the current iOS app, server t3 v0.1.2.

Environment

iOS app on iPhone (compact layout); self-hosted server on Linux through T3 Connect.

Workaround

Tap the project on the new draft and change it before sending.

Note

🤖 Claude Opus 5.5 responding on behalf of Theo

Fixed on main by #24741. New thread now starts in the current thread's project, then the last project used on the device, and otherwise opens the picker. It no longer falls back to the oldest project. Reopen if you still see it on a build with #24741.

Synced from GitHub

Hit this today on iPhone with the T3 server on 0.1.2: compose from the thread list always opens the draft in my oldest project, whichever project I was working in. Thanks for the fix in #24741 — will update to v0.1.5, enable "Use last project", and report back here if it still happens.