Finish standard markdown table column drag-drop in live preview #142

Open
opened 2026-05-29 19:23:33 +00:00 by steve · 0 comments
Owner

Standard live-preview markdown tables now support validated row drag/drop, but column drag/drop is still unresolved and was intentionally left out of the partial landing that closed the Bases migration issue.

Problem

The standard markdown table widget in packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/editor-table.svelte does not currently persist column reordering through the new drag/drop path. During the extraction work for the Bases migration, row drag/drop was stabilized and covered by Playwright, but the focused column regression kept failing with unchanged markdown output after drop.

Goal

Finish standard markdown table column drag/drop in live preview so dragging a column handle reorders the underlying markdown table source without regressing row reordering, widget rendering, or the existing column context-menu actions.

Scope

  • Standard markdown table widgets in live preview.
  • Column handle drag source and drop-target resolution.
  • Selection and persistence behavior after a successful column move.
  • Focused regression coverage for markdown table column drag/drop.

Non-goals

  • Bases table drag/drop, which shipped in issue #5.
  • Workspace layout drag/drop.
  • New markdown table features unrelated to drag/drop.
  • Grid-table behavior unless shared helper changes make a matching fix necessary.

Acceptance Criteria

  • Dragging a standard markdown table column handle in live preview persists reordered markdown source.
  • The focused row drag/drop regression continues to pass.
  • The markdown table widget still renders interactively in live preview after the column fix.
  • Focused automated coverage exists for the column drag/drop path in packages/workspace/e2e/markdown-rich-content.spec.ts or a narrower equivalent.
  • pnpm --filter @lapis-notes/markdown check passes after the implementation.

Implementation Notes

  • The extracted partial landing proved TableNode.moveColumn(...) and markdown serialization work in isolation, so the remaining defect is in the widget drag integration or post-drop update path rather than the table model itself.
  • The previous attempt added @dnd-kit/svelte row and column helper components, but only the row path is currently validated.
  • Be careful not to reintroduce the earlier widget-render regression from replacing the handle primitive with an incompatible sortable abstraction.
  • The last known failing regression read the unchanged markdown source after a column drag, even though row drag/drop and widget rendering were passing.

Suggested Files or Specs To Inspect

  • packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/editor-table.svelte
  • packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/markdown-table-drag-handle.svelte
  • packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/markdown-table-drop-target.svelte
  • packages/workspace/e2e/markdown-rich-content.spec.ts
  • packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/table-node.ts
  • spec/src/20-packages/plugins/markdown/index.md
  • spec/src/30-cross-package-contracts/drag-drop-patterns.md

Validation Commands

  • pnpm --filter @lapis-notes/markdown check
  • pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-rich-content.spec.ts -g 'renders markdown tables as interactive live-preview widgets|reorders markdown table'

Follow-up Tasks

  • Reevaluate whether grid-table should share any column-target helpers after the standard markdown table path is stable.
  • Keep the markdown and cross-package drag/drop specs in sync if the final implementation meaningfully changes the current helper split.

Implementation Summary

Populate when closing the issue.

Standard live-preview markdown tables now support validated row drag/drop, but column drag/drop is still unresolved and was intentionally left out of the partial landing that closed the Bases migration issue. ## Problem The standard markdown table widget in `packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/editor-table.svelte` does not currently persist column reordering through the new drag/drop path. During the extraction work for the Bases migration, row drag/drop was stabilized and covered by Playwright, but the focused column regression kept failing with unchanged markdown output after drop. ## Goal Finish standard markdown table column drag/drop in live preview so dragging a column handle reorders the underlying markdown table source without regressing row reordering, widget rendering, or the existing column context-menu actions. ## Scope - Standard markdown table widgets in live preview. - Column handle drag source and drop-target resolution. - Selection and persistence behavior after a successful column move. - Focused regression coverage for markdown table column drag/drop. ## Non-goals - Bases table drag/drop, which shipped in issue #5. - Workspace layout drag/drop. - New markdown table features unrelated to drag/drop. - Grid-table behavior unless shared helper changes make a matching fix necessary. ## Acceptance Criteria - Dragging a standard markdown table column handle in live preview persists reordered markdown source. - The focused row drag/drop regression continues to pass. - The markdown table widget still renders interactively in live preview after the column fix. - Focused automated coverage exists for the column drag/drop path in `packages/workspace/e2e/markdown-rich-content.spec.ts` or a narrower equivalent. - `pnpm --filter @lapis-notes/markdown check` passes after the implementation. ## Implementation Notes - The extracted partial landing proved `TableNode.moveColumn(...)` and markdown serialization work in isolation, so the remaining defect is in the widget drag integration or post-drop update path rather than the table model itself. - The previous attempt added `@dnd-kit/svelte` row and column helper components, but only the row path is currently validated. - Be careful not to reintroduce the earlier widget-render regression from replacing the handle primitive with an incompatible sortable abstraction. - The last known failing regression read the unchanged markdown source after a column drag, even though row drag/drop and widget rendering were passing. ## Suggested Files or Specs To Inspect - `packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/editor-table.svelte` - `packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/markdown-table-drag-handle.svelte` - `packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/markdown-table-drop-target.svelte` - `packages/workspace/e2e/markdown-rich-content.spec.ts` - `packages/plugins/plugin-markdown/src/lib/codemirror-extensions/table/table-node.ts` - `spec/src/20-packages/plugins/markdown/index.md` - `spec/src/30-cross-package-contracts/drag-drop-patterns.md` ## Validation Commands - `pnpm --filter @lapis-notes/markdown check` - `pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-rich-content.spec.ts -g 'renders markdown tables as interactive live-preview widgets|reorders markdown table'` ## Follow-up Tasks - Reevaluate whether grid-table should share any column-target helpers after the standard markdown table path is stable. - Keep the markdown and cross-package drag/drop specs in sync if the final implementation meaningfully changes the current helper split. ## Implementation Summary Populate when closing the issue. <!-- backlog:task_id=TASK-PLUGIN-065 source_spec=spec/src/30-cross-package-contracts/drag-drop-patterns.md -->
steve changed title from New issue to Finish standard markdown table column drag-drop in live preview 2026-05-29 19:24:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#142
No description provided.