Skip to content

feat(ui): dual-read browser localStorage keys during the rebrand - #5405

Merged
JSONbored merged 1 commit into
mainfrom
loopover/localstorage-dual-read
Jul 12, 2026
Merged

feat(ui): dual-read browser localStorage keys during the rebrand#5405
JSONbored merged 1 commit into
mainfrom
loopover/localstorage-dual-read

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Renames 6 client-side localStorage keys from gittensory.* to loopover.* (workbench tab, saved run views, onboarding checklist state, notification opt-in, the API playground session token, and the maintainer onboarding-preview dismiss flag), with a one-time migration: read the new key, fall back to the legacy key if absent, and write the value forward so every later read hits the new key directly.

Renaming these outright would have silently reset every returning visitor's saved state -- most notably logging out anyone with a saved session token.

useLocalStorage (used by 4 of the 6 sites) gains an optional legacyKey parameter implementing this pattern once; the two sites using raw localStorage directly get the same treatment (one inline in try-it.tsx, refactored into a small exported/testable readStoredSessionToken function since the component itself is heavier to render in a test than the migration logic warrants).

Also fixes a real user-facing "Gittensory" brand string left in the onboarding preview card's rendered heading ("Here's what Gittensory would have flagged" → "...LoopOver..."), caught while touching this file for its dismiss-key migration.

Test plan

  • New test file for useLocalStorage's legacyKey migration: reads new-key-present, legacy-fallback-with-forward-migration, neither-present, no-legacyKey-given (unchanged behavior), and write-through-after-migration
  • New test file for try-it.tsx's extracted readStoredSessionToken: same three read-path cases
  • Updated onboarding-preview-card.test.tsx's existing dismiss-persistence test for the renamed heading text
  • Full test:ci gate green end-to-end (typecheck, ui:lint, ui:test, ui:build)
  • Confirmed every remaining gittensory.*/gittensory_* key-string reference in the diff is exactly the intended legacy-fallback constant, nothing else

Closes #5337.

Renames 6 client-side localStorage keys from gittensory.* to
loopover.* (workbench tab, saved run views, onboarding checklist
state, notification opt-in, the API playground session token, and
the maintainer onboarding-preview dismiss flag), with a one-time
migration fallback: read the new key, fall back to the legacy key if
absent, and write the value forward so every later read hits the new
key directly. Renaming these outright would have silently reset every
returning visitor's saved state -- most notably logging out anyone
with a saved session token.

useLocalStorage (used by 4 of the 6 sites) gains an optional
legacyKey parameter implementing this pattern once; the two call
sites using raw localStorage directly (the API playground token,
and the one dismiss-flag site that already used the hook) get the
same treatment inline / via the hook respectively.

Also fixes a real user-facing "Gittensory" brand-string left in the
onboarding preview card's rendered heading, caught while touching
this file for its dismiss-key migration.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 6e160b8 Commit Preview URL

Branch Preview URL
Jul 12 2026, 05:00 PM

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-12 19:03:17 UTC

10 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): apps/gittensory-ui/src/components/site/api/try-it.test.ts (matched apps/gittensory-ui/**), apps/gittensory-ui/src/components/site/api/try-it.tsx (matched apps/gittensory-ui/**), apps/gittensory-ui/src/components/site/app-panels/onboarding-preview-card.test.tsx (matched apps/gittensory-ui/**), apps/gittensory-ui/src/components/site/app-panels/onboarding-preview-card.tsx (matched apps/gittensory-ui/**), apps/gittensory-ui/src/components/site/notification-readiness-card.tsx (matched apps/gittensory-ui/**), and 5 more.

Review summary
This PR implements a dual-read/write-forward localStorage migration for 6 keys renamed as part of a gittensory→loopover rebrand, extending useLocalStorage with an optional legacyKey parameter and adding an equivalent readStoredSessionToken helper for the raw-localStorage case in try-it.tsx. The logic is correct and consistent across all 6 call sites, the migration semantics (read new, fall back to legacy, write forward, leave legacy in place) are sound and match the stated intent, and each new behavior path is covered by real tests exercising the actual hook/function rather than fabricated scenarios. It also fixes a real leftover 'Gittensory' brand string in onboarding-preview-card.tsx's rendered heading, caught incidentally while touching that file.

Blockers

  • apps/gittensory-ui/src/components/site/api/try-it.tsx:87 leaves LEGACY_STORAGE_KEY intact when saveToken("") clears STORAGE_KEY, so any browser with gittensory.session_token still set will have the token restored by readStoredSessionToken on the next op change/remount; remove both keys in the clear branch, e.g. localStorage.removeItem(STORAGE_KEY); localStorage.removeItem(LEGACY_STORAGE_KEY).
Nits — 7 non-blocking
  • try-it.tsx:20 readStoredSessionToken returns '' when neither key is present but the pre-existing placeholder/copy still says 'Gittensory session token' at try-it.tsx (unrelated brand string left over) — worth a follow-up pass since this diff already fixes one such string in onboarding-preview-card.tsx.
  • use-local-storage.ts's legacy read/migrate path only runs once per mount via the effect keyed on [key, legacyKey]; if a user has the app open in two tabs during the migration window, the second tab's storage event listener behavior for legacy-key writes isn't addressed — likely fine given it's a one-time rebrand window, but worth confirming intentional.
  • onboarding-preview-card.tsx and notification-readiness-card.tsx now pass a 3rd positional arg to useLocalStorage; consider a small JSDoc example in use-local-storage.ts showing the legacyKey call shape for future call sites.
  • Consider adding a follow-up ticket to remove the legacyKey plumbing and legacy key reads once the migration window has safely passed, so this dual-read logic doesn't linger indefinitely.
  • The extracted readStoredSessionToken in try-it.tsx is a nice testability win — consider the same extraction pattern if more raw-localStorage sites appear in the future.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5337
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 44 registered-repo PR(s), 36 merged, 457 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 44 PR(s), 457 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 44 PR(s), 457 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/app desktop before /app after /app
/app mobile before /app (mobile) after /app (mobile)
/app/runs desktop before /app/runs after /app/runs
/app/runs mobile before /app/runs (mobile) after /app/runs (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 12, 2026
@JSONbored
JSONbored merged commit 112bc4a into main Jul 12, 2026
12 checks passed
@JSONbored
JSONbored deleted the loopover/localstorage-dual-read branch July 12, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dual-read client-side localStorage keys during the rebrand cutover

1 participant