unsloth/studio
Daniel Han e1eaf6e202
Studio: HTML canvas cards in chat with auto-render, a Code view, and visible diffusion code (#6374)
* Studio: auto-render fenced HTML in chat replies as canvas cards

After an assistant reply finishes, append a clickable canvas card for each fenced html block in its text, with no render_html tool call and no extra message. Fragments and non-collapsed documents are covered; full documents already collapsed in place and blocks rendered by the render_html tool are skipped so nothing shows twice.

Hoists the fence helpers out of markdown-text.tsx into a shared module (html-fences.ts) and adds a line-based multi-fence scanner so several html blocks in one reply are all found.

* Studio: add HTML Code button to canvas cards and keep diffusion code visible

When Canvas mode is on or a diffusion model is loaded, the canvas card shows a Preview and an HTML Code button side by side; Code opens the panel source view. The requested view is threaded through openArtifact so the surface opens to preview or code.

Diffusion no longer collapses its full HTML answer, so the raw code stays in the message and the trailing canvas card is appended next to it.

* Studio: drop the Code button on diffusion cards since their code is already inline

* Studio: address review feedback on HTML canvas auto-cards

- Build the fence-body indent regex once per fence instead of per line.
- Only skip full-doc fences the in-place collapse can render (plain
  unindented triple-backtick), so 4-backtick or indented docs still get a card.
- Scan each text part on its own so a fence cannot stitch across a tool,
  source, or reasoning part.
- Exclude diffusion replies from the collapse/skip gates and the card Code
  button, since diffusion keeps its HTML inline.

---------

Co-authored-by: Daniel Han <michaelhan2050@gmail.com>
2026-06-16 17:38:42 -07:00
..
backend Add API server monitor in Studio (#5558) 2026-06-16 20:26:13 +01:00
frontend Studio: HTML canvas cards in chat with auto-render, a Code view, and visible diffusion code (#6374) 2026-06-16 17:38:42 -07:00
src-tauri feat(studio): Hub + Download Manager (#5916) 2026-06-09 04:11:24 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
install_llama_prebuilt.py Studio: don't silently fall back to a CPU prebuilt on NVIDIA Linux GPU hosts (#6310) 2026-06-14 02:06:31 -03:00
install_python_stack.py fix: use partial hipinfo output on crash to avoid CPU fallback (RDNA 4 / gfx1200) (#6292) 2026-06-15 13:26:04 +02:00
LICENSE.AGPL-3.0 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
package-lock.json ci: advisory lockfile supply-chain audit (no install-script changes) (#5604) 2026-05-19 05:56:56 -07:00
package.json ci: advisory lockfile supply-chain audit (no install-script changes) (#5604) 2026-05-19 05:56:56 -07:00
setup.bat Final cleanup 2026-03-12 18:28:04 +00:00
setup.ps1 Make the Studio installers (sh + ps1) resilient to transient uv download failures (#6281) 2026-06-16 03:48:01 -07:00
setup.sh Make the Studio installers (sh + ps1) resilient to transient uv download failures (#6281) 2026-06-16 03:48:01 -07:00
Unsloth_Studio_Colab.ipynb Fix/studio colab proxy and iframe - Unsloth Studio not loading in Colab (iframe "refused to connect" and wrong URL) (#5844) 2026-05-28 23:54:48 -07:00