diff --git a/README.md b/README.md index 38de229..0fe4ac5 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ In the panel, the «Fuentes del programa de emisión» page lists all of them wi | Interview | `http://127.0.0.1:4500/widget/interview` | 1920×1080 | | On-screen messages | `http://127.0.0.1:4500/widget/rotator` | 1200×120 | -The ticker shows the same event types you tick for «Latest» in **Widgets › Latest and ticker** (follower, sub, bits, raid, Super Chat, member or any event), up to its «Events» count; with nothing matching it shows the placeholder text. +**Preview in your broadcast program:** in **Widgets › Chat**, «Simular mensajes en Meld» makes every real chat source (the default chat, its variants and custom overlay slots) play the same sample messages as the panel preview for 2 minutes, then return to the real chat. A source loaded during the simulation joins it. Nothing is added to the chat, the history or the metrics. API: `POST /api/chat/preview` with `{ "on": true }` (optional `"seconds"`, 1–600) or `{ "on": false }`; `GET /api/chat/preview` returns `{ on, until }`. MCP: `vista_previa_chat`. **Interview.** Fullscreen layer for the active, approved item of the active interview (see `docs/entrevista-formato.md`): the question on a card at the bottom over its image, local video, YouTube player (starting at the saved minute) or social post card, with the source shown on every item that has media. Without an active item the layer is empty. In **Widgets › Se manejan en directo › Entrevista**, create or import interviews, edit and reorder rounds and questions, and press **Guardar** to save the draft. The detail header selects or stops the active interview and controls the live layer; the dock can also stop it without deleting it. `POST /api/interviews/stop` does the same and is safe to repeat. **Capa** has its URL and demo preview. Private notes never appear on the layer. Try it with `?demo`. @@ -556,7 +556,7 @@ Claude Desktop (`claude_desktop_config.json`): | Giveaway | `estado_sorteo`, `abrir_sorteo`, `cerrar_sorteo`, `sortear`, `anadir_participante`, `quitar_participante`, `reiniciar_sorteo` | | Interactives | `estado_interactivos`, `configurar_interactivos` | | Files | `listar_archivos`, `importar_archivo` (from a path on your PC), `borrar_archivo` | -| Chat | `leer_chat`, `escribir_chat` (Twitch, YouTube or both), `simular_chat`, `unir_chat`, `youtube_conectar_cuenta`, `youtube_desconectar_cuenta` | +| Chat | `leer_chat`, `escribir_chat` (Twitch, YouTube or both), `simular_chat`, `vista_previa_chat`, `unir_chat`, `youtube_conectar_cuenta`, `youtube_desconectar_cuenta` | | Widgets | `ver_widgets`, `editar_widget`, `editar_variante_chat`, `crear_objetivo`, `editar_objetivo`, `borrar_objetivo`, `crear_barra`, `editar_barra`, `borrar_barra`, `sumar_objetivo`, `fijar_objetivo`, `sumar_barra`, `fijar_barra`, `lanzar_creditos`, `parar_creditos` | | Custom overlays | `listar_overlays`, `ver_overlay`, `crear_overlay`, `editar_overlay`, `borrar_overlay`, `probar_overlay`, `css_overlay_tema` | | Stream | `resumen_directo`, `metricas_directo`, `nuevo_directo`, `renombrar_directo`, `listar_directos`, `eventos_directo` | diff --git a/app/src/lib/live.ts b/app/src/lib/live.ts index a60b9c2..faf7dc9 100644 --- a/app/src/lib/live.ts +++ b/app/src/lib/live.ts @@ -330,6 +330,7 @@ class Live { for (const r of this.inflightRemoved) r.ids.add(id); this.update(s => ({ widgets: { ...s.widgets, chat: (s.widgets?.chat || []).filter(m => m.id !== id) } })); }); + on('chatPreview', () => {}); // views listen with live.on('chatPreview') on('chatResult', () => {}); // only partial failures arrive; the panel shows them as a toast on('chatClear', ({ login }) => { for (const r of this.inflightRemoved) r.logins.add(login || null); diff --git a/app/src/lib/types.ts b/app/src/lib/types.ts index d8aa147..fd5448a 100644 --- a/app/src/lib/types.ts +++ b/app/src/lib/types.ts @@ -183,6 +183,8 @@ export interface AnonymousFollowers { at: string | null; count: number; thanked: export interface FollowerSelection { entries: FollowerEntry[]; anonymous: AnonymousFollowers[] } export interface FollowersList extends FollowerSelection { shown: FollowerSelection } export interface ThanksSnapshot { names: { name: string; platform: Platform }[]; anonymous: number } +/** Chat preview in the real sources (GET/POST /api/chat/preview, SSE chatPreview). */ +export interface ChatPreviewState { on: boolean; until: string | null } export interface WidgetsConfig { goals?: GoalConfig[]; chat?: WidgetSection; @@ -528,6 +530,7 @@ export interface LiveEvents { chat: ChatMessage; chatDelete: { id: string }; chatResult: ChatResult; + chatPreview: ChatPreviewState; chatClear: { login: string }; timeline: Timeline; prompter: PrompterState; diff --git a/app/src/panel/views/ChatWidget.tsx b/app/src/panel/views/ChatWidget.tsx index 1d1f568..a7e82f6 100644 --- a/app/src/panel/views/ChatWidget.tsx +++ b/app/src/panel/views/ChatWidget.tsx @@ -8,7 +8,7 @@ import { horizontalCssWarnings } from '../../lib/chat-css'; import { live, useLive } from '../../lib/live'; import { ManualDraft } from '../../lib/manual-draft'; import { patchWidgets } from '../../lib/patch'; -import type { ChatVariant, WidgetSection } from '../../lib/types'; +import type { ChatPreviewState, ChatVariant, WidgetSection } from '../../lib/types'; import { BrowserSource, codeTab, confirmDelete, Panel, Stage, Switch, toast, WidgetLayout } from '../../lib/ui'; const ROUTE = '/api/widgets/chat/variants'; @@ -210,7 +210,7 @@ export function ChatWidget({ info, anims }: { info: Info; anims: Options }) { return Widgets › {info.title}} title={info.title} desc={info.desc} back="#/widgets" wide foot={}> } - preview={Datos de ejemplo} src={preview} w={dimensions.w} h={dimensions.h} />}> + preview={<>Datos de ejemplo} src={preview} w={dimensions.w} h={dimensions.h} />}>