Add @dnd-kit packages to plugin host for production DragDropProvider singleton #277

Closed
opened 2026-06-04 21:11:19 +00:00 by steve · 0 comments
Owner

Problem

CI Electron production smoke fails with getDragDropManager was called outside of a DragDropProvider when opening vaults that render CSV table grips. Local dev passes because Vite dedupes @dnd-kit/svelte; production builds can bundle duplicate dnd-kit context modules. A follow-up attempt to mark all plugin-host modules as Rollup external broke host wrapper re-exports (bits-ui.js became a side-effect-only import), causing runtime Accordion export errors.

Goal

Production Electron builds use a single @dnd-kit/svelte DragDropProvider context for bundled CSV/markdown table reorder, without breaking other plugin-host wrapper modules.

Scope

  • Register @dnd-kit/dom, @dnd-kit/helpers, and @dnd-kit/svelte (+ package export subpaths) in plugin-host-modules.config.json.
  • Stop CSV row grips from calling createDraggable through TableDragGrip (separate UI module graph); attach the parent row draggable handle directly like markdown tables.
  • Do not mark all pluginSharedExternals as Rollup external in the desktop renderer build.

Acceptance Criteria

  • CI=1 pnpm --filter @lapis-notes/desktop-electron test:e2e:smoke passes (7/7).
  • Production bits-ui host wrapper re-exports named exports (no Accordion import map error).
  • pnpm plugin-host:check passes.

Validation Commands

  • pnpm plugin-host:generate && pnpm plugin-host:check
  • CI=1 pnpm --filter @lapis-notes/desktop-electron test:e2e:smoke
  • make spec-lint
  • Follow-up to #263 — shared table-dnd UI

Implementation Summary

Registered @dnd-kit/dom, helpers, and svelte (+ sortable/utilities subpaths) in plugin-host-modules.config.json; fixed CSV row grip cells to attach the parent row draggable handle directly instead of TableDragGrip (avoids duplicate dnd-kit context in production bundles); reverted desktop Rollup externalization of all pluginSharedExternals that stripped bits-ui re-exports. Validated: pnpm plugin-host:check, make spec-lint, CI=1 desktop test:e2e:smoke 7/7.

## Problem CI Electron production smoke fails with `getDragDropManager was called outside of a DragDropProvider` when opening vaults that render CSV table grips. Local dev passes because Vite dedupes `@dnd-kit/svelte`; production builds can bundle duplicate dnd-kit context modules. A follow-up attempt to mark all plugin-host modules as Rollup `external` broke host wrapper re-exports (`bits-ui.js` became a side-effect-only import), causing runtime `Accordion` export errors. ## Goal Production Electron builds use a single `@dnd-kit/svelte` DragDropProvider context for bundled CSV/markdown table reorder, without breaking other plugin-host wrapper modules. ## Scope - Register `@dnd-kit/dom`, `@dnd-kit/helpers`, and `@dnd-kit/svelte` (+ package export subpaths) in `plugin-host-modules.config.json`. - Stop CSV row grips from calling `createDraggable` through `TableDragGrip` (separate UI module graph); attach the parent row draggable handle directly like markdown tables. - Do **not** mark all `pluginSharedExternals` as Rollup `external` in the desktop renderer build. ## Acceptance Criteria - [ ] `CI=1 pnpm --filter @lapis-notes/desktop-electron test:e2e:smoke` passes (7/7). - [ ] Production `bits-ui` host wrapper re-exports named exports (no `Accordion` import map error). - [ ] `pnpm plugin-host:check` passes. ## Validation Commands - `pnpm plugin-host:generate && pnpm plugin-host:check` - `CI=1 pnpm --filter @lapis-notes/desktop-electron test:e2e:smoke` - `make spec-lint` ## Related Issues - Follow-up to #263 — shared table-dnd UI ## Implementation Summary Registered @dnd-kit/dom, helpers, and svelte (+ sortable/utilities subpaths) in plugin-host-modules.config.json; fixed CSV row grip cells to attach the parent row draggable handle directly instead of TableDragGrip (avoids duplicate dnd-kit context in production bundles); reverted desktop Rollup externalization of all pluginSharedExternals that stripped bits-ui re-exports. Validated: pnpm plugin-host:check, make spec-lint, CI=1 desktop test:e2e:smoke 7/7. <!-- backlog:task_id=TASK-UI-TABLE-DND-PLUGIN-HOST source_spec=packages/ui/src/lib/components/ui/table-dnd/ related_issue=263 -->
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#277
No description provided.