Skip to content

Add per-project settings #2567

Open
shivamhwp wants to merge 25 commits into
pingdotgg:mainfrom
shivamhwp:per-project-settings
Open

Add per-project settings #2567
shivamhwp wants to merge 25 commits into
pingdotgg:mainfrom
shivamhwp:per-project-settings

Conversation

@shivamhwp
Copy link
Copy Markdown
Collaborator

@shivamhwp shivamhwp commented May 6, 2026

  • add project details/settings RPCs and persistence
  • use project remote overrides for source control detection
  • add project details page and sidebar navigation
  • minor ui fix for the caret icon in the custom header of the diff.

What Changed

Added a per-project settings page that can be opened from the project row in the sidebar.

  • Clicking the project row opens /projects/$projectId
  • Clicking the caret still expands/collapses project threads
  • Added project settings UI for:
    • display name
    • project path
    • detected Git remote
    • effective Git remote
    • Git root and branch
  • Added a manual remote override so users can configure the source control provider/remote URL when auto-detection fails, especially for self-hosted Git remotes.
  • Persisted per-project remote override settings and wired them into source control provider resolution.

Why

Git remote detection can fail for self-hosted providers where the remote URL does not clearly identify the host, such as a self-hosted GitLab instance without gitlab.com in the URL.

This gives users a project-level fallback instead of requiring the app to guess correctly. The project name change is also scoped to T3 Code metadata only; it does not rename or move the directory on disk.

UI Changes

image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • No video needed; no animation/motion change

Note

Medium Risk
Adds new persisted per-project settings surfaced via WS RPCs and enforced in orchestration dispatch/model selection, which can affect provider availability, git remote detection, and runtime env for scripts.

Overview
Adds per-project settings (persisted in ServerSettingsService) and exposes them via new WS RPCs projects.getDetails/projects.updateSettings, including git metadata detection (root/branch/remotes) and an effective remote derived from either detection or a user override.

Wires project settings into core flows: source control provider resolution now supports project remote overrides (and tracks context source) with GitManager preferring branch remotes unless an explicit override is set; VCS status subscriptions/refresh are keyed by projectId and per-project fetch intervals.

Updates the web app to add a /projects/$projectId route and sidebar navigation, enforce project-level provider instance disablement in ChatComposer (blocking send/picker when no allowed providers and validating on dispatch), seed new drafts from project defaults (not sticky state), and propagate project actionEnvironment into terminal/script env while preventing extraEnv from overriding T3CODE_* runtime variables. Also refactors project-script keybinding syncing to remove stale bindings, and includes a minor diff panel caret CSS fix.

Reviewed by Cursor Bugbot for commit b007aa0. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add per-project settings with provider policies, action environments, and remote overrides

  • Adds ProjectSettings schema with fields for actionEnvironment, disabledProviderInstanceIds, automaticGitFetchInterval, and remoteOverride; persisted and updated via new ServerSettingsService.updateProjectSettings.
  • Adds projects.getDetails and projects.updateSettings RPC endpoints returning git-detected metadata, effective remote info, and per-project settings.
  • New project settings route (projects.$projectId.tsx) and sidebar navigation now open a project settings page instead of toggling collapse.
  • Chat composer enforces project-level provider policies, disabling send when no allowed provider instances exist for the project.
  • New draft threads now seed model selection from the project's defaultModelSelection via createDefaultModelSelection() instead of carrying over sticky settings.
  • projectScriptRuntimeEnv now prevents user-supplied env from overriding T3CODE_* runtime variables.
  • Git status queries and hosting provider resolution are now project-scoped, with override remotes taking priority over auto-detected ones.
  • Risk: projects with all provider instances disabled will block new thread creation with an error at dispatch time.

Macroscope summarized b007aa0.

- add project details/settings RPCs and persistence
- use project remote overrides for source control detection
- add project details page and sidebar navigation
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ea183f4f-e6fa-4f46-a719-3f6050042b85

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels May 6, 2026
Comment thread apps/server/src/ws.ts Outdated
Comment thread apps/web/src/routes/projects.$projectId.tsx
Comment thread apps/web/src/routes/projects.$projectId.tsx
Comment thread apps/server/src/ws.ts Outdated
Comment thread apps/web/src/components/Sidebar.tsx Outdated
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 6, 2026

Approvability

Verdict: Needs human review

This PR introduces a substantial new feature (per-project settings) with new UI, API methods, and cross-cutting behavioral changes to provider access, model selection, git operations, and action execution. The scope and nature of changes warrant human review.

You can customize Macroscope's approvability policy. Learn more.

