mirror of
https://github.com/aphrody-labs/wordcraft.git
synced 2026-10-13 19:26:53 +00:00
* Tables: select, insert and move with the mouse; double-click a border to AutoFit Like Word, on top of the border resizing: - Selection areas: just above a column the pointer becomes a down arrow, left of a row the row arrow, along a cell's left edge (inside it) the cell arrow. A click selects the column, row or cell; a drag selects every one up to the pointer. Selected cells are shaded as cells, empty ones too. - Insert buttons: left of a row border and above a column border a "+" shows with the border marked; a click adds a row or column there and puts the caret in it. - Move handle past the table's top-left corner: a click selects the table; a drag shows a dashed outline and, on release, the table floats where it is dropped with the text wrapping around it (Word's behaviour). One undo step. Nested tables and tables outside the main text are only selected. - A double-click on a column border fits the column left of it to its contents (the right neighbour gives or takes the room; on the right edge the table's width changes, up to the right margin). - Table Layout > Select > Select Column (catalog 418/449). Whole-cell selection: a column (or a rectangle of cells over several rows) is not one run of the text, so selecting it makes a block of its cells' paragraphs (`CellRange` on the existing `ColumnBlock`). Bold, alignment, Delete, typing, copy and numbering act on those cells only (a numbered column is one list); table commands (shading, merge, delete columns) take the rectangle; Tab moves on without clearing it; Undo brings the selection back. Cells of one row, or whole rows, stay an ordinary stream selection. The format painter no longer clears a block's text (edit.pasteFormat was handled like a paste). The mini toolbar stays hidden over whole-cell selections and during these drags: pinned above the selection it covered the column areas, the "+" buttons and the move handle. Engine: crates/engine/src/cmd/table_mouse.rs - table.selectAt, table.insertAt, table.moveDrag, table.fitColumn (page coordinates, so agents and the control channel can do the same) and table.selectColumn; hit testing reuses table_resize's drawn geometry, and borders keep priority for resizing. 10 engine tests (areas, a column edited cell by cell, numbering, rows/cells/drags, insert buttons, move, fit, format painter, hostile params). UI: crates/ui-egui/src/table_mouse.rs, wired into the existing canvas mouse handler (no extra ui.interact areas, so clicks in a cell's text still place the caret); kittest tests with real pointer events: column click, row drag, "+" button, move-handle drag in one undo step, double-click fit. New labels translated in all eleven catalogs. Progress docs updated: gaps, ui-parity, target-app-parity, ROADMAP, parity checklist. `cargo xtask ci` passes (fmt, clippy, test, assets, layers, wasm). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tables: a selected column's word count is its cells'; merged cells shade once With whole cells selected (a column, or a rectangle that isn't one run of the text) the status bar said "12 of 23 words": `Session::selected_text` took everything between the selection's ends. It now takes each piece's own text, a line each, for a column block too, so the status bar, Word Count and the other callers see what is selected. Since #669 a vertically merged cell is one box as tall as its rows, with a `covered` box for each continuation row; shading selected cells skips those, so a merged cell isn't shaded twice. `selected_paths` follows main's `para_paths_in` (#418): a selection ending at the start of the next paragraph doesn't take it. - Test: a selected column's text is its three cells' and Word Count says three words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tables: double-click AutoFit and the "+" buttons work as in Word Checked against Word (2019, Windows): - A double-click on a column border fits the column left of it to its contents and the columns right of it keep their widths, moving with the border, so the table narrows or widens (up to the right margin). The right neighbour used to give or take the difference. - A "+" insert button selects the new row or column (the caret used to go into it); typing then goes into its first cell. If the table can't take another row or column, nothing changes. - A double-click along a cell's left edge (the cell selection area) selects its row. - Tests: engine (fit keeps the columns on the right; insert selects the new row or column, typing lands in its first cell) and kittest (real double-click on a border; "+" selects the row; double-click by a cell's edge selects the row). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tables: the right-click menu offers the table's commands Right-clicking a table cell now offers what Word's table menu does, all through existing commands: Insert (rows above/below, columns left/right), Delete (cells, rows, columns, table), Select (cell, column, row, table), Merge Cells, Split Cells, Distribute Rows, Distribute Columns, AutoFit (contents, window, fixed column width), Text Direction, Cell Alignment (the nine alignments) and Table Properties… (opens the dialog, as the ribbon's button does). A right-click beside selected cells now moves the caret there, as in Word: with a column selected, the cells between its first and last cell in the text (the other columns of those rows) counted as "inside the selection", so the selection stayed and the menu acted on the column instead of the cell clicked. A right-click on a selected cell keeps the selection, so Cell Alignment, Distribute and the rest act on it. - UI only (crates/ui-egui/src/canvas.rs): the table part of `context_menu()` and a small check before the right-click caret logic (separate from it, so it doesn't overlap #521's change to that block). Table Layout's nine cell alignments are one shared list (`CELL_ALIGN` in ribbon.rs) for the ribbon grid and the menu. - Two new labels, "Cell Alignment" and "Table Properties…", translated in all eleven catalogs; the rest reuse the ribbon's labels. - Tests: kittest with real pointer events: right-click in a cell, the menu's table entries, Select > Select Column; with a column selected, a right-click on it keeps it and Cell Alignment > Align Bottom Right aligns just the column (one undo step), and a right-click beside it drops it. Progress docs updated: ui-parity (context menus 55% -> 60%), gaps, target-app-parity, ROADMAP. No new commands, so the catalog is unchanged. `cargo xtask ci` passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tables: the right-click menu's table items follow the selection, as in Word Checked against Word (2019, Windows): Word's table items in the context menu depend on what is selected, and there is no Select or Cell Alignment submenu among them. - Caret in a cell: Insert, Delete Cells, Split Cells, Text Direction, Table Properties… - Several cells: Insert, Delete Cells, Merge Cells, Text Direction, Table Properties… - Whole columns: Insert, Delete Columns, Merge Cells, Distribute Rows, Distribute Columns, Text Direction, Table Properties… (whole rows the same with Delete Rows; not checked in Word). - The whole table: Insert, Delete Table, Distribute Rows and Columns, AutoFit, Text Direction, Insert Caption…, Table Properties… Insert lists the columns first, as Word does. Select and Cell Alignment are gone, and with them the shared CELL_ALIGN constant in the ribbon; "Insert Caption…" replaces "Cell Alignment" in all fifteen catalogs. Word's Border Styles and Insert Cells… aren't here yet. - Tests (kittest, real right-clicks): the menu with the caret in a cell and with the whole table; a selected column keeps its column menu and Text Direction turns only it; beside it the menu is a cell's again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: rabis <340973947+rabis7575@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Brandon Thomas <echelon@gmail.com>