unsloth/studio/src-tauri
Leo Borcherding 478d30f361
Unsloth Studio (desktop): fix canvas preview, download file button, toast placement, and model-load typing lag (#7391)
* Studio desktop: fix loading-toast overlap and typing lag on model load

- Toaster: on desktop, offset toasts below the ~34px custom window titlebar
  (top 46 when isTauri) so they no longer cover the min/max/close controls.
  Web is unchanged (top 12).
- Model load: the 2s load poll wrote loadProgress state every tick, which
  re-renders the whole chat page during "Starting model" (cheap in Chrome,
  janky in the desktop WebView2 -> laggy typing). That state is only read by
  the dismissed-toast inline status, so gate all four poll branches to write
  it only when the inline view is live; while the toast is up it updates via
  Sonner alone.

* Studio desktop: fix HTML canvas preview, download, and panel offset

- CSP: add frame-src for localhost/127.0.0.1 so the desktop webview can
  frame the backend-served artifact preview. default-src 'self' (no
  frame-src) blocked it -> "127.0.0.1 refused to connect"; web is
  same-origin so it already worked.
- Download: route the canvas Download button through the native save
  dialog (downloadFile) instead of a blob-anchor click, which the Tauri
  WebView2 silently drops.
- Nudge the artifact panel down 8px so its top edge/shadow isn't tucked
  under the window top bar.

* Studio desktop: add HTML filter for native canvas save dialog

Canvas Download saves .html via save_native_file, but save_filter() had no
html/htm case, so the native dialog fell back to the JSON/CSV/etc filter and
could block saving/browsing the .html export. Add an HTML filter and include
html/htm in the catch-all. Addresses Codex review on #7391.

* Studio desktop: unblock canvas preview in dev shell + clear header fade

- Preview: the app CSP frame-src fix wasn't enough in the tauri dev shell.
  The preview endpoint sets its own frame-ancestors response header, which
  only allowed 'self' tauri://localhost http://tauri.localhost -- so the
  Vite dev origin (http://localhost:5173) was blocked and the frame stayed
  "refused to connect". Extend the allowlist with http://localhost:* and
  http://127.0.0.1:* (the endpoint only renders postMessage'd HTML in a
  no-same-origin sandbox, so it exposes no server resource).
- Shadow: the artifact panel toolbar sat under the full-width
  chat-header-fade; lower the panel top (mt 80->90px) so the controls clear
  the fade.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-24 22:23:41 -05:00
..
capabilities Studio: persist Tauri window size and maximized state across launches (#5799) 2026-06-02 09:26:15 -07:00
icons Polish Studio desktop chrome (#6332) 2026-06-24 17:56:25 -07:00
linux Windows installer: fix DiskPart UAC mid-install, drive-root cache, and spurious unsloth.exe rename warning (#6296) 2026-06-22 03:09:08 -07:00
src Unsloth Studio (desktop): fix canvas preview, download file button, toast placement, and model-load typing lag (#7391) 2026-07-24 22:23:41 -05:00
windows Windows installer: fix DiskPart UAC mid-install, drive-root cache, and spurious unsloth.exe rename warning (#6296) 2026-06-22 03:09:08 -07:00
build.rs Add tauri (#5144) 2026-04-23 04:50:10 -07:00
Cargo.lock Fix Studio desktop reliability (#7255) 2026-07-21 09:51:18 +02:00
Cargo.toml Fix Studio desktop reliability (#7255) 2026-07-21 09:51:18 +02:00
Entitlements.plist Fix Studio desktop reliability (#7255) 2026-07-21 09:51:18 +02:00
Info.plist Fix Studio desktop reliability (#7255) 2026-07-21 09:51:18 +02:00
tauri.conf.json Unsloth Studio (desktop): fix canvas preview, download file button, toast placement, and model-load typing lag (#7391) 2026-07-24 22:23:41 -05:00
tauri.macos.conf.json Fix Studio desktop reliability (#7255) 2026-07-21 09:51:18 +02:00
tauri.windows.conf.json Fix Windows workflow issues(#5694) 2026-05-22 05:32:30 -07:00