From 8c0ae86c0760aa0389c813a384400da685962e95 Mon Sep 17 00:00:00 2001
From: egdev6 <18334564+egdev6@users.noreply.github.com>
Date: Wed, 25 Nov 2026 11:39:02 +0100
Subject: [PATCH 1/2] test(widgets): wait for the panel save to finish before
leaving the page
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The router blocks navigation while a save is in flight (confirmLeave
returns false during isSaving), and both save-bar buttons are disabled
while saving, so waiting for them was racy under full-suite load. Wait
for the save-bar status «Todo guardado» instead.
---
test/latest-ticker-panel-browser.test.mjs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/test/latest-ticker-panel-browser.test.mjs b/test/latest-ticker-panel-browser.test.mjs
index 01fa394..3f1918b 100644
--- a/test/latest-ticker-panel-browser.test.mjs
+++ b/test/latest-ticker-panel-browser.test.mjs
@@ -39,7 +39,9 @@ test('the ticker is its own widget and «Últimos» shows its own label', { time
await waitDom(c, `!!(${save})`, { timeoutMs: 5000 });
await ev(`${save}.click(); true`);
await until(async () => JSON.stringify((await widgets()).ticker?.items) === JSON.stringify(['follow', 'sub', 'cheer']), 'the ticker types were not saved');
- await waitDom(c, `!(${save})`, { timeoutMs: 8000 }); // the panel has no pending changes before leaving the page
+ // The router blocks leaving while a save is in flight: wait until the panel itself finished saving.
+ // (both buttons are disabled while saving too, so wait for the save bar status itself)
+ await waitDom(c, `document.querySelector('.lv-dirty')?.textContent === 'Todo guardado'`, { timeoutMs: 8000 });
assert.deepEqual((await widgets()).latest.items, ['follow', 'sub'], '«Últimos» keeps its own types');
// «Últimos» page: its own label field.
From bcd3c3825f6d81f0d9ab7ba68f2790dcdd03b295 Mon Sep 17 00:00:00 2001
From: egdev6 <18334564+egdev6@users.noreply.github.com>
Date: Wed, 25 Nov 2026 11:39:02 +0100
Subject: [PATCH 2/2] feat(widgets): add a social bar widget
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
New built-in widget «Redes sociales» (/widget/socials): an ordered list
of up to 12 profiles shown as brand icon + nick, with an optional label
and custom CSS. Platforms: Twitch, YouTube, X, Instagram, TikTok,
GitHub, Discord, Kick, LinkedIn and Web.
Icons come from Simple Icons 16.38.1 (CC0-1.0); Twitch and YouTube
reuse platform-icons.js. Nicks are rendered as text through the DOM.
The widget is listed as a browser source, usable as a custom overlay
slot and editable through MCP.
---
README.es.md | 7 +-
README.md | 14 +++-
app/src/lib/types.ts | 4 ++
app/src/panel/Sidebar.tsx | 2 +-
app/src/panel/views/Widgets.tsx | 35 +++++++++-
docs/estado.md | 1 +
public/custom/sdk.js | 2 +-
public/social-icons.js | 51 +++++++++++++++
public/widgets/socials.html | 53 +++++++++++++++
src/config-schema.mjs | 7 ++
src/custom-overlays.mjs | 2 +-
src/mcp.mjs | 8 +--
src/routes/shortcuts.mjs | 1 +
src/routes/widgets.mjs | 4 ++
src/server.mjs | 2 +-
src/store.mjs | 1 +
test/chat-variants.test.mjs | 2 +-
test/core.test.mjs | 2 +-
test/groups.json | 2 +
test/interview-dock-catalog-browser.test.mjs | 8 +--
test/routes-shortcuts.test.mjs | 2 +-
test/sidebar-widgets-browser.test.mjs | 4 +-
test/socials-widget-browser.test.mjs | 68 ++++++++++++++++++++
test/socials-widget.test.mjs | 68 ++++++++++++++++++++
test/theme.test.mjs | 2 +-
25 files changed, 328 insertions(+), 24 deletions(-)
create mode 100644 public/social-icons.js
create mode 100644 public/widgets/socials.html
create mode 100644 test/socials-widget-browser.test.mjs
create mode 100644 test/socials-widget.test.mjs
diff --git a/README.es.md b/README.es.md
index cecabd4..222cc3f 100644
--- a/README.es.md
+++ b/README.es.md
@@ -35,7 +35,7 @@ antena se queda entera en tu PC y le da a tu directo una capa completa de alerta
- **Comandos de chat** (`!engram`, `!web`…) que lanzan sus propias alertas, con permisos y esperas.
- **Mensajes programados:** textos que se publican solos en el chat cada X minutos (también como anuncio destacado) y, si quieres, salen además como alerta en pantalla.
- **Interactivos:** cola de preguntas del chat, tier list que vota el chat y sorteos con ruleta en pantalla.
-- **Widgets:** chat en pantalla (Twitch + YouTube), objetivos, últimos apoyos, ticker, espectadores en directo, agradecimientos a seguidores sin conexión y créditos finales.
+- **Widgets:** chat en pantalla (Twitch + YouTube), objetivos, últimos apoyos, ticker, espectadores en directo, agradecimientos a seguidores sin conexión, barra de redes sociales y créditos finales.
- **Overlays propios:** capas de HTML, CSS y JavaScript para una escena o para enmarcar la cámara, escritas por ti o por Claude por MCP, con datos en vivo y acciones que apruebas tú.
- **Resumen del directo:** totales, a quién dar las gracias y la cronología con el minuto de cada evento, en Markdown.
- **Seguidores sin conexión:** registra los seguidores de Twitch ganados mientras antena estaba cerrada y, en YouTube, las suscripciones públicas y un recuento anónimo; YouTube requiere conectar la cuenta.
@@ -167,9 +167,12 @@ En el panel, la página «Fuentes del programa de emisión» lista todas con su
| Espectadores | `http://127.0.0.1:4500/widget/viewers` | 900×160 |
| Agradecimientos | `http://127.0.0.1:4500/widget/thanks` | 900×200 |
| Entrevista | `http://127.0.0.1:4500/widget/interview` | 1920×1080 |
+| Redes sociales | `http://127.0.0.1:4500/widget/socials` | 1600×80 |
**Ú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).
+**Redes sociales.** En **Widgets › Redes sociales** (`/widget/socials`, 1600×80) añades, editas, quitas y ordenas hasta 12 redes (Twitch, YouTube, X, Instagram, TikTok, GitHub, Discord, Kick, LinkedIn y Web); cada una sale con el icono de su plataforma y tu nick, como texto. Las redes sin nick no se muestran y, sin redes, la capa queda vacía. Etiqueta opcional (por ejemplo «Sígueme») y CSS propio con las clases `.root`, `.label`, `.item`, `.item-`, `.ico` y `.handle`. Los iconos de marca vienen de Simple Icons (CC0); X, TikTok y GitHub van en blanco para verse sobre fondo oscuro. Los perfiles viven en `widgets.socials` y, como el resto de ajustes de widgets, viajan con los temas guardados. Se puede incrustar como hueco `socials` en overlays propios; por MCP, `editar_widget` con `widget: "socials"` (la lista se sustituye entera).
+
**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.
@@ -326,7 +329,7 @@ antena.slots.clear('chat'); // clear() borra todos sin animación
Solo cambian los huecos nombrados; los demás conservan su estado. Nombres `a-z0-9_-` (hasta 32 caracteres). Cada hueco admite `widget`, `params` opcional, `rect` (píxeles del lienzo `[x,y,w,h]` o `null`), `enter`/`exit` (`none`, `fade`, `left`, `right`, `up`, `down`; por defecto `fade`), `layer` (`above` por defecto o `below`), `fit` (`slot` por defecto o `canvas`) y `css` adicional tras el CSS propio del widget. `slot` hace que `.root` llene el rectángulo; `canvas` llena el lienzo y conserva posición y animaciones propias. Cambiar widget o parámetros recarga su página. No devuelven nada; los datos inválidos se ignoran y se avisan una vez en la consola del overlay. Por seguridad, el CSS del hueco rechaza tokens de carga de recursos (`url`, `image-set`, `image(`, `src(`, `@import`, `@namespace`, `@font-face`), escapes y comentarios: se ejecuta en una página de confianza y no debe hacer peticiones en nombre del marco aislado.
-Permitidos: `chat` (`variant`), `viewers` (`layout: 'column'`), `goal` (`id`), `latest` (`items`, `layout: 'column'`), `ticker`, `thanks`, `giveaway`, `question` (`nocount`), `tierlist` (`id`, `nopool`), `interview` (`item`), `credits` (`loop`, `transparent`), `alerts` y `custom` (`id` de otro overlay). Sin URLs arbitrarias, autoinclusión ni overlays propios dentro de otro incrustado. Máximo 12 huecos; rects finitos, ancho/alto 1–4320 y x/y dentro de ±2 dimensiones del lienzo. Las actualizaciones se agrupan por frame y limitan a 20/s. La shell incrusta estas páginas públicas sin permisos de acción y mantiene aislado el marco del usuario.
+Permitidos: `chat` (`variant`), `viewers` (`layout: 'column'`), `goal` (`id`), `latest` (`items`, `layout: 'column'`), `ticker`, `thanks`, `giveaway`, `question` (`nocount`), `tierlist` (`id`, `nopool`), `interview` (`item`), `credits` (`loop`, `transparent`), `socials`, `alerts` y `custom` (`id` de otro overlay). Sin URLs arbitrarias, autoinclusión ni overlays propios dentro de otro incrustado. Máximo 12 huecos; rects finitos, ancho/alto 1–4320 y x/y dentro de ±2 dimensiones del lienzo. Las actualizaciones se agrupan por frame y limitan a 20/s. La shell incrusta estas páginas públicas sin permisos de acción y mantiene aislado el marco del usuario.
Las alertas y entrevistas incrustadas silencian audio cuando Page Visibility indica que el overlay está oculto; el vídeo YouTube de entrevista se reinicia al volver a verse. **No se ha comprobado la visibilidad fuera de escena en Meld**: usa una sola fuente de navegador y capas Duplicator en las demás escenas para evitar audio duplicado aunque Meld no marque ocultas las fuentes.
diff --git a/README.md b/README.md
index e19f8d8..030c0df 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,7 @@ antena runs entirely on your PC and gives your stream a full alert and interacti
- **Chat commands** (`!engram`, `!web`…) that trigger their own alerts, with permissions and cooldowns.
- **Scheduled messages:** texts that post themselves to chat every X minutes (also as a highlighted announcement) and, if you want, also appear on screen as an alert.
- **Interactives:** chat question queue, a tier list the chat votes on, and giveaways with an on-screen roulette.
-- **Widgets:** on-screen chat (Twitch + YouTube), goals, latest supporters, ticker, live concurrent viewers, offline follower thank-yous, rotating on-screen messages and end credits.
+- **Widgets:** on-screen chat (Twitch + YouTube), goals, latest supporters, ticker, live concurrent viewers, offline follower thank-yous, rotating on-screen messages, a social bar and end credits.
- **Custom overlays:** HTML, CSS and JavaScript layers for a scene or to frame the camera, written by you or by Claude via MCP, with live data and actions you approve.
- **Stream recap:** totals, who to thank and a timeline with the minute of each event, in Markdown.
- **Offline followers:** records Twitch followers gained while antena was closed, and YouTube's public subscribers plus an anonymous count; YouTube requires a connected account.
@@ -168,6 +168,7 @@ In the panel, the «Fuentes del programa de emisión» page lists all of them wi
| Thank-yous | `http://127.0.0.1:4500/widget/thanks` | 900×200 |
| Interview | `http://127.0.0.1:4500/widget/interview` | 1920×1080 |
| On-screen messages | `http://127.0.0.1:4500/widget/rotator` | 1200×120 |
+| Social bar | `http://127.0.0.1:4500/widget/socials` | 1600×80 |
**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).
@@ -329,7 +330,7 @@ antena.slots.clear('chat'); // clear() removes all without animation
Only named slots change; unmentioned slots keep their state. Names use `a-z0-9_-` (up to 32 characters). Each slot has `widget`, optional `params`, `rect` (canvas pixels `[x,y,w,h]` or `null`), `enter`/`exit` (`none`, `fade`, `left`, `right`, `up`, `down`; default `fade`), `layer` (`above` by default or `below`), `fit` (`slot` by default or `canvas`) and optional extra `css` applied after the widget's own CSS. `slot` makes `.root` fill the rectangle; `canvas` fills the canvas and preserves the page's own positioning and animations. A changed widget or parameters reload its page. Calls return nothing; invalid input is ignored and reported once in the overlay console. For safety, slot CSS rejects resource-loading tokens (`url`, `image-set`, `image(`, `src(`, `@import`, `@namespace`, `@font-face`), CSS escapes and comments: it runs on a trusted same-origin page and must not make requests on the sandbox's behalf.
-Allowed: `chat` (`variant`), `viewers` (`layout: 'column'`), `goal` (`id`), `latest` (`items`, `layout: 'column'`), `ticker`, `thanks`, `giveaway`, `question` (`nocount`), `tierlist` (`id`, `nopool`), `interview` (`item`), `credits` (`loop`, `transparent`), `rotator`, `alerts` and `custom` (`id` of another overlay). No arbitrary URLs, self-embedding or custom overlays nested inside another embedded overlay. Maximum 12 slots; finite rects, width/height 1–4320 and x/y within ±2 canvas dimensions. Updates are coalesced per animation frame and limited to 20/s. The shell embeds these public pages, so no action permission is needed; it keeps the user frame sandboxed.
+Allowed: `chat` (`variant`), `viewers` (`layout: 'column'`), `goal` (`id`), `latest` (`items`, `layout: 'column'`), `ticker`, `thanks`, `giveaway`, `question` (`nocount`), `tierlist` (`id`, `nopool`), `interview` (`item`), `credits` (`loop`, `transparent`), `rotator`, `socials`, `alerts` and `custom` (`id` of another overlay). No arbitrary URLs, self-embedding or custom overlays nested inside another embedded overlay. Maximum 12 slots; finite rects, width/height 1–4320 and x/y within ±2 canvas dimensions. Updates are coalesced per animation frame and limited to 20/s. The shell embeds these public pages, so no action permission is needed; it keeps the user frame sandboxed.
Embedded alerts and interviews suppress audio while Page Visibility reports the overlay hidden; hidden YouTube interview media restarts when visible. **Meld's off-air visibility has not been verified**: use one browser source and Duplicator layers in other scenes to prevent duplicated audio even if Meld does not mark sources hidden.
@@ -384,6 +385,15 @@ The pause button also stops scheduled messages, automatic ones and «Send now».
The preview rotates every 5 s with your messages so you can check all of them. Custom overlays can embed it as the `rotator` slot. Via MCP: `editar_widget` with `widget: "rotator"`; the message list is replaced as a whole.
+### Social bar
+
+**Widgets › Redes sociales** (`/widget/socials`, 1600×80) shows your social profiles in a row: each platform's icon with your nick.
+
+- **Networks:** add, edit, remove and reorder up to 12. Platforms: Twitch, YouTube, X, Instagram, TikTok, GitHub, Discord, Kick, LinkedIn and Web. A network without a nick is not shown; with no networks the layer stays empty.
+- **Label** (for example «Sígueme»; empty hides it) and **custom CSS** with the classes `.root`, `.label`, `.item`, `.item-`, `.ico` and `.handle`.
+
+Nicks are shown as text, never as markup. The brand icons come from Simple Icons (CC0); X, TikTok and GitHub use a white glyph so they stay visible on dark backgrounds (`.item-x .ico path { fill: … }` changes it). The profiles live in `widgets.socials`, so, like the other widget settings, they travel with saved themes. Custom overlays can embed it as the `socials` slot. Via MCP: `editar_widget` with `widget: "socials"`; the list is replaced as a whole.
+
### Questions, tier list and giveaway
They live in **Widgets** and each one has its browser layer. Their state (questions, votes, participants) is saved in `data/interactive.json` and survives a restart.
diff --git a/app/src/lib/types.ts b/app/src/lib/types.ts
index d21b72a..4eb7719 100644
--- a/app/src/lib/types.ts
+++ b/app/src/lib/types.ts
@@ -186,6 +186,9 @@ export interface FollowersList extends FollowerSelection { shown: FollowerSelect
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 }
+/** Social bar profile (widgets.socials.items). */
+export interface SocialProfile { id: string; platform: string; handle: string }
+export interface SocialsConfig { label?: string; items?: SocialProfile[]; css?: string }
export interface WidgetsConfig {
goals?: GoalConfig[];
chat?: WidgetSection;
@@ -195,6 +198,7 @@ export interface WidgetsConfig {
credits?: WidgetSection;
thanks?: ThanksConfig;
rotator?: RotatorConfig;
+ socials?: SocialsConfig;
[k: string]: unknown;
}
/** Estado que consumen los widgets (engine.widgetState()). */
diff --git a/app/src/panel/Sidebar.tsx b/app/src/panel/Sidebar.tsx
index 431ce01..fb2e6de 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(13);
+ : I.vote ? live('votando', 'votación en curso') : I.giveaway?.open ? live('sorteo', 'sorteo abierto') : num(14);
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 801f2bf..9f4b916 100644
--- a/app/src/panel/views/Widgets.tsx
+++ b/app/src/panel/views/Widgets.tsx
@@ -11,8 +11,9 @@ import { useManualSave } from '../../lib/draft';
import { Box, Card, CardGroup, Dot, ListPanel, NameCell, PageHead, SaveBar, Slide, Tags } from '../../lib/layout';
import { go } from '../router';
import { useCallback, useEffect, useRef, useState, type ReactNode } from 'react';
-import type { FollowerEntry, FollowersList, GoalBar, GoalConfig, GoalValue, RotatorMessage, WidgetSection } from '../../lib/types';
+import type { FollowerEntry, FollowersList, GoalBar, GoalConfig, GoalValue, RotatorMessage, SocialProfile, WidgetSection } from '../../lib/types';
import { CHAT_ANIMS, type ChatAnim } from '../../../../public/widgets/chat-anims.js';
+import { SOCIAL_NAMES } from '../../../../public/social-icons.js';
import { ChatWidget } from './ChatWidget';
import { InterviewSettings } from './InterviewWidget';
@@ -23,6 +24,7 @@ const INFO: RecordParámetros: ?platforms=twitch · ?layout=column · ?total=0 · ?peak=1. La cifra se refresca cada «pollSec» de la alerta de récord.
>;
if (name === 'thanks') form = ;
if (name === 'rotator') form = ;
+ if (name === 'socials') form = ;
if (name === 'interview') form = ;
if (name === 'credits') form = <>