Skip to content

Commit aa8b877

Browse files
committed
fix(menus): keep empty-row actions together
1 parent 349c42a commit aa8b877

6 files changed

Lines changed: 4 additions & 39 deletions

File tree

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/components/chunk-context-menu/chunk-context-menu.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export function ChunkContextMenu({
7171
const hasEditSection = !isMultiSelect && (!!onEdit || !!onCopyContent)
7272
const hasStateSection = !!onToggleEnabled
7373
const hasDestructiveSection = !!onDelete
74-
/** @see `.claude/rules/sim-list-ordering.md` — one rule, before the destructive group. */
7574
const hasActionsAboveDestructive = hasNavigationSection || hasEditSection || hasStateSection
7675

7776
return (

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/document-context-menu/document-context-menu.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export function DocumentContextMenu({
7171
const hasEditSection = !isMultiSelect && (!!onRename || !!onViewTags)
7272
const hasStateSection = !!onToggleEnabled
7373
const hasDestructiveSection = !!onDelete
74-
/** @see `.claude/rules/sim-list-ordering.md` — one rule, before the destructive group. */
7574
const hasActionsAboveDestructive = hasNavigationSection || hasEditSection || hasStateSection
7675

7776
return (

apps/sim/app/workspace/[workspaceId]/knowledge/components/knowledge-base-context-menu/knowledge-base-context-menu.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export const KnowledgeBaseContextMenu = memo(function KnowledgeBaseContextMenu({
7575
const hasMoveSection = !disableEdit && !!onMove && !!moveOptions && moveOptions.length > 0
7676
const hasEditSection = (showEdit && !!onEdit) || hasMoveSection
7777
const hasDestructiveSection = showDelete && !!onDelete
78-
/** @see `.claude/rules/sim-list-ordering.md` — one rule, before the destructive group. */
7978
const hasActionsAboveDestructive = hasNavigationSection || hasInfoSection || hasEditSection
8079

8180
return (

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/workflow-group-meta-cell.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ export function ColumnOptionsMenu({
180180
<DropdownMenuItem onSelect={() => onRunColumnIncomplete?.()}>
181181
{runLabels.incomplete}
182182
</DropdownMenuItem>
183-
<DropdownMenuItem onSelect={() => onRunColumnAll?.()}>
184-
{runLabels.all}
185-
</DropdownMenuItem>
186183
{onRunColumnLimited &&
187184
LIMITED_RUN_PRESETS.map((max) => (
188185
<DropdownMenuItem key={max} onSelect={() => onRunColumnLimited(max)}>
189186
{runLabels.limited(max)}
190187
</DropdownMenuItem>
191188
))}
189+
<DropdownMenuItem onSelect={() => onRunColumnAll?.()}>
190+
{runLabels.all}
191+
</DropdownMenuItem>
192192
</DropdownMenuSubContent>
193193
</DropdownMenuSub>
194194
)}
@@ -519,12 +519,12 @@ export function WorkflowGroupMetaCell({
519519
<DropdownMenuItem onSelect={handleRunIncomplete}>
520520
{runLabels.incomplete}
521521
</DropdownMenuItem>
522-
<DropdownMenuItem onSelect={handleRunAll}>{runLabels.all}</DropdownMenuItem>
523522
{LIMITED_RUN_PRESETS.map((max) => (
524523
<DropdownMenuItem key={max} onSelect={() => handleRunLimited(max)}>
525524
{runLabels.limited(max)}
526525
</DropdownMenuItem>
527526
))}
527+
<DropdownMenuItem onSelect={handleRunAll}>{runLabels.all}</DropdownMenuItem>
528528
</DropdownMenuContent>
529529
</DropdownMenu>
530530
)}

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/context-menu/context-menu.test.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,6 @@ describe('sidebar context menu dismissal', () => {
138138
})
139139
})
140140

141-
/**
142-
* Separator invariants. The menu carries exactly one rule, immediately before the
143-
* destructive group, and it may never render with an empty group on either side —
144-
* see the grouping section of `.claude/rules/sim-list-ordering.md`.
145-
*
146-
* These pin the shape the flag matrix used to get wrong: `showLeave` in the rule's
147-
* guard without the `&& onLeave` its item requires produced a trailing rule under
148-
* the last item, and nothing covered it.
149-
*/
150141
describe('separators', () => {
151142
function renderWith(props: Partial<React.ComponentProps<typeof ContextMenu>>) {
152143
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
@@ -169,7 +160,6 @@ describe('separators', () => {
169160
)
170161
}
171162

172-
/** Menu children in render order, each as 'sep' or its label. */
173163
function menuShape(): string[] {
174164
const content = document.querySelector('[role="menu"]')
175165
if (!content) return []

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/context-menu/context-menu.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -165,29 +165,7 @@ export function ContextMenu({
165165
showUploadLogo = false,
166166
disableUploadLogo = false,
167167
}: ContextMenuProps) {
168-
/**
169-
* One rule, immediately before the destructive group — see the menu-grouping
170-
* section of `.claude/rules/sim-list-ordering.md`.
171-
*
172-
* This menu previously carried four semantic bands (navigation / status / edit /
173-
* copy / destructive) behind up to five separators. No toolbar in the app renders
174-
* a divider — every header is a flat `gap-1` chip row — so those bands taught a
175-
* taxonomy the user met nowhere else, and each caller's flag combination banded
176-
* the same action differently (Pin alone here, Pin beside Duplicate there). Order
177-
* still mirrors the surface's toolbar, which is what the ordering rule actually
178-
* requires; only the rules between groups are gone.
179-
*
180-
* Every term below is the exact render condition of the item it stands for, so a
181-
* separator can never outlive the group on either side of it. `showLeave` was the
182-
* one asymmetric term — it omitted `&& onLeave`, so a caller passing `showLeave`
183-
* from a permission check with a conditional `onLeave` (the `x ? fn : undefined`
184-
* shape used for `onDuplicate`/`onTogglePin`/`onCloseTab` elsewhere) would have
185-
* rendered a trailing rule under the last item.
186-
*/
187168
const hasActionsAboveDestructive =
188-
/* No `openInNewTabPosition` term: the item renders in the 'first' slot or the
189-
'last' one, and the prop is a closed two-value union, so `showOpenInNewTab &&
190-
onOpenInNewTab` already means exactly "the nav item renders somewhere above". */
191169
(showOpenInNewTab && onOpenInNewTab) ||
192170
(showMarkAsRead && onMarkAsRead) ||
193171
(showMarkAsUnread && onMarkAsUnread) ||

0 commit comments

Comments
 (0)