docs/plans/4798-fix-table-left-border-multirow-selection.md
Fix GitHub issue #4798 so toggling the left border for a multi-row table selection updates every selected cell on the left edge of the selection, not only the topmost cell.
https://github.com/udecode/plate/issues/4798Table: Left border toggle affects only topmost cell in multi-row selectionbug, plugin:table52.0.8https://platejs.org/docs/tablepackages/table/src/react/components/TableCellElement/getOnSelectTableBorderFactory.tspackages/table/src/react/components/TableCellElement/setSelectedCellsBorder.spec.tsx| Phase | Status | Notes |
|---|---|---|
| Fetch issue and prior learnings | complete | Issue fetched; learnings search started |
| Inspect code and existing tests | complete | Root cause is in border writes interacting with active table-cell selection |
| Reproduce and write failing test | complete | Added integration coverage for multi-row left-border toggling |
| Implement fix | complete | withTableCellSelection now skips its setNodes override for unselected path targets, and the border command no longer clears selection as a workaround |
| Verify tests and browser | complete | Targeted tests, install, build, typecheck, lint passed; browser verification confirmed the real local docs demo and real multi-cell selection state, but border-toggle UI automation remains partial |
setSelectedCellsBorder writes left-border changes onto adjacent cells via setBorderSize(... { at: leftCellPath, border: 'right' }).withTableCellSelection.tsx overrides editor.tf.setNodes using the broader linear Slate selection as a proxy for selected-cell membership.withTableCellSelection only override targeted writes when options.at actually points into one of the selected cells.task, planning-with-files, learnings-researcher, reproduce-bug, and tdd.#4798.packages/table/src/react/components/TableCellElement/setSelectedCellsBorder.integration.spec.tsx.setBorderSize writes to adjacent cells work outside the active multi-cell selection override.withTableCellSelection.tsx.withoutActiveSelection(...) from getOnSelectTableBorderFactory.ts after the plugin-layer fix made it unnecessary.@platejs/table.pnpm --filter @platejs/table test packages/table/src/lib/withTableCellSelection.spec.tsx packages/table/src/react/components/TableCellElement/setSelectedCellsBorder.integration.spec.tsx packages/table/src/react/components/TableCellElement/setSelectedCellsBorder.spec.tsx packages/table/src/lib/queries/getSelectedCellsBorders.spec.tsxpnpm installpnpm turbo build --filter=./packages/tablepnpm turbo typecheck --filter=./packages/tablepnpm lint:fixhttp://localhost:3000/docs/table.~/.browser-use/tmp/issue-4798-longterm-selection.png.