Skip to content

feat(server,web): choose where new projects are created - #5

Open
mneuhaus wants to merge 1 commit into
marc/mainfrom
marc/projects-location
Open

mneuhaus wants to merge 1 commit into
marc/mainfrom
marc/projects-location

Conversation

@mneuhaus

@mneuhaus mneuhaus commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Projects started from just a name (New project in the command palette, on mobile, or the t3_project_create MCP tool) always land in <T3 home>/projects, e.g. ~/.t3/projects. There was no way to put them where the rest of your code lives.

What changes

  • New server setting projectsDirectory, shown as Settings → General → Projects & threads → New project location, next to "Add project starts in". It is per machine (server-scoped) and only shown when every selected environment advertises the new projectsDirectory capability.
  • ManagedProjectFolders.createNamedProject reads the setting at create time. It reuses the worktree location rules (resolveWorktreesDirectory): ~ expands, and the folder must be absolute on that machine and not a drive root. A bad value fails with NamedProjectLocationError, whose message names the value and the setting. The WebSocket handler and the MCP tool already forward error.message. A missing folder is created on first use.
  • Clients show the destination through the new resolveNewProjectsRoot helper in client-runtime (palette and mobile Add Project). It prefers the live setting over the config snapshot's newProjectsRoot. Otherwise the "Goes in …" preview would stay stale until the next snapshot, because settingsUpdated only carries settings. The snapshot field keeps meaning "default folder".
  • When a single machine is selected, the setting row's placeholder shows that machine's default folder.
  • Upstream decides some things by asking whether a project sits directly inside the new-projects folder: the first thread of a new project opens in its folder (fix: new projects start their first thread in the project folder, not a worktree pingdotgg/t3code#17371, web useHandleNewThread and mobile new-task-flow-provider), and a prompt link clones into that folder (feat: open T3 Code from a link with a prompt ready to send pingdotgg/t3code#18454, web NewThreadLinkView). All three now read the folder through resolveNewProjectsRoot, so they follow the setting.
  • ServerConfig gains an optional homeDirectory (absent on older servers). resolveNewProjectsRoot uses it to expand ~, ~/ and ~\ the way the server does, so a setting like ~/Projects matches absolute project paths and previews show the absolute folder. Without the field the setting is used as typed.
  • User docs: one sentence in docs/user/source-control.md.

Existing projects stay where they are. With an empty setting, nothing changes.

Verification

  • apps/server ManagedProjectFolders.test.ts: 16 pass. New tests cover a project created under the setting (the default folder is not touched) and a relative location refused with NamedProjectLocationError.
  • packages/client-runtime projects.test.ts: 19 pass. The new tests cover setting vs. default vs. no support and ~ expansion.
  • packages/shared serverSettings.test.ts (35) and apps/web settingsSearch.test.ts (60) pass.
  • tsc --noEmit is clean for contracts, client-runtime, server, web and mobile. Targeted lint shows only the existing warnings in CommandPalette.

Built with Claude Opus 5.5 (1M context) in Claude Code, running inside T3 Code.

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Oct 8, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for d80d1bc.

This comment will update automatically after the next completed run.

@mneuhaus
mneuhaus force-pushed the marc/projects-location branch from d80d1bc to 130fb1c Compare October 12, 2026 09:25
Projects started from just a name always landed in `<T3 home>/projects`.
A new `projectsDirectory` server setting (Settings → General → New project
location) moves them, for example to `~/Projects`. It follows the worktree
location rules: `~` expands, and the folder must be absolute on that machine
and not a drive root; otherwise the create fails with a message that names
the setting. The server reads it at create time, so the palette, the mobile
Add Project screen and the t3_project_create MCP tool all follow it.

Clients read the folder through resolveNewProjectsRoot, which prefers the
live setting over the config snapshot's default folder and expands `~` with
the server's home (new optional ServerConfig.homeDirectory). The palette and
mobile previews, the first-thread-in-the-project-folder rule for new
projects (web and mobile), and clones from a prompt link all use it.
@mneuhaus
mneuhaus force-pushed the marc/projects-location branch from 130fb1c to 059b311 Compare October 13, 2026 11:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant