remove signup store#29092
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the legacy signup Zustand store and replaces it with lightweight feature-local state helpers for signup device-name draft and the post-signup email banner state, simplifying global store surface area.
Changes:
- Deleted
shared/stores/signup.tsxand removedsignupfrom the store registry and init wiring. - Introduced module-scoped helpers for signup device name draft (
shared/signup/device-name-draft.tsx) and signup email banner state (shared/people/signup-email.tsx) and updated signup/people flows to use them. - Updated/rewrote signup store tests to cover the new helpers and adjusted init subscriptions/engine handlers to clear the new state.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| skill/zustand-store-pruning/references/store-checklist.md | Marks signup store removal as completed in the pruning checklist. |
| shared/stores/tests/signup.test.ts | Replaces store-based tests with helper-based tests for signup email + device name draft. |
| shared/stores/store-registry.tsx | Removes signup from registry types and dynamic hook loader. |
| shared/stores/signup.tsx | Deletes the signup Zustand store implementation. |
| shared/signup/username.tsx | Clears device-name draft on back navigation instead of resetting the removed store. |
| shared/signup/routes.tsx | Stores the “no email” sentinel via setSignupEmail instead of the removed store. |
| shared/signup/email.tsx | Stores the entered/skipped email via setSignupEmail instead of the removed store. |
| shared/signup/device-name.tsx | Uses device-name draft helper and calls push prompt directly from usePushState. |
| shared/signup/device-name-draft.tsx | New module-scoped helper for staging/clearing the signup device name. |
| shared/people/signup-email.tsx | New external-store helper (with useSyncExternalStore) for the post-signup email banner value. |
| shared/people/index.shared.tsx | Refactors banner component to take signupEmail as a prop and clears via clearSignupEmail. |
| shared/people/container.tsx | Reads signupEmail from useSignupEmail() and passes through People props. |
| shared/constants/init/shared.tsx | Removes signup callback wiring and clears new helpers on logout/tab leave and email-verified engine events. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
323fa1c to
a35bca9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 37 out of 38 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case T.RPCChat.SyncInboxResType.current: | ||
| if (get().inboxRows.length === 0) { | ||
| inboxRefresh('inboxSyncedCurrentButEmpty') | ||
| } |
There was a problem hiding this comment.
Calling inboxRefresh whenever syncType is current and inboxRows.length === 0 can lead to repeated refreshes for accounts with an actually-empty inbox (and can potentially loop if a refresh triggers another ChatInboxSynced/current). Consider gating this to only happen when the inbox has never loaded yet (e.g. !get().inboxHasLoaded) or track a one-shot retry flag so we only attempt this recovery once per session.
No description provided.