Skip to content

馃幆 fix: Center Collapsed Sidebar Icons and Unclip Sidebar Focus Rings - #122

Open
dustinhealy wants to merge 1 commit into
chore/click-ui-0.9.1from
fix/click-ui-sidebar
Open

馃幆 fix: Center Collapsed Sidebar Icons and Unclip Sidebar Focus Rings#122
dustinhealy wants to merge 1 commit into
chore/click-ui-0.9.1from
fix/click-ui-sidebar

Conversation

@dustinhealy

@dustinhealy dustinhealy commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Three sidebar polish issues, all pre-existing (introduced by the sidebar collapse refactor in #6, not by the click-ui 0.9.1 bump):

  1. In the collapsed rail, icons (logo, nav icons, avatar) sat left of center. The labels stay mounted for the slide animation, but the gap-2.5 between icon and label never collapsed and the truncated label spans kept a shrink-to-fit sliver of width, so justify-center had nothing to center. Collapsed rows now use gap-0 with justify-center, and every label span (logo title, nav labels, user-row name/email container) becomes w-0 flex-none overflow-hidden while collapsed so no residual width or flex-1 growth can absorb the free space. Measured result: icon centers moved from x=26.0 (logo x=20.0) to exactly x=27.5, the true center of the 55px inner rail.
  2. The user-profile button's focus ring was clipped instead of forming a full circle. The global focus convention draws a 1px ring at outline-offset: 2px outside the box, and the row wrapper's overflow-hidden cut it on all sides. The wrapper clip is removed; the labels already truncate and the aside still clips during the width transition.
  3. The collapse toggle at the bottom showed only the top edge of its focus ring: the button is flush with the aside's clipped left/right edges and the viewport bottom. A scoped .sidebar-toggle:focus-visible rule draws the ring inset (outline-offset: -2px), following the existing scoped-override convention in styles.css.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

New Sidebar.test.tsx (3 cases) asserts the collapsed-state classes (justify-center, gap-0, no overflow-hidden on the user row, sidebar-toggle on the toggle) and that the expanded state restores gap-2.5. Geometry itself is not assertable in jsdom; visual verification below.

Manually verified in the app: collapsed icons center in the rail, the avatar focus ring is a full circle, and tabbing to the collapse toggle shows a complete ring.

Before/after proof:

01_AI-1764_sidebar-icon-centering 02_AI-1765_profile-focus-ring 03_AI-1766_expander-focus-ring

Test Configuration:

  • bunx tsc --noEmit, bunx eslint src/ --max-warnings 0, bunx vitest run (802/802), bun run build: all green
  • Local dev server against local LibreChat backend

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

The collapsed sidebar kept its labels mounted with a gap-2.5 that never collapsed, so the 10px gap next to the zero-width truncated labels pushed the logo, nav icons, and avatar left of center and justify-* had no effect. Rows now drop to gap-0 with justify-center when collapsed, and the user row's flex-1 label container becomes w-0 flex-none so it cannot grow into the free space and offset the avatar.

The user row wrapper's overflow-hidden clipped the avatar button's focus ring, which the global convention draws at a 2px offset outside the box. The wrapper no longer clips; the name and email already truncate inside their min-w-0 container and the aside still clips during the width transition.

The collapse toggle is w-full and flush with the panel edges and the viewport bottom, so ancestor clipping leaves only the top segment of an outside ring visible. A scoped sidebar-toggle override draws the focus outline inset instead.
@dustinhealy dustinhealy changed the title 馃悰 fix: Center Collapsed Sidebar Icons and Unclip Sidebar Focus Rings 馃幆 fix: Center Collapsed Sidebar Icons and Unclip Sidebar Focus Rings Aug 11, 2026
@dustinhealy
dustinhealy marked this pull request as ready for review August 11, 2026 23:03
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