Repository navigation
Improve setup wizard onboarding - #86
Conversation
Confidence Score: 3/5Issues Detected1. Duplicate state updates in
// refreshHarnessStatus already sets:
// setInventories(result);
// setHarnessState(hasModelReadyHarness(result) || hasInstalledHarness(result) ? "ready" : "none");
useEffect(() => {
let cancelled = false;
void (async () => {
const result = await refreshHarnessStatus(); // <-- already sets state
if (cancelled) return;
setInventories(result); // <-- redundant
setHarnessState(/* same logic */); // <-- redundant
})();
return () => { cancelled = true; };
}, []);Fix: Remove the duplicate state-sets in the useEffect(() => {
let cancelled = false;
void (async () => {
await refreshHarnessStatus();
if (cancelled) return;
})();
return () => { cancelled = true; };
}, []);2. Duplicate harness-state logic — The same ternary expression appears in two places. If the readiness criteria ever changes (e.g., adding "warning" status), both sites must be updated in lockstep. 3.
What's Working Well
|
Confidence Score: 4/5Issues Detected1.
// REMOVED — this was the only way to collapse the sidebar by dragging/clicking the edge
<SidebarRail />Fix: Unless you've verified the sidebar trigger button is always accessible, keep the 2. Inconsistent return value from When async function refreshHarnessStatus(shouldUpdate = () => true) {
setHarnessState("detecting");
try {
const result = await client.runtime.getHarnessInventories().catch(() => []);
if (!shouldUpdate()) return result; // returns real data
// ...
} catch {
if (!shouldUpdate()) return []; // returns empty
// ...
}
}Fix: Return the same shape in both early-exit paths. Either both return 3.
async function refreshHarnessStatus(shouldUpdate = () => true) {
setHarnessState("detecting"); // fires even if shouldUpdate returns false at next checkFix: Guard the initial state set or move it after the cancellation check: async function refreshHarnessStatus(shouldUpdate = () => true) {
if (!shouldUpdate()) return [];
setHarnessState("detecting");
// ...4. Button layout The "Check again" button moves from the right edge (grouped with other actions) to the far left, creating visual separation. This is a deliberate UX choice but should be confirmed with design. What's Working Well
|


Summary\n- Improve setup wizard onboarding flow and state handling\n- Clean up obsolete setup wizard locale strings\n- Resolve sidebar merge cleanup\n\n## Checks\n- vp check (passes with existing pi-bridge await-thenable warnings)