LibreChat/client/src
Danny Avila 611a1ef5dc
🏖️ fix: Sandpack ExternalResources for Static HTML Artifact Previews (#12509)
* fix: omit externalResources for static Sandpack previews

The Tailwind CDN URL lacks a file extension, causing Sandpack's
static template to throw a runtime injection error. Static previews
already load Tailwind via a script tag in the shared index.html,
so externalResources is unnecessary for them.

Closes #12507

* refactor: extract buildSandpackOptions and add tests

- Surgically omit only externalResources for static templates
  instead of discarding all sharedOptions, preventing future
  regression if new template-agnostic options are added.
- Extract options logic into a pure, testable helper function.
- Add unit tests covering all template/config combinations.

* chore: fix import order and pin test assertions

* fix: use URL fragment hint instead of omitting externalResources

Sandpack's static template regex detects resource type from the URL's
last file extension. The versioned CDN path (/3.4.17) matched ".17"
instead of ".js", throwing "Unable to determine file type". Rather
than omitting externalResources for static templates (which would
remove the only Tailwind injection path for HTML artifacts that don't
embed their own script tag), append a #tailwind.js fragment hint so
the regex matches ".js". Fragments are not sent to the server, so
the CDN response is unchanged.
2026-04-01 22:06:42 -04:00
..
@types 🧩 feat: Redesign Tool Call UI with Contextual Icons, Smart Grouping, and Rich Output Rendering (#12163) 2026-03-25 12:31:39 -04:00
a11y ⚗️ feat: Agent Context Compaction/Summarization (#12287) 2026-03-21 14:28:56 -04:00
common 🪢 refactor: Eliminate Unnecessary Re-renders During Message Streaming (#12454) 2026-03-29 17:05:12 -04:00
components 🏖️ fix: Sandpack ExternalResources for Static HTML Artifact Previews (#12509) 2026-04-01 22:06:42 -04:00
constants 🔐 feat: Granular Role-based Permissions + Entra ID Group Discovery (#7804) 2025-08-13 16:24:17 -04:00
data-provider 🔑 fix: Auth-Aware Startup Config Caching for Fresh Sessions (#12505) 2026-04-01 17:20:39 -04:00
hooks 🔑 fix: Auth-Aware Startup Config Caching for Fresh Sessions (#12505) 2026-04-01 17:20:39 -04:00
locales 🌍 i18n: Update translation.json with latest translations (#12458) 2026-03-29 18:43:43 -04:00
Providers 🪝 fix: Safe Hook Fallbacks for Tool-Call Components in Search Route (#12423) 2026-03-26 16:40:37 -04:00
routes 📁 refactor: Prompts UI (#11570) 2026-03-22 16:56:22 -04:00
store 🧩 feat: Redesign Tool Call UI with Contextual Icons, Smart Grouping, and Rich Output Rendering (#12163) 2026-03-25 12:31:39 -04:00
utils 🏖️ fix: Sandpack ExternalResources for Static HTML Artifact Previews (#12509) 2026-04-01 22:06:42 -04:00
App.jsx 🛜 feat: Enable Network Requests in Offline Mode (#11107) 2025-12-26 09:01:27 -05:00
main.jsx 🎨 feat: add copy-tex to improve copying KaTeX (#7308) 2025-05-15 12:08:47 -04:00
mobile.css 🎨 refactor: Redesign Sidebar with Unified Icon Strip Layout (#12013) 2026-03-22 01:15:20 -04:00
style.css 🧩 feat: Redesign Tool Call UI with Contextual Icons, Smart Grouping, and Rich Output Rendering (#12163) 2026-03-25 12:31:39 -04:00
vite-env.d.ts 🖱️ fix: Message Scrolling UX; refactor: Frontend UX/DX Optimizations (#3733) 2024-08-21 18:18:45 -04:00