Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[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>
  • Loading branch information
awkoy and claude committed Jul 15, 2026
commit de2d552e2704c1a6ef402fffa4fbb0d3aabc1554
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const WorkspaceMenuContent: React.FC<WorkspaceMenuContentProps> = ({
const isSearching = search.trim().length > 0;

// When searching, show all matches flat (virtualized above the threshold).
// Otherwise cluster into Pinned + Recently visited (capped) sections.
// Otherwise cluster into Pinned + Recently updated (capped) sections.
const workspacesById = new Map(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 suggestion | Performance

Derived workspace collections are rebuilt on every render, including during search when they're discarded unused.

workspacesById (a new Map scanning all workspaces), pinnedWorkspaces (map+filter), and recentlyVisitedWorkspaces (filter+slice) are computed unconditionally in the component body. The menu re-renders on every search keystroke, so these O(n) derivations re-run each time — and they're only consumed in the non-search branch, so during search they're computed and thrown away.

The sibling ProjectMenuContent.tsx memoizes the analogous projectsById with useMemo. Consider wrapping these in useMemo.

🤖 Review posted via /review-github-pr

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in c05ff5d — wrapped workspacesById, pinnedWorkspaces, and recentlyVisitedWorkspaces in useMemo, matching ProjectMenuContent's memoized projectsById. Deps are referentially stable: sortedWorkspaces is already memoized in useWorkspaceSelectorData, and isPinned/pinnedConfig come from useCallback/useLocalStorageState. Lint, typecheck, and the 11 hook tests (Node 20) are green.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit c05ff5d addressed this comment by memoizing workspacesById, pinnedWorkspaces, and recentlyVisitedWorkspaces with useMemo. This prevents those O(n) derivations from being rebuilt on every render, including search re-renders where they would otherwise be discarded.

sortedWorkspaces.map((workspace) => [workspace.workspaceId, workspace]),
);
Expand Down Expand Up @@ -310,7 +310,7 @@ const WorkspaceMenuContent: React.FC<WorkspaceMenuContentProps> = ({
{pinnedWorkspaces.length > 0 && (
<DropdownMenuSeparator className="my-1" />
)}
Comment on lines +341 to +352

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate section layout

The pinned/recent section markup in the new workspace menu duplicates ProjectMenuContent.tsx, so the two views can drift on labels, spacing, and empty-state behavior and any tweak has to be made twice — should we extract the shared section rendering into a common helper/component?

Severity

Want Baz to fix this for you? Activate Fixer

<MenuSectionLabel>Recently visited</MenuSectionLabel>
<MenuSectionLabel>Recently updated</MenuSectionLabel>
{recentlyVisitedWorkspaces.map(renderWorkspaceItem)}
</>
)}
Expand Down
Loading