Skip to content

feat(web_core): refine SurfaceModel and SurfaceComponentsModel for Python SDK parity - #2310

Open
gspencergoog wants to merge 5 commits into
v1_0_sauce_tsfrom
v1_0_polishing_ts
Open

feat(web_core): refine SurfaceModel and SurfaceComponentsModel for Python SDK parity#2310
gspencergoog wants to merge 5 commits into
v1_0_sauce_tsfrom
v1_0_polishing_ts

Conversation

@gspencergoog

@gspencergoog gspencergoog commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

PR Description: Refine Web Core Surface Manager & Framework Adapter State Models (v1_0_polishing_ts)

Summary

This PR implements Stage 4 Step 4.5 (Polishing-TS) of the A2UI v1.0 Implementation Plan. It refines the Web Core TypeScript state models (SurfaceModel and SurfaceComponentsModel) to achieve 100% API parity with the Python Core SDK (a2ui_core).

Stacking Structure

This PR is stacked on top of the Stage 3 Sauce PR (v1_0_sauce_ts):

  • Base Branch: v1_0_sauce_ts
  • Feature Branch: v1_0_polishing_ts

Key Changes

  • SurfaceModel DataModel Constructor Parameter: Updated constructor to accept an optional dataModel?: DataModel instance instead of forcing instantiation of an empty DataModel, matching python/a2ui_core.
  • Bidirectional Action Dispatching: Expanded dispatchAction(payload, sourceComponentId) to handle both event ({ name, context }) and functionCall ({ call, args }) action payload structures.
  • SurfaceComponentsModel.componentsMap: Added componentsMap readonly map accessor to mirror SurfaceGroupModel.surfacesMap for framework renderers (Angular, React, Lit).
  • Unit Testing: Added dedicated test cases in surface-model.test.ts and surface-components-model.test.ts verifying custom data model injection, function call action dispatching, and map access.

Verification

  • npx tsc --noEmit passed with 0 errors.
  • yarn test passed 298/298 unit tests cleanly in typescript/web_core.

gemini-code-assist[bot]

This comment was marked as resolved.

…Action

- Ensure dispatchAction validates that the payload contains a valid event wrapper, functionCall wrapper, or flat name/call property
- Return early if eventPayload or name is missing or invalid
- Add unit tests for malformed and missing action payloads in surface-model.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant