Skip to content

Playground: land the adopters picker and query params on main, plus two CLAUDE.md rules (#185, #146) - #200

Merged
hhkaos merged 5 commits into
mainfrom
redesign/playground-tabs-and-chrome
Nov 26, 2026
Merged

hhkaos merged 5 commits into
mainfrom
redesign/playground-tabs-and-chrome

Conversation

@hhkaos

@hhkaos hhkaos commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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 to CLAUDE.md, written from what this stack cost — see below.

What happened

#197 merged redesign/playground-tabs-and-chrome into main, but the branch was not deleted, so GitHub did not retarget #198. #198 then merged into redesign/playground-tabs-and-chrome — a branch whose contents were already in main — 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 deleted

The two rules

pnpm lint is 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-assignment found a dead initialiser that four local green runs had walked past, and the first anyone heard of it was a red PR. The Tests: bullet under-stated the bar by naming only pnpm 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 reach main.

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

hhkaos and others added 5 commits November 26, 2026 20:48
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>
Playground: example feeds from the adopters registry, and links that open configured (#185, #146)
@hhkaos
hhkaos merged commit 0b71505 into main Nov 26, 2026
1 check passed
@hhkaos hhkaos changed the title Playground: land the adopters picker and query params on main (#185, #146) Playground: land the adopters picker and query params on main, plus two CLAUDE.md rules (#185, #146) Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

embed playground: pick a feed from the OTE adopters registry, reusing the converter loader Poder precargar los widgets con query params

1 participant