From 1413d77b1ff36ed030c179b3bc59dc6a9b9679b3 Mon Sep 17 00:00:00 2001
From: Brendan Allan <brendonovich@outlook.com>
Date: Thu, 12 Feb 2026 17:44:06 +0800
Subject: desktop: sqlite migration progress bar (#13294)

---
 packages/desktop/src/loading.tsx | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

(limited to 'packages/desktop/src/loading.tsx')

diff --git a/packages/desktop/src/loading.tsx b/packages/desktop/src/loading.tsx
index 752cde893..a1d537a00 100644
--- a/packages/desktop/src/loading.tsx
+++ b/packages/desktop/src/loading.tsx
@@ -4,7 +4,7 @@ import "@opencode-ai/app/index.css"
 import { Font } from "@opencode-ai/ui/font"
 import { Splash } from "@opencode-ai/ui/logo"
 import "./styles.css"
-import { createSignal, Match, onMount } from "solid-js"
+import { createSignal, Match, onCleanup, onMount } from "solid-js"
 import { commands, events, InitStep } from "./bindings"
 import { Channel } from "@tauri-apps/api/core"
 import { Switch } from "solid-js"
@@ -57,15 +57,29 @@ render(() => {
                     "This could take a couple of minutes",
                   ]
                   const [textIndex, setTextIndex] = createSignal(0)
+                  const [progress, setProgress] = createSignal(0)
 
                   onMount(async () => {
+                    const listener = events.sqliteMigrationProgress.listen((e) => {
+                      if (e.payload.type === "InProgress") setProgress(e.payload.value)
+                    })
+                    onCleanup(() => listener.then((c) => c()))
+
                     await new Promise((res) => setTimeout(res, 3000))
                     setTextIndex(1)
                     await new Promise((res) => setTimeout(res, 6000))
                     setTextIndex(2)
                   })
 
-                  return <>{textItems[textIndex()]}</>
+                  return (
+                    <div class="flex flex-col items-center gap-1">
+                      <span>{textItems[textIndex()]}</span>
+                      <span>Progress: {progress()}%</span>
+                      <div class="h-2 w-48 rounded-full border border-white relative">
+                        <div class="bg-[#fff] h-full absolute left-0 inset-y-0" style={{ width: `${progress()}%` }} />
+                      </div>
+                    </div>
+                  )
                 }}
               </Match>
             </Switch>
-- 
cgit v1.2.3

