feat(rectification): confirm the tap on the choice card and show the declared minute on the empty board

The selected option carries a check and 已选择, and a card whose tap is
being recorded shows one inline-spinner row 正在记录… (the timeline row's
shape, not a new vocabulary). Before any candidate exists the board's clock
shows the profile's declared birth minute with two lines of copy, the peek
reads 当前盘面 · 填报 HH:MM, and the column narrows until a result arrives.
The snapshot API has no declared-time house table, so none is invented.

BUG-482, BUG-483

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JUei7K13cYxLHE3Axe4A45
This commit is contained in:
Jesse_Chen
2026-09-02 04:53:59 +00:00
parent 91b8b33aa6
commit ef11f6e335
3 changed files with 47 additions and 7 deletions
@@ -17,6 +17,7 @@ import {
windowScanLayerLabel,
type WindowScanLayer,
} from "@/lib/rectification-agentic/v9/refinement-packet";
import { rectificationBoardEmptyCopy } from "@/lib/rectification-surface-state";
import { RectificationHouseTableView } from "./rectification-house-table";
import { ConfirmationGateDisclosure, TechniqueAuditDisclosure } from "./technique-audit-disclosure";
@@ -35,6 +36,7 @@ function LayerChips({ layers }: Readonly<{ layers: readonly WindowScanLayer[] }>
function RectificationBoardBody({
result,
declaredTime,
savedStatus,
diff,
compact,
@@ -42,6 +44,7 @@ function RectificationBoardBody({
onClose,
}: Readonly<{
result: RectificationCandidateResult | null;
declaredTime: string | null;
savedStatus: "accepted" | "confirmed" | null;
diff: RectificationBoardDiff;
compact: boolean;
@@ -50,6 +53,7 @@ function RectificationBoardBody({
}>) {
const table = result ? workingRectificationHouseTable(result) : null;
const workingTime = workingRectificationTime(result);
const emptyCopy = rectificationBoardEmptyCopy(declaredTime);
const grouped = result ? groupWindowTransitions(result.windowTransitions) : [];
const scoringMinutes = grouped.filter((row) => row.scoringLayers.length > 0);
const displayMinutes = grouped.filter((row) => row.displayLayers.length > 0);
@@ -69,7 +73,11 @@ function RectificationBoardBody({
<header className="rectification-board__header">
<div className="rectification-board__title-row">
<h2 id={titleId}></h2>
{workingTime ? <span className="rectification-board__clock">{workingTime}</span> : null}
{workingTime
? <span className="rectification-board__clock">{workingTime}</span>
: emptyCopy.clock
? <span className="rectification-board__clock is-declared">{emptyCopy.clock}</span>
: null}
{compact && (
<button
className="rectification-board__close"
@@ -86,9 +94,9 @@ function RectificationBoardBody({
<div className="rectification-board__body">
<p className="sr-only" role="status" aria-live="polite" aria-atomic="true">{diff.liveMessage}</p>
{!table && (
<p className="rectification-board__empty">
</p>
<div className="rectification-board__empty">
{emptyCopy.lines.map((line) => <p key={line}>{line}</p>)}
</div>
)}
{table && (
<div className="rectification-snapshot">
@@ -194,6 +202,7 @@ function RectificationBoardBody({
export function RectificationBoard({
result,
declaredTime,
savedStatus,
diff,
compact,
@@ -203,6 +212,7 @@ export function RectificationBoard({
onClose,
}: Readonly<{
result: RectificationCandidateResult | null;
declaredTime: string | null;
savedStatus: "accepted" | "confirmed" | null;
diff: RectificationBoardDiff;
compact: boolean;
@@ -237,6 +247,7 @@ export function RectificationBoard({
>
<RectificationBoardBody
result={result}
declaredTime={declaredTime}
savedStatus={savedStatus}
diff={diff}
compact={compact}
@@ -258,16 +269,18 @@ export function RectificationBoard({
export function RectificationBoardPeek({
result,
declaredTime = null,
expanded,
boardId,
onOpen,
}: Readonly<{
result: RectificationCandidateResult | null;
declaredTime?: string | null;
expanded: boolean;
boardId: string;
onOpen: () => void;
}>) {
const peek = rectificationBoardPeekCopy(result);
const peek = rectificationBoardPeekCopy(result, declaredTime);
return (
<button
className="rectification-board-peek"
@@ -1,6 +1,8 @@
"use client";
import { Check } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { InlineSpinner } from "@/components/inline-spinner";
import type {
ChoiceKey,
RectificationChoiceCard as ChoiceCard,
@@ -43,6 +45,14 @@ export function RectificationChoiceCard(props: RectificationChoiceCardProps) {
className={`rectification-choice-card${props.pending ? " is-pending" : ""}${answered ? " is-answered" : ""}`}
aria-label={props.card.scoring ? "校正判断" : "盘外核对"}
>
{props.pending && answered ? (
// The tap is being recorded: the same live-row shape as a timeline step,
// so the card itself says something is happening (BUG-482).
<p className="rectification-choice-card__pending" role="status">
<InlineSpinner size={12} />
<span className="agent-activity-status__text"></span>
</p>
) : null}
<fieldset
className="birth-time-choice-question"
disabled={props.pending || props.disabled || answered}
@@ -61,6 +71,12 @@ export function RectificationChoiceCard(props: RectificationChoiceCardProps) {
onClick={() => select(option.key)}
>
<strong>{option.key}.</strong> {option.label}
{selectedKey === option.key ? (
<span className="rectification-choice-card__selected">
<Check aria-hidden="true" />
</span>
) : null}
</button>
))}
<button
@@ -70,6 +86,12 @@ export function RectificationChoiceCard(props: RectificationChoiceCardProps) {
onClick={stop}
>
{props.card.stop_label}
{selectedKey === "stop" ? (
<span className="rectification-choice-card__selected">
<Check aria-hidden="true" />
</span>
) : null}
</button>
</div>
</fieldset>
@@ -160,13 +160,18 @@ export function diffRectificationBoard(
};
}
export function rectificationBoardPeekCopy(result: RectificationCandidateResult | null): Readonly<{
export function rectificationBoardPeekCopy(
result: RectificationCandidateResult | null,
declaredTime: string | null = null,
): Readonly<{
title: string;
detail: string | null;
}> {
const table = result ? workingRectificationHouseTable(result) : null;
if (!table) {
return { title: "当前盘面", detail: "补充经历后会在这里更新" };
// Before any candidate exists the board still has a time to show: the one
// the reader declared (BUG-483). Without one, say what fills it later.
return { title: "当前盘面", detail: declaredTime ? `填报 ${declaredTime}` : "补充经历后会在这里更新" };
}
return { title: "当前盘面", detail: `${table.time} · 上升${table.lagna}` };
}