fix(ui): sync useLocalStorage across tabs via storage events (#8384) - #8422
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-24 12:47:25 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
useLocalStoragelisten for the nativestorageevent so already-mounted hooks in other same-origin tabs re-render when the same key (or configuredlegacyKey) changes elsewhere.initialwhen another tab removes the key (newValue: null); ignore malformed JSON the same way mount-time reads already do.use-local-storage.test.tswith cross-tab sync, ignore-other-key, null-reset, malformed, legacyKey, and unmount cleanup coverage.Closes #8384
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
apps/loopover-ui(Codecov ignoresapps/**). Validated withnpm run ui:test,npm run ui:typecheck,npm run ui:lint,git diff --check, andnpm audit --audit-level=moderateas required by the issue.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
No visual/layout change — data-correctness fix only (cross-tab state sync). Per the issue Expected Outcome: no UI Evidence screenshots required.
Notes
startHealthPolling()inapps/loopover-ui/src/lib/api/status.ts.initialis read via a ref so inline[]/ object-literal call sites do not re-subscribe every render.