Repository navigation
fix(footnote): position the preview popup from the current footnote's height - #1495
Merged
Merged
Conversation
This was referenced Oct 3, 2026
Owner
Author
|
The red |
… height The footnote preview sits above its reference, so its offset depends on its own height. The WYSIWYG popup measured itself before resizing the textarea for the new footnote, so it reused the previous footnote's height: hovering one footnote and then another placed the second at the first one's offset until it was hovered again. - WYSIWYG: size the textarea before measuring; re-position on input. - Source mode: hovering straight to another footnote kept the old text at the old place, and the popup always positioned as if 100px tall. The source footnote popup now uses SourcePopupView's shouldReshow hook to re-show on a new footnote, and positions from its rendered height after the content is set. - Both modes re-anchor when the hover moves to another reference of the same footnote. Closes #1494
The guide listed only the WYSIWYG trigger. In Source mode the popup opens on hover or click over a footnote reference or definition. Updated in every locale.
xiaolai
force-pushed
the
fix/issue-1494-footnote-popup-position
branch
from
October 4, 2026 01:36
230dbb4 to
e8e1bf6
Compare
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
The footnote preview popup sits above its reference, so its position depends on its own height. The WYSIWYG popup measured itself before resizing its textarea for the footnote being shown, so it reused the previous footnote's height. Hovering footnote ① and then ② put ② at ①'s offset; hovering ② again was correct, because the leftover height was by then its own. That matches every step in #1494.
Source mode had a worse version of the same bug: the base view never re-showed a popup that was already open, so hovering straight from one footnote to another kept the old text at the old place. It also always positioned as if 100px tall.
Policy Gates (Required)
Linked Issue
Type of Change
What Changed
FootnotePopupView): size the textarea before measuring and positioning; re-position on input as the popup grows.SourceFootnotePopupView): overrideSourcePopupView.shouldReshow(now onmain) to re-show when the hovered footnote changes; position from the rendered height after the content is set; re-position on input.referencePos; onlyopenPopupwrites that field, so this cannot fire spuriously).website/guide/popups.md(all locales) now lists the Source-mode trigger for footnote popups.Known limit: in Source mode, moving from a footnote's definition to its reference doesn't re-anchor, because both carry the same
labelandreferencePos. Re-showing on every anchor change would instead reset unsaved edits when the same footnote is clicked again.Validation
pnpm check:alllocally.Two new
*.position.test.tsfiles (11 tests) were written first and seen failing, including the reporter's exact sequence and the Source-mode stale-text case. jsdom has no layout, so the tests simulate one in which the textarea'sscrollHeightfollows its text and the container's height follows the textarea.Not verified in the running app. Manual check: hover a long footnote, then move straight to a short one — the gap above the reference should stay constant, in both WYSIWYG and Source mode.
UI Evidence (if applicable)
None yet — see the manual check above.
PR Checklist