You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After creating the block, remind the user to register it in `apps/sim/blocks/registry-maps.ts` (the data maps live here; `registry.ts` holds only the accessor functions). Add the import and an entry to each map alphabetically:
The data maps (`BLOCK_REGISTRY` + `BLOCK_META_REGISTRY`) live in `registry-maps.ts`; `registry.ts` holds only the accessor functions. Add the import and an entry to each map alphabetically:
Copy file name to clipboardExpand all lines: .claude/rules/sim-integrations.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The full authoring instructions — tool/block/icon/trigger scaffolding, SubBloc
13
13
14
14
## Hard rules (don't get these wrong)
15
15
16
-
- Tool IDs are `snake_case` (`service_action`). Register tools in `tools/registry.ts`, blocks in `blocks/registry.ts` (alphabetically), triggers in `triggers/registry.ts`.
16
+
- Tool IDs are `snake_case` (`service_action`). Register tools in `tools/registry.ts`, blocks in `blocks/registry-maps.ts` (the `BLOCK_REGISTRY` config map + `BLOCK_META_REGISTRY` catalog-meta map, alphabetically — `blocks/registry.ts` holds only the accessor functions), triggers in `triggers/registry.ts`.
17
17
- Type coercions (`Number()`, etc.) belong in `tools.config.params` (runs at execution, after variable resolution) — never in `tools.config.tool` (runs at serialization; coercing there destroys dynamic `<Block.output>` references).
18
18
-`canonicalParamId` must NOT match any subblock's `id`, must be unique per operation/condition context, and all subblocks in a canonical group must share the same `required` status. The `inputs` section and the params function reference canonical IDs, not raw subblock IDs.
19
19
- Blocks must also set the catalog/UI metadata fields `integrationType`, `tags`, `authMode`, `docsLink`, and export a `{Service}BlockMeta` — see the `/add-block` skill's BlockMeta section for details.
(from `@/app/workspace/[workspaceId]/components/credential-detail`). The
129
+
in-view header **Discard** chip (via `SaveDiscardActions onDiscard`) is a
130
+
*reset to original* — distinct from the back-confirm's discard, which leaves.
131
+
-**`useSettingsBeforeUnload`** is mounted **once** in the settings shell
132
+
(`settings/[section]/settings.tsx`) — never add a per-page `beforeunload`.
133
+
-**Dirty *computation* stays local** (shapes differ: field-compare vs
134
+
normalize+stringify) — only how dirty is *consumed* is shared. Derive it (a
135
+
`const`/`useMemo`), never store it in `useState`.
136
+
-**CRITICAL — rules of hooks:** call `useSettingsUnsavedGuard(...)`
137
+
**unconditionally, before every early-return gate** (entitlement / loading /
138
+
not-entitled `return <SettingsEmptyState>`). A hook placed after a gate is
139
+
skipped on gated renders and crashes.
140
+
- The route-based credential detail keeps its own `useUnsavedChangesGuard` (it
141
+
guards real `router.push` navigation + browser Back via a history sentinel);
142
+
it already shares `UnsavedChangesModal`, so copy stays unified.
143
+
104
144
## Detail sub-views (the one exception)
105
145
106
146
A drill-down view reached from a list row (selected MCP server, workflow MCP
@@ -119,5 +159,6 @@ A settings page is design-system-clean when:
119
159
-[ ] Header chips are in `actions`; a standalone search is in the `search` prop.
120
160
-[ ] Its `NavigationItem` has an accurate, consistent-length `description`.
121
161
-[ ] Detail sub-views and entitlement/loading gates keep their own chrome (intentional).
162
+
-[ ] If it has editable state: Save/Discard go through `SaveDiscardActions`, dirty is wired via `useSettingsUnsavedGuard` (called before any early-return gate), and there is **no** hand-rolled Save button / `beforeunload` / "Unsaved changes" modal.
122
163
-[ ] No business logic, handlers, or conditional rendering changed by the migration.
After creating the block, remind the user to register it in `apps/sim/blocks/registry-maps.ts` (the data maps live here; `registry.ts` holds only the accessor functions). Add the import and an entry to each map alphabetically:
The data maps (`BLOCK_REGISTRY` + `BLOCK_META_REGISTRY`) live in `registry-maps.ts`; `registry.ts` holds only the accessor functions. Add the import and an entry to each map alphabetically:
Copy file name to clipboardExpand all lines: .cursor/rules/sim-integrations.mdc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The full authoring instructions — tool/block/icon/trigger scaffolding, SubBloc
10
10
11
11
## Hard rules (don't get these wrong)
12
12
13
-
- Tool IDs are `snake_case` (`service_action`). Register tools in `tools/registry.ts`, blocks in `blocks/registry.ts` (alphabetically), triggers in `triggers/registry.ts`.
13
+
- Tool IDs are `snake_case` (`service_action`). Register tools in `tools/registry.ts`, blocks in `blocks/registry-maps.ts` (the `BLOCK_REGISTRY` config map + `BLOCK_META_REGISTRY` catalog-meta map, alphabetically — `blocks/registry.ts` holds only the accessor functions), triggers in `triggers/registry.ts`.
14
14
- Type coercions (`Number()`, etc.) belong in `tools.config.params` (runs at execution, after variable resolution) — never in `tools.config.tool` (runs at serialization; coercing there destroys dynamic `<Block.output>` references).
15
15
- `canonicalParamId` must NOT match any subblock's `id`, must be unique per operation/condition context, and all subblocks in a canonical group must share the same `required` status. The `inputs` section and the params function reference canonical IDs, not raw subblock IDs.
16
16
- Blocks must also set the catalog/UI metadata fields `integrationType`, `tags`, `authMode`, `docsLink`, and export a `{Service}BlockMeta` — see the `/add-block` skill's BlockMeta section for details.
0 commit comments