Skip to content

feat(core): add list item drag reorder and table row height resize#134

Open
wxd-hash wants to merge 1 commit into
floatboatai:mainfrom
wxd-hash:feat/core-list-drag-reorder
Open

feat(core): add list item drag reorder and table row height resize#134
wxd-hash wants to merge 1 commit into
floatboatai:mainfrom
wxd-hash:feat/core-list-drag-reorder

Conversation

@wxd-hash

@wxd-hash wxd-hash commented Jul 6, 2026

Copy link
Copy Markdown

Summary

Three enhancements to the live-preview engine:

  1. List item drag reorder — hover to reveal grip, drag to reorder, release to update Markdown source (OpenSpec §2.4)

  2. Table row height resize — hover the bottom edge of any table row, drag to adjust row height

  3. Fix table add-column bug — previously corrupted the table; now correctly inserts a new column

Motivation

  • Roadmap: add-missing-features tasks.md §2.4 (list item drag reorder, P1)
  • OpenSpec: openspec/changes/add-missing-features/ (already approved)
  • Table already had column resize but no row height resize
  • Table add-column button was broken with certain separator formats

Changes

  • packages/core/src/live-preview.ts (+228 lines):
    List grip rendering (), custom mousedown/mousemove/mouseup drag, editing lock (listEditingCount), CM6 coordsAtPos positioning, single-dispatch moveListLines, findItemEnd boundary detection
  • packages/core/src/live-preview-table.ts (+103 lines):
    Row height resize (session-scoped tableRowHeights map, applyRowHeights/measureRowHeights/startRowResize, resize handle on first cell), addColumn rewrite (cell-split detection instead of SEPARATOR_RE anchor check)
  • packages/core/test/live-preview.test.ts (+67 lines):
    3 tests: grip rendering, grip hidden when cursor on item, document reorder via setDocument

Testing

  • pnpm test passes — 34 test files, 518 tests
  • Affected packages build (pnpm build)
  • New vitest cases: 3 (grip render, cursor hides grip, document reorder)
  • Manual check in electron-demo: list drag reorder, row resize, add column

Compliance

  • CLA signed — will sign when prompted by CLA bot
  • AI disclosure: AI pair-programming used for implementation; all code reviewed and tested.
  • New dependencies: none
  • No build artifacts committed
  • No secrets committed

Checklist

  • Title follows Conventional Commits
  • Public API changes update package README / types — N/A
  • Touched live-preview-table.ts — walked through 12 Table Widget rules in CLAUDE.md
  • New capability → OpenSpec proposal linked (openspec/changes/add-missing-features/)
  • Change aligns with project scope (GOVERNANCE.md §4)

- List item drag reorder with grip handles (⋮) in live-preview.ts
  Custom mousedown/mousemove/mouseup drag, editing locks,
  CM6 coordsAtPos positioning, single-dispatch source update.
- Table row height resize in live-preview-table.ts
  Per-row resize handles with session-scoped height storage,
  same editing-lock pattern as column resize.
- Fix table addColumn to detect separator rows without
  relying on ^-anchored SEPARATOR_RE regex.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants