fix(ui): migrate the pre-rebrand analytics window preference forward - #8728
fix(ui): migrate the pre-rebrand analytics window preference forward#8728tryeverything24 wants to merge 1 commit into
Conversation
…legacyKey fallback app.analytics.tsx called useLocalStorage with no third legacyKey argument, unlike its rebrand siblings app.runs.tsx and app.workbench.tsx. The storage key was renamed from gittensory.analytics.windowDays to loopover.analytics.windowDays in the same rebrand commit (75450f1) that added the legacyKey migration elsewhere, so a returning user who had picked a 30d/90d window silently reverted to the 7-day default. Pass gittensory.analytics.windowDays as the legacy key: the hook reads it once when the new key is absent, adopts the value, and backfills the new key, exactly like the runs/workbench view preferences. Closes JSONbored#8699
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-26 01:19:44 UTC
Review summary Nits — 4 non-blocking
CI checks failing
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. Visual previewClick any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll previewA short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 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.
|
|
This pull request changes UI/visual code but its screenshot evidence is incomplete. Every required viewport × theme combination needs its own before/after image pair in a labeled table row (e.g. "Desktop · Light | before | after"). Still missing: Desktop · Dark, Tablet · Dark, Mobile · Dark. Please resubmit with the remaining rows filled in. See https://github.com/JSONbored/loopover/blob/main/.claude/skills/contributing-to-loopover/SKILL.md for the exact format and examples. This is an automated maintenance action. |









Closes #8699
What
app.analytics.tsxcalleduseLocalStorage<AnalyticsWindowDays>(ANALYTICS_WINDOW_STORAGE_KEY, DEFAULT_ANALYTICS_WINDOW_DAYS)with no thirdlegacyKeyargument. The key was renamed from"gittensory.analytics.windowDays"to"loopover.analytics.windowDays"in the rebrand commit (75450f1d5) that gaveapp.runs.tsxandapp.workbench.tsxtheir one-timelegacyKeymigration — this file was missed. Any returning user who had picked a 30d/90d analytics window before the cutover silently reverted to the 7-day default.How
apps/loopover-ui/src/routes/app.analytics.tsxnow passes"gittensory.analytics.windowDays"as the thirduseLocalStorageargument, matching theapp.runs.tsx/app.workbench.tsxpattern exactly. The hook already implements the one-time fallback: if the new key is absent it reads the legacy key, adopts the value, and writes it forward to the new key (leaving the legacy key in place).Deliverables
useLocalStoragecall for the analytics window preference includes the"gittensory.analytics.windowDays"legacy key.apps/loopover-ui/src/routes/app.analytics.test.tsx: seedslocalStorage["gittensory.analytics.windowDays"] = "30", mountsProductAnalytics, and asserts the toggle group shows 30d selected (data-state="on", 7d"off"), the dashboard is fetched for?days=30, andlocalStorage["loopover.analytics.windowDays"]is backfilled with"30"— mirroring the migration tests used for the runs/workbench keys inuse-local-storage.test.ts. A companion test pins the no-keys case: 7d default, and no value invented under either key.Before / after
On unfixed
main(fix stashed), the new migration test fails exactly as the issue describes — the seeded 30d preference is ignored and the default wins:With the fix: