Skip to content

fix: order spanner footnotes by column when the spanner id differs from its label - #1103

Merged
rich-iannone merged 2 commits into
posit-dev:mainfrom
Enesuygurs:fix/spanner-footnote-order-by-id
Nov 6, 2026
Merged

rich-iannone merged 2 commits into
posit-dev:mainfrom
Enesuygurs:fix/spanner-footnote-order-by-id

Conversation

@Enesuygurs

Copy link
Copy Markdown
Contributor

Summary

Spanner footnotes didn't always follow the left-to-right reading order:

  • _get_spanner_leftmost_column_index() looked spanners up by spanner_label, but since fix: footnote targeting spanner with different id compared to label #844 spanner footnotes store the spanner id. When the id differed from the label, the lookup failed, every spanner was sorted as column 0, and the marks followed the order the footnotes were added in. The lookup now matches on spanner_id.
  • _process_footnotes_for_display() builds its own sort key for the footer and treated every spanner footnote as column 0. With symbol or letter marks, the footer could list b before a. It now uses the same spanner column as the mark numbering.

The tests add footnotes right to left on two spanners and check both the marks and the footer, with matching and different ids, for number and letter marks. A unit test also checks that _get_spanner_leftmost_column_index() finds a spanner by its id. The new tests fail without the change, and the existing footnote tests still pass.

Related GitHub Issues and PRs

Checklist

@rich-iannone rich-iannone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.70%. Comparing base (e840de6) to head (28baa70).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1103   +/-   ##
=======================================
  Coverage   98.70%   98.70%           
=======================================
  Files          63       63           
  Lines       12076    12078    +2     
=======================================
+ Hits        11920    11922    +2     
  Misses        156      156           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rich-iannone
rich-iannone merged commit 32e5174 into posit-dev:main Nov 6, 2026
16 checks passed
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.

Footnote marks on spanners don't follow column order when the spanner id differs from its label

2 participants