docs(web): drop migration-history framing from store docstrings (LUM-1752)#31362
Merged
ashleeradka merged 1 commit intoMay 20, 2026
Merged
Conversation
…1752)
Rewrites the module docstrings on auth-store, organization-store,
nudge-store, and onboarding-store to describe what each store does
now — session lifecycle, org list + active-org selection, nudge
prefs, onboarding/privacy flags — instead of leading with what it
replaced. Same for the inline focus-refetch comment in
setupOrganizationStore.
No behavior changes; docstrings and one inline comment only.
Acceptance grep clean:
grep -rnE 'Replaces the|previously lived|Matches the old' \
apps/web/src --include='*.ts' --include='*.tsx'
https://claude.ai/code/session_018S9mQ5rmtUAvixYCcmXJaZ
Contributor
There was a problem hiding this comment.
✦ APPROVE
Documentation-only — no behavior changes. All four files follow the STYLE_GUIDE rule from #31354: docstrings lead with what the store does today, not where it came from.
Each rewrite is an improvement:
auth-store.ts— new opener leads with session lifecycle behavior (allauth probe, focus/visibility refresh, BroadcastChannel) instead of the "Replaces React Context" frame. The "read from anywhere" rationale is now embedded in the lifecycle sentence where it belongs.organization-store.ts— "Owns the organization list and active-organization selection" is immediately useful. The dropped inline comment ("Matches the old React QueryrefetchOnWindowFocus+staleTimebehavior") is replaced by a behavior description that's actually more informative — it explains why the stale check exists (rapid focus events on fresh data).nudge-store.ts— "Owns whether each nudge has been actioned or dismissed and when" is much clearer than theuseSyncExternalStorearchaeology. Seed-from-per-key description now explains the keys without "legacy" or "platform deployment" framing. Section header ("hydrate from legacy per-key localStorage entries" → "seeded from per-key localStorage entries on first load") adds timing context and drops the loaded word.onboarding-store.ts— the new per-key write rationale is actually more informative: "so a field that was never explicitly set stays absent in localStorage — keeping the privacy-safe default intact" makes the invariant explicit where before it was implied by migration history.
computeInitialFromLegacy name left as-is — correct call. Renaming a function is wider than a docstring pass and the PR body calls it out explicitly.
Anti-patterns KB: nothing to flag (no code changes).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clean up the 5 module-level docstrings (and one inline comment) flagged in LUM-1752 — opens with "Replaces the React Context-based X with..." / "previously lived in Y" / "Matches the old React Query behavior" are now rewritten to describe what each store does today.
Per the STYLE_GUIDE rule added in #31354.
Files
apps/web/src/stores/auth-store.ts— module docstring leads with session lifecycle (allauth probe, focus/visibility refresh, cross-tab BroadcastChannel) instead of the React-Context-replacement narrative.apps/web/src/stores/organization-store.ts— module docstring + thesetupOrganizationStorefocus-refetch comment. Behavior described directly (refetch on focus when older thanSTALE_TIME_MS) instead of by comparison to React Query.apps/web/src/domains/nudges/nudge-store.ts— module docstring (kept the persist + cross-tab sync detail, dropped the "useSyncExternalStore that previously lived in..." opener and the "platform deployment" reference). Also retitled the section header abovecomputeInitialFromLegacyto avoid framing the on-first-load seeding step as "legacy".apps/web/src/domains/onboarding/onboarding-store.ts— module docstring (kept the substantive "why not Zustand persist" rationale, dropped the migration narrative and the "preserving the original" framing). The privacy-safe-default reasoning that motivates the per-key writes is now self-contained.Out of scope (intentionally not touched)
computeInitialFromLegacyfunction name — renaming the symbol is a wider change than the ticket asked for (docstrings + one inline comment).// Initial state ... seeded from per-key localStorage entries on first loadis the surviving section header for that block; the function still describes a real runtime concern (seeding the store on first load from per-key entries), so the seeding step itself is documented, just without the "legacy" framing.Test plan
bun test src/stores/ src/domains/nudges/ src/domains/onboarding/— 32 / 32 passbunx tsc --noEmit— cleanbun run linton the 4 touched files — cleangrep -rnE 'Replaces the|previously lived|Matches the old' apps/web/src --include='*.ts' --include='*.tsx'returns nothinghttps://claude.ai/code/session_018S9mQ5rmtUAvixYCcmXJaZ
Generated by Claude Code