Skip to content

Commit a5edce6

Browse files
chore(rules): drop the resource-menu sidebar-mirroring rule
1 parent 84e67b2 commit a5edce6

4 files changed

Lines changed: 18 additions & 17 deletions

File tree

‎.claude/rules/sim-list-ordering.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: List and menu ordering that mirrors the sidebar or toolbar, with one separator before the destructive action
2+
description: List and menu ordering that mirrors the toolbar or settings nav, encoded once, with one separator before the destructive action
33
paths:
44
- "apps/sim/app/**/*.tsx"
55
- "apps/sim/ee/**/*.tsx"
@@ -8,7 +8,7 @@ paths:
88

99
# List & Menu Ordering
1010

11-
**A list orders itself the way the user already reads the same things somewhere else.** Dropdowns, context menus, tab strips, command palettes, and settings navs are all *second* presentations of a set the user has already seen — in the sidebar, in a toolbar, in a column-header row. When the second presentation reorders that set, the user re-reads it from scratch every time.
11+
**A list orders itself the way the user already reads the same things somewhere else.** Dropdowns, context menus, tab strips, command palettes, and settings navs are all *second* presentations of a set the user has already seen — in a toolbar, in the settings nav, in a column-header row. When the second presentation reorders that set, the user re-reads it from scratch every time.
1212

1313
This is not a style preference. Order is the cheapest affordance a list has, and the only one that costs nothing to get right.
1414

@@ -18,13 +18,14 @@ Before writing a list of items, find where the user sees those same items *first
1818

1919
| The list | Mirrors |
2020
| --- | --- |
21-
| Resource menus (`+` attach, `@` mention, resource-tab `+`) | the workspace **sidebar**, top-down |
2221
| A row / root **context menu** | that surface's **toolbar**, left-to-right → top-to-bottom |
2322
| Settings tab strip, recently-deleted tabs | the **settings nav**, top-down |
2423
| A "New …" menu | the order those things appear once created |
2524

2625
Left-to-right becomes top-to-bottom. A toolbar reading `Filter · Sort · Export · Delete` becomes a menu reading Filter, Sort, Export, Delete — never alphabetized, never grouped by implementation, never "destructive last" unless the toolbar already puts it last.
2726

27+
Resource menus (`+` attach, `@` mention, resource-tab `+`) do not mirror the sidebar. Their order is a product decision encoded in `RESOURCE_MENU_ORDER` (see below), and every resource menu shares it.
28+
2829
Platform-only entries (desktop **Browser** and **Terminal**) trail the shared set rather than interleaving, so the common prefix is identical on every platform.
2930

3031
## Grouping: a rule marks a change in what the action acts on
@@ -107,10 +108,10 @@ grouping wants the standard grouping.
107108
An order duplicated across surfaces is an order that will drift. Export **one** constant and sort by it — do not hand-maintain a matching literal per menu.
108109

109110
```ts
110-
/** Top-down order for every menu listing resource families, mirroring the sidebar. */
111+
/** Top-down order for every menu listing resource families. */
111112
export const RESOURCE_MENU_ORDER: readonly MothershipResourceType[] = [
112-
'integration', 'task', 'table', 'file', 'filefolder',
113-
'knowledgebase', 'log', 'workflow', 'folder', 'browser', 'terminal', 'generic',
113+
'integration', 'task', 'dashboard', 'table', 'file', 'filefolder',
114+
'knowledgebase', 'workflow', 'log', 'folder', 'browser', 'terminal', 'generic',
114115
]
115116

116117
export function byResourceMenuOrder<T extends { type: MothershipResourceType }>(a: T, b: T) {

‎.cursor/rules/sim-list-ordering.mdc‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
description: "List and menu ordering that mirrors the sidebar or toolbar, with one separator before the destructive action"
2+
description: "List and menu ordering that mirrors the toolbar or settings nav, encoded once, with one separator before the destructive action"
33
globs: ["apps/sim/app/**/*.tsx","apps/sim/ee/**/*.tsx","apps/sim/components/**/*.tsx"]
44
---
55

66
<!-- Generated from .claude/rules/sim-list-ordering.md by `bun run skills:sync`. Edit the source, not this file. -->
77

88
# List & Menu Ordering
99

10-
**A list orders itself the way the user already reads the same things somewhere else.** Dropdowns, context menus, tab strips, command palettes, and settings navs are all *second* presentations of a set the user has already seen — in the sidebar, in a toolbar, in a column-header row. When the second presentation reorders that set, the user re-reads it from scratch every time.
10+
**A list orders itself the way the user already reads the same things somewhere else.** Dropdowns, context menus, tab strips, command palettes, and settings navs are all *second* presentations of a set the user has already seen — in a toolbar, in the settings nav, in a column-header row. When the second presentation reorders that set, the user re-reads it from scratch every time.
1111

1212
This is not a style preference. Order is the cheapest affordance a list has, and the only one that costs nothing to get right.
1313

@@ -17,13 +17,14 @@ Before writing a list of items, find where the user sees those same items *first
1717

1818
| The list | Mirrors |
1919
| --- | --- |
20-
| Resource menus (`+` attach, `@` mention, resource-tab `+`) | the workspace **sidebar**, top-down |
2120
| A row / root **context menu** | that surface's **toolbar**, left-to-right → top-to-bottom |
2221
| Settings tab strip, recently-deleted tabs | the **settings nav**, top-down |
2322
| A "New …" menu | the order those things appear once created |
2423

2524
Left-to-right becomes top-to-bottom. A toolbar reading `Filter · Sort · Export · Delete` becomes a menu reading Filter, Sort, Export, Delete — never alphabetized, never grouped by implementation, never "destructive last" unless the toolbar already puts it last.
2625

26+
Resource menus (`+` attach, `@` mention, resource-tab `+`) do not mirror the sidebar. Their order is a product decision encoded in `RESOURCE_MENU_ORDER` (see below), and every resource menu shares it.
27+
2728
Platform-only entries (desktop **Browser** and **Terminal**) trail the shared set rather than interleaving, so the common prefix is identical on every platform.
2829

2930
## Grouping: a rule marks a change in what the action acts on
@@ -106,10 +107,10 @@ grouping wants the standard grouping.
106107
An order duplicated across surfaces is an order that will drift. Export **one** constant and sort by it — do not hand-maintain a matching literal per menu.
107108

108109
```ts
109-
/** Top-down order for every menu listing resource families, mirroring the sidebar. */
110+
/** Top-down order for every menu listing resource families. */
110111
export const RESOURCE_MENU_ORDER: readonly MothershipResourceType[] = [
111-
'integration', 'task', 'table', 'file', 'filefolder',
112-
'knowledgebase', 'log', 'workflow', 'folder', 'browser', 'terminal', 'generic',
112+
'integration', 'task', 'dashboard', 'table', 'file', 'filefolder',
113+
'knowledgebase', 'workflow', 'log', 'folder', 'browser', 'terminal', 'generic',
113114
]
114115

