Repository navigation
feat(composer): edit Markdown tables as a grid - #3575
Draft
ericm-square wants to merge 2 commits into
Draft
ericm-square wants to merge 2 commits into
ericm-square wants to merge 2 commits into
Conversation
Tables in the message composer are now an editable grid instead of raw pipe text. A GFM table that is typed, pasted as Markdown, pasted as spreadsheet cells, or inserted with insertText becomes a header row plus body rows with inline-editable cells. Column alignment is kept, and sending writes the same GFM Markdown back, with pipes escaped. Tab and Shift+Tab move between cells and Tab in the last cell adds a row. Arrow keys move across cell edges and leave the table above or below. Backspace in an empty table removes it. Enter keeps sending, and Shift+Enter moves down a row, as it adds a line elsewhere. While the caret is in a table, a toolbar adds rows and columns above, below, left and right, and deletes the row, column or table. Alt+F10 moves focus to it. A Table control in the formatting tools starts a 3 by 2 grid. Wide and long tables scroll inside the composer. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Eric Morgan <ericm@squareup.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Eric Morgan <ericm@squareup.com>
This branch has not been deployed
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.
Summary
Tables in the message composer become an editable grid instead of raw pipe text. Today a Markdown table stays as
| a | b |text while you write, which is hard to edit once it's more than a few cells.A GFM table becomes a grid when you type it, paste it as Markdown, paste cells from a spreadsheet, or a plugin inserts it with
insertText. The grid has a header row and body rows, and every cell is inline-editable with the composer's usual marks and chips. Sending writes the same GFM Markdown back, with|escaped and column alignment kept, so messages render exactly as they do now. Restored drafts keep the table.Linear: https://linear.app/squareup/issue/AXON-829/buzz-composer-edit-markdown-tables-as-a-grid
Draft to track iterations. It isn't ready for review yet.
Changes
composer-table.ts(new): table parsing, serializing and commands (add and delete rows and columns, delete table, cell navigation).composer-document.ts,composer-markdown.ts,composer-blocks.ts: a table node in the schema, Markdown parse and serialize, and block conversion.composer-clipboard.ts,composer-dom.ts,selection-copy.ts: spreadsheet (TSV) and Markdown table paste, and copying a timeline table into the composer. Raw paste (Mod+Shift+V) still pastes plain text.EditableInput.tsx,EditableInput.module.css: the grid, keyboard handling, the active cell tint and in-table scrolling with a sticky header.ComposerTableTools.tsx(new),MessageComposer.tsx: the table toolbar.ComposerFormattingTools.tsx: a Table control (Mod+Alt+T) that starts a 3 by 2 grid.icons/index.ts: 7 Tabler icons for the toolbar.docs/buzz-help.md: a short note on tables.Keyboard
Open questions
insertText?a\|b) can't round-trip exactly.Test plan
pnpm checkandpnpm lintpass.vitest run src: 21,494 passed.composer-table.test.ts(43): parse, serialize, round trip, escaping, alignment, ragged rows, spreadsheet paste and every command.EditableInput.test.tsx"editable tables" (15): the keyboard flows, paste, andinsertTextinto a cell.MessageComposer.test.tsx"table editing controls" (2): the toolbar.tests/browser/composer-tables.spec.mjs: native typing, Tab and arrows, scrolling and the toolbar. With the existingcomposer-*andmention*specs, 150 passed and 2 skipped on Chromium and WebKit.EditableInput.test.tsxand one intests/browser/composer-paste.spec.mjs, because pasting spreadsheet cells now gives a grid instead of tab-separated text.Manual test steps
just desktopfrom this branch and sign in.🤖 Generated with Claude Code