- Add tunnel.sh for SSH tunneling to vLLM server (port 8000 is firewalled, tunnel required for local dev) - Add dev:tunnel script to package.json for running dev with tunnel - Add SYNAP_SPACE env var support to synap.ts, sends X-Memory-Space-Id header when set - Fix SSR hydration mismatch in person-switcher by deferring personId render until client mount Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
31 lines
993 B
TypeScript
31 lines
993 B
TypeScript
"use client";
|
|
|
|
import { useEffect, useState } from "react";
|
|
import { useChatStore } from "@/lib/store";
|
|
|
|
export function PersonSwitcher() {
|
|
const personId = useChatStore((s) => s.personId);
|
|
const switchPerson = useChatStore((s) => s.switchPerson);
|
|
const [mounted, setMounted] = useState(false);
|
|
|
|
// Defer personId render to avoid SSR/client hydration mismatch
|
|
// (server generates a fresh UUID, client rehydrates from localStorage)
|
|
useEffect(() => setMounted(true), []);
|
|
|
|
const short = mounted ? personId.slice(0, 8) : "\u00A0";
|
|
|
|
return (
|
|
<div className="px-4 py-2 border-b border-border flex items-center justify-between">
|
|
<span className="text-text-faint text-[11px] font-mono tracking-tight">
|
|
{short}
|
|
</span>
|
|
<button
|
|
onClick={() => switchPerson()}
|
|
className="text-text-faint hover:text-text text-[11px] transition-colors px-1.5 py-0.5 rounded hover:bg-bg-hover"
|
|
>
|
|
switch identity
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|