From 265867a3a83fd219f1cf16997ce0e42cc2f705a5 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 19:27:46 +0000 Subject: [PATCH 1/4] Work in progress --- bun.lockb | Bin 364853 -> 364901 bytes src/routeTree.gen.ts | 9 +++++++++ 2 files changed, 9 insertions(+) diff --git a/bun.lockb b/bun.lockb index 5adc3b1161650f182ed06876fee69d8ba28200e4..6213102e2ad81f24c55e991382d407bd557b0015 100755 GIT binary patch delta 1015 zcmXZbOKeP09LMo<@0p5eQFM&xLuXWrQmUQ_BB`*bq_dG!Fc+o!ji@k#quk#qmWn9s5#^Lu3xevz$a zdbOClz!`67X+cYCSUN2GDyzokZS)r3WHn5W%f4e=rj~l)0^^7F)sfrD72JQy){+~@ zON_~zU&4BD#&wzTTb3d}z+B`1$kOD8vcH)74(q56%smVrAeshhhMu{HVKH}z_0+7a z4)ghZ(+G~Mx%GN+6E=*w#;0T($bFP+a$0Y=k^ETQ+NXV+uqU$pvSw@oa}VQyUb~rG z$}@4JOB=V4FUnkdIiP8w+|R>}6WX_x?4G6@CuQ5nk2rdo`zcu~`Ic)3BP-iZp4Wl% zfv^oM2~W#*U^lTQ?q_5>$-0@$jVJ?eT_%Q delta 977 zcmXZbOGs2v9LMo<=Z@iIrRFq|<13wBW)H0v)iP>P;H-LCGnwGt2@QAC3`mOzEUak} zGzdYP0ztVEMAoWBw06->gJLqK!onWV_wW53?w|Rc&pBsi&VQJX(}}t1#ALtsxR9Pm zdlTu%T-uM1L>5Ma;SoRSd8bN+oZpo1ci~uyI2R>uq|VDeVIFxC^XkbRLgV$HH;*=DRIw5J z;FrDi^Tlw(!lQr<-7&8>SiR-f$78kSa3K{mmi-eiW8)e7?>RRfWHQk+UhGLWoZr4V MlZ^&5*_zqD|4_AP-T(jq diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 94db69b..2c230ca 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -1046,3 +1046,12 @@ const rootRouteChildren: RootRouteChildren = { export const routeTree = rootRouteImport ._addFileChildren(rootRouteChildren) ._addFileTypes() + +import type { getRouter } from './router.tsx' +import type { createStart } from '@tanstack/react-start' +declare module '@tanstack/react-start' { + interface Register { + ssr: true + router: Awaited> + } +} From 2cae922c9f5989b65036c778be00d7205212a992 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 19:28:01 +0000 Subject: [PATCH 2/4] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routeTree.gen.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 2c230ca..94db69b 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -1046,12 +1046,3 @@ const rootRouteChildren: RootRouteChildren = { export const routeTree = rootRouteImport ._addFileChildren(rootRouteChildren) ._addFileTypes() - -import type { getRouter } from './router.tsx' -import type { createStart } from '@tanstack/react-start' -declare module '@tanstack/react-start' { - interface Register { - ssr: true - router: Awaited> - } -} From 7de082707037a04091c5efdd0c3619150fc08b72 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 19:28:37 +0000 Subject: [PATCH 3/4] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/invoices.new.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/routes/invoices.new.tsx b/src/routes/invoices.new.tsx index 9fc22b9..fd4f6e2 100644 --- a/src/routes/invoices.new.tsx +++ b/src/routes/invoices.new.tsx @@ -1,4 +1,4 @@ -import { createFileRoute, useNavigate } from "@tanstack/react-router"; +import { createFileRoute, useNavigate, Outlet, useMatches } from "@tanstack/react-router"; import { useEffect, useMemo, useState } from "react"; import { ProtectedLayout } from "@/components/protected-layout"; import { PageContainer, PageHeader } from "@/components/app-shell"; @@ -11,12 +11,20 @@ import { Search, ArrowLeft } from "lucide-react"; import { formatCurrency } from "@/lib/format"; export const Route = createFileRoute("/invoices/new")({ - component: () => ( + component: NewInvoiceLayout, +}); + +function NewInvoiceLayout() { + // If a child route (e.g. /invoices/new/$clientId) is matched, render only it. + const matches = useMatches(); + const hasChild = matches.some((m) => m.routeId !== "/invoices/new" && m.routeId.startsWith("/invoices/new/")); + if (hasChild) return ; + return ( - ), -}); + ); +} interface ClientLite { id: string; From 0e72b0d941c9431dc5fec1339eeb9755b2e98949 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 19:28:58 +0000 Subject: [PATCH 4/4] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/cases/import-unbilled-dialog.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/cases/import-unbilled-dialog.tsx b/src/components/cases/import-unbilled-dialog.tsx index 898230a..94656ff 100644 --- a/src/components/cases/import-unbilled-dialog.tsx +++ b/src/components/cases/import-unbilled-dialog.tsx @@ -55,8 +55,8 @@ export function ImportUnbilledDialog({ open, onOpenChange, kind, caseId, clientI return; } const select = kind === "time" - ? "id, work_date, description, hours, hourly_rate, case_id, user:profiles!time_entries_user_id_fkey(full_name, email)" - : "id, expense_date, description, amount, case_id, user:profiles!expenses_user_id_fkey(full_name, email)"; + ? "id, work_date, description, hours, hourly_rate, case_id, user_id" + : "id, expense_date, description, amount, case_id, user_id"; const { data, error } = await supabase .from(table) .select(select) @@ -66,7 +66,18 @@ export function ImportUnbilledDialog({ open, onOpenChange, kind, caseId, clientI .order(dateCol, { ascending: false }) .limit(1000); if (error) toast.error(error.message); - setRows((data ?? []).map((r: any) => ({ ...r, _case: caseMap[r.case_id] }))); + const baseRows = (data ?? []) as any[]; + // Fetch users separately (no FK relationship between these tables and profiles). + const userIds = Array.from(new Set(baseRows.map((r) => r.user_id).filter(Boolean))); + let userMap: Record = {}; + if (userIds.length) { + const { data: profs } = await supabase + .from("profiles") + .select("id, full_name, email") + .in("id", userIds); + userMap = Object.fromEntries((profs ?? []).map((p: any) => [p.id, p])); + } + setRows(baseRows.map((r) => ({ ...r, _case: caseMap[r.case_id], user: r.user_id ? userMap[r.user_id] : null }))); setLoading(false); })(); }, [open, clientId, caseId, kind]);