From a70e0dc0105993698ad1d33e520cc0630603265e Mon Sep 17 00:00:00 2001 From: Ahmed Date: Mon, 15 Jun 2026 22:22:23 +0000 Subject: [PATCH] feat(chat): render charts and HTML reports in an artifact panel Assistant replies can now produce visual output instead of raw markup. HTML in a fenced ```html block (or an untagged fence whose content is HTML) renders as a CSS/SVG chart or report inside a sandboxed iframe (sandbox="allow-same-origin", no scripts: styles are isolated and the markup's own JS never runs). Rendered output opens in a dedicated artifact panel on the right: the latest chart auto-opens, and inline "Chart" cards reopen any previous one. A new `report` message role plus a session._post_report(html) helper let server-side code push a full report into the conversation. Tool-call chips are now collapsed by default behind a per-message toggle (with a running spinner), reducing noise in long replies. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Ahmed --- CHANGELOG.md | 15 ++++ SECURITY.md | 13 +++- codexoo/__manifest__.py | 3 + codexoo/models/codexoo_message.py | 4 +- codexoo/models/codexoo_session.py | 21 ++++++ codexoo/static/src/artifacts.js | 42 ++++++++++++ codexoo/static/src/chat_action.js | 68 ++++++++++++++++++- codexoo/static/src/chat_action.xml | 23 ++++++- codexoo/static/src/components/message.js | 56 +++++++++++++-- codexoo/static/src/components/message.xml | 40 ++++++++--- codexoo/static/src/components/message_list.js | 6 +- .../static/src/components/message_list.xml | 2 +- codexoo/static/src/components/report_frame.js | 39 +++++++++++ .../static/src/components/report_frame.xml | 13 ++++ codexoo/static/src/scss/codexoo.scss | 53 +++++++++++++++ 15 files changed, 375 insertions(+), 23 deletions(-) create mode 100644 codexoo/static/src/artifacts.js create mode 100644 codexoo/static/src/components/report_frame.js create mode 100644 codexoo/static/src/components/report_frame.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index c626a99..adb5ac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,11 +15,26 @@ Odoo-style versioning (`17.0.MAJOR.MINOR.PATCH`). Add new entries under gate. ### Added +- **Rendered charts & HTML reports in chat** — the assistant can now produce + visual output instead of raw markup. HTML emitted in a fenced ` ```html ` + block (or an untagged fence whose content is HTML) renders as a CSS/SVG chart + or report inside a **sandboxed iframe** (`sandbox="allow-same-origin"`, no + scripts — styles are isolated and the markup's own JS never runs). Rendered + output opens in a dedicated **artifact panel on the right**, with the latest + chart auto-opening and inline "Chart" cards to reopen any previous one. A new + `report` message role plus a `codexoo.session._post_report(html)` helper let + server-side code push a full report straight into the conversation. + - **Contribution gates** — a `pr-checks` CI workflow (CHANGELOG, DCO sign-off, SECURITY.md-when-relevant, flake8) plus branch protection, and `CONTRIBUTING.md` guidance covering AI-assisted contributions and the Developer Certificate of Origin (`DCO`). +### Changed +- **Tool calls are collapsed by default** in each assistant message, behind a + toggle that shows the call count (and a spinner while any call is still + running); expand to see the per-tool chips. + ## [17.0.1.0.3] — 2026-06-11 ### Changed diff --git a/SECURITY.md b/SECURITY.md index 0d84c2d..9ff78b4 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -42,8 +42,15 @@ are in scope for security reports include: boundary is server-side (the loopback bridge token + per-user ACLs). - **Per-user credential isolation** — ChatGPT login credentials are stored per user in a private `CODEX_HOME` with mode `0600` and never exposed on a record. +- **Sandboxed report/chart rendering** — HTML the model emits (charts, reports, + and `codexoo.session._post_report` output) is rendered in an + `