Repository navigation
Playground: example feeds from the adopters registry, and links that open configured (#185, #146) - #198
Merged
hhkaos merged 4 commits intoNov 26, 2026
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>
hhkaos
force-pushed
the
redesign/playground-tabs-and-chrome
branch
from
November 26, 2026 19:50
d032a1d to
46ea11b
Compare
hhkaos
force-pushed
the
feat/adopters-picker
branch
from
November 26, 2026 19:50
375fe21 to
31259a6
Compare
`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.
Stacked on #197 — review that one first; this PR's base is its branch, so the diff here is only the three commits on top.
Public bundles are still byte-identical to
main(md5 verified), so no version bump.#185 — pick an example feed
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 becomes 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 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.tswas an importable loader. It is a template string served as a classic<script src="/adopters.js">, which cannot import anything at runtime — so the shape of the work is different from the issue's. The shared piece is the part that matters, the shape check, as a pure dependency-free function inapps/embed/src/adopters.ts. The playground imports it; the worker embeds its source text, bound to aconstrather than relied on by name, because the worker bundle is minified and that renames a declaration but not a name written inside a string.workers/convertimporting across a package boundary is the same relative import it already makes intoapps/validatorforfetchDocument. The rootCLAUDE.mdcalls that "the one thing in this repo that does" — it is now the second, which seemed worth saying out loud rather than leaving to be discovered.#146 —
?tab=and?preset=?feed=already round-tripped, but a link 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.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. An unknown tab or preset is ignored rather than erroring — a link that outlives a renamed preset should still open the playground.
?preset=names the configuration the form is in, so touching any control clears it: a link claiming "Cards grid" that opens something else is worse than one making no claim.Verification
403 tests in
apps/embed, whole repo green.By execution rather than by reading the diff:
apps/embed/src/adopters.tsfailsworkers/convert's owntest/adopters.test.ts— proof the worker runs the shared code and not a stale copy of it.javascript:,data:,file:), credentials in the URL, a hostile entry not costing the page its whole list, the feed URL preserved exactly including its query string, and that the function still closes over nothing — a new import there would break the converter's picker, silently.?tab=subscribe&preset=cards&feed=…opens all three together.Also fixed
The Cards grid preset 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.Closes #185. Closes #146.
🤖 Generated with Claude Code