Skip to content

feat(custom-overlays): settings fields for custom widgets and «Personalizados» - #347

Merged
egdev6 merged 4 commits into
mainfrom
feat/custom-widget-fields
Nov 25, 2026
Merged

egdev6 merged 4 commits into
mainfrom
feat/custom-widget-fields

Conversation

@egdev6

@egdev6 egdev6 commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Summary

Custom overlays can declare settings fields and work as custom widgets: the panel renders a form, the sandboxed page reads the values, and agents create everything through MCP without a new release. The panel section is renamed «Personalizados».

  • Fields (up to 30): text, number (min/max/step), toggle, select (options), color, list and media (an Antena file). Values are validated per type in every write path (API, /api/config, /api/config/set, import).
  • SDK: antena.settings and antena.on('settings', fn); media values arrive as absolute /media/<file> URLs built by the shell from a validated file name.
  • Live: changing values does not version the overlay; the new customOverlaySettings event pushes them to open layers. Changing fields reloads the layer and keeps the values whose key still exists and fits (owner decision). A value identical to the stored one is "carried" and follows that rule; a new value stays strict.
  • Permissions and themes: fields/values never require approving actions again; values travel with config export, not saved themes.
  • MCP: campos and valores in crear_overlay / editar_overlay.
  • Panel: «Valores» form generated from the fields, «Campos» tab (JSON; invalid JSON is flagged and never saved), values changed by the agent reach an open editor.
  • Rename: only visible labels. /custom/<id>, /api/custom-overlays, MCP tool names and the custom(id) slot are unchanged.

Pre-existing bug fixed (in the first commit): after a frame reload (saving the code), the shell never sent ready again, so antena.ready never resolved in the reloaded page.

Size: about 790 authored lines in 4 commits; the owner chose a single PR. Review commit by commit: server/SDK/MCP → panel → S3 fix → regression test.

Validation

  • Focused checks passed: new custom-overlay-settings (API, SSE events, permissions, config replace vs merge, media names), -sdk (vm), -browser (real sandboxed page: settings before ready, live value without reload, reload on fields change, ready after reload), -panel-browser, MCP test; contract tests updated for the new key/event (SDK state, overlay record, SSE/WebSocket initial frames). RED observed for server, SDK, MCP, the ready fix and the S3 fix; the panel test was written after the code.
  • Full suite: 3383 tests, 3381 pass, 0 fail, 2 skipped. pnpm typecheck passes. (One earlier run had a chat-preview-browser countdown failure that passed 3/3 alone; unrelated area.)
  • Independent verification (Risk: sandbox boundary and shared write paths): security (hostile names/values, media URL confinement, message isolation), permissions, versioning, ready fix, snapshot event and rename PASS. One blocker (drop rule rejected carried values on /api/config/set, PUT /api/config and mixed panel drafts) fixed in 6caad29; the single re-verification confirmed it with no regressions. Its probes are regression tests.
  • Documentation and configuration are updated when needed: README.md / README.es.md (SDK table, «Settings fields» section, «Personalizados»), docs/themes.md, SDK header docs, MCP help.

Linked issue

Closes #344

Custom overlays can declare settings fields (text, number, toggle,
select, color, list, media; up to 30) and store values validated per
type in every write path (API, generic config and import). The page
reads them as antena.settings / antena.on('settings'). Media values are
file names that the shell turns into absolute /media URLs.

Changing values does not version the overlay: the new
customOverlaySettings event pushes them to open layers live. Changing
the fields reloads the layer and keeps the values whose key still
exists and fits. Fields and values never require approving the actions
again, and they stay out of saved themes. MCP: campos and valores.

Also fixes the shell not sending ready again after the frame reloads
(saving the code or changing fields), so antena.ready never resolved in
the reloaded page.
…lizados»

The overlay editor shows a «Valores» form generated from the declared
fields (one control per type, «Por defecto» to clear a value) and a
«Campos» tab to edit the fields as JSON; invalid JSON is flagged and
never saved. Values changed by the agent reach an open editor even
though they do not version the overlay.

The panel section is now «Personalizados». Only the visible name
changes: /custom/<id>, /api/custom-overlays, MCP tools and the
custom(id) slot keep their names.
…write path

The owner rule «keep matching values, drop the rest» only applied to an
update that carried fields alone. /api/config/set, PUT /api/config and
a panel draft that also sent the stored values got a 400 instead.

A value identical to the stored one is now carried and follows the drop
rule; a new value stays strict (unknown key or invalid value is a 400).
Media names also reject DEL, C1 controls and line separators.

Found by independent verification; its probe is the regression test.
Adds the re-verification probe: generic config replaces the values map,
update merges, carried values that no longer fit are dropped and new
invalid values stay rejected.
@egdev6 egdev6 added the type:feature New feature or enhancement label Nov 25, 2026
@egdev6
egdev6 merged commit 0177a71 into main Nov 25, 2026
5 checks passed
@egdev6
egdev6 deleted the feat/custom-widget-fields branch November 25, 2026 11:53
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.

feat(custom): custom widgets with declared settings fields

1 participant