fix: hydration mismatch in run history date formatting

This commit is contained in:
lorentz 2026-04-08 18:07:36 +00:00
parent 1d01c3fb3d
commit 3a8f21704a
3 changed files with 47323 additions and 2 deletions

View file

@ -24,7 +24,12 @@
"Bash(python3 -c \"import sys,json; d=json.load\\(sys.stdin\\); deps={**d.get\\('dependencies',{}\\), **d.get\\('devDependencies',{}\\)}; [print\\(k\\) for k in sorted\\(deps.keys\\(\\)\\)]\")",
"Bash(npx tsx:*)",
"Bash(tee /tmp/shape-import-console.txt)",
"Bash(python3:*)"
"Bash(python3:*)",
"Read(//usr/**)",
"Read(//usr/lib/**)",
"Bash(ls /usr/bin/pg*)",
"Bash(dpkg -l)",
"Bash(docker exec dev-db:*)"
]
}
}

View file

@ -70,7 +70,16 @@ function StatLine({ label, value }: { label: string; value: number | string }) {
)
}
function formatDate(iso: string) {
return new Date(iso).toLocaleString(undefined, {
year: 'numeric', month: 'numeric', day: 'numeric',
hour: 'numeric', minute: '2-digit',
})
}
export function ShapeImportPanel({ initialRuns }: { initialRuns: Run[] }) {
const [mounted, setMounted] = useState(false)
useEffect(() => setMounted(true), [])
const [runs, setRuns] = useState<Run[]>(initialRuns)
// SharePoint picker state
@ -486,7 +495,7 @@ export function ShapeImportPanel({ initialRuns }: { initialRuns: Run[] }) {
)}
<div className="min-w-0">
<p className="text-sm font-medium truncate">
{run.dryRun ? 'Dry Run' : 'Execute'} {new Date(run.startedAt).toLocaleString()}
{run.dryRun ? 'Dry Run' : 'Execute'} {mounted ? formatDate(run.startedAt) : ''}
</p>
{run.user && (
<p className="text-xs text-muted-foreground">by {run.user.displayName || run.user.email}</p>

File diff suppressed because one or more lines are too long