feat: wire up hdwallet-gridplus safecard validation - #11198
Conversation
- Added walletUid and isExternal fields to Redux SafeCard type - Updated Redux actions to store wallet UID and type during pairing - Modified utils.ts to pass expectedWalletUid for reconnection validation - Updated GridPlusSetup to capture and store wallet UID on first pairing - Updated handleSelectSafeCard to validate wallet UID on SafeCard selection - Integrated with hdwallet-gridplus@1.62.12 for validation support This enables validation that the correct SafeCard is inserted before signing, fixing the "trust me bro" issue from #10904. When reconnecting, the system now validates the wallet UID matches the expected SafeCard. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The pairConnectedDevice function now returns an object with { wallet, walletUid, isExternal }
but GridPlusPair.tsx was passing the entire object as the wallet prop, causing
"wallet.getVendor is not a function" error.
- Destructured the result in GridPlusPair.tsx to extract wallet, walletUid, isExternal
- Pass walletUid and isExternal through navigation state
- Updated GridPlusSetup to accept and use walletUid/isExternal from location state
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added validation call in GridPlusSetup when walletUid is undefined - This fixes the "Add New SafeCard" flow which wasn't capturing UIDs - Ensures all SafeCards have their hardware UID stored for validation - No duplicate validation calls - only fetches when needed Now all flows properly capture and validate wallet UIDs: 1. Initial pairing ✅ 2. Add new SafeCard ✅ 3. Reconnection with validation ✅ 4. Wrong SafeCard shows error ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Added Tag indicators for SafeCard (blue) vs Internal (green) wallets in list - Added "Switch SafeCard" menu option that disconnects and reopens wallet drawer - Created GridPlusMenu component to extend wallet menu functionality - Added translations for new menu option - Shows visual distinction between external SafeCards and internal device wallets Users can now easily: 1. See which type of wallet they're using (SafeCard vs Internal) 2. Quickly switch between SafeCards via the wallet menu 3. Understand their wallet configuration at a glance 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Validate correct SafeCard on reconnection in WalletProvider - Set expected wallet UID for JIT validation before signing - Add UI tags for SafeCard/Internal distinction - Add Switch SafeCard menu option - Reject connections without stored walletUid (cache clear required) Closes #10904 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Rewrote connectAndPairDevice to use new connectDevice() return type - Rewrote pairConnectedDevice to call connectDevice() then pairDevice() - Fixed type declarations (type: 'external' | 'internal' instead of boolean) - Fixed WalletProvider validation to use throw-based API (removed isValid check) - Removed dead code accessing getSessionId() - Removed unused sessionId variables - All lint and type-check passing Version: 1.62.13-gridplus-validation.10
Renamed across GridPlus integration: - walletUid → activeWalletId in Redux state types - uid → activeWalletId in validation return types - Updated all usages in components, utils, and hooks Updated to @shapeshiftoss/hdwallet-*@1.62.13-gridplus-validation.12 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Updated all @shapeshiftoss/hdwallet-* packages to 1.62.13-gridplus-validation.13 Fixes Device Locked error during initial pairing by removing resetActiveWallets() call that was clearing cache unnecessarily. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The Device Locked error was caused by calling adapter.connectDevice() twice during initial pairing flow: 1. Connect screen calls connectDevice() - device enters pairing mode 2. Pair screen was calling connectDevice() AGAIN - device already in pairing mode causes "Device Locked" error Fixed by removing the second connectDevice() call from pairConnectedDevice(). The connection is already established from the first call, we only need to call pairDevice() with the pairing code. This matches the master/develop behavior before our changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Updated to 1.62.13-gridplus-validation.14 with resetActiveWallets() restored in adapter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
We accidentally removed the setConnection() dispatch calls when updating to the new adapter API. This caused: - physicalDeviceId always null in Redux - "Add New" button dead click (checks physicalDeviceId) - Connect button fails with "Device Id required" Fixed by: - Re-adding dispatch parameter to connectAndPairDevice() - Calling setConnection() after successful connect - Making sessionId nullable in action type (no longer used in new API) - Passing dispatch from all call sites 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
When signing fails due to wrong SafeCard inserted, show helpful error message instead of generic "Failed to sign transaction". Changes: - Added error check in ErrorHandler for SafeCard mismatch message - Throws ChainAdapterError with specific translation key - Added translation: "Wrong SafeCard inserted. Please insert the correct SafeCard and try again." Works across all chain adapters (EVM, UTXO, Solana, Cosmos) since they all use the same ErrorHandler. Applies to both Send and Swap flows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Changed internal SafeCard tag from green to blue to match external SafeCard tags. Updated text from "Internal" to "Internal SafeCard" for clarity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Updated to hdwallet 1.62.13-gridplus-validation.15 with type-aware validation errors. Added two distinct error messages and translations: 1. External mismatch: "Wrong SafeCard inserted. Please insert the correct SafeCard and try again." 2. Internal blocked: "Remove inserted SafeCard to access internal GridPlus wallet." Changes: - Added error check in ErrorHandler for internal wallet access message - Added translation key: chainAdapters.errors.gridplus.removeSafeCard - Pass type parameter when setting expected wallet ID - Works across all chains (EVM, UTXO, Solana, Cosmos) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Updated to hdwallet 1.62.13-gridplus-validation.16 and wired up expectedType parameter: - Added expectedType to ConnectAndPairDeviceParams - Pass safeCard.type when reconnecting to existing SafeCard - Adapter now passes expectedType to validateActiveWallet This enables context-aware error messages when wrong SafeCard is inserted during reconnection or signing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Rate limit exceeded@gomesalexandre has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 40 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR implements SafeCard validation for GridPlus wallets by tracking active wallet IDs and card types through the connection flow, adding error detection for SafeCard mismatches, validating card identity before transactions, and extending the UI to distinguish between external and internal SafeCards. Changes
Sequence DiagramsequenceDiagram
actor User
participant UI as GridPlus UI
participant Hook as useGridPlusConnection
participant Utils as Connection Utils
participant Adapter as Wallet Adapter
participant State as State/Redux
User->>UI: Select SafeCard to connect
UI->>Hook: handleSelectSafeCard()
Note over Hook: Lookup selected SafeCard<br/>Extract expectedActiveWalletId<br/>and expectedType
Hook->>Utils: connectAndPairDevice({expectedActiveWalletId,<br/>expectedType})
Utils->>Adapter: connectDevice(expected*)
Adapter-->>Utils: wallet result
alt Validation Success
Utils->>State: Update connection state
Utils-->>Hook: {wallet, activeWalletId, type}
Hook->>Hook: Call pairConnectedDevice()
Hook->>Utils: pairConnectedDevice(pairingCode)
Utils->>Adapter: pairDevice(pairingCode)
Adapter-->>Utils: {wallet, activeWalletId, type}
Utils-->>Hook: pairing result with identity
Hook->>State: dispatch(addSafeCard with<br/>activeWalletId, type)
Hook->>State: dispatch(setActiveSafeCard)
State-->>Hook: SafeCard stored with validation
Hook->>UI: Navigate to finalization
Note over UI: SafeCard is now validated<br/>and linked to specific wallet
else Mismatch or Error
Adapter-->>Utils: Wrong SafeCard/validation fails
Utils-->>Hook: Error with SafeCard context
Hook->>UI: Display error message
UI->>User: "Wrong SafeCard inserted..."
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Use early return in updateSafeCardWalletUid - Remove AI-generated comments - Remove console.error statements - Remove implied Promise<void> return type - Refactor let to const with IIFE in finalizeWalletSetup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (15)
.yarnrc.yml(1 hunks)gridplus-safecard-validation.md(1 hunks)package.json(1 hunks)packages/chain-adapters/src/error/ErrorHandler.ts(1 hunks)src/assets/translations/en/main.json(3 hunks)src/context/WalletProvider/GridPlus/components/GridPlusMenu.tsx(1 hunks)src/context/WalletProvider/GridPlus/components/GridPlusPair.tsx(1 hunks)src/context/WalletProvider/GridPlus/components/GridPlusSetup.tsx(5 hunks)src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx(2 hunks)src/context/WalletProvider/GridPlus/hooks/useGridPlusConnection.ts(4 hunks)src/context/WalletProvider/GridPlus/utils.ts(3 hunks)src/context/WalletProvider/WalletProvider.tsx(2 hunks)src/context/WalletProvider/config.ts(1 hunks)src/state/slices/gridplusSlice/gridplusSlice.ts(3 hunks)src/state/slices/gridplusSlice/types.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,js,jsx}: Never assume a library is available - always check imports/package.json first
Prefer composition over inheritance
Write self-documenting code with clear variable and function names
Keep functions small and focused on a single responsibility
Avoid deep nesting - use early returns instead
Prefer procedural and easy to understand code
Never expose, log, or commit secrets, API keys, or credentials
Validate all inputs, especially user inputs
Handle errors gracefully with meaningful messages
Don't silently catch and ignore exceptions
Log errors appropriately for debugging
Provide fallback behavior when possible
Use appropriate data structures for the task
Never add code comments unless explicitly requested
When modifying code, do not add comments that reference previous implementations or explain what changed. Comments should only describe the current logic and functionality.
Use meaningful names for branches, variables, and functions
Always runyarn lint --fixandyarn type-checkafter making changes
Avoidletvariable assignments - preferconstwith inline IIFE switch statements or extract to functions for conditional logic
Files:
src/state/slices/gridplusSlice/types.tspackages/chain-adapters/src/error/ErrorHandler.tssrc/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusMenu.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/state/slices/gridplusSlice/gridplusSlice.tssrc/context/WalletProvider/GridPlus/utils.tssrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsxsrc/context/WalletProvider/config.tssrc/context/WalletProvider/GridPlus/hooks/useGridPlusConnection.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Avoid useEffect where practical - use it only when necessary and following best practices
Avoid 'any' types - use specific type annotations instead
For default values with user overrides, use computed values (useMemo) instead of useEffect - pattern:userSelected ?? smartDefault ?? fallback
When function parameters are unused due to interface requirements, refactor the interface or implementation to remove them rather than prefixing with underscore
Sanitize data before displaying to prevent XSS
Memoize aggressively - wrap component variables inuseMemoand callbacks inuseCallbackwhere possible
For static JSX icon elements (e.g.,<TbCopy />) that don't depend on state/props, define them as constants outside the component to avoid re-renders instead of using useMemo
Account for light/dark mode usinguseColorModeValuehook
Account for responsive mobile designs in all UI components
When applying styles, use the existing standards and conventions of the codebase
Use Chakra UI components and conventions
All copy/text must use translation keys - never hardcode strings
Use the translation hook:useTranslate()fromreact-polyglot
UseuseFeatureFlag('FlagName')hook to access feature flag values in components
Prefertypeoverinterfacefor type definitions
Use strict typing - avoidany
UseNominaltypes for domain identifiers (e.g.,WalletId,AccountId)
Import types from@shapeshiftoss/caipfor chain/account/asset IDs
UseuseAppSelectorfor Redux state
UseuseAppDispatchfor Redux actions
Memoize expensive computations withuseMemo
Memoize callbacks withuseCallback
**/*.{ts,tsx}: UseResult<T, E>pattern for error handling in swappers and APIs; ALWAYS useOk()andErr()from@sniptt/monads; AVOID throwing within swapper API implementations
ALWAYS use custom error classes from@shapeshiftoss/errorswith meaningful error codes for internationalization and relevant details in error objects
ALWAYS wrap async op...
Files:
src/state/slices/gridplusSlice/types.tspackages/chain-adapters/src/error/ErrorHandler.tssrc/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusMenu.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/state/slices/gridplusSlice/gridplusSlice.tssrc/context/WalletProvider/GridPlus/utils.tssrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsxsrc/context/WalletProvider/config.tssrc/context/WalletProvider/GridPlus/hooks/useGridPlusConnection.ts
src/state/slices/**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
src/state/slices/**/*.ts: Migrations are required when changing persisted state structure (seesrc/state/migrations/)
Export selectors from slice using inlineselectorsproperty
Files:
src/state/slices/gridplusSlice/types.tssrc/state/slices/gridplusSlice/gridplusSlice.ts
src/state/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
src/state/**/*.{ts,tsx}: UsecreateDeepEqualOutputSelectorfrom@/state/selector-utilsfor deep equality checks
UsecreateCachedSelectorfromre-reselectfor parameterized selectors
Files:
src/state/slices/gridplusSlice/types.tssrc/state/slices/gridplusSlice/gridplusSlice.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/naming-conventions.mdc)
**/*.{js,jsx,ts,tsx}: Use camelCase for variables, functions, and methods with descriptive names that explain the purpose
Use verb prefixes for functions that perform actions (e.g., fetch, validate, execute, update, calculate)
Use UPPER_SNAKE_CASE for constants and configuration values with descriptive names
Usehandleprefix for event handlers with descriptive names in camelCase
Use descriptive boolean variable names withis,has,can,shouldprefixes
Use named exports for components, functions, and utilities instead of default exports
Use descriptive import names and avoid renaming imports unless necessary
Avoid non-descriptive variable names likedata,item,obj, and single-letter variable names except in loops
Avoid abbreviations in names unless they are widely understood
Avoid generic function names likefn,func, orcallback
Files:
src/state/slices/gridplusSlice/types.tspackages/chain-adapters/src/error/ErrorHandler.tssrc/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusMenu.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/state/slices/gridplusSlice/gridplusSlice.tssrc/context/WalletProvider/GridPlus/utils.tssrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsxsrc/context/WalletProvider/config.tssrc/context/WalletProvider/GridPlus/hooks/useGridPlusConnection.ts
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)
**/*.{tsx,jsx}: ALWAYS wrap React components in error boundaries and provide user-friendly fallback components with error logging
ALWAYS useuseErrorToasthook for displaying errors with translated error messages and handle different error types appropriatelyUse PascalCase for React component names and match the component name to the file name
Files:
src/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusMenu.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/react-best-practices.mdc)
**/*.{jsx,tsx}: ALWAYS useuseMemofor expensive computations, object/array creations, and filtered data
ALWAYS useuseMemofor derived values and computed properties
ALWAYS useuseMemofor conditional values and simple transformations
ALWAYS useuseCallbackfor event handlers and functions passed as props
ALWAYS useuseCallbackfor any function that could be passed as a prop or dependency
ALWAYS include all dependencies inuseEffect,useMemo,useCallbackdependency arrays
NEVER use// eslint-disable-next-line react-hooks/exhaustive-depsunless absolutely necessary, and ALWAYS explain why dependencies are excluded if using eslint disable
ALWAYS use named exports for components; NEVER use default exports for components
KEEP component files under 200 lines when possible; BREAK DOWN large components into smaller, reusable pieces
EXTRACT complex logic into custom hooks
ALWAYS wrap components in error boundaries for production
ALWAYS handle async errors properly in async operations
ALWAYS provide user-friendly error messages in error handling
ALWAYS use virtualization for lists with 100+ items
ALWAYS implement proper key props for list items
ALWAYS lazy load heavy components using React.lazy for code splitting
ALWAYS use Suspense wrapper for lazy loaded components
USE local state for component-level state; LIFT state up when needed across multiple components; USE Context for avoiding prop drilling; USE Redux only for global state shared across multiple places
Wrap components receiving props withmemofor performance optimization
Files:
src/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusMenu.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/react-best-practices.mdc)
Ensure TypeScript types are explicit and proper; avoid use of
anytype
Files:
src/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusMenu.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
src/assets/translations/en/main.json
📄 CodeRabbit inference engine (CLAUDE.md)
Add English copy to
src/assets/translations/en/main.json(find appropriate section)
Files:
src/assets/translations/en/main.json
🧠 Learnings (46)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11170
File: patches/@shapeshiftoss+bitcoinjs-lib+7.0.0-shapeshift.0.patch:9-19
Timestamp: 2025-11-25T21:43:10.838Z
Learning: In shapeshift/web, gomesalexandre will not expand PR scope to fix latent bugs in unused API surface (like bitcoinjs-lib patch validation methods) when comprehensive testing proves the actual used code paths work correctly, preferring to avoid costly hdwallet/web verdaccio publish cycles and full regression testing for conceptual issues with zero runtime impact.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10879
File: src/context/WalletProvider/WalletConnectV2/components/WalletConnectDirectRow.tsx:64-81
Timestamp: 2025-10-22T22:11:22.918Z
Learning: In early WalletConnect POC/features behind a flag, gomesalexandre prioritizes connection correctness/stability over UX polish; minimal safety guards (like preventing concurrent connects) are preferred, while visuals will be wired later by reallybeard.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10569
File: src/plugins/walletConnectToDapps/components/WalletConnectSigningModal/WalletConnectModalSigningFooter.tsx:121-129
Timestamp: 2025-09-17T22:40:30.149Z
Learning: gomesalexandre maintains strict scope discipline even for style/UI PRs in shapeshift/web, declining functionally correct UX improvements (like keeping Cancel button enabled during gas simulation loading) when they fall outside the PR's stated styling objectives, demonstrating his consistent pattern of deferring valid but tangential improvements to separate efforts.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/modals/EIP712MessageDisplay.tsx:21-24
Timestamp: 2025-09-12T13:16:27.004Z
Learning: gomesalexandre declined to add error boundaries to WalletConnect modals in PR #10461, stating "no error boundaries in this pr ser", consistent with his preference to keep PR scope focused and defer tangential improvements to separate efforts.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/utils/tenderly/index.ts:0-0
Timestamp: 2025-09-12T11:56:19.437Z
Learning: gomesalexandre rejected verbose try/catch error handling for address validation in Tenderly integration (PR #10461), calling the approach "ugly" but still implemented safety measures in commit ad7e424b89, preferring cleaner safety implementations over defensive programming patterns.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/WalletConnectSigningModal/StructuredMessage/StructuredMessage.tsx:0-0
Timestamp: 2025-09-13T16:45:17.166Z
Learning: gomesalexandre appreciates safety-focused suggestions for UI rendering in WalletConnect components, specifically defensive programming approaches that prevent null/undefined values from displaying as literal "null"/"undefined" strings in the user interface.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10596
File: src/components/Layout/Header/NavBar/WalletConnectedMenu.tsx:77-99
Timestamp: 2025-10-01T07:42:40.195Z
Learning: In WalletConnectedMenu.tsx's handleReconnectWallet handler, gomesalexandre prefers throwing an error for unsupported wallet types in the default case rather than gracefully handling with a fallback. His reasoning: "if we have a problem here, we have bigger problems" - only supported wallets (KeepKey, Ledger, MetaMask, Coinbase, Phantom) should reach the reconnect flow when disconnected/locked, so encountering an unsupported type indicates a larger architectural issue that should be surfaced explicitly rather than masked with graceful degradation.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11012
File: src/context/WalletProvider/Vultisig/components/Connect.tsx:24-59
Timestamp: 2025-11-19T16:59:50.569Z
Learning: In src/context/WalletProvider/*/components/Connect.tsx files across the ShapeShift web codebase, the established pattern for handling null/undefined adapter from getAdapter() is to simply check `if (adapter) { ... }` without an else clause. All wallet Connect components (Coinbase, Keplr, Phantom, Ledger, MetaMask, WalletConnectV2, KeepKey, Vultisig) follow this pattern—they reset loading state after the if block but do not show error messages when adapter is null. This is an intentional design decision and should be maintained for consistency.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10206
File: src/config.ts:127-128
Timestamp: 2025-08-07T11:20:44.614Z
Learning: gomesalexandre prefers required environment variables without default values in the config file (src/config.ts). They want explicit configuration and fail-fast behavior when environment variables are missing, rather than having fallback defaults.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/modals/ContractInteractionBreakdown.tsx:0-0
Timestamp: 2025-09-13T16:45:18.813Z
Learning: gomesalexandre prefers aggressively deleting unused/obsolete code files ("ramboing") rather than fixing technical issues in code that won't be used, demonstrating his preference for keeping codebases clean and PR scope focused.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10458
File: src/plugins/walletConnectToDapps/types.ts:7-7
Timestamp: 2025-09-10T15:34:29.604Z
Learning: gomesalexandre is comfortable relying on transitive dependencies (like abitype through ethers/viem) rather than explicitly declaring them in package.json, preferring to avoid package.json bloat when the transitive dependency approach works reliably in practice.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10503
File: .env:56-56
Timestamp: 2025-09-16T13:17:02.938Z
Learning: gomesalexandre prefers to enable feature flags globally in the base .env file when the intent is to activate features everywhere, even when there are known issues like crashes, demonstrating his preference for intentional global feature rollouts over cautious per-environment enablement.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10249
File: src/pages/ThorChainLP/components/ReusableLpStatus/TransactionRow.tsx:447-503
Timestamp: 2025-08-13T17:07:10.763Z
Learning: gomesalexandre prefers relying on TypeScript's type system for validation rather than adding defensive runtime null checks when types are properly defined. They favor a TypeScript-first approach over defensive programming with runtime validations.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10276
File: src/hooks/useActionCenterSubscribers/useThorchainLpDepositActionSubscriber.tsx:61-66
Timestamp: 2025-08-14T17:51:47.556Z
Learning: gomesalexandre is not concerned about structured logging and prefers to keep console.error usage as-is rather than implementing structured logging patterns, even when project guidelines suggest otherwise.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10413
File: src/components/Modals/FiatRamps/fiatRampProviders/onramper/utils.ts:29-55
Timestamp: 2025-09-02T14:26:19.028Z
Learning: gomesalexandre prefers to keep preparatory/reference code simple until it's actively consumed, rather than implementing comprehensive error handling, validation, and robustness improvements upfront. They prefer to add these improvements when the code is actually being used in production.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10276
File: src/pages/ThorChainLP/components/ReusableLpStatus/TransactionRow.tsx:396-402
Timestamp: 2025-08-14T17:55:57.490Z
Learning: gomesalexandre is comfortable with functions/variables that return undefined or true (tri-state) when only the truthy case matters, preferring to rely on JavaScript's truthy/falsy behavior rather than explicitly returning boolean values.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10783
File: src/context/ModalStackProvider/useModalRegistration.ts:30-41
Timestamp: 2025-10-16T11:14:40.657Z
Learning: gomesalexandre prefers to add lint rules (like typescript-eslint/strict-boolean-expressions for truthiness checks on numbers) to catch common issues project-wide rather than relying on code review to catch them.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10206
File: src/lib/moralis.ts:47-85
Timestamp: 2025-08-07T11:22:16.983Z
Learning: gomesalexandre prefers console.error over structured logging for Moralis API integration debugging, as they find it more conventional and prefer to examine XHR requests directly rather than rely on structured logs for troubleshooting.
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to src/state/slices/**/*.ts : Migrations are required when changing persisted state structure (see `src/state/migrations/`)
Applied to files:
src/state/slices/gridplusSlice/types.tssrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/state/slices/gridplusSlice/gridplusSlice.ts
📚 Learning: 2025-11-19T16:59:50.569Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11012
File: src/context/WalletProvider/Vultisig/components/Connect.tsx:24-59
Timestamp: 2025-11-19T16:59:50.569Z
Learning: In src/context/WalletProvider/*/components/Connect.tsx files across the ShapeShift web codebase, the established pattern for handling null/undefined adapter from getAdapter() is to simply check `if (adapter) { ... }` without an else clause. All wallet Connect components (Coinbase, Keplr, Phantom, Ledger, MetaMask, WalletConnectV2, KeepKey, Vultisig) follow this pattern—they reset loading state after the if block but do not show error messages when adapter is null. This is an intentional design decision and should be maintained for consistency.
Applied to files:
packages/chain-adapters/src/error/ErrorHandler.tssrc/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/context/WalletProvider/GridPlus/utils.tssrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxpackage.jsonsrc/context/WalletProvider/GridPlus/hooks/useGridPlusConnection.ts
📚 Learning: 2025-09-12T13:44:17.019Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/hooks/useSimulateEvmTransaction.ts:0-0
Timestamp: 2025-09-12T13:44:17.019Z
Learning: gomesalexandre prefers letting chain adapter errors throw naturally in useSimulateEvmTransaction rather than adding explicit error handling for missing adapters, consistent with his fail-fast approach and dismissal of defensive validation as "stale" in WalletConnect transaction simulation flows.
Applied to files:
packages/chain-adapters/src/error/ErrorHandler.tssrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsx
📚 Learning: 2025-10-01T07:42:40.195Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10596
File: src/components/Layout/Header/NavBar/WalletConnectedMenu.tsx:77-99
Timestamp: 2025-10-01T07:42:40.195Z
Learning: In WalletConnectedMenu.tsx's handleReconnectWallet handler, gomesalexandre prefers throwing an error for unsupported wallet types in the default case rather than gracefully handling with a fallback. His reasoning: "if we have a problem here, we have bigger problems" - only supported wallets (KeepKey, Ledger, MetaMask, Coinbase, Phantom) should reach the reconnect flow when disconnected/locked, so encountering an unsupported type indicates a larger architectural issue that should be surfaced explicitly rather than masked with graceful degradation.
Applied to files:
packages/chain-adapters/src/error/ErrorHandler.tssrc/context/WalletProvider/WalletProvider.tsxsrc/assets/translations/en/main.jsonsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/context/WalletProvider/GridPlus/utils.tssrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxsrc/context/WalletProvider/GridPlus/hooks/useGridPlusConnection.ts
📚 Learning: 2025-11-24T21:20:17.804Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/error-handling.mdc:0-0
Timestamp: 2025-11-24T21:20:17.804Z
Learning: Applies to **/*.{ts,tsx} : ALWAYS use custom error classes from `shapeshiftoss/errors` with meaningful error codes for internationalization and relevant details in error objects
Applied to files:
packages/chain-adapters/src/error/ErrorHandler.ts
📚 Learning: 2025-11-24T21:20:17.804Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/error-handling.mdc:0-0
Timestamp: 2025-11-24T21:20:17.804Z
Learning: Applies to **/swapper{s,}/**/*.{ts,tsx} : ALWAYS use `makeSwapErrorRight` for swapper errors with `TradeQuoteError` enum for error codes and provide detailed error information
Applied to files:
packages/chain-adapters/src/error/ErrorHandler.ts
📚 Learning: 2025-10-23T14:27:19.073Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10857
File: src/plugins/walletConnectToDapps/eventsManager/useWalletConnectEventsHandler.ts:101-104
Timestamp: 2025-10-23T14:27:19.073Z
Learning: In WalletConnect wallet_switchEthereumChain and wallet_addEthereumChain requests, the chainId parameter is always present as per the protocol spec. Type guards checking for missing chainId in these handlers (like `if (!evmNetworkIdHex) return`) are solely for TypeScript compiler satisfaction, not real runtime edge cases.
Applied to files:
packages/chain-adapters/src/error/ErrorHandler.ts
📚 Learning: 2025-08-26T19:04:38.672Z
Learnt from: kaladinlight
Repo: shapeshift/web PR: 10369
File: packages/chain-adapters/src/cosmossdk/CosmosSdkBaseAdapter.ts:167-176
Timestamp: 2025-08-26T19:04:38.672Z
Learning: In packages/chain-adapters/src/cosmossdk/CosmosSdkBaseAdapter.ts, when processing assets from data.assets.reduce(), the team prefers using empty catch blocks to gracefully skip any assets that fail processing, rather than specific error type handling, to avoid useless noise and ensure robust asset filtering.
Applied to files:
packages/chain-adapters/src/error/ErrorHandler.ts
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Wallets are managed via `WalletProvider` context
Applied to files:
src/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsx
📚 Learning: 2025-08-13T15:52:25.116Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10272
File: src/context/WalletProvider/MobileWallet/mobileMessageHandlers.ts:61-0
Timestamp: 2025-08-13T15:52:25.116Z
Learning: In the ShapeShift web codebase, specifically in src/context/WalletProvider/MobileWallet/mobileMessageHandlers.ts, message variants in the Message union type do not include inline comments documenting their expected return types. The codebase follows a pattern of keeping these type definitions clean without such documentation comments.
Applied to files:
src/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/context/WalletProvider/GridPlus/utils.tssrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.{ts,tsx} : Account for light/dark mode using `useColorModeValue` hook
Applied to files:
src/context/WalletProvider/WalletProvider.tsx
📚 Learning: 2025-10-07T03:44:27.350Z
Learnt from: 0xApotheosis
Repo: shapeshift/web PR: 10760
File: src/components/ManageHiddenAssets/ManageHiddenAssetsList.tsx:78-84
Timestamp: 2025-10-07T03:44:27.350Z
Learning: In the ShapeShift web codebase, the following are stable references and do not need to be included in useCallback/useMemo dependency arrays:
- `navigate` from `useBrowserRouter()` hook
- Modal control objects (like `walletDrawer`) from `useModal()` hook (including their `isOpen`, `close`, and `open` methods)
- These are backed by stable context providers
Applied to files:
src/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsxsrc/context/WalletProvider/config.tssrc/context/WalletProvider/GridPlus/hooks/useGridPlusConnection.ts
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.{ts,tsx} : Import types from `shapeshiftoss/caip` for chain/account/asset IDs
Applied to files:
src/context/WalletProvider/WalletProvider.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-09-04T12:16:47.748Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10430
File: src/components/Layout/Header/NavBar/PopoverWallet.tsx:72-94
Timestamp: 2025-09-04T12:16:47.748Z
Learning: gomesalexandre declined to add error boundaries to the PopoverWallet component in src/components/Layout/Header/NavBar/PopoverWallet.tsx, stating he didn't touch this component and preferring not to expand the scope of the PR with error boundary additions.
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusMenu.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsxsrc/context/WalletProvider/config.ts
📚 Learning: 2025-09-16T09:32:21.333Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10490
File: src/components/Layout/Header/NavBar/NavigationDropdown.tsx:96-103
Timestamp: 2025-09-16T09:32:21.333Z
Learning: In the shapeshift/web codebase, gomesalexandre confirms that using `item.icon && <Icon as={item.icon} boxSize={4} />` for Chakra UI MenuItem.icon prop is valid and acceptable - the boolean short-circuit pattern works fine with Chakra components and doesn't need to be changed to explicit undefined.
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusMenu.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to src/assets/translations/en/main.json : Add English copy to `src/assets/translations/en/main.json` (find appropriate section)
Applied to files:
src/assets/translations/en/main.json
📚 Learning: 2025-09-08T15:53:09.362Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10442
File: src/components/TradeAssetSearch/components/GroupedAssetList/GroupedAssetList.tsx:34-35
Timestamp: 2025-09-08T15:53:09.362Z
Learning: In DefaultAssetList.tsx, the GroupedAssetList component already receives the activeChainId prop correctly on line ~58, contrary to automated analysis that may flag it as missing.
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Portfolio state is filtered by active `walletId`
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusSetup.tsx
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.{ts,tsx} : Use `useAppSelector` for Redux state
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusSetup.tsx
📚 Learning: 2025-09-02T00:02:44.889Z
Learnt from: premiumjibles
Repo: shapeshift/web PR: 10380
File: src/components/AssetSearch/components/GroupedAssetRow.tsx:116-0
Timestamp: 2025-09-02T00:02:44.889Z
Learning: premiumjibles prefers avoiding store.getState() calls in favor of useAppSelector where reactivity is needed, to prevent accidentally breaking reactive updates in components.
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusSetup.tsx
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.{ts,tsx} : Use `useAppDispatch` for Redux actions
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusSetup.tsx
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Each wallet has unique `walletId` (e.g., `metamask:0x123`, `ledger:ABC`)
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusSetup.tsx
📚 Learning: 2025-09-22T14:28:23.109Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10566
File: src/hooks/useLedgerConnectionState.ts:71-95
Timestamp: 2025-09-22T14:28:23.109Z
Learning: gomesalexandre designed useLedgerConnectionState to distinguish between USB device connection state and wallet pairing state. When pairing fails but USB is connected, connectionState should remain 'idle' to allow retries, while 'failed' is reserved for when the USB device is physically disconnected.
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusSetup.tsxsrc/context/WalletProvider/GridPlus/utils.tssrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsxsrc/context/WalletProvider/GridPlus/hooks/useGridPlusConnection.ts
📚 Learning: 2025-10-22T22:12:31.955Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10879
File: src/context/WalletProvider/WalletConnectV2/useDirectConnect.ts:15-23
Timestamp: 2025-10-22T22:12:31.955Z
Learning: In shapeshift/web WalletConnect V2 direct connection (src/context/WalletProvider/WalletConnectV2/useDirectConnect.ts), gomesalexandre prefers using native URL schemes only (metamask://, trust://, zerion://) and not universal links/app links for deep-linking.
Applied to files:
src/context/WalletProvider/GridPlus/utils.tssrc/context/WalletProvider/GridPlus/hooks/useGridPlusConnection.ts
📚 Learning: 2025-09-12T12:00:33.924Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/modals/SendTransactionConfirmation.tsx:42-50
Timestamp: 2025-09-12T12:00:33.924Z
Learning: gomesalexandre prefers maintaining consistency with existing code patterns across WalletConnect modal components, including side-effects-during-render for error handling (showErrorToast + handleReject calls before return null), rather than introducing isolated refactors that would create inconsistency in the codebase.
Applied to files:
src/context/WalletProvider/GridPlus/utils.tssrc/context/WalletProvider/GridPlus/components/GridPlusPair.tsx
📚 Learning: 2025-09-12T11:52:39.280Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/modals/EIP155TransactionConfirmation.tsx:18-21
Timestamp: 2025-09-12T11:52:39.280Z
Learning: In WalletConnect dApps integration, gomesalexandre has implemented intentional routing logic where EIP155TransactionConfirmation is typed for EthSignTransactionCallRequest only, while a separate SendTransactionConfirmation component handles EthSendTransactionCallRequest. The WalletConnectModalManager contains conditional logic to route native send transactions to SendTransactionConfirmation and other transaction types to EIP155TransactionConfirmation, creating a clean separation of concerns between signing and sending flows.
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusPair.tsx
📚 Learning: 2025-09-12T12:00:33.924Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/modals/SendTransactionConfirmation.tsx:42-50
Timestamp: 2025-09-12T12:00:33.924Z
Learning: gomesalexandre prefers maintaining consistency with existing code patterns in WalletConnect modals, including side-effects-during-render for error handling (showErrorToast + handleReject), rather than introducing isolated refactors that would make the codebase inconsistent.
Applied to files:
src/context/WalletProvider/GridPlus/components/GridPlusPair.tsx
📚 Learning: 2025-08-22T12:58:26.590Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/components/Layout/Header/ActionCenter/components/GenericTransactionActionCard.tsx:108-111
Timestamp: 2025-08-22T12:58:26.590Z
Learning: In the RFOX GenericTransactionDisplayType flow in src/components/Layout/Header/ActionCenter/components/GenericTransactionActionCard.tsx, the txHash is always guaranteed to be present according to NeOMakinG, so defensive null checks for txLink are not needed in this context.
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-08-22T12:59:01.702Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/components/Layout/Header/ActionCenter/components/RewardDistributionActionCard.tsx:37-53
Timestamp: 2025-08-22T12:59:01.702Z
Learning: In RewardDistributionActionCard component (src/components/Layout/Header/ActionCenter/components/RewardDistributionActionCard.tsx), NeOMakinG confirmed that runeAsset is expected to always be defined when the component renders, so defensive guards against undefined runeAsset are not needed.
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-08-22T12:59:01.210Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/components/Layout/Header/ActionCenter/components/RewardDistributionActionCard.tsx:26-29
Timestamp: 2025-08-22T12:59:01.210Z
Learning: In src/components/Layout/Header/ActionCenter/components/RewardDistributionActionCard.tsx, NeOMakinG declined wrapping the RewardDistributionActionCard component with React.memo, saying it was "too much", suggesting that like other action center components, memoization is not beneficial for this specific use case.
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-08-08T14:59:40.422Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10231
File: src/pages/Explore/ExploreCategory.tsx:231-238
Timestamp: 2025-08-08T14:59:40.422Z
Learning: In src/pages/Explore/ExploreCategory.tsx, for the PageHeader filter trigger, NeOMakinG considers changing a clickable Chakra Icon to IconButton too nitpicky for this PR and prefers to keep the current Icon-based trigger; such minor a11y/UI nitpicks should be deferred to a follow-up if needed.
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-08-08T15:00:49.887Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10231
File: src/components/AssetSearch/components/AssetList.tsx:2-2
Timestamp: 2025-08-08T15:00:49.887Z
Learning: Project shapeshift/web: NeOMakinG prefers avoiding minor a11y/UI nitpicks (e.g., adding aria-hidden to decorative icons in empty states like src/components/AssetSearch/components/AssetList.tsx) within feature PRs; defer such suggestions to a follow-up instead of blocking the PR.
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-07-29T15:04:28.083Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10139
File: src/components/MultiHopTrade/components/TradeConfirm/components/ExpandableStepperSteps.tsx:109-115
Timestamp: 2025-07-29T15:04:28.083Z
Learning: In src/components/MultiHopTrade/components/TradeConfirm/components/ExpandableStepperSteps.tsx, the component is used under an umbrella that 100% of the time contains the quote, making the type assertion `activeTradeQuote?.steps[currentHopIndex] as TradeQuoteStep` safe. Adding conditional returns before hooks would violate React's Rules of Hooks.
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.{ts,tsx} : Use Chakra UI components and conventions
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.{ts,tsx} : For static JSX icon elements (e.g., `<TbCopy />`) that don't depend on state/props, define them as constants outside the component to avoid re-renders instead of using useMemo
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-11-24T21:20:44.637Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/react-best-practices.mdc:0-0
Timestamp: 2025-11-24T21:20:44.637Z
Learning: Applies to **/*.{jsx,tsx} : Wrap components receiving props with `memo` for performance optimization
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-11-24T21:20:44.637Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/react-best-practices.mdc:0-0
Timestamp: 2025-11-24T21:20:44.637Z
Learning: Applies to **/*.{jsx,tsx} : EXTRACT complex logic into custom hooks
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-08-06T09:46:50.860Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10191
File: src/pages/Explore/components/CategoryCard.tsx:27-196
Timestamp: 2025-08-06T09:46:50.860Z
Learning: In src/pages/Explore/components/CategoryCard.tsx, NeOMakinG indicated that wrapping the CategoryCard component with React.memo would be "quite useless in this case", suggesting that memoization is not beneficial for this particular component despite it receiving props, likely due to its specific usage patterns or context.
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-10-17T07:51:58.374Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10783
File: src/context/WalletProvider/NewWalletViews/NewWalletViewsSwitch.tsx:344-349
Timestamp: 2025-10-17T07:51:58.374Z
Learning: In the shapeshift/web codebase, Chakra UI's ModalContent component supports the containerProps prop. When using the useModalRegistration hook from ModalStackProvider, spreading {...modalContentProps} directly onto ModalContent is correct and properly applies z-index and pointer-events through containerProps.sx. Do not suggest extracting sx from modalContentProps.containerProps.sx.
Applied to files:
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx
📚 Learning: 2025-11-19T22:20:25.661Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10767
File: package.json:324-324
Timestamp: 2025-11-19T22:20:25.661Z
Learning: In shapeshift/web package.json, the resolution "gridplus-sdk/bs58check": "2.1.2" is intentional and must not be removed. It forces gridplus-sdk's transitive bs58check dependency from 4.0.0 down to 2.1.2 because bs58check 4.0.0 breaks legacy address validation (due to bs58 v6.0.0 and noble/hash vs 2.1.2's bs58 v4.0.0 and create-hash).
Applied to files:
package.json
📚 Learning: 2025-08-08T20:16:12.898Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10222
File: package.json:202-202
Timestamp: 2025-08-08T20:16:12.898Z
Learning: In shapeshift/web, the semver package must be included in dependencies (not devDependencies) because hdwallet packages have transient dependencies that require semver but don't ship it themselves. This ensures semver is available at runtime for hdwallet functionality.
Applied to files:
package.json
📚 Learning: 2025-08-08T20:27:02.203Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10222
File: package.json:202-202
Timestamp: 2025-08-08T20:27:02.203Z
Learning: In shapeshift/web, while gomesalexandre generally prefers pinned dependencies for security, semver with a caret range (^7.7.2) is acceptable as an exception since it's already a transient dependency of many packages and is being made explicit for hdwallet support.
Applied to files:
package.json
📚 Learning: 2025-11-25T21:43:10.838Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11170
File: patches/@shapeshiftoss+bitcoinjs-lib+7.0.0-shapeshift.0.patch:9-19
Timestamp: 2025-11-25T21:43:10.838Z
Learning: In shapeshift/web, gomesalexandre will not expand PR scope to fix latent bugs in unused API surface (like bitcoinjs-lib patch validation methods) when comprehensive testing proves the actual used code paths work correctly, preferring to avoid costly hdwallet/web verdaccio publish cycles and full regression testing for conceptual issues with zero runtime impact.
Applied to files:
package.json
📚 Learning: 2025-11-20T12:00:45.005Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11078
File: src/setupVitest.ts:11-15
Timestamp: 2025-11-20T12:00:45.005Z
Learning: In shapeshift/web, src/setupVitest.ts must redirect 'ethers' to 'ethers5' for shapeshiftoss/hdwallet-trezor (and -trezor-connect), same as ledger and shapeshift-multichain. Removing 'trezor' from the regex causes CI/Vitest failures due to ethers v6 vs v5 API differences.
Applied to files:
package.json
📚 Learning: 2025-08-29T18:09:45.982Z
Learnt from: kaladinlight
Repo: shapeshift/web PR: 10376
File: vite.config.mts:136-137
Timestamp: 2025-08-29T18:09:45.982Z
Learning: In the ShapeShift web repository vite.config.mts, the commonjsOptions.exclude configuration using bare package name strings like ['shapeshiftoss/caip', 'shapeshiftoss/types'] works correctly for excluding specific packages from CommonJS transformation, despite theoretical concerns about module ID matching patterns.
Applied to files:
package.json
🧬 Code graph analysis (8)
packages/chain-adapters/src/error/ErrorHandler.ts (1)
packages/chain-adapters/src/index.ts (1)
ChainAdapterError(4-4)
src/context/WalletProvider/WalletProvider.tsx (1)
src/state/store.ts (1)
store(138-138)
src/context/WalletProvider/GridPlus/components/GridPlusMenu.tsx (1)
src/components/Layout/Header/NavBar/ManageAccountsMenuItem.tsx (1)
ManageAccountsMenuItem(18-47)
src/context/WalletProvider/GridPlus/components/GridPlusSetup.tsx (2)
src/context/WalletProvider/GridPlus/utils.ts (1)
pairConnectedDevice(50-61)src/state/slices/gridplusSlice/gridplusSlice.ts (1)
gridplusSlice(19-125)
src/state/slices/gridplusSlice/gridplusSlice.ts (1)
src/state/slices/gridplusSlice/types.ts (1)
SafeCard(1-8)
src/context/WalletProvider/GridPlus/components/GridPlusPair.tsx (2)
src/context/WalletProvider/GridPlus/utils.ts (1)
pairConnectedDevice(50-61)src/state/slices/gridplusSlice/gridplusSlice.ts (1)
gridplusSlice(19-125)
src/context/WalletProvider/GridPlus/components/SafeCardRow.tsx (1)
src/components/Text/Text.tsx (1)
Text(19-83)
src/context/WalletProvider/config.ts (1)
src/context/WalletProvider/GridPlus/components/GridPlusMenu.tsx (1)
GridPlusMenu(16-38)
Resolved conflicts by: - Taking develop's version of package.json and yarn.lock - Keeping feat_gridplus_validation's version of GridPlus files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Yeeting, same rationale as hdwallet:
|
Description
Wires up shapeshift/hdwallet#748
Issue (if applicable)
closes #10904
Risk
Low - Gridplus not out yet
Testing
Engineering
Operations
Still under flag, nothing to see here
Screenshots (if applicable)
gridplus.validation.final.testing.mov
Summary by CodeRabbit
New Features
Improvements
Chores
✏️ Tip: You can customize this high-level summary in your review settings.