-
Notifications
You must be signed in to change notification settings - Fork 6
feat(footer): 新增友情链接 #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: 通过 hover + click 共同控制
showFriendLinks会导致桌面端状态不一致,并在纯触摸设备上几乎无法使用。当前可见性既受 hover(
onMouseEnter/onMouseLeave)的控制,又受点击切换showFriendLinks的控制。在桌面端,这会导致在悬停时点击,面板可能立刻关闭;而在纯触摸设备上不会触发 hover,因此打开/关闭行为会变得不一致且更难使用。建议在每个断点下采用单一且一致的交互模式(例如:指针设备使用 hover,触摸设备仅使用点击),或者以 hover 作为基础,再为触摸设备提供点击兜底逻辑,并结合外部点击/失焦关闭的方式。建议的实现方式:
showFriendLinks只由点击(或另一种单一的交互模式)控制,并移除文件中其他位置基于 hover 的状态更新。group-hover来控制可见性;showFriendLinks作为触摸端的“仅点击”兜底逻辑,并通过指针能力检测(例如在useEffect或事件处理函数中使用window.matchMedia('(hover: none)'))来控制是否启用。useEffect和document.addEventListener('mousedown', ...)),在点击外部时关闭面板,并以showFriendLinks作为单一可信的状态来源。Original comment in English
suggestion: Hover + click interaction for
showFriendLinkscan lead to inconsistent state on desktop and unusable behavior on pure touch devices.Visibility is being driven both by hover (
onMouseEnter/onMouseLeave) and by click togglingshowFriendLinks. On desktop this can cause the panel to immediately close when clicking while hovered, and on touch-only devices hover never fires so the open/close behavior is inconsistent and harder to use. Consider using a single, consistent pattern per breakpoint (e.g., hover for pointer devices, click-only for touch) or deriving visibility from hover with a click fallback for touch, possibly combined with outside-click/blur to close.Suggested implementation:
showFriendLinksis only controlled via click (or another single interaction pattern) inside this container, and remove any other hover-driven state updates elsewhere in the file.group-hoverto control visibility for pointer/desktop.showFriendLinksas a click-only fallback for touch, and gate usage with a pointer-capability check (e.g.,window.matchMedia('(hover: none)')) in auseEffector handler.useEffectanddocument.addEventListener('mousedown', ...)) to close the panel when clicking away, usingshowFriendLinksas the single source of truth.