Skip to content

Richer <ote-events> cards, a fields attribute, and a calendar layout - #29

Merged
hhkaos merged 1 commit into
mainfrom
embed-richer-fields-calendar
Aug 7, 2026
Merged

Richer <ote-events> cards, a fields attribute, and a calendar layout#29
hhkaos merged 1 commit into
mainfrom
embed-richer-fields-calendar

Conversation

@hhkaos

@hhkaos hhkaos commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #28 (merged). While testing the MVP locally, a few gaps and one real bug came up:

  • Bug fix: :host painted its own background (--ote-bg), so the widget showed an opaque box behind its content instead of blending into the host page — very visible in dark mode. :host is now transparent by default; only individual .event/.message surfaces keep a background.
  • More visual fields: packages/preview-feed's PreviewEvent now carries image, price (cheapest priced offer), organizerName, tags, and attendanceMode — parsed from a JSON feed's image/offers/organizers, previously dropped entirely or buried in a generic details[] bag.
  • A fields attribute so a site can choose exactly which of these render (fields="price,tags" — a full allow-list override, not a merge, over the default image,when,location,attendance,description).
  • layout="calendar", lazy-loaded via its own esbuild entry point (dist/calendar-layout.js, never statically imported by main.ts) so it costs nothing for consumers who don't use it. Built on @event-calendar/core rather than the FullCalendar apps/preview already uses — FullCalendar injects its CSS into document.head, which never reaches into a Shadow DOM at all, while @event-calendar/core ships an importable stylesheet this widget captures and injects into its own shadow root. Confirmed end-to-end in Chrome: month grid renders, is fully styled, navigates, and events are clickable. Core+DayGrid comes out to ~44KB gzip, fetched only when layout="calendar" is actually requested (dist/ote-events.js itself only grew from ~7KB to ~11KB).
  • Playground updated: a fields checkbox group (mirroring DEFAULT_FIELDS) and a calendar option in the layout select, both wired into the generated copy-paste snippet the same way show-past already was (omitted when it matches the default).

Test plan

  • pnpm build && pnpm test && pnpm typecheck && pnpm lint — all green across the whole workspace
  • Manual pass in Chrome against a synthetic feed covering every new field (image as both bare-string and {url,alt} form, multiple offers, zero-price offer, organizers, tags, all three attendance modes):
    • Cards and list layouts render image/price/tags/organizer/attendance correctly, respecting field-presence and the fields= override
    • Dark theme: confirmed the area behind/between cards is now transparent (page background shows through), not painted dark
    • A broken image URL disappears cleanly (no broken-image icon) — also unit-tested
    • layout="calendar": month grid renders styled inside the Shadow DOM, next/prev navigation works, clicking an event with no link is a safe no-op
  • Clicking a calendar event with a link (opens in a new tab) wasn't manually re-verified this pass — same window.open(url, "_blank", "noopener") pattern already used elsewhere in the codebase, low risk

Closes no issue on its own (an enhancement pass on top of #27's MVP) — flagging back on #27 for visibility.

https://claude.ai/code/session_011dPq4KUvwFaPbSUmYXBGae

…ayout

Fixes a real bug found while dogfooding the MVP: :host painted its own
background, so the widget showed an opaque box (very visible in dark mode)
instead of blending into the host page. :host is now transparent by
default; only individual event/message surfaces keep their background.

Extends the shared PreviewEvent model (packages/preview-feed) to parse
image, offers (price), organizers, tags, and attendanceMode from a JSON
feed — previously dropped or buried in a generic details[] bag. The widget
renders all of these, gated by a new `fields` attribute (a full allow-list
override, not a merge) so a site can pick exactly what shows.

Adds layout="calendar", lazy-loaded via a dedicated esbuild entry point
(dist/calendar-layout.js, never statically imported by main.ts) so it costs
nothing for consumers who don't use it. Built on @event-calendar/core
rather than the FullCalendar apps/preview already uses: FullCalendar
injects its CSS into document.head, which never reaches into a Shadow DOM,
while @event-calendar/core ships an importable stylesheet this widget can
inject into its own shadow root — confirmed end-to-end in Chrome. Core+DayGrid
compiles to ~44KB gzip, only fetched when layout="calendar" is requested.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011dPq4KUvwFaPbSUmYXBGae
@hhkaos
hhkaos merged commit ffbaf6c into main Aug 7, 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.

1 participant