WIP: pull out of store 1#29074
Open
chrisnojima-zoom wants to merge 21 commits intonojima/HOTPOT-next-670-cleanfrom
Open
WIP: pull out of store 1#29074chrisnojima-zoom wants to merge 21 commits intonojima/HOTPOT-next-670-cleanfrom
chrisnojima-zoom wants to merge 21 commits intonojima/HOTPOT-next-670-cleanfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR continues the “zustand-store-pruning” effort by shrinking several Keybase Zustand stores (notably signup, settings-email, and settings-password) and moving screen-owned RPC orchestration and transient form state into route params, component state, and new hooks.
Changes:
- Added a new pruning skill (
zustand-store-pruning) plus reference docs/checklists to guide a stacked cleanup series. - Refactored signup flow to rely on route params + local component state (and new
useRequestAutoInvite) instead of storing username/invite/signup errors globally. - Pruned
settings-email/settings-passwordstores to retain only shared/notification-backed state; moved add-email and password-submit flows into component hooks and updated tests accordingly.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| skill/zustand-store-pruning/references/store-checklist.md | Adds a running checklist for the stacked store-pruning series. |
| skill/zustand-store-pruning/references/keybase-examples.md | Adds concrete examples/heuristics for what to keep global vs move local/route. |
| skill/zustand-store-pruning/agents/openai.yaml | Registers a “Zustand Store Pruning” agent configuration. |
| skill/zustand-store-pruning/SKILL.md | Documents the refactor workflow/rules for pruning Zustand stores safely. |
| shared/stores/tests/signup.test.ts | Updates tests to match the slimmer signup store API. |
| shared/stores/tests/settings-password.test.ts | Updates tests to reflect settings-password store only caching randomPW. |
| shared/stores/tests/settings-email.test.ts | Updates tests to match removal of add-email orchestration from the store. |
| shared/stores/signup.tsx | Removes screen-local signup orchestration/state; keeps only device name + verified-email staging. |
| shared/stores/settings-password.tsx | Removes UI/RPC orchestration; keeps only cached randomPW + notification update. |
| shared/stores/settings-email.tsx | Removes add-email form/RPC orchestration; keeps email map + banner state + edit actions. |
| shared/signup/username.tsx | Moves username validation/RPC to component state and passes invite/username via route params. |
| shared/signup/use-request-auto-invite.ts | New hook to fetch invite code and navigate into signup with params (replacing store action). |
| shared/signup/email.tsx | Uses new useAddEmail hook instead of store-owned add-email state/RPC. |
| shared/signup/device-name.tsx | Moves device-name validation + signup RPC into the screen, using route params for username/invite. |
| shared/settings/password.tsx | Adds useSubmitNewPassword hook and moves PGP state fetch + password submit out of the store. |
| shared/settings/logout.tsx | Switches to useSubmitNewPassword and local PGP state loading. |
| shared/settings/advanced.tsx | Moves remember-passphrase RPC/state out of the store and into component-local state. |
| shared/settings/account/use-add-email.tsx | New hook that owns add-email validation, RPC, waiting, and error state. |
| shared/settings/account/index.tsx | Removes call sites for now-removed password-store loadRememberPassword. |
| shared/settings/account/add-modals.tsx | Converts email-add modal to use useAddEmail instead of store-owned add-email flow. |
| shared/provision/username-or-email.tsx | Switches signup entry to use useRequestAutoInvite hook. |
| shared/people/todo.tsx | Removes dependency on removed settings-email.addingEmail field. |
| shared/login/signup/error.tsx | Converts signup error screen to read error details from route params instead of signup store. |
| shared/login/relogin/container.tsx | Switches “create account” entry to useRequestAutoInvite. |
| shared/login/recover-password/password.tsx | Updates UpdatePassword usage to match new props shape. |
| shared/login/join-or-login.tsx | Switches “create account” entry to useRequestAutoInvite. |
Comments suppressed due to low confidence (1)
shared/signup/username.tsx:108
onContinuecan still fire while an RPC is in-flight (e.g., via Enter key), because it only checksdisabledanddisableddoesn’t incorporateprops.waiting. This can lead to duplicatesignupCheckUsernameAvailablecalls and multiple navigations. Consider treatingwaitingas a disabling condition (and early-returning inonContinue) so the handler is a no-op whileprops.waitingis true.
const onContinue = () => {
if (disabled) {
return
}
onChangeUsername(usernameTrimmed) // maybe trim the input
props.onContinue(usernameTrimmed)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Thinning out stores for non global/cross-screen stuff