Skip to content

🐛 Fixed hover-reveal View more buttons staying hidden on keyboard focus#28929

Open
dimitristrechas wants to merge 1 commit into
TryGhost:mainfrom
dimitristrechas:dimitristrechas/focus-visible-view-more-btns
Open

🐛 Fixed hover-reveal View more buttons staying hidden on keyboard focus#28929
dimitristrechas wants to merge 1 commit into
TryGhost:mainfrom
dimitristrechas:dimitristrechas/focus-visible-view-more-btns

Conversation

@dimitristrechas

Copy link
Copy Markdown

The bug

In Ghost Admin analytics, several View more buttons use a hover-reveal pattern: they are hidden by default (opacity-0 + horizontal offset) and only become visible when the parent card is hovered.

Keyboard users can still tab to these buttons, but they remained invisible while focused. That made it unclear which control was active and effectively blocked keyboard-only navigation to those actions.

Affected surfaces include Post Analytics overview cards (Web, Newsletter, Growth), KPI tile View more buttons on analytics detail pages, and site Stats overview KPI cards.

The fix

Added focus-visible:translate-x-0 focus-visible:opacity-100 to each hover-reveal View more button so keyboard focus applies the same visible state as card hover.

Used focus-visible rather than focus so mouse clicks do not leave the button permanently visible after activation, matching existing Shade button focus behaviour.

Screen.Recording.2026-06-26.at.10.30.44.AM.mov

Existing E2E coverage for Post Analytics overview View more clicks should continue to pass unchanged.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c8b95803-030d-4c03-a627-0ea1071184d4

📥 Commits

Reviewing files that changed from the base of the PR and between 08ea1cd and e7ad648.

📒 Files selected for processing (6)
  • apps/posts/src/views/PostAnalytics/Overview/components/newsletter-overview.tsx
  • apps/posts/src/views/PostAnalytics/Overview/components/web-overview.tsx
  • apps/posts/src/views/PostAnalytics/Overview/overview.tsx
  • apps/posts/src/views/PostAnalytics/components/kpi-card.tsx
  • apps/shade/src/components/patterns/kpi-card.stories.tsx
  • apps/stats/src/views/Stats/Overview/components/overview-kpis.tsx
✅ Files skipped from review due to trivial changes (5)
  • apps/posts/src/views/PostAnalytics/Overview/components/newsletter-overview.tsx
  • apps/posts/src/views/PostAnalytics/Overview/overview.tsx
  • apps/posts/src/views/PostAnalytics/Overview/components/web-overview.tsx
  • apps/posts/src/views/PostAnalytics/components/kpi-card.tsx
  • apps/stats/src/views/Stats/Overview/components/overview-kpis.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/shade/src/components/patterns/kpi-card.stories.tsx

Walkthrough

Updated View more button styling across post analytics overview, stats overview, and a kpi card story to add focus-visible translation and opacity states alongside hover behavior. Two related JSX lines in the post analytics web overview and KPI card components were reformatted, with click targets and navigation behavior unchanged.

Suggested reviewers

  • 9larsons
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: hover-reveal View more buttons now show on keyboard focus.
Description check ✅ Passed The description matches the implemented accessibility fix and affected analytics surfaces.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@9larsons 9larsons left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @dimitristrechas, valid change here but I'm not able to reproduce the expected behavior. Could you please take a look to verify this and if you're getting it, would you mind appending a quick vid of that, too?

@dimitristrechas

Copy link
Copy Markdown
Author

Hey @9larsons, in the PR's description I have attached a video of the fix.

Notice that the focus moves from "Last 30 days" to "0%" and finally when it lands in the "View more" button it also reveals it, which is the fix. I am attaching before/after vids, hopefully it makes it clearer.

Before fix

Screen.Recording.2026-06-26.at.8.55.53.PM.mov

After fix

Screen.Recording.2026-06-26.at.10.30.44.AM.mov

@dimitristrechas

Copy link
Copy Markdown
Author

Storybook

KPI Card -> With Hover Button

Screen.Recording.2026-06-27.at.10.36.42.AM.mov

Hover-reveal analytics buttons were only visible on card hover, so keyboard users could tab to a focused but invisible control. Added focus-visible styles so the reveal state matches hover when navigating with the keyboard.
@dimitristrechas dimitristrechas force-pushed the dimitristrechas/focus-visible-view-more-btns branch from 188c499 to e7ad648 Compare June 27, 2026 07:44
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