- Replace sidebar rename action with project settings access
- Show detected remotes and project path in settings
- Extract remote override parsing into shared server helper
@shivamhwp shivamhwp changed the title Add per-project settings and remote overrides Add per-project settings May 7, 2026
@shivamhwp shivamhwp changed the title Add per-project settings Add per-project settings (wip) May 7, 2026
Comment thread apps/server/src/sourceControl/RemoteOverride.ts
Comment thread apps/web/src/routes/projects.$projectId.tsx Outdated
Comment thread apps/server/src/git/GitManager.ts
shivamhwp added 2 commits May 7, 2026 19:10
- Persist project action environment and surface it in setup/runtime
- Seed new threads from project default model selection
- Refine source control detection precedence and project settings UI
Comment thread apps/web/src/routes/projects.$projectId.tsx
Comment thread apps/web/src/routes/projects.$projectId.tsx
Comment thread apps/server/src/ws.ts
Comment thread apps/web/src/hooks/useHandleNewThread.ts
- sync script keybindings against existing local bindings
- preserve sticky draft state when seeding new threads
- reject duplicate action environment keys during normalization
Comment thread apps/web/src/routes/projects.$projectId.tsx Outdated
Comment thread apps/web/src/components/ChatView.tsx Outdated
- Replace the manual remote block with a detected remote summary
- Add provider icons and friendlier labels for Git remotes
- Keep custom remote override controls available when enabled
Comment thread apps/web/src/routes/projects.$projectId.tsx
- Seed new chat drafts from per-project defaults
- Cache project settings edits locally while commits are in flight
- Prevent duplicate action-environment keys
Comment thread apps/web/src/routes/projects.$projectId.tsx
Comment thread apps/web/src/routes/projects.$projectId.tsx
Comment thread apps/server/src/ws.ts Outdated
Comment thread apps/web/src/lib/projectScriptKeybindings.ts Outdated
- update project settings from the latest persisted snapshot
- skip keybinding validation when no server is available
- cover the new atomic update path with tests
Comment thread apps/web/src/lib/projectScriptKeybindings.ts
Comment thread apps/server/src/provider/Layers/ProviderRegistry.test.ts
Comment thread apps/server/src/serverSettings.ts
Comment thread apps/web/src/components/ChatView.tsx
- block action environment keys that start with `T3CODE_`
- keep runtime `T3CODE_*` values owned by T3Code
- add coverage for reserved env validation
Comment thread apps/web/src/components/ChatView.tsx Outdated
- Remove the Electron-only guard around project script keybinding sync
- Pass the local server when available and let the helper handle non-Electron cases
Comment thread apps/web/src/lib/projectScriptKeybindings.ts
Comment thread apps/web/src/components/ChatView.tsx
- Deploy the web app from release workflow
- Replace broad Effect imports with subpath imports
- Add lint rules and diagnostics for cleaner schema usage
@shivamhwp shivamhwp changed the title Add per-project settings (wip) Add per-project settings May 8, 2026
Comment thread apps/server/src/sourceControl/SourceControlProviderRegistry.ts
shivamhwp added 2 commits May 9, 2026 13:28
- Remove detected-remote summary and provider icon usage
- Show effective remote URL inline with external-link opening
- Reuse shared external URL helper for remote actions
- Persist project-level Git fetch refresh settings
- Thread project context through VCS status polling and UI
- Update project settings schema and tests for the new field
Comment thread apps/web/src/components/DiffPanel.tsx
Comment thread apps/web/src/components/ChatView.tsx
Comment thread apps/server/src/vcs/VcsStatusBroadcaster.ts
shivamhwp added 2 commits May 9, 2026 17:37
- Persist disabled provider instance IDs in project settings
- Gate chat and project selection on project-specific provider access
- Update project settings UI and validation
# Conflicts:
#	apps/server/src/provider/Layers/ProviderRegistry.test.ts
#	apps/server/src/serverSettings.ts
#	apps/server/src/ws.ts
#	packages/shared/src/serverSettings.ts
Comment thread apps/server/src/ws.ts Outdated
Comment thread apps/web/src/components/chat/ChatComposer.tsx Outdated
Comment thread apps/server/src/provider/Layers/ProviderRegistry.test.ts
Comment thread apps/web/src/lib/gitStatusState.ts
shivamhwp added 2 commits May 14, 2026 00:13
# Conflicts:
#	apps/server/src/ws.ts
#	apps/web/src/components/chat/ChatComposer.tsx
Comment thread apps/web/src/hooks/useHandleNewThread.ts
- Stop reseeding model defaults for reused empty drafts
- Keep draft routing stable when creating a new thread from an emptied draft
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b007aa0. Configure here.

contextSource: null,
}),
),
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing provider field in error fallback object

Low Severity

When sourceControlProviders.resolveHandle({ cwd }) fails, the Effect.catch fallback returns { context: null, contextSource: null } which is missing the provider field from SourceControlProviderHandle. The code only accesses .contextSource and .context from this value so it works at runtime, but it relies on structural typing leniency rather than matching the declared interface. If future code accesses .provider from this result, it'll be undefined.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b007aa0. Configure here.

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

Labels

size:XXL 1,000+ changed lines (additions + deletions). 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