Add Published documents screen#234
Conversation
| if ( item.kind !== 'page' || ! item.link ) { | ||
| return ( | ||
| <Text variant="muted"> | ||
| { __( 'Embedded in pages', 'cortext' ) } |
There was a problem hiding this comment.
Nice touch, although I found it confusing; this sounded like it was an embedded/inline collection, but in reality, it's cascade-published by the parent page containing the collection view block, but the collection doesn't live inside the page.
Another question is whether non-inline/full-page collections should have a public URL when they are cascade-published rather than manually published.
My gut says "no", because when we publish a page and collection view blocks, we should probably just publish the view, with its filters and columns locked, so we shouldn't just allow users to see the whole collection as a result of the page publishing.
|
Refined to distinguish full from inline collections:
cortext-published-documents-inline.movThis work could later tie with the concepts in #235 so that even full collections could list where they are embedded. In this case, we'd still want to keep the tooltip. Alternatively, we could explore something a lot more sophisticated as you hint at in #234 (comment) to equip the CollectionRows controller to only disclose data (rows and columns) based on view settings defined for that collection's public pages. |
Adds a sidebar entry and full-canvas screen that lists every page and collection currently published, so users can see at a glance which documents are publicly accessible. Closes #223. The pane uses @wordpress/dataviews over a merged query of crtxt_page and crtxt_collection records filtered by status=publish, with title (linking back to the document), type, modified date, and public link columns. Navigation goes through a new `published` kind in the route reducer; the sidebar entry is a quick-action button next to Home. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Public link column was hardcoding every collection to "Embedded in pages", regardless of workspace mode. Inline collections now render "Embedded in <owner page title>" with the title acting as a navigation link to the owner page; full-page collections (which have no canonical URL but whose rows are still REST-queryable when published) render "N/A" alongside an Infotip explaining the distinction. Exposes _cortext_inline_owner_page read-only via REST so the pane can resolve the owner page title client-side. Writes remain locked by the existing auth_callback and CollectionsController::validate_pre_insert. Adds a reusable Infotip component on top of @wordpress/components' Popover, mirroring the Gutenberg design system's Infotip pattern (Popover with openOnHover) since @wordpress/ui isn't a dependency here. Preferred over Tooltip when the trigger's only purpose is to reveal the popup, as tooltips are hidden from touch users and announce as no-op buttons to assistive tech. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Nice! |
Part of: #223
https://github.com/user-attachments/assets/8c7b757c-6c36-4434-a0d8-4d927a64d58bcortext-published-documents-inline.mov
Summary
status=publish), so users can see at a glance which documents are publicly accessible. Closes Better visibility / management of published documents #223.Implementation notes
publishedkind inparseTarget/entityRouteReducer, mounted as aWorkspacePanefromEntityRoute.__experimentalHeading,__experimentalText,__experimentalVStackfrom@wordpress/componentsfor the header chrome — minimal bespoke CSS.PUBLISHED_PAGES_QUERY(page-queries.js) andPUBLISHED_COLLECTIONS_QUERY(collections.js). Inline collections are included since publishing them exposes their rows via REST.cortext-sidebar__quick-actionwith a--publishedmodifier; the existing hover/focus rule was generalised to target__quick-actions > .components-buttonso we don't duplicate per-modifier.Test plan
?p=/published, pane renders pages + collections withstatus=publish.?p=/published— paints directly without bouncing through the home-redirect.?p=/published/foo→ falls through to document-not-found.is-pressedstyling only while on the Published documents screen.🤖 Generated with Claude Code