115116
export function byResourceMenuOrder<T extends { type: MothershipResourceType }>(a: T, b: T) {

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The `'use client'` server boundary, the app/worker runtime env split, and featur
9191
- **Components**: `'use client'` only for hooks or browser APIs. Structure order, extraction thresholds, and list-render rules: `.claude/rules/sim-components.md`. Render-performance idioms (lazy-init refs, hoisting, `Map` pre-indexing, `[...arr].sort()` never `toSorted()` on client paths): `.claude/rules/sim-react-performance.md`. For effect/state/memo/callback anti-patterns use the `/you-might-not-need-*` skills and verify against the running UI.
9292
- **State ownership**: React Query owns server data — never `useState` + `fetch`; shareable client view-state (tabs, filters, search, pagination, selected id) lives in the URL via `nuqs`; Zustand owns global client state; `useState` owns UI-only state. Hooks: `.claude/rules/sim-hooks.md`. Stores (`devtools`, `persist` only with an explicit `partialize` whitelist, workflow value invariants): `.claude/rules/sim-stores.md`. URL state: `.claude/rules/sim-url-state.md`.
9393
- **Utils**: inline a helper with one consumer; create `utils.ts` when 2+ files share it — in `lib/` (app-wide) or `feature/utils/` (feature-scoped). Check `lib/` before writing a new one.
94-
- **Lists and menus** mirror the order the user already reads elsewhere (sidebar, toolbar), encoded in one exported order constant; a separator marks only a change in what the action acts on (typically one, before the destructive action): `.claude/rules/sim-list-ordering.md`.
94+
- **Lists and menus** mirror the order the user already reads elsewhere (toolbar, settings nav), encoded in one exported order constant (resource menus share `RESOURCE_MENU_ORDER`, a product order that does not mirror the sidebar); a separator marks only a change in what the action acts on (typically one, before the destructive action): `.claude/rules/sim-list-ordering.md`.
9595
- **Caching**: `lru-cache` with a `max` ceiling, never a hand-rolled TTL `Map`; a lifecycle map is not a cache; cache the gate, never the credential: `.claude/rules/sim-caching.md`.
9696

9797
## API Contracts and Routes

‎apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-registry/resource-registry.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,9 @@ export const RESOURCE_REGISTRY: Record<MothershipResourceType, ResourceTypeConfi
289289
export const MENTION_PREVIEW_DEFAULT_LIMIT = 5
290290

291291
/**
292-
* Top-down order for every menu that lists resource families, mirroring the
293-
* workspace sidebar so a user reads the same sequence in both places. The two
294-
* desktop-only panels trail the workspace resources, matching where they surface
295-
* in the app. `folder`/`filefolder` never render as their own entry — they feed
292+
* Top-down order for every menu that lists resource families (`+` attach, `@`
293+
* mention, resource-tab `+`). It is its own product order, not a copy of the
294+
* sidebar. The two desktop-only panels trail the workspace resources. `folder`/`filefolder` never render as their own entry — they feed
296295
* their family's folder tree — but are ordered beside it so a menu that ever does
297296
* surface them lands in the right place.
298297
*/

0 commit comments

Comments
 (0)