Skip to content

refactor(footnotes): render ordinals via decorations, not node attributes - #9580

Merged
mejo- merged 1 commit into
mainfrom
fix/footnote_ordinals_decorations
Nov 18, 2026
Merged

mejo- merged 1 commit into
mainfrom
fix/footnote_ordinals_decorations

Conversation

@mejo-

@mejo- mejo- commented Nov 9, 2026

Copy link
Copy Markdown
Member

Footnote numbers were stored as ordinal attributes on footnote and footnoteReference nodes and rewritten in appendTransaction on every document change. Being derived view state, they still ended up in the Yjs document and were synced between all clients.

Compute the numbers in plugin state instead and hand them to the view as node decorations that set a --footnote-ordinal CSS variable, rendered via a CSS counter. Plain CSS counters are not enough on their own: repeated references to the same footnote must share a number, and the footnotes section is not necessarily in reference order.

Assisted-by: ClaudeCode:claude-opus-5-5

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@mejo- mejo- self-assigned this Nov 9, 2026
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity team Nov 9, 2026
@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Nov 9, 2026
@mejo- mejo- moved this from 🧭 Planning evaluation (don't pick) to 👀 In review in 📝 Productivity team Nov 9, 2026
…utes

Footnote numbers were stored as `ordinal` attributes on footnote and
footnoteReference nodes and rewritten in appendTransaction on every
document change. Being derived view state, they still ended up in the
Yjs document and were synced between all clients.

Compute the numbers in plugin state instead and hand them to the view
as node decorations that set a `--footnote-ordinal` CSS variable,
rendered via a CSS counter. Plain CSS counters are not enough on their
own: repeated references to the same footnote must share a number, and
the footnotes section is not necessarily in reference order.

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5-5
@mejo-
mejo- force-pushed the fix/footnote_ordinals_decorations branch from dd39b97 to 936f950 Compare November 18, 2026 10:08
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mejo-
mejo- merged commit f315413 into main Nov 18, 2026
64 of 66 checks passed
@mejo-
mejo- deleted the fix/footnote_ordinals_decorations branch November 18, 2026 11:19
@mejo-

mejo- commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

/backport to stable35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted This PR contains AI-assisted commits technical debt

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

3 participants