Repository navigation
feat(custom-overlays): settings fields for custom widgets and «Personalizados» - #347
Merged
Merged
Conversation
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.
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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».
text,number(min/max/step),toggle,select(options),color,listandmedia(an Antena file). Values are validated per type in every write path (API,/api/config,/api/config/set, import).antena.settingsandantena.on('settings', fn); media values arrive as absolute/media/<file>URLs built by the shell from a validated file name.customOverlaySettingsevent 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.camposandvaloresincrear_overlay/editar_overlay./custom/<id>,/api/custom-overlays, MCP tool names and thecustom(id)slot are unchanged.Pre-existing bug fixed (in the first commit): after a frame reload (saving the code), the shell never sent
readyagain, soantena.readynever 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
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.pnpm typecheckpasses. (One earlier run had achat-preview-browsercountdown failure that passed 3/3 alone; unrelated area.)/api/config/set,PUT /api/configand mixed panel drafts) fixed in6caad29; the single re-verification confirmed it with no regressions. Its probes are regression tests.docs/themes.md, SDK header docs, MCP help.Linked issue
Closes #344