Skip to content

Epic 3 di - #168

Open
jgindin wants to merge 9 commits into
mainfrom
epic-3-di
Open

Epic 3 di#168
jgindin wants to merge 9 commits into
mainfrom
epic-3-di

Conversation

@jgindin

@jgindin jgindin commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

Third in a series of refactorings, intended to cleanup the A2UI Composer code.

Circular Dependency Eradication & Settings Unification

  • Eliminates circular dependency cycles between StartupResolution, AppConfigProvider, and LocalStorageConfigProvider by extracting acyclic leaf state services (StartupConfigStateService and EnvironmentContextService).
  • Completely removes manual Injector / injector.get() runtime workarounds across services.
  • Extracts an AbstractSelector base class for ApiKeySelector and RendererSelector modals to eliminate duplicate dialog boilerplate and lifecycle leaks.
  • Separates telemetry and API tracking into Angular HTTP interceptors.

Pre-launch Checklist

  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I read the [Style Guide].
  • I have added updates to the [CHANGELOG].
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on fork, I have verified that scripts/e2e_test.sh passes.

Create SafeUrlValidatorService for http/https validation.
Create DomainOriginVerificationService for strict iframe networking validation.
Wire bypassSecurityTrustResourceUrl inside rendered-frame.ts through the rigorous URL validator.
Swap the check in preview-bridge.ts for the strict origin verification.
Fix LLM concurrency in ChatCoordinator submitPrompt.
Fix Monaco model.dispose() in a2ui-composer-monaco-editor.
Inject takeUntilDestroyed in api-key-selector.ts and renderer-selector.ts.
Delete debug/mock-rules/ entirely.
Rip out console.error patch hacks from ChatCoordinator.
Delete obsolete storage key ACTIVE_DRAFT.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several architectural improvements, including the extraction of the A2UI payload parser, error formatter, and prompt factory into dedicated services, as well as the introduction of an AbstractSelector base class for settings selectors. It also adds strict origin verification for postMessage communication and a safe URL validator service. The review feedback highlights a high-severity security issue where the origin query parameter is trusted blindly without validation against an allowlist, a potential memory leak in ChatCoordinator due to an uncleaned subscription, and the use of the deprecated String.prototype.substr method in MonacoEditor.

Comment thread bridge/src/domain-origin-verification.ts
Comment thread shell/src/app/chat/chat-coordinator/chat-coordinator.ts
Comment thread shell/src/app/shared/monaco-editor/monaco-editor.ts
@github-actions

Copy link
Copy Markdown
Contributor

⚡ A2UI Composer PR Preview

Your automated preview is successfully live (commit 9389f26):
👉 Launch PR Preview

Note: This environment will be wiped automatically when the PR is merged or closed.

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