Skip to content

Replace expand-on-hover icon buttons with fixed-width buttons + tooltips#37

Open
do4k wants to merge 1 commit into
cassidoo:mainfrom
do4k:feature/ux-action-accessibility
Open

Replace expand-on-hover icon buttons with fixed-width buttons + tooltips#37
do4k wants to merge 1 commit into
cassidoo:mainfrom
do4k:feature/ux-action-accessibility

Conversation

@do4k
Copy link
Copy Markdown

@do4k do4k commented Mar 23, 2026

Summary

  • Replaces the expand-on-hover icon buttons with fixed-width (36px) icon-only buttons that show a tooltip below on hover
  • Eliminates the layout shift problem where hovering "About FancyGist" would push "File" and other buttons out of position
  • Adds proper aria-label attributes on all icon buttons for screen reader accessibility

Problem

The previous IconButton component animated its width via a Framer Motion spring to reveal a text label on hover. Because buttons are in a flex container with gap-2, expanding one button shifted all siblings to the right. Hovering "About FancyGist" (the widest label) displaced "File" entirely, making it impossible to click without the target moving.

Solution

  • New Tooltip component (src/components/Tooltip.tsx) -- a reusable tooltip that appears below the trigger after a 400ms delay, with Framer Motion fade animation and automatic horizontal nudging to stay within the viewport.
  • Refactored IconButton -- removed all width animation, label measurement, forceExpanded, and hover state logic. Now a static 36x36px circle button wrapped in <Tooltip>.
  • Refactored SplitDownloadButton -- same treatment; the split button (download icon + chevron) is now fixed-width with a tooltip.
  • Navbar cleanup -- removed the forceExpanded prop from the File menu trigger.

This follows standard toolbar UX conventions used by VS Code, Figma, Slack, and similar tools.

Kapture 2026-03-23 at 10 39 14

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 23, 2026

👷 Deploy request for fancygist pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c4cb1a1

The previous hover behavior animated button widths to reveal labels,
causing layout shift that pushed neighboring buttons out of position.
Buttons are now fixed 36px icons with tooltip labels shown below on
hover, following standard toolbar conventions (VS Code, Figma, etc.).

Co-authored-by: Claude <noreply@anthropic.com>
@do4k do4k force-pushed the feature/ux-action-accessibility branch from 77d9024 to c4cb1a1 Compare March 23, 2026 10:43
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