Skip to content

BL-16818 Tables 2/6: a table as a canvas element - #8326

Open
hatton wants to merge 2 commits into
BL-16818-table-corefrom
BL-16818-table-on-canvas
Open

BL-16818 Tables 2/6: a table as a canvas element#8326
hatton wants to merge 2 commits into
BL-16818-table-corefrom
BL-16818-table-on-canvas

Conversation

@hatton

@hatton hatton commented Sep 7, 2026

Copy link
Copy Markdown
Member

Second of six stacked PRs splitting #8315. Base is BL-16818-table-core (#8325); merge that first.

What to try

With the Tables experiment on, open the Canvas tool and drag the Table item onto a page. Drag a cell boundary and watch it resize the table rather than move the element; put a picture in a cell; check that each cell has its own format button and language name.

What is here

The canvas element machinery learning that a table is not a single text box. CanvasElementFactories builds one, the control registry and type inference recognise it, and duplication and clone cleanup handle its cells.

Pointer handling is the interesting part: a drag starting on a cell boundary has to resize the table rather than move the canvas element, so CanvasElementPointerInteractions lets the boundary win and CanvasElementSelectionUi keeps the right thing selected afterwards.

The CSS follows from the same fact. Each cell keeps its own format button and language name rather than the canvas element's context controls speaking for the whole table; a table keeps its corner resize handle, since its rows share out height the way its columns share out width; and a picture in a cell loses its crop handles, because the cell already decides its size.

Checks

pnpm typecheck, pnpm test (810 passed) and build/agent-vite.sh green on this branch.

[Claude Opus 5 following a prompt from Hatton]

Devin review


This change is Reviewable

Second of six PRs splitting BL-16818. The Canvas tool's palette gains a
Table item, so a table can be dropped onto a canvas page as well as filling
an origami section.

Most of this is the canvas element machinery learning that a table is not a
single text box. CanvasElementFactories builds one; the control registry and
type inference recognise it; duplication and clone cleanup handle its cells.

Pointer handling is the interesting part: a drag that starts on a cell
boundary has to resize the table rather than move the canvas element, so
CanvasElementPointerInteractions lets the boundary win and
CanvasElementSelectionUi keeps the right thing selected afterwards.

The CSS follows from the same fact. Each cell keeps its own format button
and language name, rather than the canvas element's context controls
speaking for the whole table; a table keeps its corner resize handle, since
its rows share out height the way its columns share out width; and a picture
in a cell loses its crop handles, because the cell already decides its size.
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.

1 participant