Skip to content

Offer demo content from an empty workspace#351

Merged
priethor merged 3 commits into
mainfrom
priethor/fix/dry-run-seed-zip
Jun 3, 2026
Merged

Offer demo content from an empty workspace#351
priethor merged 3 commits into
mainfrom
priethor/fix/dry-run-seed-zip

Conversation

@priethor

@priethor priethor commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

What

When a Cortext workspace has no documents, the empty state offers an Add demo contentaction that loads a small set of sample collections and pages. The action only shows while the workspace is empty, so it disappears once you add anything of your own.

Why

Desktop and Playground arrive already seeded, but a plain plugin install starts empty, with no way to load the sample content from inside the app. Now those installs can try Cortext with real content without dropping to the command line.

How

  • Adding a seed endpoint, behind an edit-access check, that the empty-state action calls.
  • Sharing the seed with the existing wp cortext seed command and keeping it idempotent, so a repeat run reuses content instead of duplicating it.
  • Reading whether to show the offer from the workspace's own documents rather than a stored flag, so it clears itself.

Testing Instructions

  1. On an install with no Cortext content, open Cortext. The main area shows an Add demo content action.
  2. Click Add demo content. Sample collections and pages are created, and the first document opens.
  3. Reload Cortext. It opens straight to a document, and the Add demo content action no longer appears.
  4. On an empty install, switch the color scheme to Dark (bottom of the sidebar) and confirm the empty-state heading is readable.

Screen recording

Grabacion.de.pantalla.2026-06-03.a.las.16.46.32.mov

@priethor priethor added the type: enhancement Improvement to existing behavior. label Jun 3, 2026
@priethor priethor merged commit 8cd6d40 into main Jun 3, 2026
11 of 12 checks passed
@priethor priethor deleted the priethor/fix/dry-run-seed-zip branch June 3, 2026 14:51
@github-actions github-actions Bot added this to the 0.1.1 milestone Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement to existing behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant