{"slug":"developers/13_SHARED_COMPONENTS_AND_FRONTEND_STATE","title":"13 — Shared Components and Frontend State","section":"developers","sectionLabel":"Developers","status":"current","type":"document","path":"developers/13_SHARED_COMPONENTS_AND_FRONTEND_STATE.mdx","bytes":1783,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n**Status:** Active frontend handoff\n\n## State ownership\n\n| State                              | Owner                                          |\n| ---------------------------------- | ---------------------------------------------- |\n| Identity/session token             | Clerk SDK; verified again by Gateway           |\n| Tenant, membership and permissions | Gateway discovery response                     |\n| Entity/projection data             | Server-query cache keyed by tenant and version |\n| Canvas layout and local drafts     | Frontend local state until explicit save       |\n| Mutation/proposal/execution status | Platform response and event stream             |\n| Connector credentials              | Credential wall; never frontend state          |\n\nAll query keys include tenant and projection context. Sign-out, tenant switch\nand permission downgrade clear affected caches immediately.\n\n## Shared components\n\n- `EntityTable`, `EntityRecord`, `ProjectionPage`, `WorkbenchCanvas`\n- `FreshnessBadge`, `ProvenanceDrawer`, `ConfidenceIndicator`\n- `CapabilityControl`, `ApprovalCard`, `ExecutionStatus`\n- `ConnectorCard`, `ConnectionHealth`, `ActivationChecklist`\n- `EmptyState`, `PartialEvidenceNotice`, `ConflictResolver`, `ErrorBoundary`\n- contextual `TwinProposalCard`—never a permanent global panel\n\n## Typed client\n\nOne client owns base URL, Clerk token forwarding, correlation ID, idempotency\nkeys, retry policy, error decoding and schema validation. Components never build\nservice URLs or call internal services directly.\n\nRetries are limited to safe reads and idempotent requests. A retryable transport\nfailure is different from an application rejection, authorization failure,\nversion conflict or required approval.\n"}