Playground demos: open on a demo page covering every input format - #102
Merged
Merged
Conversation
The release, main-build, and WordPress.org Preview blueprints now open the
editor on a generated demo page instead of a one-block starter:
- Copy-ready samples of every accepted input: DOI (bare, doi:, doi.org
link), PMID, PMCID, arXiv (modern, legacy, link, arXiv DOI), ISBN-13 and
ISBN-10, BibTeX and BibLaTeX, and formatted book, article, chapter, and
webpage citations (one with an embedded DOI), above an empty block.
- Brief notes on the key features.
- Three example bibliographies (Chicago notes with Cite / Export, APA 7,
IEEE), formatted by the plugin's own formatter and rendered by its PHP
port of save() at boot, so they validate against whatever version the
blueprint installs; releases without the port get a note instead. They
are stored sorted and with the editor's export strings, so the untouched
page opens with no unsaved changes.
- The Welcome Guide is turned off so the page is what opens.
The page is defined once in playground/demo-content.{json,php};
`npm run playground:build` inlines it into each blueprint's runPHP step.
src/playground-demo.test.js fails on a stale blueprint, on a sample that
stops reaching the parser backend it claims, and on export strings that
drift from what the editor computes. playground/ joins scripts/ in the
first-party PHP metric's exclusions, since it never ships.
Checked in a local Playground (CLI 3.1.40, WordPress trunk, this build):
all 44 blocks valid, no unsaved changes, no Welcome Guide, and the front
end renders all four bibliographies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
dknauss
marked this pull request as ready for review
September 26, 2026 16:17
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #102 +/- ##
=======================================
Coverage 86.65% 86.65%
=======================================
Files 52 52
Lines 5367 5367
Branches 597 597
=======================================
Hits 4651 4651
Misses 235 235
Partials 481 481 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dknauss
pushed a commit
that referenced
this pull request
Sep 26, 2026
Full GPL CSL styles and locales (#103), Phase 05 M0-M3 (stable IDs, review routes and abilities, opt-in citation and block write routes: #104, #106), the save-markup language fix, reference-manager .bib fixes, the Playground demo page (#102), and the runtime matrix on the release package with formatter-parity and write-route checks (#105). Version bumped in the plugin header, block.json, readme.txt Stable tag, the POT header, and the package manifests. CHANGELOG [Unreleased] is dated as 1.7.0; readme.txt gains a user-facing changelog entry, an Upgrade Notice, and an FAQ note on the opt-in write routes. README highlights and STATE/ROADMAP move to the 1.7.0 baseline. Tested up to stays 7.1: WordPress latest is 7.1.2, which CI's runtime matrix exercises, including formatter parity across all nine styles. package-release.sh now also prunes .git directories from vendor/. When Composer falls back from dist to a git clone (as it did in this sandbox), the ZIP otherwise carried 4 MB of git metadata. Release checklist gates run locally: lint:js, lint:css, lint:i18n, npm audit (0), composer audit (none), Jest 873 passed / 2 skipped, PHPUnit 318 OK (the 4 vendor deprecations already on main), build, package:release (552,718-byte ZIP). citeproc-php v2.7.1 is current. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
dknauss
added a commit
that referenced
this pull request
Sep 26, 2026
* chore(release): 1.7.0 Full GPL CSL styles and locales (#103), Phase 05 M0-M3 (stable IDs, review routes and abilities, opt-in citation and block write routes: #104, #106), the save-markup language fix, reference-manager .bib fixes, the Playground demo page (#102), and the runtime matrix on the release package with formatter-parity and write-route checks (#105). Version bumped in the plugin header, block.json, readme.txt Stable tag, the POT header, and the package manifests. CHANGELOG [Unreleased] is dated as 1.7.0; readme.txt gains a user-facing changelog entry, an Upgrade Notice, and an FAQ note on the opt-in write routes. README highlights and STATE/ROADMAP move to the 1.7.0 baseline. Tested up to stays 7.1: WordPress latest is 7.1.2, which CI's runtime matrix exercises, including formatter parity across all nine styles. package-release.sh now also prunes .git directories from vendor/. When Composer falls back from dist to a git clone (as it did in this sandbox), the ZIP otherwise carried 4 MB of git metadata. Release checklist gates run locally: lint:js, lint:css, lint:i18n, npm audit (0), composer audit (none), Jest 873 passed / 2 skipped, PHPUnit 318 OK (the 4 vendor deprecations already on main), build, package:release (552,718-byte ZIP). citeproc-php v2.7.1 is current. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2 * Parse each CSL style once per format request CiteProc::render() calls init() every time, which builds a new Context, reads and parses the locale file, and rebuilds the style's object tree: about 3 ms, against well under 1 ms to render an entry. With one render per entry (the fix that stopped an "et al." entry from dropping the next entry's "and"), 50 entries took about 90 ms, against about 8 ms in 1.6.0 with its short stand-in styles. Bibliography_Builder_Reusable_CiteProc parses once, records every property of every object in the parsed style tree, and before each later render restores them, resets the Context's per-render lists, and zeroes Layout's static cited-item counter. Each entry renders against the state a fresh parse would give it: 50 entries now take about 25 ms. The nine style goldens still match byte for byte. A new test formats the corpus in reverse order, putting the "et al." and APA 21+ entries ahead of the short author lists, and requires every entry to match its golden line; with the restore disabled, both the goldens and the new test fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2 * Drop the #[\Override] attribute from the reusable formatter PHP 7.4 reads an attribute on its own line as a comment (php -l on 7.4 passes, and so does the PHP 7.4 runtime smoke), but Copilot flagged it as a 7.4 parse error, and compatibility scanners can do the same. It does nothing at runtime, so drop it, and turn off Psalm's MissingOverrideAttribute, which cannot apply to a plugin that supports PHP 7.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2 --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed?
The release, main-build, and WordPress.org Preview blueprints now open the block editor on a generated demo page. Before, they opened a one-block starter.
Section 1: samples of every accepted input. Copy-ready code blocks, grouped by format, above an empty Bibliography block:
doi:, and a doi.org link.23 samples in total, well under the 50-per-paste limit.
Section 2: brief feature notes. Styles, editing entries, manual entry, duplicates, ordering, exports, per-entry Cite / Export, machine-readable output, and a link to the post's read-only REST data.
Section 3: example bibliographies.
save()from Phase 05 M2 spike: PHP save() port with parity harness; M1 review-route fixes #97. They therefore validate against whatever version the blueprint installs.Welcome Guide. It is turned off (the
core/edit-postpersisted preference), so the page is what opens.Maintenance.
playground/demo-content.json(the data) andplayground/demo-content.php(the writer).npm run playground:buildinlines both into each blueprint'srunPHPstep. It also reformats short arrays in the blueprints, which is cosmetic.src/playground-demo.test.jsfails when:computeExportStrings.playground/joinsscripts/in the exclusions for the first-party PHP metric, since it never ships (it is already in.distignore).Why? So visitors can try every input format and the key features without having to find their own identifiers.
Heads-up, not changed here: the bundled CSL styles in
packages/citation-style-language-styles/are about 2 KB, project-written stand-ins. So "APA" and "Chicago" output initializes given names and omits volume, issue, and pages. The examples show exactly what the editor produces.Validation
npm run lint:jspassesnpm run lint:css: no CSS changesnpm run lint:i18n: no source strings changednpm run testpasses (872 passed)npm run buildsucceedsverify-metrics.shpassesI haven't run the hosted playground.wordpress.net Playground: WordPress.org is blocked in this sandbox. The
runPHPstep uses only core APIs plus the plugin's own functions, and those calls are guarded withfunction_exists.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
Generated by Claude Code