refactor(同步): 简化远程书籍同步逻辑, 现在移动端和PC端可以自动同步书籍文件#194
Open
flyswxf wants to merge 13 commits intopacexy:mainfrom
Open
refactor(同步): 简化远程书籍同步逻辑, 现在移动端和PC端可以自动同步书籍文件#194flyswxf wants to merge 13 commits intopacexy:mainfrom
flyswxf wants to merge 13 commits intopacexy:mainfrom
Conversation
flyswxf
commented
Feb 11, 2026
- 移除 usePrevious 钩子,直接依赖 remoteBooks 触发同步
- 将 readyToSync 状态改为 syncVersion 计数器,避免条件竞争
- 合并两个 useEffect,减少不必要的远程文件监听
- 移除 usePrevious 钩子,直接依赖 remoteBooks 触发同步 - 将 readyToSync 状态改为 syncVersion 计数器,避免条件竞争 - 合并两个 useEffect,减少不必要的远程文件监听
|
@flyswxf is attempting to deploy a commit to the pacexy Team on Vercel. A member of the Team first needs to authorize it. |
修复了在 iOS 上禁用捏合缩放时过度阻止 touch 事件的问题。之前会阻止所有 touchmove 事件,导致页面无法正常滚动。现在仅当检测到缩放操作(event.scale !== 1)时才阻止默认行为,从而允许正常的滚动交互。
在文本选择菜单的复制按钮上添加 onMouseDown 事件处理,调用 e.stopPropagation() 以防止鼠标事件冒泡到父元素,避免可能的意外交互。
在移动端阅读时,iframe 的滚动会导致页面错位。通过监听滚动事件并强制重置滚动位置来确保阅读器界面稳定。
添加对 selectionchange 事件的监听,以处理文本选择导致的滚动问题。同时引入容差机制处理亚像素滚动差异,确保页面在移动设备上能正确对齐到整页宽度。
移除BookPane组件中移动端滚动对齐的冗余逻辑,该功能已由其他机制处理。 同时在全局样式中为html和body元素添加overflow: hidden以防止不必要的滚动条出现。
在移动端设备上,当用户在iframe内进行选择文本等交互操作时,浏览器会自动滚动以保持选择区域可见,这会干扰阅读体验。通过监听touchstart/mousedown事件来锁定当前滚动位置,并在scroll和selectionchange事件中强制保持该位置,直到交互结束(mouseup/touchend)。这确保了用户交互期间视图的稳定性。
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.