Epic 2 chat - #167
Conversation
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.
There was a problem hiding this comment.
Code Review
This pull request refactors the chat pipeline by modularizing ChatCoordinator into separate services for payload parsing, error formatting, and prompt generation, while also removing the MockRules debug panel. Additionally, it introduces strict origin verification in PreviewBridge and safe URL validation for the rendered frame. The review feedback highlights a critical bug in sanitizeValue where the logic to strip out rules and mock* properties was omitted, along with a corresponding gap in unit test assertions. Feedback also recommends hardening isConnectivityError against nullish inputs with guard clauses and tests, and replacing the deprecated substr() method with slice() in MonacoEditor.
⚡ A2UI Composer PR PreviewYour automated preview is successfully live (commit
|
Description
Second in a series of refactorings to clean up the A2UI Composer code.
Chat Coordinator Decomposition & Pure Syntax Healing
Pre-launch Checklist