Skip to content

refactor(同步): 简化远程书籍同步逻辑, 现在移动端和PC端可以自动同步书籍文件#194

Open
flyswxf wants to merge 13 commits intopacexy:mainfrom
flyswxf:main
Open

refactor(同步): 简化远程书籍同步逻辑, 现在移动端和PC端可以自动同步书籍文件#194
flyswxf wants to merge 13 commits intopacexy:mainfrom
flyswxf:main

Conversation

@flyswxf
Copy link

@flyswxf flyswxf commented Feb 11, 2026

  • 移除 usePrevious 钩子,直接依赖 remoteBooks 触发同步
  • 将 readyToSync 状态改为 syncVersion 计数器,避免条件竞争
  • 合并两个 useEffect,减少不必要的远程文件监听

- 移除 usePrevious 钩子,直接依赖 remoteBooks 触发同步
- 将 readyToSync 状态改为 syncVersion 计数器,避免条件竞争
- 合并两个 useEffect,减少不必要的远程文件监听
@vercel
Copy link

vercel bot commented Feb 11, 2026

@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)。这确保了用户交互期间视图的稳定性。
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

Comments