Repository navigation
Playground: land the adopters picker and query params on main, plus two CLAUDE.md rules (#185, #146) - #200
Merged
Conversation
The playground started on one hard-coded feed and offered nothing else, so anyone evaluating the widget either already had an OTE feed URL or saw a single example — and every layout and density decision got exercised against one shape of data. The "Example feed" button is replaced by the picker the converter's landing page already has: one control that reaches an example *and* the other eight. **The default feed changes too, on measured grounds.** A demo whose calendar is mostly empty months and whose cards have no images teaches that the widget is thin. Across the nine registered feeds on 2026-11-26, HackBarna Digest has 216 events, 77 of them upcoming and 214 with an image, and declares spec 0.6.0 — where the previous default declares 0.3.0, which has since fallen out of the support window. The playground was demonstrating OTE on a spec version OTE no longer supports. **One validator, two pages, and not by copy-paste.** The issue assumed `workers/convert/src/adopters.ts` was an importable loader; it is a template string served as a classic `<script src="/adopters.js">`, which cannot import anything at runtime. So the shared piece is the part that matters — the shape check — as a pure, dependency-free function in `apps/embed/src/adopters.ts`. The playground imports it; the worker embeds its *source text* and binds it to a `const` rather than relying on its name, because the worker bundle is minified and that renames a declaration but not a name written inside a string. `workers/convert` importing across a package boundary is the same relative import it already makes into `apps/validator` for `fetchDocument`. That was "the one thing in this repo that does"; it is now the second, which is worth saying out loud rather than discovering later. Verification, by execution: - Deleting the protocol check in `apps/embed/src/adopters.ts` fails `workers/convert`'s own `test/adopters.test.ts` — proof the worker runs the shared code and not a stale copy. - 21 new cases on the validation branches, including every rejected scheme, credentials in the URL, a hostile entry not costing the page its whole list, and that the function still closes over nothing (a new import would break the *converter's* picker, silently). - Driven in Chrome: nine adopters load, the open feed arrives pre-selected, picking one drives the field, the live element and the snippet together, and typing a URL by hand clears the selection. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…146) `?feed=` already round-tripped, so a link could point the playground at someone's feed — but it always landed on the Events tab showing the default calendar. For the "Crear widget" button on the adopters list that is the wrong half of the demo: someone exploring a feed there may well want the subscribe widget, and a configured widget is closer to "the code and the preview" than a pre-filled URL alone. - `?tab=events|subscribe|reference` - `?preset=<id>`, resolved against `EVENT_PRESETS` One writer for all three parameters, reading the current URL each time, so adding one cannot drop another — and a value at its default is *absent* rather than written out, which keeps a plain link to the playground plain. An unknown tab or preset is ignored rather than treated as an error: a link that outlives a renamed preset should still open the playground. `?preset=` names the configuration the form is *in*, so it survives only while that stays true — touching any control clears it, and so does Reset. A link claiming "Cards grid" that opens something else is worse than a link making no claim. Preset ids are public API now, so a test guards that they are unique and need no escaping in a query string. Also fixes the Cards grid preset, which rendered one card wide: at 320px (`card-width: large`) two cards do not fit the preview column, so a preset named "grid" was not showing one. It takes the 220px default instead. Verified in Chrome: `?tab=subscribe&preset=cards&feed=…` opens all three together; switching tab writes it and returning to Events removes it; touching a control drops `?preset=`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`CLAUDE.md` called the validator-fetcher import "the one thing in this repo that does", which the adopters picker makes false in the same branch that makes it false. Exactly the shape of stale prose the file's own rule warns about: a true sentence that stopped being true with nothing to notice. Names the direction both share — a worker reaching into an app's `src/` — so the sentence describes the rule rather than listing the instances, and points at #158, where the extract-or-document decision actually lives. #158 now carries the same note. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`let adopters = []` was overwritten on every path that reads it — the catch returns rather than falling through — so the seed value was a value nothing could observe. ESLint's `no-useless-assignment` is right, and this was caught by CI rather than here: build, typecheck and tests all passed, and `pnpm lint` is the step I had not run. Declaring it without an initialiser is also the clearer statement: the only way past the block is through the assignment. Co-Authored-By: Claude Opus 5 (1M context) <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.
Mostly a mechanical follow-up. Four of these five commits are the ones #198 already reviewed; they just never reached
main. The fifth adds two rules toCLAUDE.md, written from what this stack cost — see below.What happened
#197 merged
redesign/playground-tabs-and-chromeintomain, but the branch was not deleted, so GitHub did not retarget #198. #198 then merged intoredesign/playground-tabs-and-chrome— a branch whose contents were already inmain— and stopped there. The result: the adopters picker and the query-param work live on that branch and nowhere else, and #185 and #146 stayed open because a PR only auto-closes issues when it merges into the default branch.This PR is that branch going to
main, which is the step the stack was missing.Contents
feat(embed): pick an example feed from the adopters registry (#185)feat(embed): open the playground from a link with ?tab= and ?preset= (#146)docs: there are two cross-package imports now, not one (#185)fix(embed): drop the dead initialiser in loadAdopters (#185)docs: the bar is the whole CI pipeline, and a stack needs its branch deletedThe two rules
pnpm lintis the first CI step and the one that gets skipped, because build/typecheck/test feel like the real verification and a lint rule feels like style.no-useless-assignmentfound a dead initialiser that four local green runs had walked past, and the first anyone heard of it was a red PR. TheTests:bullet under-stated the bar by naming onlypnpm test.The new bullet gives the command that prints the steps rather than listing them, per this file'''s own rule — and writing it immediately showed the pipeline has seven steps where this session had claimed six and run six.
Stacking PRs needs the base branch deleted on merge, not just merged first. GitHub retargets a child PR only when its base branch is deleted. That is exactly what went wrong here, and the bullet names the check that catches it (
git log origin/main..origin/<branch>must be empty) plus the cheap proxy: an issue still open after its PR merged means the PR did not reachmain.Verification
Re-ran the full CI pipeline against this branch's tip after the merge commit:
pnpm lint,pnpm build,pnpm typecheck,pnpm test— all clean. CI already passed on the same tree as #198's head.Public bundles still build byte-identical to the previous
main, so no version bump.Delete the branch on merge this time, so nothing can be stacked onto it again.
Closes #185. Closes #146.
🤖 Generated with Claude Code