* Replace the workspace display order (e.g. after a drag reorder in the * sidebar) and persist it. The id set is unchanged, so the reconciliation * watcher above will not fire — only the sort in `workspacesView` reacts.
(ids: string[])
| 2104 | * watcher above will not fire — only the sort in `workspacesView` reacts. |
| 2105 | */ |
| 2106 | function reorderWorkspaces(ids: string[]): void { |
| 2107 | workspaceOrder.value = ids; |
| 2108 | saveWorkspaceOrder(ids); |
| 2109 | // A drag is an explicit manual ordering, so drop out of `recent` mode — the |
| 2110 | // dragged order would otherwise be overwritten by the live recency sort. |
| 2111 | if (workspaceSortMode.value !== 'manual') { |
| 2112 | workspaceSortMode.value = 'manual'; |
| 2113 | saveWorkspaceSort('manual'); |
| 2114 | } |
| 2115 | } |
| 2116 | |
| 2117 | /** Switch the sidebar workspace sort mode and persist the choice. */ |
| 2118 | function setWorkspaceSortMode(mode: WorkspaceSortMode): void { |
nothing calls this directly
no test coverage detected