优化文档卡片间距与顶部操作栏并发布 1.2.8 - #20
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e21ae8875
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Let the spacer, sticky action bar, and document header participate | ||
| // directly in the scroller's flex layout. A sticky descendant would | ||
| // otherwise stop sticking at the bottom of this short wrapper. | ||
| display: "contents", |
There was a problem hiding this comment.
Preserve a measurable box for viewport anchoring
When a user scrolls past the new sticky toolbar and switches tabs, display: contents makes scrollHeaderRef.current.getBoundingClientRect() in captureViewportAnchor return an empty rectangle. The anchor is consequently sampled at scrollRect.top + 8, underneath the sticky toolbar rather than below it; posAtCoords can then return no document position, causing the fallback viewport.from anchor to restore the tab at the wrong vertical position or behind the toolbar. Query the sticky toolbar's rectangle for anchoring, or otherwise retain a measurable header box.
Useful? React with 👍 / 👎.
改动
验证