fix(web): 审稿面板去重标题/去英文 slug + 伏笔待登记数实时递减 + 移动端决策栏 + 对比度修复

This commit is contained in:
Yaojia Wang
2026-06-30 08:56:23 +02:00
parent 69030eacc3
commit f0f925b195
6 changed files with 114 additions and 40 deletions

View File

@@ -22,6 +22,9 @@ interface ForeshadowSuggestionsProps {
incomplete: boolean;
projectId: string;
chapterNo: number;
// 把「仍待处理(未登记/未回收)」的建议数上抛给报告页:
// 喂 AcceptPanel 的验收预览与伏笔分区徽标,随登记/回收操作实时递减。
onRemainingChange?: (count: number) => void;
}
interface RegisterFormState {
@@ -39,6 +42,7 @@ export function ForeshadowSuggestions({
incomplete,
projectId,
chapterNo,
onRemainingChange,
}: ForeshadowSuggestionsProps) {
const fs = useForeshadow([]);
const [openIdx, setOpenIdx] = useState<number | null>(null);
@@ -145,20 +149,24 @@ export function ForeshadowSuggestions({
.map((s, i) => ({ s, i }))
.filter(({ s, i }) => !isAlreadySaved(s, i));
// 上抛「仍待处理」建议数(已登记/已回收/历史已存的都已从 visible 过滤),
// 让报告页的验收预览与伏笔徽标随作者操作递减(父传入稳定 setter
const remaining = visible.length;
useEffect(() => {
onRemainingChange?.(remaining);
}, [remaining, onRemainingChange]);
return (
<section className="mb-4">
<h2 className="text-xs font-semibold uppercase tracking-wide text-ink-soft">
(foreshadow-analyst)
</h2>
<section>
{incomplete ? (
<Badge variant="warning" className="mt-1">
<Badge variant="warning">
<CircleDashed className="h-3 w-3" aria-hidden="true" />
</Badge>
) : visible.length === 0 ? (
<p className="mt-1 text-xs text-ink-soft"></p>
<p className="text-xs text-ink-soft"></p>
) : (
<ul className="mt-2 space-y-2">
<ul className="space-y-2">
{visible.map(({ s, i }) => {
const code = s.code;
const isResolved = s.kind === "resolved";