refactor(home): 校正面 15 个状态从 Home 下沉
Independent Staging Quality Gate / validate (push) Failing after 6m43s
Independent Staging Quality Gate / publish (push) Skipped

Home() useState 66->52, useRef 41->39. Shell-facing fields merge into one object;
subtree state lives in useRectificationSurface. Chat props 20->7. Growth contract
rebaselined. Zero behavior/copy change.
This commit is contained in:
jesse-ux
2026-09-16 08:33:48 +08:00
parent 3b17c1b242
commit f8e607c29a
10 changed files with 448 additions and 122 deletions
@@ -31,7 +31,7 @@ export type PersistedRectificationTurn = Readonly<{
}> | null;
}>;
export type ConversationalBirthTimeRectificationProps = Readonly<{
export type RectificationChatPanel = Readonly<{
caseId: string;
sessionId: string;
readonly: boolean;
@@ -39,23 +39,44 @@ export type ConversationalBirthTimeRectificationProps = Readonly<{
initialTurns: readonly PersistedRectificationTurn[];
/** The Case snapshot read together with the turns before the surface mounted; null when hydration failed. */
initialSnapshot: RectificationCaseSnapshotPayload | null;
pendingConsultationQuestion?: string | null;
headerSlot: HTMLElement | null;
onMessagesChange?: (messages: ChatMessage[]) => void;
onCompleted?: () => void;
onPendingChange?: (pending: boolean) => void;
onProfileIncomplete?: () => void;
onOpeningConsumed?: () => void;
onRestart?: () => void;
}>;
export type ConversationalBirthTimeRectificationProps = Readonly<{
/** The declared birth minute from the profile, shown on the board before any candidate exists. */
declaredTime: string | null;
models: readonly PublicLanguageModel[];
selectedModelId: string;
onSelectModel: (modelId: string) => void;
onMessagesChange?: (messages: ChatMessage[]) => void;
onCompleted?: () => void;
onPendingChange?: (pending: boolean) => void;
onProfileIncomplete?: () => void;
onOpenBilling?: (options?: { source?: string }) => void;
onSaved?: (time: string, status: "accepted" | "confirmed") => void;
onOpeningConsumed?: () => void;
pendingConsultationQuestion?: string | null;
onRestart?: () => void;
headerSlot: HTMLElement | null;
panel: RectificationChatPanel;
}>;
export function ConversationalBirthTimeRectification(props: ConversationalBirthTimeRectificationProps) {
export function ConversationalBirthTimeRectification({
declaredTime,
models,
selectedModelId,
onSelectModel,
onOpenBilling,
onSaved,
panel,
}: ConversationalBirthTimeRectificationProps) {
const props = {
declaredTime,
models,
selectedModelId,
onSelectModel,
onOpenBilling,
onSaved,
...panel,
};
return <RectificationAgenticChat {...props} />;
}