Commit History
18 days ago
-
perf(frontend): load Mermaid, Shiki grammars and language detection on demand
- Mermaid is imported when a diagram renders - the editor uses shiki/core with the JavaScript regex engine and fetches each grammar the first time a block needs it; only SHIKI_LANGS ship - highlight.js language detection loads with the first language-less block - the chat panel and Embed Studio are lazy components - shiki-langs.ts holds the shared language/theme constants without a runtime Shiki import; the publisher keeps the eager highlighter Entry chunk: 2.79 MB -> 1.60 MB (813 KB -> 492 KB gzip). Co-authored-by: Cursor <cursoragent@cursor.com>d840d7c
20 days ago
-
feat(embed-studio): error loop, versions, chips and preview controls
- Preview errors reach the agent: a studio-only reporter in the srcdoc relays uncaught errors, rejections, failed loads and embed:error to the parent; the studio shows "The chart threw ... [Fix it]" and sends one automatic fix per user message. - Versions per agent turn in Y.Map("embed-versions") (shared, capped at 20): vN / Restore / Compare under each reply, Undo last change; restore appends a copy so history stays linear. - Starter and follow-up prompt chips, preview width presets (Article, Wide, 360) and a local light/dark toggle pushed with setTheme. - The agent's title and source land on the node; Shiki code view with Copy and Download. - Provider errors keep their HTTP status; 401/402/429 become actionable messages with Retry; model name in the header; Done replaces Save & Close; no more fake "Generating chart..." banner. - Minimal mobile layout: files drawer and Chat / Preview tabs under 900px. Co-authored-by: Cursor <cursoragent@cursor.com>461e15a