fix(vite): restore admin hover without Option key - #2312
Merged
Conversation
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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
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.
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, andskipHoverguards.useOptionKeyPressedstore and all associatedwindowevent listeners (keydown,keyup,blur) so the module no longer accumulates global state!isAdmin || hide || skipHover || !optionKeyPressedto!isAdmin || hide || skipHover, restoring hover-triggered preview cards for admin usersConfidence 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
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%%{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:#dc3545Reviews (1): Last reviewed commit: "Merge branch 'main' into hotfix/admin-ho..." | Re-trigger Greptile