feat: add OpenUI integration#8218
Conversation
Review: PR #8218 - feat: add OpenUI integrationSummaryThis is a substantial feature PR that adds experimental OpenUI integration to Jan. When enabled, the assistant can describe UI elements in OpenUI Lang, and Jan renders them as interactive components (buttons, forms, etc.) instead of plain markdown. User interactions with these components are routed back into the conversation. Architecture OverviewThe implementation follows a clean layered approach:
Detailed FindingsStrengths:
Concerns:
Missing
VerdictThis is a well-architected feature with good code separation and lazy loading. However, it introduces a large dependency footprint and has security considerations around unsanitized model-generated UI that need attention before merging. The lack of i18n on the settings page is inconsistent with the rest of the codebase. Recommendation: fix needed Priority action items:
|
7908d7f to
1985c8f
Compare
|
Thanks for the review, I will refactor the pr and push the changes soon. |
1985c8f to
80f761b
Compare
80f761b to
143da66
Compare
Re-review: PR #8218 - feat: add OpenUI integrationUpdated review after the author's changes (commit What improved since the last reviewThe author addressed several of the original concerns:
Remaining concerns1. // Keep ref in sync with latest closure so the OpenUI event listener
// (registered once with []) always calls the current handleSendMessage.
const handleSendMessageRef = useRef(handleSendMessage)
useEffect(() => { handleSendMessageRef.current = handleSendMessage })2. System prompt is appended to every chat when enabled globally. 3. Bundle size from
4. No XSS sanitization within the OpenUI renderer itself. 5. 6. Zustand peer dependency override in Test coverage assessmentThe PR includes solid test coverage:
Missing: No e2e tests for the full enable-to-interact flow, but this is understandable for an experimental feature. ArchitectureThe layered approach is clean and well-separated:
The two library modes (Chat vs Standard) are well-isolated: Chat uses the locally defined VerdictThe author has addressed the most critical issues from the first review (URL sanitization, i18n, detection accuracy, documentation). The remaining items are either minor (missing comment on ref pattern), known trade-offs (bundle size, global prompt injection), or require upstream verification (XSS in Renderer). Recommendation: improve needed Minimum before merge:
Nice-to-have for follow-up: |
Summary
Adds an experimental OpenUI integration to Jan.
What Changed
Validation
yarn workspace @janhq/web-app lint yarn workspace @janhq/web-app exec vitest --run yarn workspace @janhq/web-app buildAll passed.
closes #8214