feat: shared components — reusable, linked pipeline configs#82
feat: shared components — reusable, linked pipeline configs#82TerrifiedBug merged 19 commits intomainfrom
Conversation
- Detail panel shows "Open in Library" link on shared component banner - Component palette shared tab includes kind filter buttons (All/Source/Transform/Sink)
- Verify environment ownership on getById, update, delete (prevents IDOR) - Validate cross-environment linking in linkExisting - Use atomic version increment to prevent race conditions - Move createFromNode uniqueness check inside transaction (TOCTOU fix) - Fix operator precedence in discardChanges node mapping
- New shared-components.md covering full feature lifecycle - Update templates.md to reflect Library page rename and shared link stripping - Update pipeline-editor.md with Shared palette tab, context menu, and linked node detail panel - Update pipelines.md with stale shared component badge - Add Shared Components entry to SUMMARY.md table of contents
Greptile SummaryThis PR introduces Shared Components — environment-scoped, versioned pipeline component configurations that can be linked into multiple pipelines — along with a restructured Library page (replacing Key changes:
Minor issues found:
Confidence Score: 4/5
Important Files Changed
Entity Relationship Diagram%%{init: {'theme': 'neutral'}}%%
erDiagram
Environment {
string id PK
string name
}
SharedComponent {
string id PK
string name
string componentType
ComponentKind kind
Json config
int version
string environmentId FK
DateTime createdAt
DateTime updatedAt
}
PipelineNode {
string id PK
string pipelineId FK
string componentType
ComponentKind kind
Json config
string sharedComponentId FK "nullable, SetNull on delete"
int sharedComponentVersion "nullable"
}
Pipeline {
string id PK
string environmentId FK
string name
}
Environment ||--o{ SharedComponent : "scopes"
Environment ||--o{ Pipeline : "contains"
Pipeline ||--o{ PipelineNode : "has"
SharedComponent ||--o{ PipelineNode : "linked to (0..*)"
|
…e name check in transaction - createFromNode now verifies the pipeline belongs to the claimed environmentId - update procedure wraps lookup + name-conflict check + write in a transaction to prevent TOCTOU race on concurrent renames
|
@greptile fixed.
|
…te in transaction - saveGraph now validates all sharedComponentIds belong to the pipeline's environment before persisting, preventing cross-environment injection - create procedure wraps duplicate-name check in a transaction to match createFromNode pattern and prevent TOCTOU race (P2002 → clean CONFLICT)
|
@greptile fixed.
|
…/redo - Add patchNodeSharedData, acceptNodeSharedUpdate, unlinkNode store actions - acceptUpdate/unlink mutations now sync the flow store on success, preventing saveGraph from reverting DB changes with stale in-memory data - Shared component drop uses patchNodeSharedData instead of raw setState, preserving linkage across undo/redo cycles - acceptUpdate endpoint returns decrypted config + version for client sync - saveGraph validates that all sharedComponentIds exist (not just env match)
|
@greptile fixed
|
Canvas now immediately shows purple shared treatment after creating a shared component from a node, without requiring a page reload.
|
@greptile fixed. The SaveSharedComponentDialog now calls patchNodeSharedData in onSuccess to sync the Zustand store — canvas immediately shows the purple border, read-only config, and shared banner without needing a page reload. |
Summary
/templatesto/librarywith sub-navigation for Templates and Shared Components. Full CRUD management for shared components including create-from-scratch, create-from-node, edit, delete, and linked pipeline tracking.Test plan
/templatesredirects to/library/templatesnpx tsc --noEmit,pnpm lint,pnpm build— all pass