Skip to content

less store 13#29093

Open
chrisnojima-zoom wants to merge 4 commits intonojima/ZCLIENT-less-store-12from
nojima/ZCLIENT-less-store-13
Open

less store 13#29093
chrisnojima-zoom wants to merge 4 commits intonojima/ZCLIENT-less-store-12from
nojima/ZCLIENT-less-store-13

Conversation

@chrisnojima-zoom
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the “zustand-store-pruning” effort by removing the wallets zustand store and migrating a couple of users-store RPC helpers into the feature/components that invoke them, while updating the pruning checklist documentation accordingly.

Changes:

  • Removed the wallets zustand store and its unit tests; wallets screens now load/delete accounts via direct RPC calls and pass required data via route params.
  • Removed reportUser / setUserBlocks dispatch helpers from the users store and updated call sites to invoke the underlying RPCs directly.
  • Updated the store-pruning checklist statuses/notes for team-building, tracker, users, and wallets.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
skill/zustand-store-pruning/references/store-checklist.md Updates pruning progress notes/statuses for several stores.
shared/wallets/index.tsx Loads wallet accounts via direct RPC into component state; passes needed params to modals.
shared/wallets/remove-account.tsx Removes wallets-store dependency; uses route params for name/balance display.
shared/wallets/really-remove-account.tsx Removes wallets-store dependency; deletes account via direct RPC and uses route params.
shared/stores/wallets.tsx Deletes the wallets zustand store implementation.
shared/stores/tests/wallets.test.ts Deletes wallets-store unit tests.
shared/stores/users.tsx Removes reportUser and setUserBlocks dispatch helpers from the users store.
shared/chat/blocking/block-modal.tsx Calls report/block RPCs directly instead of via users-store dispatch helpers.
shared/teams/team/rows/member-row.tsx Uses direct userSetUserBlocks RPC instead of users-store dispatch.
shared/teams/channel/rows.tsx Uses direct userSetUserBlocks RPC instead of users-store dispatch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +7 to +13
type Account = {
accountID: string
balanceDescription: string
deviceReadOnly: boolean
isDefault: boolean
name: string
}
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Account duplicates fields that already exist on the RPC type (T.RPCStellar.WalletAccountLocal). To avoid drift when the protocol type changes, consider defining this as a Pick (or alias) of the generated RPC type instead of re-declaring the shape here.

Suggested change
type Account = {
accountID: string
balanceDescription: string
deviceReadOnly: boolean
isDefault: boolean
name: string
}
type Account = Pick<
T.RPCStellar.WalletAccountLocal,
'accountID' | 'balanceDescription' | 'deviceReadOnly' | 'isDefault' | 'name'
>

Copilot uses AI. Check for mistakes.
Comment on lines 120 to +144
const Container = () => {
const [accounts, setAccounts] = React.useState<Array<Account>>([])
const [acceptedDisclaimer, setAcceptedDisclaimer] = React.useState(false)
const checkDisclaimer = C.useRPC(T.RPCStellar.localHasAcceptedDisclaimerLocalRpcPromise)

const load = useWalletsState(s => s.dispatch.load)
const loadAccounts = C.useRPC(T.RPCStellar.localGetWalletAccountsLocalRpcPromise)

C.Router2.useSafeFocusEffect(
() => {
load()
loadAccounts(
[undefined, loadAccountsWaitingKey],
res => {
setAccounts(
(res ?? []).map(a => ({
accountID: a.accountID,
balanceDescription: a.balanceDescription,
deviceReadOnly: a.deviceReadOnly,
isDefault: a.isDefault,
name: a.name,
}))
)
},
() => {
setAccounts([])
}
)
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous wallets store had unit tests for account loading/removal, but this screen now owns the RPC + mapping logic directly (and the store tests were removed). Consider adding replacement tests for the localGetWalletAccountsLocal result mapping / sorting and the navigation params used by the remove-account flow so this behavior stays covered.

Copilot uses AI. Check for mistakes.
Comment on lines +153 to +166
reportUserRPC(
[
{
comment: report.extraNotes,
convID: conversationIDKey,
includeTranscript: report.includeTranscript && !!conversationIDKey,
reason: report.reason,
username,
},
S.waitingKeyUsersReportUser,
],
() => {},
() => {}
)
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These RPC calls intentionally ignore both success and error callbacks (() => {}), which makes failures silent and hard to debug (and can leave the modal in an unclear state if a report/block fails). Consider at least logging errors and/or surfacing a user-visible error/feedback path on failure.

Copilot uses AI. Check for mistakes.
navigateUp()
deleteAccount([{accountID, userAcknowledged: 'yes'}, loadAccountsWaitingKey], () => {
navigateUp()
}, () => {})
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The delete-account RPC error callback is currently a no-op, so failures will be silent and the user won’t know why the account wasn’t removed. Consider handling the error (e.g., show a banner/toast and/or log) so this flow is diagnosable.

Suggested change
}, () => {})
}, err => {
console.error('Error deleting wallet account', err)
})

Copilot uses AI. Check for mistakes.
@chrisnojima chrisnojima force-pushed the nojima/ZCLIENT-less-store-13 branch from 125aaec to f833bc9 Compare March 30, 2026 15:01
@chrisnojima chrisnojima force-pushed the nojima/ZCLIENT-less-store-12 branch from 323fa1c to a35bca9 Compare March 30, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants