Skip to content

fix(vite): restore admin hover without Option key - #2312

Merged
johnyeocx merged 2 commits into
mainfrom
hotfix/admin-hover-without-option
Jul 20, 2026
Merged

fix(vite): restore admin hover without Option key#2312
johnyeocx merged 2 commits into
mainfrom
hotfix/admin-hover-without-option

Conversation

@johnyeocx

@johnyeocx johnyeocx commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • remove the global Option-key state and keyboard listeners from AdminHover
  • restore admin preview cards on normal hover
  • preserve the existing admin, hide, and skip-hover guards

Verification

  • bun -F @autumn/vite ts
  • bunx biome check vite/src/components/general/AdminHover.tsx
  • bunx react-doctor@latest --verbose --scope changed --base origin/main (89/100, no issues)

Summary by cubic

Restores admin preview cards to show on normal hover by removing the Option-key requirement and related global keyboard listeners. Keeps the existing admin, hide, and skip-hover guards intact.

Written for commit c12d330. Summary will update on new commits.

Review in cubic

Greptile Summary

This PR removes the Option/Alt-key requirement that was gating admin preview cards, restoring them to appear on normal hover. The change eliminates ~40 lines of global keyboard-listener infrastructure while preserving the isAdmin, hide, and skipHover guards.

  • [Bug fixes] Drops the useOptionKeyPressed store and all associated window event listeners (keydown, keyup, blur) so the module no longer accumulates global state
  • [Bug fixes] Simplifies the early-return guard from !isAdmin || hide || skipHover || !optionKeyPressed to !isAdmin || hide || skipHover, restoring hover-triggered preview cards for admin users

Confidence Score: 5/5

Safe to merge — the change is a focused removal of the Option-key guard with no regressions to the admin/hide/skipHover checks.

The diff is a pure deletion of ~40 lines of global keyboard-listener infrastructure. All three existing access guards remain intact and the component's rendering logic is otherwise unchanged.

No files require special attention.

Important Files Changed

Filename Overview
vite/src/components/general/AdminHover.tsx Removes Option-key gating and cleans up ~40 lines of global keyboard listener state; guards preserved correctly

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[AdminHover renders] --> B{isAdmin?}
    B -- No --> C[Return children only]
    B -- Yes --> D{hide?}
    D -- Yes --> C
    D -- No --> E{skipHover?}
    E -- Yes --> C
    E -- No --> F[Render PreviewCard with hover trigger]

    style F fill:#d4edda,stroke:#28a745
    style C fill:#f8d7da,stroke:#dc3545
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[AdminHover renders] --> B{isAdmin?}
    B -- No --> C[Return children only]
    B -- Yes --> D{hide?}
    D -- Yes --> C
    D -- No --> E{skipHover?}
    E -- Yes --> C
    E -- No --> F[Render PreviewCard with hover trigger]

    style F fill:#d4edda,stroke:#28a745
    style C fill:#f8d7da,stroke:#dc3545
Loading

Reviews (1): Last reviewed commit: "Merge branch 'main' into hotfix/admin-ho..." | Re-trigger Greptile

@johnyeocx
johnyeocx requested a review from ay-rod as a code owner July 20, 2026 16:47
@capy-ai

capy-ai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
checkout Ignored Ignored Jul 20, 2026 4:48pm
landing-page Ignored Ignored Jul 20, 2026 4:48pm

Request Review

@johnyeocx
johnyeocx merged commit 16862d0 into main Jul 20, 2026
10 checks passed
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