From 838ec9617ab3c0055cc45470f14c127006ed548c Mon Sep 17 00:00:00 2001 From: Rene Date: Wed, 1 Jul 2026 11:29:05 +0200 Subject: [PATCH 1/4] Fix ensure-ollama.mjs: sleep -> timeout for Windows compatibility --- scripts/ensure-ollama.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/ensure-ollama.mjs b/scripts/ensure-ollama.mjs index 9a299be..bcee6ef 100644 --- a/scripts/ensure-ollama.mjs +++ b/scripts/ensure-ollama.mjs @@ -50,7 +50,11 @@ if (!isRunning()) { spawn(bin, ["serve"], { stdio: "ignore", detached: true }).unref() } // Give it a moment to start listening - execSync("sleep 3", { stdio: "ignore", timeout: 5000 }) + if (platform() === "win32") { + execSync("timeout /t 3 /nobreak >nul", { stdio: "ignore", timeout: 10000, shell: true }) + } else { + execSync("sleep 3", { stdio: "ignore", timeout: 5000 }) + } } else { console.log("Ollama already running") } From 72f872b2f9d5eeb44f27bcd5b6c39506e54df878 Mon Sep 17 00:00:00 2001 From: Rene Date: Wed, 1 Jul 2026 11:35:34 +0200 Subject: [PATCH 2/4] Fix projects.map crash on API error response Added res.ok guards on projects and time-tracking pages so that setProjects receives [] instead of an error object when the API returns a non-200 response. --- src/app/(dashboard)/projects/page.tsx | 3 ++- src/app/(dashboard)/time-tracking/page.tsx | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/(dashboard)/projects/page.tsx b/src/app/(dashboard)/projects/page.tsx index a6a9be1..f409c84 100644 --- a/src/app/(dashboard)/projects/page.tsx +++ b/src/app/(dashboard)/projects/page.tsx @@ -62,9 +62,10 @@ export default function ProjectsPage() { if (search) params.set("search", search) if (statusFilter !== "all") params.set("status", statusFilter) const res = await fetch(`/api/projects?${params}`) - setProjects(await res.json()) + if (res.ok) setProjects(await res.json()); else setProjects([]) } catch (e) { console.error("Failed to load projects", e) + setProjects([]) } finally { setLoading(false) } diff --git a/src/app/(dashboard)/time-tracking/page.tsx b/src/app/(dashboard)/time-tracking/page.tsx index 7a286a4..46fda53 100644 --- a/src/app/(dashboard)/time-tracking/page.tsx +++ b/src/app/(dashboard)/time-tracking/page.tsx @@ -52,11 +52,13 @@ export default function TimeTrackingPage() { fetch("/api/time-entries/summary"), fetch("/api/projects"), ]) - setEntries(await eRes.json()) - setSummary(await sRes.json()) - setProjects(await pRes.json()) + if (eRes.ok) setEntries(await eRes.json()); else setEntries([]) + if (sRes.ok) setSummary(await sRes.json()); else setSummary(null) + if (pRes.ok) setProjects(await pRes.json()); else setProjects([]) } catch (e) { console.error("Failed to load time data", e) + setEntries([]) + setProjects([]) } finally { setLoading(false) } From c1745df3290765b9ff8bde25b63984d4665a240c Mon Sep 17 00:00:00 2001 From: Rene Date: Wed, 1 Jul 2026 11:46:22 +0200 Subject: [PATCH 3/4] Fix users.map crash in NewProjectDialog /api/users returns { users: [...] } but setUsers was receiving the full wrapper object instead of the inner array. --- src/app/(dashboard)/projects/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/(dashboard)/projects/page.tsx b/src/app/(dashboard)/projects/page.tsx index f409c84..e08629c 100644 --- a/src/app/(dashboard)/projects/page.tsx +++ b/src/app/(dashboard)/projects/page.tsx @@ -168,7 +168,7 @@ function NewProjectDialog({ statuses, onCreated }: { statuses: ProjectStatus[]; useEffect(() => { if (!open) return fetch("/api/customers?limit=100").then(r => r.json()).then(setCustomers).catch(() => {}) - fetch("/api/users").then(r => r.json()).then(setUsers).catch(() => {}) + fetch("/api/users").then(r => r.json()).then(d => setUsers(d.users || [])).catch(() => {}) }, [open]) const handleSubmit = async () => { From 48f78cf2ca8c00c835f5004dce947411bfcd6394 Mon Sep 17 00:00:00 2001 From: Rene Date: Wed, 1 Jul 2026 11:51:31 +0200 Subject: [PATCH 4/4] Center New Proposal page with mx-auto --- src/app/(dashboard)/proposals/new/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/(dashboard)/proposals/new/page.tsx b/src/app/(dashboard)/proposals/new/page.tsx index 778d3ba..7f727c4 100644 --- a/src/app/(dashboard)/proposals/new/page.tsx +++ b/src/app/(dashboard)/proposals/new/page.tsx @@ -116,7 +116,7 @@ export default function NewProposalPage() { const formatCurrency = (n: number) => `R${n.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` return ( -
+