Skip to content

Playground: tabs, presets, and help that is not in the way (#199) - #197

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

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

Conversation

@hhkaos

@hhkaos hhkaos commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Reorganises the embed playground. The page's own markup only — ote-events.js and ote-subscribe.js build byte-identical to main (verified by md5), so no version bump.

Eight commits, each self-contained and in a sensible reading order.

What changed

  • Page chrome above the preview is ~160px shorter. A two-sentence intro, ul.agent-index hidden (it is written for an agent reading the DOM and duplicates the Reference tab), and the feed field and widget tabs in one sticky strip. The strip is sticky because its status line reports a real fetch: if it scrolls away, a 404 verdict goes with it and an empty widget reads as a broken widget.
  • Tabs instead of accordions, with a badge per tab counting the settings inside it that are not at their default. The badge is not decoration — hiding controls behind tabs is what makes a value set in another tab forgettable, and the badge is what makes it findable. It derives from the DOM's own defaultChecked/defaultValue/defaultSelected rather than a table of defaults beside the form.
  • One view switcher. The playground's layout toolbar is gone; the widget has had its own since ote-events: a Calendar / List / Cards view switcher, so the visitor picks the layout the host guessed #183, and playground.ts already listened to ote-view-change to keep the two agreeing. layout becomes a select, which is what "the view the widget opens on" is. The theme toolbar stays over the preview — theme has no in-widget equivalent.
  • Per-view settings grouped by view and dimmed, not disabled. With views the visitor reaches every enabled view, so card-width is in effect in the embed you copy whatever the preview shows. Disabling it hid a live setting, and behind tabs the reason ("Cards layout only") was nowhere near the greyed control.
  • The subscribe panel asks once where the Calendar and RSS links come from — a three-way radio, replacing a closed group plus a convert checkbox pair that meant the same thing.
  • Long help behind an info button and a popover. Eighteen hints, the longest 199 words. Threshold is 20 words, and it matters in both directions: a form where every field is an opaque label with a mystery icon is the opposite failure.
  • Four one-click presets and a Reset. Twenty-five controls across four tabs are a poor way to find out what the widget can do.

Bugs found while verifying this in a browser

Two of the three predate this branch:

  1. The playground handed out a wrong snippet. The form shipped group-events's checkboxes ticked while parseGroupEvents() treats the absent attribute as a deliberate no-op (opt-in behaviour, pinned consumer). Every snippet copied from an untouched form turned on grouping the visitor never asked for — beside a hint reading "Off by default". On main since the attribute landed.
  2. The page scrolled sideways: a grid item's min-width is auto, so the preview panel was sized by the calendar's min-content.
  3. Fixing (2) squeezed the widget under the 600px container width where it degrades the month grid to a list — the calendar in the headline view was never a calendar. The preview column is now the wide one and the breakpoint drops 58rem → 52rem, so a 1024px tablet keeps two columns instead of putting the preview below a 25-control form.

Verification

382 tests in apps/embed (26 new), whole repo green, typecheck clean.

Checked by execution rather than by reading the diff, per the five checks in CLAUDE.md:

  • Reverted the "a moved radio group counts once" guard → its test fails.
  • Re-ticked group-events in the markup → its test fails.
  • test/playground-page.test.ts parses the real index.html: every panel starts at its default, every info button resolves to a popover and every popover has an invoker, every tablist has exactly one selected tab with the rest out of the tab order, and every preset names selectors that exist and actually moves the form. That last one is the real failure mode of selector-driven config — a renamed control makes a preset silently do nothing.
  • Driven in Chrome at 1440x900 and 820x900: no horizontal scroll, month grid renders as a grid, clicking List inside the widget drives the select, the snippet's layout and the dimming together, and all three subscribe source states emit the right attributes — including that returning to generated drops feed-ics from the snippet and from the live element.

Deferred, not dropped

🤖 Generated with Claude Code

Closes #199.

hhkaos and others added 8 commits November 26, 2026 19:55
The playground's scroll was blamed on the collapsible control groups, but
roughly 400px of it is page chrome ahead of <main>: brand row, a five-sentence
intro, a page index, a three-row feed card and the tabs. The sticky preview
column only starts helping after you have scrolled past all of it.

- The intro is two sentences and spans the wrap. The three it loses were
  instructions ("Try each widget below", "the snippet panel always reflects
  what you're seeing") that the page should make evident rather than state.
- `ul.agent-index` is `display: none`. It is written for an agent reading the
  DOM and duplicates the Reference tab for anyone reading the page; hiding it
  keeps it in the source and out of the render.
- The feed field and the widget tabs become one sticky strip, and the feed
  field is one row. Both have to survive a scroll for the same reason: the
  status line reports a real fetch, so if it scrolls away a 404 verdict goes
  with it and an empty widget reads as a broken widget.
- Its long hint moves behind an info button and a `popover`. Introduces the
  mechanism the rest of the form's prose will use: anchored through the
  *implicit* anchor (`popovertarget` makes the button the anchor), so N
  popovers need no N `anchor-name`s, with a centred-sheet fallback where
  `position-area` is missing.

`aria-describedby` still names the hint's id: a description referenced on a
hidden element is still used to compute the accessible description, so moving
the prose into a popover does not cost a screen reader anything.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ith a changed-count badge (#199)

Four `<details>` groups over ~25 controls made the controls column change
height on every open and close, which moved the page under the sticky preview
column. Tabs keep that height constant.

Their cost is hidden state: a value set in a tab you are not looking at is a
value you can forget and then blame the widget for. The badge is the
mitigation and not optional — it counts, per panel, the controls that differ
from their default, so "where did I set that" has an answer without opening
all four.

The count derives from the DOM's own `defaultChecked` / `defaultValue` /
`defaultSelected` rather than from a table of defaults kept beside the form:
a second copy of that set is how a new control gets added and silently never
counted. A moved radio group counts once, not twice — one newly checked radio
and one newly unchecked one is a single decision.

The tabs are underlined and light where `.site-tabs` are dark pills, because
the page now has two tablists and two rows of identical-looking tabs is its
own confusion. Roving tabindex with arrows/Home/End, as the site tabs
already do.

Lives in `src/control-tabs.ts`, imported by `playground.ts` alone so none of
it can reach `dist/ote-events.js`, and tested there: ten cases in
`test/control-tabs.test.ts` covering the radio-counted-once rule, the badge
landing on the *hidden* panel's tab, and the keyboard contract.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…tead of disabled (#199)

Three changes to the events controls, all downstream of #183 giving the
widget its own Calendar/List/Cards header.

**The playground's layout toolbar is gone.** It was a second control over one
thing — `playground.ts` already listened to `ote-view-change` to keep the two
agreeing — and `layout` no longer means "the view" but "the view the widget
*opens* on", which is a one-line select, not a toolbar. It moves into
Appearance. The theme toolbar stays over the preview: theme has no in-widget
equivalent, and burying it in a tab means leaving the tab you are editing to
see dark mode.

**Per-view settings are grouped by view and dimmed, not disabled.** Disabling
them was wrong twice. With `views` the widget renders all three and the
visitor moves between them, so `card-width` is in effect in the embed you
copy whatever is on screen here — disabling it hid a live setting. And behind
tabs, a greyed control's reason is nowhere near it; it was buried in a hint
("Cards layout only"). The scope is declared in the markup as `data-views`
and read generically, so a control added to one of these groups is covered
without a matching edit in `updateControlAvailability()`.

**Appearance was four groups wearing one name** — typography, box, calendar
density and footer, twelve controls deep. It is now `layout`, then
typography/box, then a group per view, then Footer.

Two layout fixes found while verifying this in a browser, neither caused by
it:

- The preview panel overflowed its own column and scrolled the whole page
  sideways: a grid item's `min-width` is `auto`, so the panel was sized by
  the calendar's min-content.
- Fixing that squeezed the widget under 600px of container, where it
  degrades the month grid to a list — the calendar in the headline screenshot
  was never a calendar. The preview column is now the wide one
  (0.78fr/1.22fr), and the breakpoint drops 58rem → 52rem so a 1024px tablet
  keeps two columns instead of putting the preview below a 25-control form.

Verified in Chrome at 1440x900: no horizontal scroll, the month grid renders
as a grid, and clicking List inside the widget still drives the select, the
snippet's `layout` and the dimming together.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
)

Eighteen hints in the two controls columns were documents, not captions —
the four longest ran 199, 189, 99 and 88 words, about 575 words of reference
material sitting between a visitor and the next input. They move into
`popover`s reached from an icon beside the label.

The threshold is 20 words, and it matters in both directions: "Optional base
font-size for the widget" stays where it is. A form where every field is an
opaque label with a mystery icon is the opposite failure, and reaching for
the icon to read six words is worse than reading them.

Popovers, not modals, because these are read *while* editing a value: a modal
steals focus, covers the preview, and has to be dismissed before you can
type. Anchored placement is explicit about its fallbacks rather than using
`flip-*` — flipping inline from a control near the left edge slams the box
against the viewport edge, where it reads as floating chrome rather than as
this control's help — and `position-try-order: most-block-size` picks the
side with the room instead of the first that technically fits.

Each control now names its popover in `aria-describedby`. The prose was
adjacent text before, associated with its control only by proximity, so this
is a gain rather than a hedge: a description on a hidden element is still
used to compute the accessible description.

Verified in Chrome: the popover lands against its own control, scrolls
internally for the longest hints, and leaves the preview readable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…nce (#199)

"Where do the Calendar and RSS links come from" was spread over three
controls in two groups: a closed "Do you host your own ICS or RSS?" group,
and a `convert` checkbox pair under Behavior whose "untick both" meant the
same thing as "no links at all". One question, one radio — Generated from
your OTE feed / You host your own / No calendar or RSS links — with the two
URL fields revealed only by the middle option.

Hiding them also makes them stop counting: a value left in `feed-ics` under
`generated` no longer outranks the generated feed from an input nobody can
see. Verified in Chrome across all three states, including that returning to
`generated` drops `feed-ics` from the snippet *and* from the live element.

`convert="ics"` alone — generate the calendar but not the feed — is no longer
reachable from the form. `show` already drops a whole group, which is what
anyone reaching for that was after; the attribute itself is unchanged.

`show`'s nine flat checkboxes are grouped as Calendar / RSS / OTE feed, the
way the widget renders them, so unticking one and looking at the preview is
one mapping instead of nine. The tokens stay raw: the audience edits JSON and
runs workflows (see the root CLAUDE.md).

One correctness fix in the badge this surfaced: a control inside a group the
form has switched off contributes nothing to the snippet, so it must
contribute nothing to the count — while a panel that is merely the closed tab
must still count, or the badge reads zero exactly when it is needed. Both
directions are tested.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Twenty-five controls across four tabs are a poor way to find out what the
widget can do: every setting is a small change and nothing in the page shows
the range. Four presets — Sidebar list, Cards grid, Compact calendar, No
chrome — change the preview and the snippet together and visibly.

A preset resets to defaults before it applies, so two in a row cannot compose
into a third configuration nobody chose, and a preset states a whole checkbox
group rather than adding to whatever was ticked. `resetToDefaults()` reads
the same DOM defaults the badge counts against, so "changed" and "what it
changes back to" cannot disagree. The Reset button is that function on its
own.

The buttons are rendered from the preset list rather than written out in the
HTML: one list, so a preset cannot be added with no button or a button left
pointing at nothing.

**Fixes a pre-existing bug this made visible.** The form shipped
`group-events`'s checkboxes ticked while `parseGroupEvents()` treats the
absent attribute as a deliberate no-op (opt-in behaviour, pinned consumer —
see this app's CLAUDE.md). So every snippet the playground handed out, from
an untouched form, turned on grouping the visitor never asked for — directly
beside a hint reading "Off by default". The boxes now ship unticked; present
on `main` since the attribute landed.

Tests: `test/playground-page.test.ts` parses the real `index.html` and
guards the structure this series introduced — every panel starts at its
default, every info button resolves to a popover and every popover has an
invoker, every tablist has exactly one selected tab with the rest out of the
tab order, and every preset names selectors that exist and actually moves the
form. That last one is the real failure mode of selector-driven config: a
renamed control makes a preset silently do nothing. Re-ticking `group-events`
in the markup fails the suite.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…d rework (#199)

Below 52rem the preview moves above the controls. The page exists to show the
widget; a 25-control form above it puts the thing you came to see below the
fold on exactly the screens with the least of it.

The changelog entry records that `ote-events.js` and `ote-subscribe.js` build
byte-identical to the previous commit — this series is the page's own markup,
so there is no version bump.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
"START FROM" spent a line on a heading for four self-evident buttons, and
`margin-left: auto` put Reset on a second row of its own as soon as the
presets wrapped — which at this column width they always do.

Both go. Reset trails the presets in the same flow and is borderless: it
undoes rather than chooses, so it should not read as a fifth preset.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The comments and the changelog entry cited #192, which is a closed Dependabot
PR bumping @event-calendar/core — the number was never checked against the
tracker. The rework's issue is #199.

The commit messages on this branch were rewritten for the same reason. The
one reference left pointing at #192 is the correct one: the changelog line
about the library bump failing the build, which really is that PR.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@hhkaos
hhkaos force-pushed the redesign/playground-tabs-and-chrome branch from d032a1d to 46ea11b Compare November 26, 2026 19:50
@hhkaos hhkaos changed the title Playground: tabs, presets, and help that is not in the way (#192) Playground: tabs, presets, and help that is not in the way (#199) Nov 26, 2026
@hhkaos
hhkaos merged commit 6582383 into main Nov 26, 2026
1 check passed
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: the controls have outgrown their shape — accordions, buried help, and a second view switcher

1 participant