Skip to content

Preserve grid/table cell metadata when covering and let absolute jumps escape outer hiding - #383

Draft
OrangeX4 wants to merge 1 commit into
mainfrom
codex/fix-issues-369-and-373
Draft

Preserve grid/table cell metadata when covering and let absolute jumps escape outer hiding#383
OrangeX4 wants to merge 1 commit into
mainfrom
codex/fix-issues-369-and-373

Conversation

@OrangeX4

@OrangeX4 OrangeX4 commented Jun 10, 2026

Copy link
Copy Markdown
Member

Motivation

  • Preserve rowspan/colspan and other cell metadata when covering paused table.cell/grid.cell so layout is not lost.
  • Ensure content that can become visible earlier than its container (fn-wrappers or absolute jumps/#meanwhile) can escape outer hiding and manage its own visibility inside pause zones.

Description

  • Treat absolute jumps inside cell metadata and child metadata as escapes by setting has-fn-wrapper = true when an absolute jump is encountered.
  • Introduce cover-item to apply cover-fn only to a cell's body and reconstruct the original table.cell/grid.cell node so cell metadata is preserved.
  • Change covered computation to map cover-item over items when all items are cells, and otherwise call cover-fn(items.sum()).
  • Add a regression test file tests/issues/i369-i373-grid-regressions/test.typ covering the grid/cell covering and #meanwhile escape cases.

Testing

  • Added and ran the regression test tests/issues/i369-i373-grid-regressions/test.typ, and it passed.

@zral0kh

zral0kh commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

the test ref images for tytanic are not yet added

@zral0kh

zral0kh commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

and can you maybe ask codex for whether it has a good idea for a syntax/solution for #327 ?

still can't think of anything there

edit:
perhaps we could introduce a simple pause-cell function and we just throw an error when it is used outside of a cell.
and during parsing we of a table/grid we store whether such a pause or a normal pause was encountered and then either cover the cells or just the content

@OrangeX4

Copy link
Copy Markdown
Member Author

codex said:

For #327, I would lean toward not adding a global option that changes the meaning of normal #pause inside tables/grids. If we support this, a more explicit API like #pause-cells / #cell-pause might be clearer: normal #pause would keep the layout and cover later cells, while #pause-cells would remove later cells from the table/grid layout until they become visible. It should probably error outside direct table/grid children.

That said, I’m not fully convinced this is worth adding yet. It introduces another pause variant and more rules users need to understand, especially around auto-placement, rowspan/colspan, and nested content. The extra cognitive burden may outweigh the benefit unless we see more real-world demand for this behavior.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants