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
{{ message }}
Repository navigation
Commit 3e586ee
Browse filesBrowse the repository at this point in the historyBrowse files
improvement(menus): one separator per menu, before the destructive action
Menus banded themselves into semantic groups — navigation, status, edit,
copy, destructive — behind two to four separators each. No toolbar in the
app renders a divider: every header is a flat gap-1 chip row and every
bulk action bar a flat gap-[5px] run. The bands therefore taught a
taxonomy the user met on no other surface, and because each band is
conditional, the same action landed in a different group depending on
which siblings happened to be visible. Pin sat alone in one caller of the
shared workflow menu and beside Duplicate in another.
Every menu now carries at most one rule, immediately before the
destructive group. Order is untouched, so the toolbar-mirroring the
ordering rule requires is unaffected.
Two separator bugs fixed. The logs row menu had two unconditional
separators above conditional items, so a log already filtered by its
workflow with no active filters ended on a dangling rule. The shared
workflow menu guarded its destructive rule on showLeave alone while the
Leave item required showLeave && onLeave, so a caller passing showLeave
from a permission check with a conditional onLeave would trail a rule
under the last item; every term in both guards is now the exact render
condition of the item it stands for.
Removes groupNonDestructiveActions and separateNavigationAction. Between
them they moved one separator for one caller, four of six branches were
unreachable, and separateNavigationAction had no observable effect
anywhere in the repo.
The separator matrix was previously untested, which is how the showLeave
asymmetry survived; it now has invariants including a flag sweep.
Platform-only entries (desktop **Browser** and **Terminal**) trail the shared set rather than interleaving, so the common prefix is identical on every platform.
28
28
29
+
## Grouping: one rule, before the destructive action
30
+
31
+
Order is governed above. **Separators are governed here** — and the answer is: use at most one.
32
+
33
+
Put a single `DropdownMenuSeparator` immediately before the destructive group (Delete, Leave,
34
+
Close, Hide) and nowhere else. Everything above it runs uninterrupted in toolbar-mirroring order.
35
+
36
+
```tsx
37
+
// ✗ Bad — four semantic bands the user meets nowhere else
This is the failure that put a dangling rule at the bottom of the logs row menu, where two
69
+
unconditional separators sat above conditional items.
70
+
71
+
**Do not add a prop to move a rule.** The shared workflow context menu grew
72
+
`groupNonDestructiveActions` and `separateNavigationAction` for this; between them they moved one
73
+
separator for one caller, four of six branches were unreachable, and `separateNavigationAction`
74
+
had no observable effect anywhere in the repo. Both are gone. A menu that wants different
75
+
grouping wants the standard grouping.
76
+
29
77
## Encode the order once
30
78
31
79
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.
Copy file name to clipboardExpand all lines: CLAUDE.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -386,7 +386,9 @@ Co-locate a `search-params.ts` per feature exporting the parser map (single sour
386
386
387
387
A list orders itself the way the user already reads the same things somewhere else. Resource menus (`+` attach, `@` mention, resource-tab `+`) mirror the **sidebar** top-down; a row or root **context menu** mirrors that surface's **toolbar**, left-to-right becoming top-to-bottom; tab strips mirror their nav. Platform-only entries (desktop Browser, Terminal) trail the shared set.
388
388
389
-
Encode the order in ONE exported constant and sort by it — never a hand-maintained literal per menu (`RESOURCE_MENU_ORDER` / `byResourceMenuOrder` in `home/components/mothership-view/components/resource-registry`). Render mixed item kinds in a single ordered pass; emitting all submenu-backed families and then all flat ones silently pins every submenu to the top no matter what the constant says. Divergence is allowed only for search ranking, user-controlled ordering, and recency. Full rule in `.claude/rules/sim-list-ordering.md`.
389
+
Encode the order in ONE exported constant and sort by it — never a hand-maintained literal per menu (`RESOURCE_MENU_ORDER` / `byResourceMenuOrder` in `home/components/mothership-view/components/resource-registry`). Render mixed item kinds in a single ordered pass; emitting all submenu-backed families and then all flat ones silently pins every submenu to the top no matter what the constant says. Divergence is allowed only for search ranking, user-controlled ordering, and recency.
390
+
391
+
**Grouping**: at most ONE `DropdownMenuSeparator` per menu, immediately before the destructive group (Delete/Leave/Close/Hide). No toolbar in the app renders a divider, so multi-band menus teach a taxonomy that exists on no other surface. Build each separator's guard from the EXACT render conditions of the items on both sides — a looser guard is what leaves a dangling rule when its group is conditional. Never add a prop to move a rule. Full rule in `.claude/rules/sim-list-ordering.md`.
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/browser-session/browser-tab-strip.tsx
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -216,9 +216,7 @@ export function BrowserTabStrip({
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/components/chunk-context-menu/chunk-context-menu.tsx
+3-10Lines changed: 3 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,8 @@ export function ChunkContextMenu({
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/document-context-menu/document-context-menu.tsx
+3-10Lines changed: 3 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,8 @@ export function DocumentContextMenu({
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/knowledge/components/knowledge-base-context-menu/knowledge-base-context-menu.tsx
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/workflow-group-meta-cell.tsx
+24-29Lines changed: 24 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -160,34 +160,31 @@ export function ColumnOptionsMenu({
0 commit comments