Richer <ote-events> cards, a fields attribute, and a calendar layout - #29
Merged
Conversation
…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
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.
Summary
Follow-up to #28 (merged). While testing the MVP locally, a few gaps and one real bug came up:
:hostpainted 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.:hostis now transparent by default; only individual.event/.messagesurfaces keep a background.packages/preview-feed'sPreviewEventnow carriesimage,price(cheapest priced offer),organizerName,tags, andattendanceMode— parsed from a JSON feed'simage/offers/organizers, previously dropped entirely or buried in a genericdetails[]bag.fieldsattribute so a site can choose exactly which of these render (fields="price,tags"— a full allow-list override, not a merge, over the defaultimage,when,location,attendance,description).layout="calendar", lazy-loaded via its own esbuild entry point (dist/calendar-layout.js, never statically imported bymain.ts) so it costs nothing for consumers who don't use it. Built on@event-calendar/corerather than the FullCalendarapps/previewalready uses — FullCalendar injects its CSS intodocument.head, which never reaches into a Shadow DOM at all, while@event-calendar/coreships 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 whenlayout="calendar"is actually requested (dist/ote-events.jsitself only grew from ~7KB to ~11KB).fieldscheckbox group (mirroringDEFAULT_FIELDS) and acalendaroption in the layout select, both wired into the generated copy-paste snippet the same wayshow-pastalready was (omitted when it matches the default).Test plan
pnpm build && pnpm test && pnpm typecheck && pnpm lint— all green across the whole workspace{url,alt}form, multiple offers, zero-price offer, organizers, tags, all three attendance modes):fields=overridelayout="calendar": month grid renders styled inside the Shadow DOM,next/prevnavigation works, clicking an event with no link is a safe no-opwindow.open(url, "_blank", "noopener")pattern already used elsewhere in the codebase, low riskCloses 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