Skip to content

feat(widget): add copyable Room & Booth website embed widget - #1437

Draft
VineetRamshetty wants to merge 10 commits into
fossasia:devfrom
VineetRamshetty:feat/1436-website-widget
Draft

VineetRamshetty wants to merge 10 commits into
fossasia:devfrom
VineetRamshetty:feat/1436-website-widget

Conversation

@VineetRamshetty

Copy link
Copy Markdown
Member

Closes #1436
Depends on #1409 (split out from #1409 per review feedback; stacked on feat/1408-embed-ai-voice).

Summary

  • Database: Added nullable Room.widget_key column via migration 051_add_room_widget_key.py.
  • Owner Management: Added POST /admin/events/{event_id}/rooms/{room_id}/widget/enable (atomic conditional set; rotates only when rotate=1) and /widget/disable, allowlisted under /workspace/.../widget/*.
  • Widget Routes: Added /widget/{event_slug}/{room_id}, /widget/{event_slug}/{room_id}/{language_code}, and /widget/{event_slug}/{room_id}/session with rate-limited widget key verification and room-scoped embed JWTs (room_id).
  • UI & Snippets: Added Website widget builder to Room and Booth detail pages (widget-builder.js) generating inline <iframe> and floating corner launcher <script> (widget.js) snippets with live same-origin preview, plus in-player channel switching in embed.html / embed-player.js.
  • Tests: Added tests/test_widget.py and channel-switcher / session-refresh tests in tests/test_embed_player.js.

Validation

  • node tests/test_embed_player.js (51 passed, 0 failed)
  • node tests/test_room_ai.mjs (passed)
  • uv run ruff check . (All checks passed)
  • uv run pytest tests/test_widget.py tests/test_design_tokens.py tests/test_static_references.py -v (143 passed)

Created with Gemini in Antigravity.

…ptions

- Enforce optional room_id on embed tokens in /embed, /ws/captions, and /ws/tts (403/4003 on mismatch)
- Close /ws/tts with 4001 on expired tokens both on connect and on the 5s recheck
- Update embed-player.js to call audioScheduler.reset(), close AudioContext on stop(),
  fix WHEP stop/detached & TTS resumeInFlight races, and support headless captions-only mode
- Update embed.html/embed.css to use tokens.css and --vb-color-live
- Add room-scoping, TTS expiry, and headless captions-only tests; document /embed AI channels

Created with Gemini in Antigravity.
@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the ai-assisted PR created or assisted with an AI coding agent label Dec 1, 2026
Non-embed (user/participant) expired tokens continue closing with 4003
(WS_CLOSE_REVOKED), preserving test_existing_tts_subscriber_stops_when_token_expires.

Created with Gemini in Antigravity.
- test_build_embed_context_keys_and_fallbacks: add new widget keys
  (channels, session_url, compact, initial_channel_key) to expected set
  and assert their default values
- test_widget_*.py: add autouse setup_db fixture (init in-memory SQLite
  via configure+init_db before each test) so widget tests work in CI
  where no pre-existing database exists, mirroring test_fastapi_app.py
- test_room_ai.mjs: stub initWidgetBuilder() as a no-op in all three VM
  contexts so the room-detail.js model-filter assertions reach correctly

Created with Gemini in Antigravity.
- Scope widget embed tokens to room_id and enforce room_id in /ws/captions & /ws/tts
- Preserve existing widget_key on enable unless rotate=1; filter widget_channels to resolvable embed channels
- Only expose floor widget channel when a floor audio producer or captions exist
- Fix embed-player.js WHEP stop/detached state, TTS reorder grace & resume/pause race, mutable audioController, playBtn handler, and openCaptionWs scope
- Use --vb-color-live design token in embed.css, load tokens.css in embed.html, and load booth-detail.js for coordinators with widget_key
- Tighten widget.js hex color regex and avoid logging raw URLs on parse error
- Document AI Voice and AI Captions embed usage and update tests

Created with Gemini in Antigravity.
… and clarify AI Voice docs

Created with Gemini in Antigravity.
@VineetRamshetty
VineetRamshetty force-pushed the feat/1436-website-widget branch from 62aefa9 to 7e6532a Compare December 1, 2026 03:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted PR created or assisted with an AI coding agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(widget): add copyable Room & Booth website embed widget

1 participant