feat: move Workspaces and Worker Logs to sidebar bottom section#8
feat: move Workspaces and Worker Logs to sidebar bottom section#8
Conversation
trepechov
left a comment
There was a problem hiding this comment.
Overall the feature is well-structured — icon paths extracted to named constants, proper ARIA attributes on the dropdown, and click-outside/Escape handling are all good. One blocking issue needs to be fixed before merging.
Blocking
Rules of Hooks violation in apps/webapp/app/components/Sidebar.tsx.
The useEffect is called after the early return guard:
if (!userData?.user) return null;
const user = userData.user;
useEffect(() => { ... }, [isProfileMenuOpen]); // ❌ called conditionallyHooks must be called unconditionally, before any early returns. Move useEffect, useState, and useRef above isActive and the if (!userData?.user) guard. React will throw in development and may misbehave silently in production.
Minor
-
bottomQuickActionsinside the component — has no dependency on props, state, or context. Move to module scope alongsidenavItemsto avoid recreating the array on every render. -
Duplicated dropdown JSX — the Profile Settings link + Logout button block is copied verbatim for both expanded and collapsed sidebar states (~40 lines each). Extract into a shared variable or local component so future changes stay in one place.
-
Missing
aria-labelon collapsed avatar button —title={user.username}is not reliably announced by screen readers. Addaria-label={user.username}alongside it.
Move Workspaces (/workspaces) and Worker Logs (/worker-logs) into the sidebar bottom section and add a profile-card dropdown menu for Profile Settings and Logout. Trello: https://trello.com/c/tG93L5Yt/85-move-workspaces-and-worker-logs-in-to-bottom-section Made-with: Cursor
- Fix Rules of Hooks violation: move useEffect above early return guard - Move bottomQuickActions to module scope (no component deps) - Extract duplicate profile dropdown JSX into profileMenuItems variable - Add aria-label to collapsed avatar button for screen reader support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34552ad to
0650836
Compare
Summary
Details
The sidebar now has a clear three-zone layout:
The profile dropdown closes on outside click via a
mousedownlistener scoped to the menu ref.Trello: https://trello.com/c/tG93L5Yt/85-move-workspaces-and-worker-logs-in-to-bottom-section
Test plan
/profile-settings🤖 Generated with Claude Code