HEL-829 review: mechanical lint fix in ManagePanel (U+3000 -> space, drop unused eslint-disable directives, trailing ws)

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
Chief Engineer
2026-10-24 11:14:22 +08:00
co-authored by multica-agent
parent 58d65aea05
commit 64a47f35d0
+4 -4
View File
@@ -122,7 +122,7 @@ export function ManagePanel({ state, open, onClose, onSave, fail, theme, setThem
} }
const switchSection = (s: string) => { request.current?.abort(); generation.current++; setBusy(false); setSection(s); setDetail(true); setMessage(''); };
const lastFocus = useRef(focus);
useEffect(() => { if (focus === lastFocus.current) return; lastFocus.current = focus; switchSection('her'); }, [focus]); // eslint-disable-line react-hooks/exhaustive-deps
useEffect(() => { if (focus === lastFocus.current) return; lastFocus.current = focus; switchSection('her'); }, [focus]);
// Esc on a phone steps back from a section to the section list first; confirmations handle their own Esc.
useEffect(() => { if (!open || !detail) return; const key = (e: KeyboardEvent) => { if (e.key !== 'Escape' || confirm || !matchMedia('(max-width:720px)').matches) return; e.stopImmediatePropagation(); setDetail(false); }; window.addEventListener('keydown', key, true); return () => window.removeEventListener('keydown', key, true); }, [open, detail, confirm]);
const growth = state.memories.filter(m => m.group === '她的成长' && m.lifeIds.every(id => state.events.some(e => e.id === id && e.shared === true)));
@@ -135,13 +135,13 @@ export function ManagePanel({ state, open, onClose, onSave, fail, theme, setThem
if (!quiet) setPersonaLoad('loading');
loadPersona(c.signal).then(view => { if (!c.signal.aborted) { setPersona(view); setPersonaLoad('ok'); } }, () => { if (!c.signal.aborted && !quiet) setPersonaLoad('error'); });
};
useEffect(() => { if (!real || !open || section !== 'her') return; polls.current = 0; readPersona(); return () => personaRequest.current?.abort(); }, [real, open, section, personaRead]); // eslint-disable-line react-hooks/exhaustive-deps
useEffect(() => { if (!real || !open || section !== 'her') return; polls.current = 0; readPersona(); return () => personaRequest.current?.abort(); }, [real, open, section, personaRead]);
// A profile created moments ago may still be forming: look again a bounded number of times, never forever.
useEffect(() => {
if (!real || !open || section !== 'her' || persona?.state !== 'loading' || polls.current >= 12) return;
const t = setTimeout(() => { polls.current++; readPersona(true); }, 5000);
return () => clearTimeout(t);
}, [real, open, section, persona]); // eslint-disable-line react-hooks/exhaustive-deps
}, [real, open, section, persona]);
async function retryGeneration() {
personaRequest.current?.abort(); const c = new AbortController(); personaRequest.current = c;
setPersonaBusy(true); setPersonaNote('');
@@ -155,7 +155,7 @@ export function ManagePanel({ state, open, onClose, onSave, fail, theme, setThem
if (personaLoad === 'loading' && !persona) return <div className="skel" aria-hidden="true">{[78, 62, 70, 54].map(w => <i key={w} style={{ width: `${w}%` }}/>)}</div>;
if (personaLoad === 'error' || !persona) return <div className="off-card" role="alert"><p className="off-t">她的这部分资料一时没读出来。</p><p>不是你的问题,资料仍在服务器保存。</p><Button onClick={() => setPersonaRead(n => n + 1)}>再试一次</Button></div>;
const p = persona, interp = p.interpretation;
if (p.state === 'ready' && interp) return <><blockquote className="quote">{interp.text}</blockquote><p className="d-dim">{backfilled(interp.provenance) ? `后来补上的初始印象 · ${day(interp.created_at)} 生成,不是她出生时就有的。` : `创建时形成 · ${day(interp.created_at)}`} 由模型从出生资料自主形成,会延续;不是固定模板,也不能直接改写。</p></>;
if (p.state === 'ready' && interp) return <><blockquote className="quote">{interp.text}</blockquote><p className="d-dim">{backfilled(interp.provenance) ? `后来补上的初始印象 · ${day(interp.created_at)} 生成,不是她出生时就有的。` : `创建时形成 · ${day(interp.created_at)}`} 由模型从出生资料自主形成,会延续;不是固定模板,也不能直接改写。</p></>;
if (p.state === 'loading') return <><div className="skel" aria-hidden="true">{[78, 62, 70].map(w => <i key={w} style={{ width: `${w}%` }}/>)}</div><p className="d-dim" role="status">{polls.current >= 12 ? '还在形成中。稍后回到这里会再看一次。' : '她正在形成对自己的理解…'}</p></>;
if (p.state === 'failed') return <div className="off-card" role="alert"><p className="off-t">她对自己的理解这次没有形成。</p><p>档案、名字和底色都保留;这里不会用模板顶替。</p>{personaNote && <p className="d-dim">{personaNote}</p>}<Button disabled={personaBusy} onClick={() => void retryGeneration()}>{personaBusy ? '正在重新形成…' : '重新形成'}</Button></div>;
if (p.state === 'not_initialized') return <Off title="这份档案创建时还没有这一层。" will="她对自己的理解和最初的小习惯,是这个版本以后新建档案时才会形成的。已有的档案不会被自动补建。" now="补建需要单独授权,这里不会自动生成,也不会用模板顶替。"/>;