feat(Block Editor): implement table handles and popovers#35740
Conversation
…and row actions v1
|
Claude finished @rjvelazco's task in 4m 0s —— View job ReviewMain finding is downstream — the SDK renderers don't honor the cell-level 🔴 Blocker — SDK renderers ignore cell type and force header purely by row index
Practical impact, given this PR explicitly adds
The VTL renderer at 🟠 Selection handle vertical-centering misplaces for rowspan > 2 inside even-row selections
const anchorCellSpansBoundary =
!isOdd &&
anchorRow > rect.top &&
map.map[(anchorRow - 1) * map.width + anchorCol] === cellOffset;If the anchor cell is merged across only a subset of the selection (e.g. 4-row selection, anchor cell spans rows 0..2 → 3 rows), the cell at This is an edge case (multi-row rowspan + even selection height), but it's the exact case the comment claims to handle. 🟡 i18n — hardcoded English keys
🟡 Auto-scope plugin walks the full doc on every doc-changing transaction
🟡 Synchronous dispatch inside the plugin's
|
…table handle functionality directly into DotTableCell and DotTableHeader
…lumn scope popover
…ttributes-to-tables-scope-on-th-caption-aria-label-aria-labelledby
- Added a new `TableSelectionPopoverComponent` to handle merge and split actions for multi-cell selections in the block editor. - Updated the editor component to include the new selection popover in the editor's popover management. - Enhanced table accessibility by adding aria labels for selection actions. - Updated CSS to manage the visibility and positioning of selection handles for better user experience. - Marked the merge-cells button as complete in the todo list for table accessibility improvements. This commit enhances the table editing experience by providing users with intuitive controls for managing cell selections, ensuring better accessibility compliance.
- Introduced new `TableColumnPopoverComponent`, `TableRowPopoverComponent`, and `TableSelectionPopoverComponent` to manage column and row actions, as well as multi-cell selections in the block editor. - Updated the editor component to integrate the new popover components, improving the user experience for table editing. - Enhanced accessibility by adding appropriate aria labels and ensuring the popovers are contextually relevant to the user's selection. - Improved code organization by restructuring imports and separating table-related popover functionalities into dedicated components. This commit significantly enhances the table editing capabilities within the block editor, providing users with intuitive controls for managing table structures.
- Enhanced the logic for determining the selection anchor class in the table editor to correctly handle cases where the anchor cell is merged across row boundaries. - Updated the class assignment to ensure the selection handle is visually centered on merged cells, improving user experience during multi-cell selections. This change addresses edge cases in the table editing functionality, ensuring accurate visual feedback for users when interacting with merged cells.
- Updated the VTL files to include `caption`, `aria-label`, `aria-labelledby`, and `scope` attributes for tables and table headers, ensuring server-rendered pages align with editor output and comply with WCAG standards. - Modified Angular and React components to accept and render these new attributes, improving accessibility for users. - Enhanced the table rendering logic to conditionally display the caption and set appropriate ARIA attributes, ensuring better screen reader support. This commit significantly improves the accessibility of tables within the block editor, aligning with ongoing efforts to enhance user experience and compliance.
|
@claude Review these changes, please |
|
Claude finished @rjvelazco's task in 4m 17s —— View job ReviewThe popover / NodeView consolidation since the prior review reads cleanly — one shell + an 🔴 Blocker — SDK renderers still ignore
|
Proposed Changes
Implements accessibility-aware table editing in
libs/new-block-editorper #35720, plus the surrounding UX.Schema additions on the
tablenode (all stored as JSONattrs, headless-consumable):caption(string) — renders as<caption>in the outputariaLabel— renders asaria-labelon<table>ariaLabelledby— renders asaria-labelledbyon<table>scopeontableHeadercells (col/row/colgroup/rowgroup) — auto-assigned by a ProseMirror plugin (colon first row,rowon first column), preserving any explicit author overrideUX — Notion-style contextual table editing:
table_edit) button for the a11y form (caption + aria-label + aria-labelledby).addNodeView()ontableCell/tableHeader— pure CSS positioning, no floating-ui:<th>), Delete columndisabledfromeditor.can(). Handles vertical centering correctly across rowspan'd merged cells.TableHandlePopoverComponentdriven byCOLUMN_ACTIONS/ROW_ACTIONS/SELECTION_ACTIONSconstants — adding a new action is one entry in theACTIONSregistry + one append to the right list.Checklist
new-block-editorconvention — verified vianx lint+tsc --noEmit)Language.properties)Additional Info
Still outstanding (tracked in
libs/new-block-editor/todo.md):caption,aria-label,aria-labelledby,scope) for server-rendered (non-headless) consumers so they get accessible markup too.Legacy
libs/block-editor: out of scope for this PR. The schema is forward-compatible — content authored here remains readable by the legacy editor (unknown attrs are preserved). A separate decision on backporting will follow.Video
video.mov
This PR fixes: #35720