Skip to content

Commit 085f58f

Browse files
committed
improvement(ui): order the remaining resource menus the way the user reads them
An audit of every menu, tab strip, and context menu against the surface the user already reads those items on turned up six more divergences. The table row context menu put View execution before the Run/Re-run/Stop cluster while the action bar puts it after, so the same four actions read in two orders; the menu now follows the bar. The Files, Tables, and Knowledge empty-space create menus were each the exact reverse of their own page header, and each named the same action differently ("Create table" vs "New table", "Add knowledge base" vs "New base") — reversed to match, labels unified. Recently Deleted led with Workflows and buried Chats last, and put Knowledge Bases ahead of Files; it now follows the sidebar after the default All tab. The command palette hoisted Workflows from last to second for the same reason, and is now in sidebar order too. Chats stays first in both, so the palette's Enter default is unchanged. Drops the unused RESOURCE_TYPES export: nothing consumed it, and its declaration order was nearly the inverse of RESOURCE_MENU_ORDER, so the first consumer to map it would have silently rendered a backwards menu. Not included: buildUnifiedSettingsNavigation never applies its own unified.order and returns registry declaration order instead. Nothing user-visible today (the sidebar re-sorts before rendering) but navigation.test.ts pins the unsorted order as canonical, so fixing it means changing that test — worth doing deliberately rather than inside this PR.
1 parent 9da559e commit 085f58f

11 files changed

Lines changed: 58 additions & 46 deletions

File tree

