Skip to content

fix(web): sidebar a11y P1 + compact/expanded toggle polish#1

Open
PrEvIeS wants to merge 5 commits intomainfrom
fix/sidebar-a11y-p1
Open

fix(web): sidebar a11y P1 + compact/expanded toggle polish#1
PrEvIeS wants to merge 5 commits intomainfrom
fix/sidebar-a11y-p1

Conversation

@PrEvIeS
Copy link
Copy Markdown
Owner

@PrEvIeS PrEvIeS commented Apr 27, 2026

Summary

P1 batch of sidebar/UX fixes on the dashboard shell. All five commits work together; the last one is the polish pass after the bigger changes landed.

  • a11y: 44×44 touch targets, aria-current, aria-expanded, focus-visible outlines, screen-reader brand label, focus management on logout (da210c9, 0d02716).
  • Compact ↔ expanded sidebar: 64px icon rail (default) toggling to 224px label rail, persisted via localStorage (panvex.sidebarExpanded); chevron toggle on the brand header (7878fde).
  • Horizontal-scroll fix: active-bar marker offset is now half of (rail − button) so it stops poking past the aside edge in compact mode (7878fde).
  • Footer buttons: Log out and theme toggle now share Sidebar's button geometry in both modes — full-width with label when expanded, 44×44 icon when compact (43f5b4c, fa08db2).
  • Tooltip contrast: compact-rail tooltips switched from bg-bg-card-hi (which blended with --panvex-bg in dark mode) to inverted tonal pair bg-fg / text-bg (fa08db2).
  • BottomNav: ≤5 primary items, optional "More" sheet for overflow on mobile (0d02716).

Test plan

  • npx tsc --noEmit clean
  • npm run lint clean
  • Live walk-through on https://panvex.azzazelvpn.ru/ in headed agent-browser
  • Compact ↔ expanded toggle persists across reload (localStorage)
  • No horizontal scroll on dashboard with sidebar visible
  • Tooltips legible in dark mode against --panvex-bg
  • Mobile (<md) hides sidebar, BottomNav active state and More sheet work
  • Logout flow shows confirm dialog + focus management

🤖 Generated with Claude Code

d.shuvalov and others added 5 commits April 27, 2026 16:42
Closes panvex-17w, panvex-asb, panvex-atn:
- bump rail to w-16 + buttons to h-11 w-11 so the sidebar, theme toggle,
  and logout meet the 44pt/48dp touch-target minimum.
- add aria-label and aria-current="page" to icon-only nav buttons; reveal
  the visual tooltip on group-focus-within so keyboard users see labels.
- distinguish the active item with a 2px accent left bar so the cue is
  not color-only (WCAG 1.4.1).
- name the <aside> + <nav> landmarks as "Primary"; expose the full brand
  name to AT (visible glyph stays the initial).

Also adds focus-visible outlines to the sidebar buttons + theme toggle.
- BottomNav: aria-label="Primary", aria-current/aria-label per tab,
  active:scale-[0.97] press feedback, focus-visible outline.
- BottomNav: cap mobile tabs at 5 (Dashboard, Servers, Fleet groups,
  Clients) with overflow (Activity, Settings, Profile) behind a "More"
  bottom sheet. Sidebar still renders the full list on desktop.
- Logout: gate handleLogout behind ConfirmProvider's useConfirm to
  prevent accidental cache wipes from a 44px target adjacent to the
  theme toggle.
- Sidebar: center the footer (theme toggle) and hide the rail's
  scrollbar via [scrollbar-width:none] [&::-webkit-scrollbar]:hidden.

Closes panvex-6kg, panvex-b62, panvex-9ph.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ThemeToggleButton now uses Lucide Sun/Moon icons (w-5 h-5) and
text-lg to match the nav buttons and the LogOut button. The two
sidebar-footer wrappers (theme + logout) now share the same shell:
py-3 border-t border-border w-full flex justify-center, so both
buttons sit on the same horizontal axis as the nav items above.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Sidebar grows to w-56 (224px) when expanded with item labels next to
  icons, or stays at w-16 as the icon rail. Brand area shows a chevron
  toggle that flips between Collapse / Expand. Tooltips render only in
  compact mode.
- AppShell persists the preference in localStorage under
  panvex.sidebarExpanded and animates main content margin (md:ml-16
  ↔ md:ml-56) with a 200ms width transition. Mobile (<md) is unaffected
  since the sidebar is hidden there and BottomNav drives navigation.
- Fix horizontal scroll: the active-item indicator used before:-left-3
  (-12px) which sat 2px outside the 64px rail and made the body scroll.
  Replaced with -left-[10px] so the bar lands flush with the rail edge,
  and added overflow-x-hidden on the AppShell wrapper as a belt.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…oltip

- ThemeToggleButton accepts `expanded` and matches Log out layout in
  full sidebar mode (gap-3 h-11 px-3) instead of an icon-only square.
- AppShell threads sidebar `expanded` to the footer slot via render-prop
  so the theme toggle stays in sync with the rest of the rail.
- Sidebar tooltips switch to inverted tonal pair (bg-fg / text-bg) so the
  compact rail's tooltip stays legible against the page background in
  dark mode (the prior bg-bg-card-hi blended with --panvex-bg).
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