BL-16818 Tables 2/6: a table as a canvas element - #8326
Open
hatton wants to merge 2 commits into
Open
Conversation
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.
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.
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.
CanvasElementFactoriesbuilds 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
CanvasElementPointerInteractionslets the boundary win andCanvasElementSelectionUikeeps 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) andbuild/agent-vite.shgreen on this branch.[Claude Opus 5 following a prompt from Hatton]
Devin review
This change is