Skip to content

feat(ui): add strict foreground action registry#5553

Draft
MADPANDA3D wants to merge 2 commits into
odysseus-dev:devfrom
MADPANDA3D:codex/upstream-foreground-actions
Draft

feat(ui): add strict foreground action registry#5553
MADPANDA3D wants to merge 2 commits into
odysseus-dev:devfrom
MADPANDA3D:codex/upstream-foreground-actions

Conversation

@MADPANDA3D

@MADPANDA3D MADPANDA3D commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Adds a strict browser-owned registry for three fixed foreground actions: open Calendar, close Document, and minimize Document. The v1 envelope is versioned, capped at 1 KiB, requires an empty payload, and rejects unknown fields, targets, selectors, URLs, markup, and executable text.

This PR adds only the host seam and existing-module handlers. It does not add a server emitter, Voice Orb UI, client-state reporting, or a plugin compatibility promise. Existing legacy UI-control behavior remains unchanged.

Target branch

  • This PR targets dev, not main.

Linked Issue

Part of #5549. Related to #4118 and discussion #4439.

Type of Change

  • Bug fix (non-breaking — fixes a confirmed issue)
  • New feature (non-breaking — adds new behaviour)
  • Breaking change (changes or removes existing behaviour)
  • Refactor / cleanup (behaviour unchanged)
  • Documentation only
  • CI / tooling / configuration

Checklist

  • I searched open issues and pull requests; no existing strict foreground-action registry duplicates this proposal.
  • This PR targets dev.
  • The registry exposes only fixed core-owned action IDs with exact empty v1 payloads.
  • Server-side authorization is explicitly documented as required before event emission.
  • The new static module is included in the service-worker precache with a cache-version bump.

How to Test

  1. Run: python -m pytest -q tests/test_foreground_actions_js.py
  2. Run Node syntax checks for static/js/foregroundActions.js, static/js/chatStream.js, and static/app.js.
  3. Start the app and send the exact foreground_action envelopes documented in docs/foreground-actions.md.
  4. Confirm Calendar opens/restores, Document minimizes/closes, and a selector-bearing or unknown action fails closed.

Local validation covered 22 targeted tests plus Ruff, formatting, Node syntax, Python compilation, and diff checks. Live FastAPI + Playwright passes exercised all three actions, verified the service-worker cache contained the module, rejected an unknown selector-bearing action with unknown_action, and observed zero browser console errors. The minimized-document close path also cleared its persisted restore marker and remained closed after reload.

Visual / UI changes

No new visible component or styling is introduced. The actions operate existing Calendar and Document surfaces.

  • Screenshot or short clip attached — no new pixels or styling are added.
  • Style match — existing surfaces are reused.
  • No new component pattern — this is a bounded host contract only.
  • I am not an LLM agent submitting a bulk PR — this contribution is coding-agent assisted, disclosed in Proposal: bounded in-tree host seams for voice and UI composition #5549, and intentionally split into an independent seam.

@github-actions github-actions Bot added the ready for review Description complete — ready for maintainer review label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant