research UI: fix 3 lint errors — async wrapper + escape apostrophe
ci / gates (push) Successful in 7s
ci / frontend (push) Failing after 19s
ci / rust (push) Successful in 3m46s
ci / e2e (push) Has been skipped
ci / publish (push) Has been skipped

Push right after ec1ddc6 tripped three eslint errors on the same-commit
lint pass. All three are cosmetic in behavior:

- ResearchList.tsx:48 + ResearchCanvas.tsx:64 — setState was called
  synchronously at the top of a useEffect. Wrap the body in an inner
  async load() and call setState inside it; effect still returns the
  cleanup for the alive-flag guard.
- ResearchWizard.tsx:207 — bare apostrophe in JSX text ("workspace's").
  Replace with ' to satisfy react/no-unescaped-entities.
This commit is contained in:
Omar Sobh
2026-07-06 07:03:11 -07:00
parent ec1ddc634d
commit 1466f8aadc
3 changed files with 20 additions and 18 deletions
@@ -65,18 +65,19 @@ export function ResearchCanvas({
return; return;
} }
let alive = true; let alive = true;
setLoading(true); const load = async () => {
setError(null); setLoading(true);
getTopic(selectedId) setError(null);
.then((d) => { try {
const d = await getTopic(selectedId);
if (alive) setTopic(d); if (alive) setTopic(d);
}) } catch (e) {
.catch((e) => {
if (alive) setError(e instanceof Error ? e.message : "load failed"); if (alive) setError(e instanceof Error ? e.message : "load failed");
}) } finally {
.finally(() => {
if (alive) setLoading(false); if (alive) setLoading(false);
}); }
};
load();
return () => { return () => {
alive = false; alive = false;
}; };
@@ -45,17 +45,18 @@ export function ResearchList({
useEffect(() => { useEffect(() => {
let alive = true; let alive = true;
setLoading(true); const load = async () => {
listTopics() setLoading(true);
.then((rows) => { try {
const rows = await listTopics();
if (alive) setTopics(rows); if (alive) setTopics(rows);
}) } catch {
.catch(() => {
if (alive) setTopics([]); if (alive) setTopics([]);
}) } finally {
.finally(() => {
if (alive) setLoading(false); if (alive) setLoading(false);
}); }
};
load();
return () => { return () => {
alive = false; alive = false;
}; };
@@ -204,7 +204,7 @@ export function ResearchWizard({
) : null} ) : null}
{refining && ( {refining && (
<p style={{ fontFamily: mono, fontSize: 12, color: "#8a8a92" }}> <p style={{ fontFamily: mono, fontSize: 12, color: "#8a8a92" }}>
Calling the workspace's default provider… Calling the workspace&apos;s default provider…
</p> </p>
)} )}
{refineError && ( {refineError && (