apps/sim/app/workspace/[workspaceId]/files/components/files-list-context-menu/files-list-context-menu.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ export const FilesListContextMenu = memo(function FilesListContextMenu({
4343
sideOffset={4}
4444
onCloseAutoFocus={(e) => e.preventDefault()}
4545
>
46-
{onCreateFile && (
47-
<DropdownMenuItem disabled={disableCreate} onSelect={onCreateFile}>
48-
<Plus />
49-
New file
46+
{/* Upload, New folder, New file — the order the page header presents
47+
them once `orderHeaderActions` has pinned the primary action last. */}
48+
{onUploadFile && (
49+
<DropdownMenuItem disabled={disableUpload} onSelect={onUploadFile}>
50+
<Upload />
51+
Upload file
5052
</DropdownMenuItem>
5153
)}
5254
{onCreateFolder && (
@@ -55,10 +57,10 @@ export const FilesListContextMenu = memo(function FilesListContextMenu({
5557
New folder
5658
</DropdownMenuItem>
5759
)}
58-
{onUploadFile && (
59-
<DropdownMenuItem disabled={disableUpload} onSelect={onUploadFile}>
60-
<Upload />
61-
Upload file
60+
{onCreateFile && (
61+
<DropdownMenuItem disabled={disableCreate} onSelect={onCreateFile}>
62+
<Plus />
63+
New file
6264
</DropdownMenuItem>
6365
)}
6466
</DropdownMenuContent>

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ export {
55
getResourceConfig,
66
invalidateResourceQueries,
77
RESOURCE_REGISTRY,
8-
RESOURCE_TYPES,
98
} from './resource-registry'
109
export { ResourceTabs } from './resource-tabs'

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ export {
55
invalidateResourceQueries,
66
RESOURCE_MENU_ORDER,
77
RESOURCE_REGISTRY,
8-
RESOURCE_TYPES,
98
} from './resource-registry'

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ export const RESOURCE_REGISTRY: Record<MothershipResourceType, ResourceTypeConfi
222222
},
223223
} as const
224224

225-
export const RESOURCE_TYPES = Object.values(RESOURCE_REGISTRY)
226-
227225
/**
228226
* Top-down order for every menu that lists resource families, mirroring the
229227
* workspace sidebar so a user reads the same sequence in both places. The two

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,20 @@ export const KnowledgeListContextMenu = memo(function KnowledgeListContextMenu({
4949
sideOffset={4}
5050
onCloseAutoFocus={(e) => e.preventDefault()}
5151
>
52-
{onAddKnowledgeBase && (
53-
<DropdownMenuItem disabled={disableAdd} onSelect={onAddKnowledgeBase}>
54-
<Plus />
55-
Add knowledge base
56-
</DropdownMenuItem>
57-
)}
52+
{/* New folder, New base — the order the page header presents them once
53+
`orderHeaderActions` has pinned the primary action last. */}
5854
{onAddFolder && (
5955
<DropdownMenuItem disabled={disableAddFolder} onSelect={onAddFolder}>
6056
<FolderPlus />
6157
New folder
6258
</DropdownMenuItem>
6359
)}
60+
{onAddKnowledgeBase && (
61+
<DropdownMenuItem disabled={disableAdd} onSelect={onAddKnowledgeBase}>
62+
<Plus />
63+
New base
64+
</DropdownMenuItem>
65+
)}
6466
</DropdownMenuContent>
6567
</DropdownMenu>
6668
)

apps/sim/app/workspace/[workspaceId]/settings/components/recently-deleted/recently-deleted.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,15 @@ interface RestoredResourceEntry {
114114
displayIndex: number
115115
}
116116

117+
/** Labels for {@link RECENTLY_DELETED_TABS}, which owns the order. */
117118
const TABS: { id: ResourceType; label: string }[] = [
118119
{ id: 'all', label: 'All' },
119-
{ id: 'workflow', label: 'Workflows' },
120-
{ id: 'folder', label: 'Folders' },
120+
{ id: 'chat', label: 'Chats' },
121121
{ id: 'table', label: 'Tables' },
122-
{ id: 'knowledge', label: 'Knowledge Bases' },
123122
{ id: 'file', label: 'Files' },
124-
{ id: 'chat', label: 'Chats' },
123+
{ id: 'knowledge', label: 'Knowledge Bases' },
124+
{ id: 'workflow', label: 'Workflows' },
125+
{ id: 'folder', label: 'Folders' },
125126
]
126127

127128
const TYPE_LABEL: Record<Exclude<ResourceType, 'all'>, string> = {

apps/sim/app/workspace/[workspaceId]/settings/components/recently-deleted/search-params.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import { parseAsStringLiteral } from 'nuqs/server'
22
import { createSortParams } from '@/lib/url-state'
33

4-
/** Selectable resource-type tabs in the Recently Deleted view. */
4+
/**
5+
* Selectable resource-type tabs in the Recently Deleted view, after the default
6+
* `all`: the sidebar's top-down order, so the tabs read the way the user already
7+
* reads these resources. `TABS` in `recently-deleted.tsx` labels this same list —
8+
* keep the two in step.
9+
*/
510
export const RECENTLY_DELETED_TABS = [
611
'all',
7-
'workflow',
8-
'folder',
12+
'chat',
913
'table',
10-
'knowledge',
1114
'file',
12-
'chat',
15+
'knowledge',
16+
'workflow',
17+
'folder',
1318
] as const
1419

1520
export type RecentlyDeletedTab = (typeof RECENTLY_DELETED_TABS)[number]

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/context-menu/context-menu.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,10 @@ export function ContextMenu({
175175
Edit cell
176176
</DropdownMenuItem>
177177
)}
178-
{canViewExecution && onViewExecution && (
179-
<DropdownMenuItem onSelect={onViewExecution}>
180-
<Eye />
181-
View execution
182-
</DropdownMenuItem>
183-
)}
184-
{/* Not gated on `disableEdit`: these write only workflow-output columns,
178+
{/* Run, Re-run, Stop, then View execution — the order the action bar
179+
presents the same four, so the user reads one sequence in both.
180+
181+
Not gated on `disableEdit`: these write only workflow-output columns,
185182
which the update lock exempts, and Stop is a cancel rather than a
186183
write. Their handlers are already withheld without edit permission. */}
187184
{hasWorkflowColumns && onRunWorkflows && (
@@ -202,6 +199,12 @@ export function ContextMenu({
202199
{stopLabel}
203200
</DropdownMenuItem>
204201
)}
202+
{canViewExecution && onViewExecution && (
203+
<DropdownMenuItem onSelect={onViewExecution}>
204+
<Eye />
205+
View execution
206+
</DropdownMenuItem>
207+
)}
205208
<DropdownMenuItem disabled={disableInsert} onSelect={onInsertAbove}>
206209
<ArrowUp />
207210
Insert row above

apps/sim/app/workspace/[workspaceId]/tables/components/tables-list-context-menu/tables-list-context-menu.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ export function TablesListContextMenu({
5454
sideOffset={4}
5555
onCloseAutoFocus={(e) => e.preventDefault()}
5656
>
57-
{onCreateTable && (
58-
<DropdownMenuItem disabled={disableCreate} onSelect={onCreateTable}>
59-
<Plus />
60-
Create table
57+
{/* Import CSV, New folder, New table — the order the page header presents
58+
them once `orderHeaderActions` has pinned the primary action last. */}
59+
{onUploadCsv && (
60+
<DropdownMenuItem disabled={disableUpload} onSelect={onUploadCsv}>
61+
<Upload />
62+
Import CSV
6163
</DropdownMenuItem>
6264
)}
6365
{onCreateFolder && (
@@ -66,10 +68,10 @@ export function TablesListContextMenu({
6668
New folder
6769
</DropdownMenuItem>
6870
)}
69-
{onUploadCsv && (
70-
<DropdownMenuItem disabled={disableUpload} onSelect={onUploadCsv}>
71-
<Upload />
72-
Import CSV
71+
{onCreateTable && (
72+
<DropdownMenuItem disabled={disableCreate} onSelect={onCreateTable}>
73+
<Plus />
74+
New table
7375
</DropdownMenuItem>
7476
)}
7577
</DropdownMenuContent>

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,9 +800,6 @@ export function SearchModal({
800800
{showSection('chats') && (
801801
<ChatsGroup items={filteredChats} onSelect={handleChatSelect} />
802802
)}
803-
{showSection('workflows') && (
804-
<WorkflowsGroup items={filteredWorkflows} onSelect={handleWorkflowSelect} />
805-
)}
806803
{showSection('tables') && (
807804
<TablesGroup items={filteredTables} onSelect={handleTableSelect} />
808805
)}
@@ -812,6 +809,9 @@ export function SearchModal({
812809
{showSection('knowledgeBases') && (
813810
<KnowledgeBasesGroup items={filteredKnowledgeBases} onSelect={handleKbSelect} />
814811
)}
812+
{showSection('workflows') && (
813+
<WorkflowsGroup items={filteredWorkflows} onSelect={handleWorkflowSelect} />
814+
)}
815815
{showSection('toolOperations') && (
816816
<ToolOpsGroup items={filteredToolOps} onSelect={handleToolOperationSelect} />
817817
)}

0 commit comments

Comments
 (0)