Skip to content

[6.x] Singles as sources - #19552

Draft
brianjhanson wants to merge 6 commits into
6.xfrom
feature/singles-as-sources
Draft

[6.x] Singles as sources#19552
brianjhanson wants to merge 6 commits into
6.xfrom
feature/singles-as-sources

Conversation

@brianjhanson

@brianjhanson brianjhanson commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Add the ability to put a single up into the "Pages" section of your navigation.

Related issues

brianjhanson and others added 6 commits September 2, 2026 15:56
craftcms/cms is the root package here, not a discovered dependency, so
package discovery never registers the aliases declared in composer.json.
Without them the Twig globals that CP templates reach for (DeltaRegistry,
Sites, Fields, …) don't exist, and _layouts/cp fails to render.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
SQLite has no DROP CONSTRAINT, so Laravel rebuilds the table and matches
the foreign key by column rather than by name. Passing only the name left
the command's columns empty, which threw.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
Singles shared one aggregate `singles` source, so they couldn't be placed
in the control panel navigation, given their own index page, or told apart
in a breadcrumb. Each Single section now emits a `section:{uid}` source of
its own, grouped under a “Singles” heading like the other section types,
and keeps the sort and columns that suited the old aggregate.

`content/{page}/singles` still resolves, as a criteria-only pseudo-source
spanning every editable Single, so bookmarks keep working. A migration
rewrites a stored `singles` row into one row per Single in place, keeping
each site's ordering, page assignments and display settings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
Element types define their group headings without keys, as did headings
stored before the modal started keying them. The modal can't build a Form
for a keyless row or post it back in `sourceOrder`, so the first save of a
source list dropped every heading it hadn't created itself — the legacy
modal keyed them client-side, which the Vue one no longer did.

A labeled heading now gets the same `heading:{uuid}` key on its way out.
The blank heading ElementSources synthesizes as a separator is regenerated
on every read, so it stays keyless and unsaveable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
A source could only get a page of its own by making the page first and then
moving the source onto it from a menu. Dragging it into the pages sidebar
now does both, dropping it in as a page beside the ones it lands between.

Each list of rows kept its drags to itself, so `useDragAndDrop` grew an
opt-in for the other list: `dragData` says what a row carries, and a list
that accepts it reports where it landed through `onForeignDrop` instead of
reordering. Lists that don't opt in behave exactly as before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
A page whose only source is a Single had a nav item pointing at an index
listing the one entry you were going to open anyway. It now points at the
entry, and stays selected while you're editing it. Every other page — one
holding more than the single, or one whose single has no entry yet — keeps
its index.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEpDRM6Esb5zPdY4saCZP1
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/uiopen Storybook

No changed components detected in this Storybook.

resources/jsopen Storybook

No changed components detected in this Storybook.

@thupsi

thupsi commented Sep 4, 2026

Copy link
Copy Markdown

Yay! 🙂

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

CMS-2385

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