Skip to content

apps/ui: align sidebar with new design mock#3137

Merged
youknowriad merged 3 commits intotrunkfrom
claude/interesting-brattain-c239fa
Apr 19, 2026
Merged

apps/ui: align sidebar with new design mock#3137
youknowriad merged 3 commits intotrunkfrom
claude/interesting-brattain-c239fa

Conversation

@youknowriad
Copy link
Copy Markdown
Contributor

Related issues

  • Related to the apps/ui sidebar design pass.

How AI was used in this PR

Built interactively via Claude Code against a supplied design mock, iterating on spacing, colors, indent, active-state styling, and component extraction until the sidebar matched the target. Verified with npm run typecheck and vite build; the user confirmed visual correctness screenshot-by-screenshot in Electron. Two bugs I would have missed without the user: the opacity trick on the user-menu row was fading the Gravatar image, and the session sessionTime was getting its opacity bumped on hover/active (user wanted it always dim).

Proposed Changes

  • Sidebar navigation — new SidebarNav with Chat / Settings / Skills. Chat links to /dashboard; the two others are placeholders until routes exist.
  • Project list — derived expansion state (MRU or active-session's project is open by default, user toggles override). Project header now shows a dimmed domain under the site name; only the active project's / + row actions stay visible. Session rows get a relative-time column and a thin left bar on the active row.
  • User menu — generic user icon replaced by a real <Gravatar> resolved from sha256(email.toLowerCase()) with the Studio profile icons as fallback. Dimming is now color-based (fg-content-neutral-weak on text/icon only), so the Gravatar image isn't faded.
  • Layout — sidebar 260 → 320 px, horizontal gutter doubled (mdxl), right border added, extra breathing room between nav and project list.
  • Cleanup / extractions — added clsx as a direct dep and switched class concatenations to it; extracted components/gravatar, lib/format-relative-time.ts, and lib/icons.tsx (also removes a duplicated drawerIcon literal between sidebar-header and sidebar-layout).

Testing Instructions

  • Start the Electron app (npm run start:new) while signed in to Wordpress.com. Confirm:
    • Top-left shows Studio + + + collapse toggle, aligned past the macOS traffic lights.
    • Chat nav is active when on /dashboard or a session route; Settings and Skills render as dim inert rows.
    • The most-recently-used project (or the one containing the active session) is expanded on launch. Clicking another project's title toggles it open/closed; clicking the domain line does not toggle (it is outside the button).
    • Active session row shows a 1px left bar aligned with the project title's left edge, darker label, no background fill.
    • Bottom-left shows a Gravatar for your wpcom email + display name + theme toggle; hovering the row brightens the text/icon but not the avatar.
  • Collapse / re-open the sidebar using the drawer icon — the floating toggle in the main area should keep its position in both normal and macOS-fullscreen modes.
  • Switch between light and dark color schemes from the theme menu — Gravatar fallback image should swap (light uses profile-icon.png, dark uses profile-icon-black.png).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors? (npm run typecheck clean; vite build clean.)
  • Cross-platform manual QA (macOS verified by author; please spot-check Windows traffic-light padding / fullscreen).

🤖 Generated with Claude Code

Flesh out the apps/ui sidebar to match the new design:

- Add a Chat / Settings / Skills nav list between header and projects
- Project sections show a dimmed domain subtitle under the name
- Session rows include a relative timestamp and a thin left-bar on the
  active session; only the MRU (or active-session's) project is expanded
  by default, and users can toggle the rest
- User menu swaps the generic user icon for a real Gravatar resolved
  from the account email, falling back to the Studio profile icons
- Widen the sidebar, double the gutter, and add a right border to
  separate it from the main area

Also extract shared bits: clsx for className joins, lib/icons.tsx for
inline SVG icons (removes a duplicate drawer icon), lib/format-relative-time
for the timestamp formatter, and a standalone Gravatar component.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented Apr 19, 2026

📊 Performance Test Results

Comparing eaa3549 vs trunk

app-size

Metric trunk eaa3549 Diff Change
App Size (Mac) 1439.59 MB 1439.59 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk eaa3549 Diff Change
load 1885 ms 1878 ms 7 ms ⚪ 0.0%

site-startup

Metric trunk eaa3549 Diff Change
siteCreation 8112 ms 8126 ms +14 ms ⚪ 0.0%
siteStartup 4927 ms 4956 ms +29 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

youknowriad and others added 2 commits April 19, 2026 09:51
…arButton

Route the three sidebar row shapes (nav items, project title, session
link) through @wordpress/ui's Button primitive — nav/session use
render={<Link/>} so routing still owns active state, project title stays
a plain onClick button. Factors the shared "neutralize the DS preset"
CSS (no center-align, no min-width, no border, no hover fill) into a
thin SidebarButton wrapper so consumers only supply their own
dimensions and active state.

Along the way:
- index.css focus-visible + icon-scale overrides now cover <a> too,
  for Button rendered as Link.
- Session active left-bar moved from ::before to ::after to avoid
  colliding with Button's loading-spinner ::before.
- Nav active state drops the grey fill to match the session pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Route the user-menu trigger and the logged-out "Log in" fallback
  through SidebarButton, matching the rest of the sidebar. Removes the
  per-site variant/tone/size preset props and the now-redundant
  justify-content / min-width / gap overrides in user-menu.module.css.
- Wrap SidebarButton in forwardRef so Base UI's Menu.Trigger can
  attach its internal ref to the underlying button element (without
  this the username span wasn't toggling the menu on click).
- Move the hover/active/focus background reset onto SidebarButton's
  base .root rule. Unlayered CSS beats @wordpress/ui's layered
  :is(:hover, :active, :focus) rule at any state, so we no longer
  need per-state selectors and the lingering grey-fill after a mouse
  click is gone.
- Audit sweep on the rest of the CSS: drop rules that duplicated
  Button defaults (.projectToggle padding / font-weight,
  .sessionLink position: relative) and the redundant
  .sessionLinkActive:hover / .itemActive:hover grouping.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@youknowriad youknowriad merged commit 160b8cf into trunk Apr 19, 2026
8 of 10 checks passed
@youknowriad youknowriad deleted the claude/interesting-brattain-c239fa branch April 19, 2026 08:22
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.

2 participants