Skip to content

fix(projects): offer the project picker on remote pipelines - #2970

Open
camielvs wants to merge 1 commit into
masterfrom
cvs/remote-project-picker
Open

camielvs wants to merge 1 commit into
masterfrom
cvs/remote-project-picker

Conversation

@camielvs

@camielvs camielvs commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Project picker was missing from the editor for remote pipelines

image

Description

The project picker in the editor's top bar sets which project a pipeline's runs go to, and adds the pipeline to a project. #2885 hid it for pipelines saved to a backend, because the picker only understood browser-held pipelines: it looked a pipeline's projects up by its local name, and Add to a project… always filed a browser-pipeline pointer. Shown as it was, it would have reported a backend pipeline as being in no project, and adding one would have created a row pointing at a browser pipeline that does not exist.

This PR shows the picker for backend pipelines again and teaches it about them:

  • ProjectPipelineRef: the picker, AddToProjectDialog and usePipelineProjects take a reference that is either a browser pipeline ({ source: "local", name }) or a backend pipeline ({ source: "remote", pipelineId, name }) instead of a bare name. projectPipelineOf(file) builds it from the editor's active PipelineFile.
  • Finding its projects: a backend pipeline's projects are matched on the resource's entityId (remotePipelineResourceIn), comparing normalized ids. The browser-pointer lookup (pointerTo) is skipped for it.
  • Adding it to a project: files { entity: "pipeline", entityId, name }, the same resource Tangent and the project page already create and read for backend pipelines.
  • Drafts: a draft has no backend id until its first save. The picker still shows, so its runs can go to a project, but Add to a project… only appears once the draft is saved.
  • Projects it is already in: choosing Add to a project… closes the picker's dropdown, which used to switch the project lookup off, so the dialog never marked the projects the pipeline was already in. The lookup now keeps running while the dialog is open. Picking one of those projects added a second pointer for a browser pipeline (since feat: pick a project from the editor and attribute runs to it #2808), and for a backend pipeline it would have failed, because the backend refuses a duplicate.

Things to look at in review:

  • Run-with-arguments dialog: RunProjectField still looks projects up by the spec's name, as a browser pipeline. For a backend pipeline it lists the selected project but misses the other projects that hold it, and can list a project that holds a browser pipeline with the same name instead. Fixing it means passing the pipeline through TangleSubmitter, which only has the spec, so it is left for a follow-up.
  • Same backend assumed: projects are read from the configured backend, and the editor always opens a backend pipeline from that same backend, so there is no cross-backend check.

Related Issue and Pull requests

Shows the picker that #2885 hid for backend pipelines.

Type of Change

  • Bug fix

Line Breakdown

Category Added Removed
Production code 115 25
Tests 282 15
Total 397 40

Checklist

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

Covered by unit tests only: the Vitest suites for projects, the editor, the flow sidebar and Tangent (1,331 tests), type-checking, lint, Prettier and knip pass. Not yet checked in a running app.

Test Instructions

  1. With projects switched on and a backend that stores pipelines, open a pipeline saved to the backend in the editor.
  2. The project picker (No project ▾) should show in the top bar, next to the run button.
  3. Choose Add to a project… and pick a project. The picker should then show that project, and the pipeline should be listed on the project's page.
  4. Choose Add to a project… again: the project the pipeline is in shows as Added and cannot be picked.
  5. Reopen the picker: the project is listed, and Remove from project takes the pipeline back out.
  6. Create a new pipeline. Before its first save, the picker shows without Add to a project…; once an edit is saved, the option appears.

🤖 Generated with Claude Code

@camielvs
camielvs requested a review from a team as a code owner October 30, 2026 20:06
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: cvs/remote-project-picker/2920495

@camielvs camielvs left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🤖 This is an AI-generated code review comment.

3 findings, inline below (1 Medium, 2 Low). tsc and the project, picker, menu-bar and sidebar suites (462 tests) pass at this head, and the branch merges cleanly with master.

One note on the description: it says RunProjectField "lists only the selected project" for a backend pipeline. It looks up pointerTo(specName), and with no local registry entry pointsAt falls back to comparing names. So it also lists any project that holds a browser pipeline with the same name.

@camielvs
camielvs force-pushed the cvs/remote-project-picker branch from 3b20ca5 to d93a8b3 Compare November 5, 2026 18:06
The editor hid the top-nav project picker for pipelines saved to a
backend, because the picker only understood browser pipelines: it
looked their projects up by local name and filed them as a browser
pipeline pointer.

Give the picker a pipeline reference that is either a browser pipeline,
by name, or a backend pipeline, by id. A backend pipeline's projects are
matched on the resource's entity id, and adding it files the same
`pipeline` resource the project page already reads. A draft has no id
until its first save, so it can still choose where runs go but cannot be
added to a project before then.

Keep looking up the pipeline's projects while the "Add to a project"
dialog is open. Choosing that option closes the dropdown, which switched
the lookup off, so the dialog never marked the projects the pipeline was
already in. For a browser pipeline that added a duplicate pointer; for a
backend pipeline the backend refuses the duplicate and the add fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@camielvs
camielvs force-pushed the cvs/remote-project-picker branch from d93a8b3 to 2920495 Compare November 5, 2026 18:06

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant