Skip to content

UI: Shared component management (edit / delete / link / bulk-accept / detail) #440

Description

@TerrifiedBug

Problem

Shared components can be created, listed, single-node-accepted, and unlinked today (trpc.sharedComponent.createFromNode, list, acceptUpdate, unlink — in src/components/flow/save-shared-component-dialog.tsx, detail-panel.tsx, and src/app/(dashboard)/library/shared-components/page.tsx). But five management procedures have no UI:

  • sharedComponent.getByIdsrc/server/routers/shared-component.ts:52 — single-component detail (VIEWER).
  • sharedComponent.update:233 — edit a shared component (EDITOR).
  • sharedComponent.delete:293 — delete a shared component (EDITOR, audited).
  • sharedComponent.linkExisting:433 — link an already-placed node to an existing shared component.
  • sharedComponent.acceptUpdateBulk:357 — accept updates for all stale linked nodes in a pipeline at once (EDITOR, audited).

So you can create and use shared components, but can't view their detail, edit them, delete them, link an existing node, or bulk-accept stale updates.

Proposed solution

Flesh out the library (src/app/(dashboard)/library/shared-components/page.tsx) and the canvas detail panel (src/components/flow/detail-panel.tsx):

  • Detail view per component (getById) — definition + linked pipelines/nodes.
  • Edit (update) and Delete (delete) actions in the library; destructive-confirm on delete.
  • "Link existing node" action on a canvas node → linkExisting.
  • "Accept all updates in this pipeline"acceptUpdateBulk, complementing the per-node acceptUpdate already wired in detail-panel.tsx.

Alternatives considered

  • Per-node accept/unlink only (current) — no way to manage the component catalog itself or to bulk-resolve drift across a large pipeline; tedious and error-prone at scale.

Additional context

Wired today: list, createFromNode, acceptUpdate (single), unlink. The five missing procedures round out detail + lifecycle (edit/delete) + linking + bulk-accept.

Part of #431

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions