Skip to content

feat(dnd): drag-list and drag-multiple on the host api; host ui gaps - #128

Merged
ErickXavier merged 9 commits into
mainfrom
feat/host-ui-gaps
Nov 21, 2026
Merged

ErickXavier merged 9 commits into
mainfrom
feat/host-ui-gaps

Conversation

@ErickXavier

@ErickXavier ErickXavier commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

D-ELEMENTS-HOST-GAPS (reference-site acceptance). Companion: no-js-dev/nojs-server#73 (the server half of drag-list).

What changes

Each gap was reproduced three times on a compiled site before the fix.

  1. drag-list / drag-multiple on the host API. These were the last two host stubs. drag-list now declares a list contract member (NoJS-Server ADR-021 amendment 2026-11-20b). The server renders the rows and compiles reorder, insert and remove into actions. On the host, the mechanics decorate the server-rendered rows, drop the loop markers, report indices through host.exec, and apply the settle class after the re-render. src/dnd/element.js splits drag-list into a core backend and a host backend, and core behavior is unchanged. drag-multiple keeps its selection on the client. The $drag of drop is declared sealed: { multiple: true, maxItems: 100 }.
  2. Dropdown menus no longer get the popover directive. popover returns early on [dropdown-menu]. Core showed the same bug outside loop rows: the elements-overlays goldens had nojs-popover on the menu.
  3. Generated ids are deterministic. Dropdown menus get nojs-dd-menu-<n>, the lowest free number in the document, through freeId in _backend.js. Core re-creates loop rows on every render, while the host initializes them once, so a running counter drifted between the two.
  4. Stepper ARIA. Each tab now links to its panel (aria-controls / aria-labelledby) from the first render, on both backends. The core backend used to leave the links out until the first navigation. The Next button on compiled sites is fixed on the server side (control state and markers on morphed subtree owners).
  5. dnd live-region label. The label is the visible text with whitespace collapsed before the 50-character cut. Source indentation used to decide where the cut fell.

Also fixed: table sort keeps sorted rows before a loop's end marker (tbody.appendChild moved them after it).

Visible changes on core pages

  • Stepper tabs carry aria-controls / aria-labelledby at load.
  • Dropdown menu ids are shorter (nojs-dd-menu-0).
  • A dropdown menu outside a loop no longer carries nojs-popover / data-popover-id.
  • The dnd grab announcement reads more of the item.

The reference-site goldens for j3-board, j6a-team and j6c-wizard need a re-capture.

Tests

  • Unit: 851 passed (5 skipped).
  • e2e: 702 passed across 3 browsers. One firefox validation-forms test flaked once under full load; it passes 3 of 3 in isolation and in a full rerun.
  • New unit tests cover the host drag-list (decoration, markers, move/insert/remove payloads, copy, drop-disabled / drop-max / drag-disabled, settle) and the host drag-multiple. They also cover dropdown ids, popover exclusion, stepper linkage, the table markers and the dnd label.

Not done / follow-ups

  • LSP / Skill: drag-list behavior on compiled sites (docs only; no directive changes).
  • Reference site: re-capture j3-board, j6a-team and j6c-wizard; update DIVERGENCES D-ELEMENTS-HOST-GAPS.

@ErickXavier
ErickXavier merged commit d9636db into main Nov 21, 2026
2 checks passed
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.

1 participant