Skip to content

feat(chat): preview the chat in the real sources from the panel - #335

Merged
egdev6 merged 3 commits into
mainfrom
feat/chat-preview-in-sources
Nov 25, 2026
Merged

egdev6 merged 3 commits into
mainfrom
feat/chat-preview-in-sources

Conversation

@egdev6

@egdev6 egdev6 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #334. Widgets › Chat gets «Simular mensajes en Meld»: every real chat source (default chat, variants and custom overlay slots) plays the same sample messages as the panel preview for 120 s, with a countdown in the button, then shows its real messages again.

  • src/chat-preview.mjs: ephemeral state (never persisted) with an auto-off timer, broadcast as the new ephemeral event chatPreview { on, until } to widget and panel clients, and sent on connect so a source loaded mid-preview joins it.
  • POST /api/chat/preview { on, seconds? } (1–600, default 120) and GET /api/chat/preview; invalid requests return 400 and change nothing. /api/chat/simulate is not reused because it writes the chat history.
  • public/widgets/chat.html: runtime switch between the real chat and the demo stream; keeps a buffer of real messages (also those received during the preview) to restore them.
  • Panel button in ChatWidget.tsx; live.ts registers chatPreview.
  • MCP vista_previa_chat; README and docs/estado.md.

Validation

  • Focused checks passed: new test/chat-preview.test.mjs (defaults, SSE frames, late source joins, auto-off, invalid requests unchanged, no chat history) and test/chat-preview-browser.test.mjs (a real source plays the demo and restores its real messages; the panel button starts and stops it with the countdown) — RED before, GREEN after. test/events-contract.test.mjs, all test/chat*.test.mjs, routes-chat (route list updated).
  • Full suite: 3343 pass; the only other failure, interview-rounds-browser, passes alone (flaky under load, unrelated).
  • Documentation and configuration are updated when needed.

Linked issue

Closes #334

Widgets › Chat gets «Simular mensajes en Meld»: every real chat source (default, variants, custom overlay slots) plays the panel preview's sample messages for 120 s, then restores its real messages. Ephemeral server state (src/chat-preview.mjs) broadcast as the chatPreview event, also on connect; nothing is written to the chat, history or metrics. POST/GET /api/chat/preview and MCP vista_previa_chat.
@egdev6 egdev6 added the type:feature New feature or enhancement label Nov 24, 2026
@egdev6 egdev6 self-assigned this Nov 24, 2026
egdev6 and others added 2 commits November 24, 2026 23:14
@egdev6
egdev6 merged commit 866ea22 into main Nov 25, 2026
5 checks passed
@egdev6
egdev6 deleted the feat/chat-preview-in-sources branch November 25, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simular mensajes de chat en las fuentes de Meld desde el panel

1 participant