Repository navigation
Description
Summary
Migrate dot-select-existing-content — the relationship field's "relate existing content" dialog picker (libs/edit-content/.../dot-edit-content-relationship-field/components/dot-select-existing-content) — to render with the Content Drive table (dot-folder-list-view) instead of its own p-table. The picker becomes a thin wrapper (dialog + search store + cardinality rules) around the Content Drive table.
Follow-up from #36737 and @nicobytes' review, under the agreed direction that the relationship field's content tables become a constrained subset of Content Drive rather than a parallel implementation. This is the first concrete migration; the inline related-content table (dot-relationship-field) is out of scope here.
The one gap: selection
For this picker, the Content Drive table is already a superset except selection. Everything else the picker renders — typed columns, sortable headers, server-side search/pagination — Content Drive already does (and its lazy/server model is the one the picker's store already feeds). So the migration is: add selection to the Content Drive table, then point the picker at it.
The picker (dot-select-existing-content) today does:
selectionModesingle or multiple — radio (single) / checkbox (multiple).- Constrained/disabled rows with a tooltip (relationship cardinality reached).
- A custom select-all that excludes constrained rows and preserves selection across pages.
- A frozen left checkbox column.
Capability to add to the Content Drive table
dot-folder-list-view hardwires multiple-checkbox selection. Generalize it:
selectionMode: 'none' | 'single' | 'multiple'— defaultmultiple(today's behavior unchanged when unset); single → radio column.- Constrained/disabled rows: an input marking rows non-selectable, with a tooltip; select-all must exclude them.
- Cross-page selection preserved.
- Frozen selection column (optional, matches the picker).
The picker's cardinality rules (which rows are constrained) and its dialog/store wiring stay in the picker container and are passed into the table as inputs — the table stays presentational.
The picker's duplicate column model (Column {field, header}) is retired in favor of Content Drive's column typing; the cell widgets it needs are already shared @dotcms/ui atoms.
Architectural decision (blocks the "consume it" step)
The CD table lives in @dotcms/portlets/content-drive/ui; the picker in @dotcms/edit-content. content-drive/portlet already imports edit-content, so edit-content importing the CD table would close an import cycle. Resolve by relocating the table (or a thin table lib) to a lower shared home, or inverting the content-drive→edit-content dependency. Not a blocker for adding selection to the CD table itself.
Phased plan
- Selection modes on the Content Drive table —
selectionMode: none | single | multiple, radio for single, constrained/disabled rows + tooltip, constrained-aware select-all, cross-page selection preservation, optional frozen selection column. Defaultmultiple; Content Drive behavior unchanged. +tests. (Independent, shippable on its own.) - Lib-home / dependency-direction decision so
edit-contentcan consume the table without a cycle. - Migrate the picker (
dot-select-existing-content) onto the Content Drive table; retire itsColumnmodel.
Acceptance criteria (draft)
- CD table supports
selectionMode: none | single | multiple(defaultmultiple; current behavior unchanged when unset), radios for single. - Rows can be marked non-selectable (with tooltip); select-all excludes them; selection is preserved across pagination.
- The relate-existing picker renders via the Content Drive table with identical behavior (single/multiple, cardinality constraints, select-all).
- Picker's duplicate
Columnmodel removed; no cyclic dependency (Nx graph clean). - No visual/behavioral regression in Content Drive or the picker.
Out of scope
- The inline related-content table (
dot-relationship-field) — reorder / CVA / delete-navigate stay untouched for now. - Merging the whole portlets.
$safeExtraColumnsdev-warning on field-key collision — small separate follow-up.
Drafted by Claude (via Claude Code) at @zJaaal's request — recommended plan grounded in a code investigation of the tables. Direction: the relate-existing content picker becomes a constrained Content Drive table. Origin: @nicobytes' review on #36737.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]Content Drive table: add single/multi-select selection modes (foundation for the relationship field as a constrained Content Drive subset)[/-][+]Migrate the relate-existing content picker onto the Content Drive table (add single/multi-select to the CD table)[/+][-]Migrate the relate-existing content picker onto the Content Drive table (add single/multi-select to the CD table)[/-][+]Migrate dot-select-existing-content (relate-existing picker) to the Content Drive table[/+]zJaaal commentedon Aug 20, 2026
Already solved on #36944