Skip to content

feat: move Workspaces and Worker Logs to sidebar bottom section#8

Open
trepechov wants to merge 2 commits intomainfrom
feature/trello-85-sidebar-bottom-section
Open

feat: move Workspaces and Worker Logs to sidebar bottom section#8
trepechov wants to merge 2 commits intomainfrom
feature/trello-85-sidebar-bottom-section

Conversation

@trepechov
Copy link
Copy Markdown
Collaborator

@trepechov trepechov commented Apr 9, 2026

Summary

  • Moves Workspaces and Worker Logs nav items from the main nav list into a dedicated bottom section of the sidebar
  • Adds a profile-card dropdown at the very bottom with avatar, user info, Profile Settings, and Logout actions
  • Refactors inline SVG path strings into named constants for readability

Details

The sidebar now has a clear three-zone layout:

  1. Top — collapse toggle + logo
  2. Middle — primary nav (Dashboard, Upload, Editor, Chat, Data Sources)
  3. Bottom — utility links (Workspaces, Worker Logs) + profile card with dropdown

The profile dropdown closes on outside click via a mousedown listener scoped to the menu ref.

Trello: https://trello.com/c/tG93L5Yt/85-move-workspaces-and-worker-logs-in-to-bottom-section

Screenshot 2026-04-09 at 15 05 10

Test plan

  • Workspaces and Worker Logs appear in the sidebar bottom section (above profile card)
  • Profile card shows avatar, name, and email
  • Profile dropdown opens on click and closes on outside click
  • Profile Settings navigates to /profile-settings
  • Logout signs the user out
  • Sidebar collapsed state hides labels but still shows icons for bottom items
  • Mobile drawer works correctly

🤖 Generated with Claude Code

Copy link
Copy Markdown
Collaborator Author

@trepechov trepechov left a comment

Choose a reason for hiding this comment

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

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 conditionally

Hooks 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

  • bottomQuickActions inside the component — has no dependency on props, state, or context. Move to module scope alongside navItems to 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-label on collapsed avatar buttontitle={user.username} is not reliably announced by screen readers. Add aria-label={user.username} alongside it.

trepechov and others added 2 commits April 9, 2026 14:57
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>
@trepechov trepechov force-pushed the feature/trello-85-sidebar-bottom-section branch from 34552ad to 0650836 Compare April 9, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant