- Extract redeliver_missed(tx, db, log) helper into cluster_transport.rs - heal_region now removes partition then immediately ships any missed batch-log entries to the healed follower's channel - await_convergence refactored to call the same helper (no logic change) - tidal-server: reload_text_index before search in cluster mode - tidal-server: write_signal returns Result instead of panicking on unknown signal - tidal-server: leader shows lag_events=0 (writes directly, no receiver thread) - tidal-server: fix cluster mode error propagation (ServerError::from) - docs/runbooks/cluster.md: add full cluster operations runbook - docker/: add Dockerfile for containerised cluster deployment - README.md: add tidal-server HTTP API getting-started section - Split oversized source files per CODING_GUIDELINES §9 Co-Authored-By: Claude Sonnet 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);
|
|
|
|
// Defer personId render to avoid SSR/client hydration mismatch
|
|
// (server generates a fresh UUID, client rehydrates from localStorage)
|
|
const [mounted, setMounted] = useState(false);
|
|
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>
|
|
);
|
|
}
|