Skip to content

Commit efbacf8

Browse files
ui: fix mobile chat form overflow and bust stale bundle cache (ggml-org#24158)
1 parent 2602169 commit efbacf8

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

tools/ui/scripts/vite-plugin-llama-cpp-build.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ export function llamaCppBuildPlugin(): Plugin {
4646

4747
content = content.replace(/\r/g, '');
4848
content = GUIDE_FOR_FRONTEND + '\n' + content;
49-
content = content.replace(/\/_app\/immutable\/bundle\.[^"]+\.js/g, './bundle.js');
49+
50+
// Keep the Vite hash as a query string so each build busts the browser cache
51+
content = content.replace(/\/_app\/immutable\/bundle\.([^".]+)\.js/g, './bundle.js?$1');
5052
content = content.replace(
51-
/\/_app\/immutable\/assets\/bundle\.[^"]+\.css/g,
52-
'./bundle.css'
53+
/\/_app\/immutable\/assets\/bundle\.([^".]+)\.css/g,
54+
'./bundle.css?$1'
5355
);
5456
content = content.replace(/__sveltekit_[a-z0-9]+/g, '__sveltekit__');
5557

tools/ui/src/routes/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
/>
255255

256256
<Sidebar.Provider bind:open={sidebarOpen}>
257-
<div class="flex h-screen w-full">
257+
<div class="flex h-dvh w-full">
258258
<Sidebar.Root variant="floating" class="h-full"
259259
><SidebarNavigation bind:this={chatSidebar} /></Sidebar.Root
260260
>

0 commit comments

Comments
 (0)