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.
  • 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: 15 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: 18 pass. The new test covers setting vs. default vs. no support.
  • 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

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 show the destination through resolveNewProjectsRoot, which prefers
the live setting over the config snapshot's default folder, so the preview
updates as soon as the setting changes.
@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

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