-
[OPIK-7126] [FE] feat: unify workspace menu with projects menu (#7484)
发布于
2026-07-16 15:18:20 +00:00 - [OPIK-7126] [FE] feat: unify workspace menu with projects menu
Bring the workspace switcher in line with the projects menu (OPIK_7125):
scoped search, recency-ordered + pinnable sections, and a "View all" footer.- Search placeholder "Search" -> "Search workspace".
- Order workspaces by recency: new useRecentWorkspaces hook records visits
in localStorage (capped) and sorts recently-visited first, alphabetical
fallback for never-visited. - Cluster into "Pinned" + "Recently visited" (top 10) sections; flat
virtualized list while searching. Pinning via new usePinnedWorkspaces hook
(org-scoped localStorage), mirroring usePinnedProjects; pin order stays
stable (insertion order). - Footer "Manage workspaces" -> "View all workspaces" with an arrow-up-right
icon, matching the projects menu. - Org header always opens the organizations submenu (chevron), matching the
Figma; the per-org settings action lives inside that submenu.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- [OPIK-7126] [FE] fix: rename section header to "Recently updated"
Match the Figma instruction note and the projects menu section header
("Recently updated"). Only the user-facing label changes; the underlying
recency mechanism (client-side visit tracking) and its hook/variable names
are unchanged.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- [OPIK-7126] [FE] fix: restore "Recently visited" section header
Revert the previous rename: "Recently visited" is the correct label for the
workspace menu (it reflects the client-side visit-based ordering, and matches
the workspace-menu component in Figma).Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- [OPIK-7126] [FE] fix: restore single-org header in workspace menu
Keep the hasMultipleOrganizations branch: single-org users get the
inline org header with a directly-visible settings gear instead of a
submenu that discloses a one-item list and buries org settings a click
deeper. Multi-org users keep the organizations submenu.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
- [OPIK-7126] [FE] perf: memoize derived workspace collections
Wrap workspacesById, pinnedWorkspaces, and recentlyVisitedWorkspaces in
useMemo so the O(n) derivations don't re-run on every render (e.g. each
search keystroke), matching ProjectMenuContent's memoized projectsById.
sortedWorkspaces is already memoized upstream in useWorkspaceSelectorData,
so the dependencies are referentially stable.Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com
下载附件