From b298831a138a8abb8aefe1c995e815aa3dfe1b97 Mon Sep 17 00:00:00 2001 From: egdev6 <18334564+egdev6@users.noreply.github.com> Date: Wed, 25 Nov 2026 10:39:15 +0100 Subject: [PATCH 1/3] feat(widgets): give the ticker its own support types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ticker now keeps its own event types (widgets.ticker.items) and falls back to the «Últimos» types until they are chosen, so existing setups do not change. All seven support types offered in the panel and MCP (follow, sub, cheer, raid, superchat, member, any) are now valid for both widgets. Before, raid, member and any were saved through /api/widgets but reset on the next load and rejected by /api/config and saved themes. PUT /api/widgets validates only these new fields and keeps its legacy partial validation for the rest. --- README.es.md | 2 + README.md | 2 + public/widgets/ticker.html | 4 +- src/config-schema.mjs | 7 +++- src/mcp.mjs | 2 +- src/routes/widgets.mjs | 6 +++ test/groups.json | 1 + test/latest-ticker-types.test.mjs | 65 ++++++++++++++++++++++++++++++ test/ticker-types-browser.test.mjs | 11 ++++- 9 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 test/latest-ticker-types.test.mjs diff --git a/README.es.md b/README.es.md index 2b8cb32..5eab8a0 100644 --- a/README.es.md +++ b/README.es.md @@ -168,6 +168,8 @@ En el panel, la página «Fuentes del programa de emisión» lista todas con su | Agradecimientos | `http://127.0.0.1:4500/widget/thanks` | 900×200 | | Entrevista | `http://127.0.0.1:4500/widget/interview` | 1920×1080 | +**Últimos y ticker.** «Últimos» muestra el último apoyo de cada tipo marcado (seguidor, sub, bits, raid, Super Chat, miembro o cualquier evento). El ticker, en cambio, recorre los eventos más recientes de sus tipos, así que pueden salir varias subs seguidas. Usa los tipos de «Últimos» hasta que eliges los suyos (`widgets.ticker.items`, mismos valores). + **Entrevista.** Capa a pantalla completa para el ítem activo y aprobado de la entrevista activa (ver `docs/entrevista-formato.md`): la pregunta en una tarjeta inferior sobre su imagen, vídeo local, reproductor de YouTube (desde el minuto guardado) o tarjeta de post, con la fuente en cada ítem que lleve media. Sin ítem activo la capa queda vacía. En **Widgets › Se manejan en directo › Entrevista** creas o importas entrevistas, editas y ordenas rondas y preguntas y pulsas **Guardar** para aplicar el borrador. La cabecera del detalle elige o para la entrevista activa y controla la capa; el dock también permite pararla sin borrarla. `POST /api/interviews/stop` hace lo mismo y se puede repetir sin riesgo. En **Capa** están la URL y la vista previa de ejemplo. Las notas privadas nunca salen en la capa. Pruébala con `?demo`. **Agradecimientos sin conexión.** Esta capa muestra un seguidor pendiente cada vez y puede terminar con el recuento anónimo de YouTube. En Widgets › Agradecimientos eliges plataformas, todo el tiempo / desde el último directo archivado / un número de días, máximo de nombres e intervalo. Las fechas desconocidas se incluyen; si no hay directos archivados, la ventana desde el último no tiene corte. Sin pendientes la capa queda transparente. Las acciones individuales y en bloque con confirmación se aplican al momento; el bloque marca solo los nombres y registros anónimos seleccionados con los ajustes guardados, no los demás pendientes. diff --git a/README.md b/README.md index 4af5f4f..fda8bf4 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,8 @@ 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 | +**Latest and ticker.** «Latest» shows the last supporter of each selected type (follower, sub, bits, raid, Super Chat, member or any event). The ticker scrolls the most recent events of its types instead, so several subs can appear at once. It uses the «Latest» types until you pick its own (`widgets.ticker.items`, same values). + **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`. diff --git a/public/widgets/ticker.html b/public/widgets/ticker.html index 4c40fd2..a872ce8 100644 --- a/public/widgets/ticker.html +++ b/public/widgets/ticker.html @@ -30,8 +30,8 @@ const cfg = s.widgets?.ticker || {}; setCss(cfg.css); document.getElementById('label').textContent = cfg.label || 'Gracias a'; - // Same event types as the «Últimos» block (widgets.latest.items); the groups mirror session.latest(). - const kinds = s.widgets?.latest?.items || ['follow', 'sub', 'cheer', 'superchat']; + // Own event types (widgets.ticker.items); without them, the «Últimos» types. The groups mirror session.latest(). + const kinds = cfg.items || s.widgets?.latest?.items || ['follow', 'sub', 'cheer', 'superchat']; const types = kinds.includes('any') ? null : new Set(kinds.flatMap(k => LATEST_TYPES[k] || [])); const items = (s.recent || []).filter(e => !types || types.has(e.type)).slice(0, Number(cfg.count) || 15); const html = items.length diff --git a/src/config-schema.mjs b/src/config-schema.mjs index 8603e5d..fa8ce43 100644 --- a/src/config-schema.mjs +++ b/src/config-schema.mjs @@ -34,6 +34,8 @@ const str = { kind: 'str' }; const bool = { kind: 'bool' }; const en = values => ({ kind: 'enum', values }); const arrStr = values => ({ kind: 'arrStr', values }); +// Support types offered by «Últimos» and the ticker (the groups mirror session.latest()). +const SUPPORT_TYPES = ['follow', 'sub', 'cheer', 'raid', 'superchat', 'member', 'any']; const list = (item, o = {}) => ({ kind: 'list', item, ...o }); // lista de objetos con esquema por elemento // Objetivos por plataforma (#128): cada objetivo es una caja con barras. La métrica válida @@ -301,8 +303,9 @@ export const CONFIG_SCHEMA = { chat: CHAT_FIELDS, chatVariants: CHAT_VARIANTS, goals: list(GOAL_BOX), - latest: { items: arrStr(['follow', 'sub', 'cheer', 'superchat']), css: str }, - ticker: { label: str, count: num({ int: true, min: 1, max: 100 }), speed: num({ int: true, min: 10, max: 500 }), css: str }, + latest: { items: arrStr(SUPPORT_TYPES), css: str }, + // items is optional: without it the ticker shows the «Últimos» types. + ticker: { label: str, items: arrStr(SUPPORT_TYPES), count: num({ int: true, min: 1, max: 100 }), speed: num({ int: true, min: 10, max: 500 }), css: str }, credits: { title: str, subtitle: str, speed: num({ int: true, min: 10, max: 500 }), css: str }, viewers: { platforms: arrStr(['twitch', 'youtube']), showTotal: bool, showPeak: bool, css: str }, thanks: THANKS_FIELDS, diff --git a/src/mcp.mjs b/src/mcp.mjs index 979e786..14d4885 100644 --- a/src/mcp.mjs +++ b/src/mcp.mjs @@ -308,7 +308,7 @@ tool('ver_widgets', 'Configuración y datos de los widgets (chat y sus variantes const chatVariantes = (w.widgets.chatVariants || []).map(v => ({ id: v.id, nombre: v.name, url: b + '/widget/chat?variant=' + enc(v.id) })); return { urls: { chat: b + '/widget/chat', objetivo: b + '/widget/goal?id=', ultimos: b + '/widget/latest', ticker: b + '/widget/ticker', creditos: b + '/widget/credits', espectadores: b + '/widget/viewers', agradecimientos: b + '/widget/thanks', mensajesEnPantalla: b + '/widget/rotator', chatVariantes }, config: w.widgets, objetivos: w.goals, totales: w.totals, ultimos: w.latest }; }); -tool('editar_widget', 'Edita un widget. chat: platforms, maxMessages, fadeAfterSec, fontSize, hideCommands, hideOwner, showPlatform, reverse, animIn, animOut, layout (vertical|horizontal), css · latest: items (follow, sub, cheer, raid, superchat, member, any), css · ticker: label, count, speed, css (muestra los mismos tipos que latest.items) · credits: title, subtitle, speed, css · viewers: platforms (twitch, youtube), showTotal, showPeak, css · thanks: title, platforms (twitch, youtube), window (all|lastStream|days), days, maxNames, intervalSec, showAnonymous, css · rotator (mensajes en pantalla, distintos de los mensajes programados del chat): label, messages ([{ id, text }] en orden; la lista se reemplaza entera), intervalSec (5–3600, de un mensaje al siguiente), durationSec (segundos visibles, como mucho el intervalo), order (sequential|random: aleatorio sin repetir el mismo dos veces seguidas), css.', +tool('editar_widget', 'Edita un widget. chat: platforms, maxMessages, fadeAfterSec, fontSize, hideCommands, hideOwner, showPlatform, reverse, animIn, animOut, layout (vertical|horizontal), css · latest: items (follow, sub, cheer, raid, superchat, member, any), css · ticker: label, items (follow, sub, cheer, raid, superchat, member, any; sin items usa los de latest), count, speed, css · credits: title, subtitle, speed, css · viewers: platforms (twitch, youtube), showTotal, showPeak, css · thanks: title, platforms (twitch, youtube), window (all|lastStream|days), days, maxNames, intervalSec, showAnonymous, css · rotator (mensajes en pantalla, distintos de los mensajes programados del chat): label, messages ([{ id, text }] en orden; la lista se reemplaza entera), intervalSec (5–3600, de un mensaje al siguiente), durationSec (segundos visibles, como mucho el intervalo), order (sequential|random: aleatorio sin repetir el mismo dos veces seguidas), css.', { widget: S.enum('Widget', ['chat', 'latest', 'ticker', 'credits', 'viewers', 'thanks', 'rotator']), cambios: S.obj('Campos a cambiar') }, ({ widget, cambios }) => put('/api/widgets', { [widget]: cambios }), ['widget', 'cambios']); tool('editar_variante_chat', 'Edita una variante del chat (ids en ver_widgets › chatVariantes; el chat predeterminado se edita con editar_widget). Cambia solo lo que pases: name, platforms, maxMessages, fadeAfterSec, fontSize, hideCommands, hideOwner, showPlatform, reverse, animIn, animOut, layout (vertical|horizontal), css. El id no cambia. Con layout horizontal, el css no debe fijar tamaño, posición, padding ni máscara de .root, ni flex, tamaño o letra de .msg: el widget ajusta la fila solo.', { id: S.str('Id de la variante'), cambios: S.obj('Campos a cambiar') }, ({ id, cambios }) => put('/api/widgets/chat/variants/' + enc(id), cambios), ['id', 'cambios']); diff --git a/src/routes/widgets.mjs b/src/routes/widgets.mjs index 1f6bc90..1b8cbb4 100644 --- a/src/routes/widgets.mjs +++ b/src/routes/widgets.mjs @@ -12,6 +12,12 @@ export function registerWidgetRoutes({ route, store, engine }) { const [error] = validatePath('widgets.chat.layout', patch.chat.layout ?? false); if (error) throw httpError(400, error.message); } + // Support types are new fields: validate only them, keep the legacy merge for the rest. + for (const [name, field] of [['latest', 'items'], ['ticker', 'items']]) { + if (!patch[name] || typeof patch[name] !== 'object' || !Object.hasOwn(patch[name], field)) continue; + const [error] = validatePath(`widgets.${name}.${field}`, patch[name][field]); + if (error) throw httpError(400, error.message); + } if (Object.hasOwn(patch, 'thanks')) { const [error] = validatePath('widgets.thanks', patch.thanks); if (error) throw httpError(400, error.message); diff --git a/test/groups.json b/test/groups.json index e116699..18dd92b 100644 --- a/test/groups.json +++ b/test/groups.json @@ -48,6 +48,7 @@ "test/interviews-mcp.test.mjs", "test/interviews.test.mjs", "test/lan-key.test.mjs", + "test/latest-ticker-types.test.mjs", "test/legacy-retirement.test.mjs", "test/live-load-race.test.mjs", "test/meld-autosession-drain.test.mjs", diff --git a/test/latest-ticker-types.test.mjs b/test/latest-ticker-types.test.mjs new file mode 100644 index 0000000..97d1ec3 --- /dev/null +++ b/test/latest-ticker-types.test.mjs @@ -0,0 +1,65 @@ +// «Últimos» and the ticker accept every support type, and the ticker keeps its own selection. +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { mkdtemp, rm } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; +import path from 'node:path'; +import { createApp } from '../src/server.mjs'; + +const ALL = ['follow', 'sub', 'cheer', 'raid', 'superchat', 'member', 'any']; + +async function start(dataDir) { + const app = await createApp({ dataDir, mediaDir: path.join(dataDir, 'media'), log: () => {} }); + await new Promise(r => app.server.listen(0, '127.0.0.1', r)); + const base = `http://127.0.0.1:${app.server.address().port}`; + const call = async (method, url, body) => { + const r = await fetch(base + url, { method, headers: { 'content-type': 'application/json' }, body: body && JSON.stringify(body) }); + return { status: r.status, body: await r.json() }; + }; + const get = async p => (await call('GET', '/api/config?path=' + p)).body.value; + const stop = () => new Promise(r => { app.viewers.stop(); app.meld.stop(); app.server.closeAllConnections(); app.server.close(r); }); + return { call, get, stop }; +} + +test('every support type offered for «Últimos» is saved, survives a restart and passes the config API', async t => { + const dataDir = await mkdtemp(path.join(tmpdir(), 'antena-latest-types-')); + t.after(() => rm(dataDir, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 })); + let app = await start(dataDir); + try { + assert.equal((await app.call('PUT', '/api/widgets', { latest: { items: ALL } })).status, 200); + assert.deepEqual(await app.get('widgets.latest.items'), ALL); + const viaConfig = await app.call('PUT', '/api/config', { widgets: { latest: { items: ['raid', 'member', 'any'] } } }); + assert.equal(viaConfig.status, 200, JSON.stringify(viaConfig.body)); + assert.deepEqual(await app.get('widgets.latest.items'), ['raid', 'member', 'any']); + } finally { await app.stop(); } + app = await start(dataDir); + try { + assert.deepEqual(await app.get('widgets.latest.items'), ['raid', 'member', 'any'], 'the selection is not reset on load'); + } finally { await app.stop(); } +}); + +test('the ticker keeps its own types, starts without them and rejects unknown ones', async t => { + const dataDir = await mkdtemp(path.join(tmpdir(), 'antena-ticker-own-types-')); + t.after(() => rm(dataDir, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 })); + let app = await start(dataDir); + try { + assert.equal(await app.get('widgets.ticker.items'), undefined, 'no own selection by default: it follows «Últimos»'); + assert.equal((await app.call('PUT', '/api/widgets', { ticker: { items: ['cheer', 'raid'] } })).status, 200); + assert.equal((await app.call('PUT', '/api/widgets', { latest: { items: ['follow'] } })).status, 200); + assert.deepEqual(await app.get('widgets.ticker.items'), ['cheer', 'raid'], 'editing «Últimos» leaves the ticker alone'); + + const badTicker = await app.call('PUT', '/api/widgets', { ticker: { items: ['cheer', 'nope'] } }); + assert.equal(badTicker.status, 400); + assert.match(JSON.stringify(badTicker.body), /widgets\.ticker.*cada elemento debe ser uno de: follow, sub, cheer, raid, superchat, member, any/); + assert.deepEqual(await app.get('widgets.ticker.items'), ['cheer', 'raid'], 'a rejected ticker patch changes nothing'); + + const badLatest = await app.call('PUT', '/api/widgets', { latest: { items: ['nope'] } }); + assert.equal(badLatest.status, 400); + assert.match(JSON.stringify(badLatest.body), /widgets\.latest.*cada elemento debe ser uno de/); + assert.deepEqual(await app.get('widgets.latest.items'), ['follow'], 'a rejected «Últimos» patch changes nothing'); + } finally { await app.stop(); } + app = await start(dataDir); + try { + assert.deepEqual(await app.get('widgets.ticker.items'), ['cheer', 'raid'], 'the ticker selection survives a restart'); + } finally { await app.stop(); } +}); diff --git a/test/ticker-types-browser.test.mjs b/test/ticker-types-browser.test.mjs index 3edbc82..ec5011c 100644 --- a/test/ticker-types-browser.test.mjs +++ b/test/ticker-types-browser.test.mjs @@ -1,4 +1,4 @@ -// Ticker: it shows the same event types as the «Últimos» block (widgets.latest.items). +// Ticker: it follows the «Últimos» types (widgets.latest.items) until it has its own (widgets.ticker.items). import { test } from 'node:test'; import assert from 'node:assert/strict'; import { mkdtemp, rm } from 'node:fs/promises'; @@ -8,7 +8,7 @@ import { createApp } from '../src/server.mjs'; import { closeAll, closeChrome, findChrome, openChromePage, waitDom } from './helpers/react-browser.mjs'; import { evaluateChrome } from './helpers/chrome-dom.mjs'; -test('the ticker follows the types selected for «Últimos»', { timeout: 60000 }, async t => { +test('the ticker follows «Últimos» until it gets its own types', { timeout: 60000 }, async t => { const bin = await findChrome(); if (!bin) return t.skip('sin Chrome local'); const dataDir = await mkdtemp(path.join(tmpdir(), 'antena-ticker-types-')); @@ -34,6 +34,13 @@ test('the ticker follows the types selected for «Últimos»', { timeout: 60000 await call('PUT', '/api/widgets', { latest: { items: ['superchat'] } }); // nothing matches: the placeholder text await waitDom(c, `${users}.length === 1 && ${users}[0] === 'egdev.es'`, { timeoutMs: 8000 }); assert.deepEqual(await evaluateChrome(c, users), ['egdev.es']); + + // Own selection: the ticker stops following «Últimos». + await call('PUT', '/api/widgets', { ticker: { items: ['cheer', 'raid'] } }); + await waitDom(c, `JSON.stringify(${users}) === JSON.stringify(['u_cheer', 'u_raid'])`, { timeoutMs: 8000 }); + await call('PUT', '/api/widgets', { latest: { items: ['follow'] } }); + await new Promise(r => setTimeout(r, 600)); + assert.deepEqual(await evaluateChrome(c, users), ['u_cheer', 'u_raid']); } finally { await closeAll(() => chrome && closeChrome(chrome), () => { app.viewers.stop(); app.meld.stop(); app.server.closeAllConnections(); app.server.close(); }); } From d92646bba29ebd3cacc5a2ef245c5af42e25efe1 Mon Sep 17 00:00:00 2001 From: egdev6 <18334564+egdev6@users.noreply.github.com> Date: Wed, 25 Nov 2026 10:49:59 +0100 Subject: [PATCH 2/3] =?UTF-8?q?feat(widgets):=20split=20=C2=AB=C3=9Altimos?= =?UTF-8?q?=C2=BB=20and=20=C2=ABTicker=C2=BB=20in=20the=20panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ticker is now its own widget in Widgets, with its own source, preview and settings. Its type checkboxes start from the «Últimos» types and the first change saves its own list. «Últimos» gets an optional label (widgets.latest.label, class .label) rendered by the widget; empty shows nothing, so existing sources do not change. --- README.es.md | 2 +- README.md | 2 +- app/src/panel/Sidebar.tsx | 2 +- app/src/panel/views/Widgets.tsx | 39 +++++++----- docs/ui-patterns.md | 2 +- public/widgets/latest.html | 4 +- src/config-schema.mjs | 2 +- src/mcp.mjs | 2 +- src/routes/widgets.mjs | 4 +- src/store.mjs | 2 +- test/detail-header-browser.test.mjs | 3 +- test/groups.json | 1 + test/interview-dock-catalog-browser.test.mjs | 8 +-- test/latest-ticker-panel-browser.test.mjs | 63 ++++++++++++++++++++ test/sidebar-widgets-browser.test.mjs | 4 +- test/ui-standardize-browser.test.mjs | 7 ++- test/widget-layout-browser.test.mjs | 13 ++-- 17 files changed, 119 insertions(+), 41 deletions(-) create mode 100644 test/latest-ticker-panel-browser.test.mjs diff --git a/README.es.md b/README.es.md index 5eab8a0..cecabd4 100644 --- a/README.es.md +++ b/README.es.md @@ -168,7 +168,7 @@ En el panel, la página «Fuentes del programa de emisión» lista todas con su | Agradecimientos | `http://127.0.0.1:4500/widget/thanks` | 900×200 | | Entrevista | `http://127.0.0.1:4500/widget/interview` | 1920×1080 | -**Últimos y ticker.** «Últimos» muestra el último apoyo de cada tipo marcado (seguidor, sub, bits, raid, Super Chat, miembro o cualquier evento). El ticker, en cambio, recorre los eventos más recientes de sus tipos, así que pueden salir varias subs seguidas. Usa los tipos de «Últimos» hasta que eliges los suyos (`widgets.ticker.items`, mismos valores). +**Últimos y ticker.** Son dos widgets separados en **Widgets**. «Últimos» muestra el último apoyo de cada tipo marcado (seguidor, sub, bits, raid, Super Chat, miembro o cualquier evento), con una etiqueta opcional (`widgets.latest.label`; vacía no se muestra, clase `.label`). El ticker, en cambio, recorre los eventos más recientes de sus tipos, así que pueden salir varias subs seguidas. Usa los tipos de «Últimos» hasta que eliges los suyos (`widgets.ticker.items`, mismos valores). **Entrevista.** Capa a pantalla completa para el ítem activo y aprobado de la entrevista activa (ver `docs/entrevista-formato.md`): la pregunta en una tarjeta inferior sobre su imagen, vídeo local, reproductor de YouTube (desde el minuto guardado) o tarjeta de post, con la fuente en cada ítem que lleve media. Sin ítem activo la capa queda vacía. En **Widgets › Se manejan en directo › Entrevista** creas o importas entrevistas, editas y ordenas rondas y preguntas y pulsas **Guardar** para aplicar el borrador. La cabecera del detalle elige o para la entrevista activa y controla la capa; el dock también permite pararla sin borrarla. `POST /api/interviews/stop` hace lo mismo y se puede repetir sin riesgo. En **Capa** están la URL y la vista previa de ejemplo. Las notas privadas nunca salen en la capa. Pruébala con `?demo`. diff --git a/README.md b/README.md index fda8bf4..e19f8d8 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 | -**Latest and ticker.** «Latest» shows the last supporter of each selected type (follower, sub, bits, raid, Super Chat, member or any event). The ticker scrolls the most recent events of its types instead, so several subs can appear at once. It uses the «Latest» types until you pick its own (`widgets.ticker.items`, same values). +**Latest and ticker.** They are separate widgets in **Widgets**. «Latest» shows the last supporter of each selected type (follower, sub, bits, raid, Super Chat, member or any event), with an optional label (`widgets.latest.label`; empty shows none, class `.label`). The ticker scrolls the most recent events of its types instead, so several subs can appear at once. It uses the «Latest» types until you pick its own (`widgets.ticker.items`, same values). **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`. diff --git a/app/src/panel/Sidebar.tsx b/app/src/panel/Sidebar.tsx index 21f3e7f..431ce01 100644 --- a/app/src/panel/Sidebar.tsx +++ b/app/src/panel/Sidebar.tsx @@ -42,7 +42,7 @@ export function Sidebar({ current }: { current: string }) { const live = (t: string, label?: string) => {t}; const warns = alertWarnings(s).length; const widgetTail = I.vote && I.giveaway?.open ? live('2 activos', 'votación en curso y sorteo abierto') - : I.vote ? live('votando', 'votación en curso') : I.giveaway?.open ? live('sorteo', 'sorteo abierto') : num(12); + : I.vote ? live('votando', 'votación en curso') : I.giveaway?.open ? live('sorteo', 'sorteo abierto') : num(13); const groups: [string, string, Item[]][] = [ ['directo', 'En directo', [ { href: '#/directo', label: 'Directo', tail: s.status?.meld?.streaming ? live('●', 'en directo') : null }, diff --git a/app/src/panel/views/Widgets.tsx b/app/src/panel/views/Widgets.tsx index 3f83783..801f2bf 100644 --- a/app/src/panel/views/Widgets.tsx +++ b/app/src/panel/views/Widgets.tsx @@ -19,13 +19,15 @@ import { InterviewSettings } from './InterviewWidget'; export const origin = () => location.origin; const INFO: Record = { chat: { title: 'Chat en pantalla', path: '/widget/chat', size: '600×900', w: 600, h: 900, desc: 'El chat de Twitch y YouTube juntos, con tu estilo. Ideal para la escena de solo cámara.' }, - latest: { title: 'Últimos y ticker', path: '/widget/latest', size: '1400×200', w: 1400, h: 260, desc: 'Último seguidor, sub, bits… y una banda que recorre los últimos apoyos.' }, + latest: { title: 'Últimos', path: '/widget/latest', size: '1400×200', w: 1400, h: 260, desc: 'El último seguidor, sub, bits… de cada tipo que marques.' }, + ticker: { title: 'Ticker', path: '/widget/ticker', size: '1920×64', w: 1920, h: 120, desc: 'Una banda que recorre los apoyos más recientes de los tipos que elijas.' }, viewers: { title: 'Espectadores', path: '/widget/viewers', size: '900×160', w: 900, h: 160, desc: 'Espectadores a la vez en Twitch y YouTube, por separado y en total. Se actualiza solo mientras emites.' }, rotator: { title: 'Mensajes en pantalla', path: '/widget/rotator', size: '1200×120', w: 1200, h: 120, desc: 'Una lista de mensajes que van rotando en pantalla cada cierto tiempo, en orden o al azar. Son distintos de los mensajes programados del chat.' }, thanks: { title: 'Agradecimientos', path: '/widget/thanks', size: '900×200', w: 900, h: 200, desc: 'Agradece a quienes te siguieron mientras antena estaba cerrada.' }, interview: { title: 'Entrevista', path: '/widget/interview', size: '1920×1080', w: 1920, h: 1080, desc: 'La pregunta de la entrevista a pantalla completa, con su imagen, vídeo, YouTube o post y la fuente.' }, credits: { title: 'Créditos', path: '/widget/credits', size: '1920×1080', w: 1920, h: 1080, desc: 'Créditos finales con todos los que han apoyado en el directo.' }, }; +const SUPPORT_TYPES: [string, string][] = [['follow', 'Seguidor'], ['sub', 'Suscripción'], ['cheer', 'Bits'], ['raid', 'Raid'], ['superchat', 'Super Chat'], ['member', 'Miembro'], ['any', 'Cualquier evento']]; const q = (p: string, mode: string) => `${p}${p.includes('?') ? '&' : '?'}${mode}`; function WField({ w, f, label, type = 'text', ...rest }: { w: string; f: string; label: ReactNode; type?: string; [k: string]: unknown }) { @@ -35,8 +37,13 @@ function WField({ w, f, label, type = 'text', ...rest }: { w: string; f: string; if (type === 'css') return