Skip to content

feat(teams): the acting team for a page - #2940

Merged
camielvs merged 2 commits into
cvs/secret-form-hardeningfrom
cvs/acting-team
Oct 31, 2026
Merged

camielvs merged 2 commits into
cvs/secret-form-hardeningfrom
cvs/acting-team

Conversation

@camielvs

@camielvs camielvs commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

useActingTeam() resolves the team a page acts as, from the projects the page belongs to. The secret pickers later in this stack read it, so they show the secrets that runs submitted from that page will use.

A page gets its project from one of two places:

  • Tangent's embedded editor and run view sit inside RunSubmissionScopeProvider, which files runs under the Tangent project.
  • The standalone editor carries the project in ?projectId=, which useRunProjectContext reads.

The hook takes the projects from both and lets useTeamForProjects decide. A page that names projects on two teams resolves to conflict rather than picking one.

It's a hook over cached queries, not a new provider. Every consumer already sits under the router and the scope provider, and the project, workspace and identity lookups are shared through the query cache.

Both project headers also show where you're working: the project's workspace and, when that workspace belongs to a team, your role in that team, as in "Search · Editor". The Tangent header shows it after the share button, and the project page shows it beside the pin.

  • Your role is Editor, Reader, No access, or Not a member, read from your memberships in GET /api/users/me. Until they load, only the workspace's name shows.
  • The team itself isn't named. The backend gives a team no name other than its id, which is long and opaque in a header.
  • The workspace has no team, or the host has teams switched off: only the workspace's name.

The headers mark the workspace with the Shapes icon. The workspace selector, used when starting a session or creating a project, now shows it on its button too, though not on its options. In the session box the selector sits next to the AI model picker, and the icon tells the two apart at a glance.

The header doesn't say whether runs act as the team. That depends on each run's secrets and its Run as choice (#2943), so the header only states facts about the project and you. The project page tests asserted that the workspace is never named. That dated from when workspaces scoped nothing, so they now assert the label is shown.

Related Issue and Pull requests

Type of Change

  • New feature

Line Breakdown

Category Added Removed
Production code 90 1
Tests 255 6
Total 345 7

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

None yet.

Test Instructions

pnpm vitest run src/services/teams/useActingTeam.test.ts src/components/Project src/components/Home/ProjectsSection/StartSessionPrompt.test.tsx src/routes/v2/pages/Tangent/components/ProjectHeader.test.tsx
  1. Open a project in a workspace with a team you're in. Both headers show the workspace, the team's id, and your role, such as "Editor".
  2. Open a project in a team's workspace while not in the team. The role reads "Not a member".
  3. Open a project in a workspace without a team. Only the workspace's name shows.
  4. With more than one workspace, open the projects page. The session box's workspace selector shows the Shapes icon before the workspace's name, and its options don't.

Additional Comments

None.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: cvs/acting-team/2eb00db

@camielvs
camielvs added this pull request to stack #2930 October 22, 2026 22:34
@camielvs
camielvs force-pushed the cvs/acting-team branch 2 times, most recently from 36da936 to 8eb46cf Compare October 23, 2026 23:50
@camielvs
camielvs force-pushed the cvs/acting-team branch 3 times, most recently from c51e09f to 3f5b7a1 Compare October 28, 2026 23:11
@camielvs
camielvs force-pushed the cvs/acting-team branch 3 times, most recently from d3efee7 to af71b7b Compare October 29, 2026 23:33
@camielvs
camielvs force-pushed the cvs/acting-team branch 2 times, most recently from 6047c77 to 521d2d3 Compare October 30, 2026 20:35
@camielvs
camielvs marked this pull request as ready for review October 30, 2026 21:23
@camielvs
camielvs requested a review from a team as a code owner October 30, 2026 21:24
`useActingTeam()` resolves the team a page acts as, from the projects
the page belongs to. The Secrets window and the secret pickers read it,
so they show the secrets that runs submitted from that page will use.

A page gets its project from one of two places:

- Tangent's embedded editor and run view sit inside
  `RunSubmissionScopeProvider`, which files runs under the Tangent
  project.
- The standalone editor carries the project in `?projectId=`, which
  `useRunProjectContext` reads.

The hook takes the projects from both and lets `useTeamForProjects`
decide, so a page that names projects on two teams resolves to
`conflict` rather than picking one. It is a hook over cached queries
rather than a new provider: every consumer already sits under the
router and the scope provider, and the project, workspace and identity
lookups are shared through the query cache.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…header

Both project headers now show the workspace a project sits in and, when
that workspace belongs to a team, your role in that team: Editor,
Reader, No access, or Not a member. A project page otherwise gave no
hint that its runs and secrets can belong to a team.

The headers mark the workspace with the Shapes icon, and the workspace
selector, used when starting a session or creating a project, now shows
it on its button, though not on its options. In the session box the
selector sits next to the AI model picker, and the icon tells the two
apart at a glance.

The team itself isn't named. The backend has no display name for a
team, only its id, which is long and opaque in a header. The role is
read from your memberships, not from whether a run would act as the
team, which depends on each run's secrets and its Run as choice.

The project page test that asserted the workspace is never named dates
from when workspaces scoped nothing; teams changed that.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@camielvs
camielvs merged commit 05c8816 into master Oct 31, 2026
18 checks passed
@camielvs
camielvs deleted the cvs/acting-team branch October 31, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants