Skip to content

Refactor(web): use TypedData type from the @safe-global/utils package #5536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 1, 2025

Conversation

compojoom
Copy link
Collaborator

What it solves

Refactors the usage of the old types to the new ones. Why? Because the new ones are "more correct & auto-generated" and the mobile app already uses them. If we want to reuse code, types need to match, otherwise all hell breaks lose and developers loose their sanity & joy of life.

Resolves #

How this PR fixes it

There is a codemod that maps old types to new types and also exchanges the use of the old enum types. After running the script I went through the files and did manual modifications that were necessary for the types to be correctly used

How to test it

Everything should continue to work as before. Unit tests and e2e tests should catch any errors.

Screenshots

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

Copy link

github-actions bot commented Mar 28, 2025

Copy link

github-actions bot commented Mar 28, 2025

Coverage (27%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files27.6123.5124.0727.83 
src0000 
   react-app-env.d.ts0000 
src/app0000 
   +html.tsx0100009–31
   +not-found.tsx0100008–21
   _layout.tsx000024–168
   accounts-sheet.tsx0100003–4
   action-details.tsx0100008
   address-book.tsx0100005
   app-settings.tsx0100005
   biometrics-opt-in.tsx00008–33
   change-signer-sheet.tsx0100003–4
   confirm-transaction.tsx0100007–9
   confirmations-sheet.tsx0100003–4
   conflict-transaction-sheet.tsx0100003–4
   developer.tsx0100006
   get-started.tsx0100005
   index.tsx01000014
   networks-sheet.tsx0100003–4
   notifications-center.tsx0100005
   notifications-opt-in.tsx000010–30
   notifications-settings.tsx0100005
   onboarding.tsx0100005
   pending-transactions.tsx0100007
   share.tsx0100007–8
   transaction-actions.tsx0100008
   transaction-parameters.tsx0100008
src/app/(import-accounts)010000 
   _layout.tsx0100005–7
   form.tsx0100008–9
   index.tsx0100005
   signers.tsx0100008–9
src/app/(tabs)010000 
   _layout.tsx0100008–62
   index.tsx0100004–5
   settings.tsx0100004
src/app/(tabs)/transactions0000 
   _layout.tsx00007–26
src/app/(tabs)/transactions/(tabs)010000 
   _layout.tsx01000012–24
   index.tsx0100005
   messages.tsx01000010–34
src/app/import-signers010000 
   _layout.tsx0100005–7
   index.tsx01000015–60
   loading.tsx0100005
   private-key-error.tsx0100009–22
   private-key-success.tsx0100009–22
   private-key.tsx0100007–8
src/app/sign-transaction010000 
   _layout.tsx0100004
   index.tsx0100005
src/app/signers010000 
   [address].tsx0100006
   _layout.tsx0100006–15
   index.tsx0100007–9
src/components/Alert10085.71100100 
   Alert.tsx10085.7110010057, 72
   index.ts0000 
src/components/Badge87.57510087.5 
   Badge.tsx85.717510085.7149
   index.ts0000 
   theme.ts100100100100 
src/components/BlurredIdenticonBackground0000 
   BlurredIdenticonBackground.tsx000014–51
   index.tsx0000 
src/components/Camera0000 
   QrCamera.tsx00007–141
   index.ts0000 
src/components/ChainsDisplay10084.61100100 
   ChainsDisplay.tsx10084.6110010015–18
   index.ts0000 
src/components/Container10075100100 
   Container.tsx1007510010033
   index.ts0000 
src/components/CopyButton250025 
   CopyButton.tsx25002513–17
   index.ts0000 
src/components/DataRow100100100100 
   DataRow.tsx100100100100 
   index.ts0000 
src/components/Dropdown0000 
   DropdownLabel.tsx000015–27
   index.ts0000 
   sheetComponents.tsx0100008–42
src/components/EncodedData0000 
   EncodedData.tsx000010–12
   index.ts0000 
src/components/EthAddress10020100100 
   ETHAddress.tsx1002010010022–23
   index.ts0000 
src/components/Fiat10037.5100100 
   Fiat.tsx10037.510010022–34
   index.ts0000 
src/components/FloatingContainer0000 
   FloatingContainer.tsx000016–49
   index.ts0000 
src/components/Identicon100100100100 
   Identicon.tsx100100100100 
   index.ts0000 
src/components/InnerShadow100100100100 
   InnerShadow.tsx100100100100 
   index.ts0000 
src/components/LoadingScreen010000 
   LoadingScreen.tsx01000011
   index.ts0000 
src/components/Logo10087.5100100 
   Logo.tsx10087.510010034
   index.ts0000 
src/components/NetworkBadge33.33100033.33 
   NetworkBadge.tsx0100009–10
   index.ts0000 
   theme.ts100100100100 
src/components/OptIn0000 
   OptIn.tsx000026–81
   index.ts0000 
src/components/SafeBottomSheet0000 
   SafeBottomSheet.tsx000044–175
   index.ts0000 
src/components/SafeButton10050100100 
   SafeButton.tsx1005010010069
   index.ts0000 
src/components/SafeCard100100100100 
   SafeCard.tsx100100100100 
   index.ts0000 
src/components/SafeFontIcon87.585.7110087.5 
   SafeFontIcon.tsx87.585.7110087.528
   index.ts0000 
src/components/SafeInput8073.337580 
   SafeInput.tsx10077.7710010044–57
   SafeInputWithLabel.tsx000014–63
   index.ts0000 
   styled.ts100100100100 
   theme.ts100100100100 
   utils.ts100100100100 
src/components/SafeListItem10073.68100100 
   SafeListItem.tsx10073.6810010077–91
   index.tsx0000 
   theme.ts100100100100 
src/components/SafeSearchBar0000 
   SafeSearchBar.tsx000011–74
src/components/SafeTab28.570030 
   SafeTab.tsx44.44100044.4414–27
   SafeTabBar.tsx9.09001018–45
   index.tsx0000 
   theme.ts100100100100 
   types.ts0000 
src/components/StatusBanners/PendingTransactions10050100100 
   PendingTransactions.tsx1005010010017
   index.tsx0000 
src/components/Tab0000 
   TabNameContext.tsx00003–10
src/components/Tag01001000 
   Tag.tsx010010003
   index.ts0000 
src/components/Title10066.66100100 
   LargeHeaderTitle.tsx100100100100 
   NavBarTitle.tsx100100100100 
   SectionTitle.tsx10066.6610010011
   index.ts0000 
src/components/TokenAmount10080100100 
   TokenAmount.tsx1008010010032, 39
   index.ts0000 
src/components/TxInfo29.164.1666.6629.16 
   TxInfo.tsx29.164.1666.6629.1636–37, 57–143
   index.tsx0000 
   types.ts0000 
src/components/navigation100100100100 
   TabBarIcon.tsx100100100100 
   index.ts0000 
src/components/transactions-list/Card/AccountCard10083.33100100 
   AccountCard.tsx10083.3310010058
   index.ts0000 
src/components/transactions-list/Card/AssetsCard100100100100 
   AssetsCard.tsx100100100100 
   index.tsx0000 
src/components/transactions-list/Card/SignersCard10054.54100100 
   SignersCard.tsx10054.5410010030, 41–52
   index.ts0000 
src/components/transactions-list/Card/TxBatchCard100100100100 
   TxBatchCard.tsx100100100100 
   index.tsx0000 
src/components/transactions-list/Card/TxConflictingCard0000 
   TxConflictingCard.tsx000015–46
   index.tsx0000 
src/components/transactions-list/Card/TxContractInteractionCard100100100100 
   TxContractInteractionCard.tsx100100100100 
   index.tsx0000 
src/components/transactions-list/Card/TxCreationCard100100100100 
   TxCreationCard.tsx100100100100 
   index.ts0000 
src/components/transactions-list/Card/TxGroupedCard90.9757590.9 
   TxGroupedCard.tsx90.9757590.957
   index.tsx0000 
src/components/transactions-list/Card/TxOrderCard6056.2566.6660 
   SellOrder.tsx100100100100 
   TwapOrder.tsx50005016
   TxOrderCard.tsx57.1462.510057.1418, 22, 32
   index.tsx0000 
src/components/transactions-list/Card/TxRejectionCard100100100100 
   TxRejectionCard.tsx100100100100 
   index.tsx0000 
src/components/transactions-list/Card/TxSafeAppCard100100100100 
   TxSafeAppCard.tsx100100100100 
   index.tsx0000 
src/components/transactions-list/Card/TxSettingsCard80505080 
   TxSettingsCard.tsx8050508021
   index.tsx0000 
src/components/transactions-list/Card/TxTokenCard10083.33100100 
   TxTokenCard.tsx10083.3310010022–31
   index.tsx0000 
src/config58.3387.5058.33 
   constants.ts10087.510010018
   ethers.ts01000010–38
   polyfills.ts0000 
src/context0000 
   NotificationsContext.tsx00009–26
src/features/AccountsSheet0000 
   AccountsSheet.container.tsx000010–23
   index.tsx0000 
src/features/AccountsSheet/AccountItem81.257566.6680 
   AccountItem.tsx81.257566.668026, 43–52
   index.ts0000 
src/features/AccountsSheet/AccountItem/hooks47.05033.3350 
   useEditAccountItem.ts47.05033.335019–44
src/features/AccountsSheet/MyAccounts93.331008092.85 
   MyAccounts.container.tsx100100100100 
   MyAccountsFooter.tsx80100508025
   index.ts0000 
src/features/AccountsSheet/MyAccounts/hooks41.661004045.45 
   useMyAccounts.ts100100100100 
   useMyAccountsSortable.ts01000011–30
src/features/ActionDetails0000 
   ActionDetails.container.tsx000015–36
   ActionsDetails.tsx00009–11
   index.ts0000 
   utils.tsx000016–112
src/features/AddressBook010000 
   AddressBook.container.tsx0100007–10
   Contact.container.tsx01000011–13
   index.tsx0000 
src/features/AddressBook/components0000 
   AddressBookView.tsx000014–42
src/features/AddressBook/components/Contact0000 
   ContactName.tsx00009–10
src/features/AddressBook/components/List0000 
   AddressBookList.tsx000021–75
   AddressBookListHeader.tsx000010
   EmptyAddressBookDark.tsx0100005
   EmptyAddressBookLight.tsx0100005
   NoContacts.tsx00007–12
   index.ts0000 
src/features/Assets010000 
   Assets.container.tsx0100009–21
   index.tsx0000 
   styles.ts010010003
src/features/Assets/components/AssetsHeader0000 
   AssetsHeader.container.tsx0100006–13
   AssetsHeader.tsx000016
   index.tsx0000 
   styles.ts010010003
src/features/Assets/components/Balance0000 
   Balance.container.tsx000016–41
   Balance.tsx000035–49
   ChainItems.tsx000017–28
   index.tsx0000 
src/features/Assets/components/Fallback10025100100 
   Fallback.tsx1002510010017–19
   index.ts0000 
src/features/Assets/components/NFTs10075100100 
   NFTItem.tsx100501001008
   NFTs.container.tsx1008010010027, 52
   index.tsx0000 
src/features/Assets/components/Navbar7.14007.14 
   Navbar.tsx000015–50
   index.tsx0000 
   theme.ts100100100100 
src/features/Assets/components/NoFunds10050100100 
   EmptyNFT.tsx1005010010010
   EmptyToken.tsx100100100100 
   NoFunds.tsx100100100100 
   index.ts0000 
src/features/Assets/components/ReadOnly10075100100 
   ReadOnly.container.tsx1005010010014
   ReadOnly.tsx100100100100 
src/features/Assets/components/Tokens10077.77100100 
   Tokens.container.tsx10077.7710010022–45
   index.tsx0000 
src/features/ChangeSignerSheet0000 
   ChangeSignerSheet.container.tsx000022–74
   index.ts0000 
src/features/ConfirmTx0000 
   ConfirmTx.container.tsx000019–51
   index.ts0000 
   utils.ts00004–15
src/features/ConfirmTx/components/ConfirmTxForm0000 
   ConfirmTxForm.tsx000022–36
   index.ts0000 
src/features/ConfirmTx/components/ConfirmationView0000 
   ConfirmationView.tsx000026–77
   index.ts0000 
   types.ts0000 
src/features/ConfirmTx/components/ExecuteForm010000 
   ExecuteForm.tsx01000014–16
   index.ts0000 
src/features/ConfirmTx/components/ListTable0000 
   ListTable.tsx000027–35
   index.ts0000 
src/features/ConfirmTx/components/LoadingTx010000 
   LoadingTx.tsx0100006
   index.ts0000 
src/features/ConfirmTx/components/ParametersButton010000 
   ParametersButton.tsx01000010–17
   index.ts0000 
src/features/ConfirmTx/components/SignForm010000 
   SignForm.tsx01000017–24
   index.ts0000 
src/features/ConfirmTx/components/SignTransaction0000 
   SignError.tsx01000013–60
   SignSuccess.tsx01000015–56
   SignTransaction.tsx000017–61
   index.ts0000 
src/features/ConfirmTx/components/TransactionHeader0000 
   TransactionHeader.tsx000031–34
   index.tsx0000 
src/features/ConfirmTx/components/TransactionInfo0000 
   TransactionInfo.tsx000017–28
   index.ts0000 
src/features/ConfirmTx/components/confirmation-views/AddSigner0000 
   AddSigner.tsx01000022–30
   index.ts0000 
   utils.tsx000013–63
src/features/ConfirmTx/components/confirmation-views/AlreadySigned100100100100 
   AlreadySigned.tsx100100100100 
   index.ts0000 
src/features/ConfirmTx/components/confirmation-views/Contract0000 
   Contract.tsx000024–35
   index.ts0000 
   utils.tsx000012–44
src/features/ConfirmTx/components/confirmation-views/GenericView0000 
   GenericView.tsx000029–36
   index.ts0000 
   utils.tsx000018–94
src/features/ConfirmTx/components/confirmation-views/RemoveSigner010000 
   RemoveSigner.tsx01000024–29
   index.ts0000 
   utils.tsx01000012–30
src/features/ConfirmTx/components/confirmation-views/SendNFT0000 
   SendNFT.tsx01000020–25
   index.ts0000 
   utils.tsx000011–29
src/features/ConfirmTx/components/confirmation-views/Stake010000 
   Stake.tsx0100007–14
   index.ts0000 
   utils.tsx0100007–61
src/features/ConfirmTx/components/confirmation-views/SwapOrder0000 
   SwapOrder.tsx000022–37
   SwapOrderHeader.tsx01000018–25
   TwapFallbackHandlerWarning.tsx0100003–4
   index.ts0000 
   utils.tsx000018–110
src/features/ConfirmTx/components/confirmation-views/SwapOrder/StatusLabel010000 
   index.tsx01000019–61
src/features/ConfirmTx/components/confirmation-views/TokenTransfer0000 
   TokenTransfer.tsx000029–84
   index.ts0000 
src/features/ConfirmTx/hooks/useTxSigner0000 
   index.ts0000 
   useTxSigner.ts000010–53
src/features/ConfirmationsSheet0000 
   ConfirmationsSheet.container.tsx000019–94
   index.ts0000 
src/features/ConflictTxSheet010000 
   ConflictTxSheet.container.tsx0100006–7
   index.ts0000 
src/features/Developer0000 
   Developer.container.tsx00009–33
   index.tsx0000 
   types.ts0000 
src/features/Developer/components010000 
   Developer.tsx01000012–33
src/features/GetStarted010000 
   GetStarted.tsx01000012–35
   index.tsx0000 
src/features/ImportPrivateKey100100100100 
   ImportPrivateKey.container.tsx100100100100 
   index.ts0000 
src/features/ImportPrivateKey/components/ImportError010000 
   ImportError.tsx01000012–14
   index.ts0000 
src/features/ImportPrivateKey/components/ImportSuccess0000 
   ImportSuccess.tsx000017–71
   index.ts0000 
src/features/ImportPrivateKey/components/LoadingImport0000 
   LoadingImport.container.tsx000019–130
   index.ts0000 
src/features/ImportPrivateKey/hooks66.66507566.66 
   useImportPrivateKey.ts66.66507566.6618–19, 30–39, 44–45
src/features/ImportReadOnly0000 
   AddSignersForm.container.tsx000017–65
   ImportAccountForm.container.tsx000015–66
   NetworkBadge.container.tsx00009–15
   ScanQrAccount.container.tsx000010–68
   index.tsx0000 
   schema.ts0100005–12
   types.ts0000 
src/features/ImportReadOnly/components0000 
   AddSignersFormView.tsx01000014–20
   AvailableNetworks.tsx0100006–11
   ImportAccountFormView.tsx000032–92
   ScanQrAccountView.tsx000016–17
   VerificationStatus.tsx000012–26
src/features/ImportReadOnly/helpers100100100100 
   safes.tsx100100100100 
src/features/NetworksSheet0000 
   NetworksSheet.container.tsx000016–47
   index.tsx0000 
src/features/Notifications010000 
   NotificationsCenter.container.tsx0100005–6
   NotificationsSettings.container.tsx0100006–9
   index.tsx0000 
src/features/Notifications/components0000 
   EmptyBell.tsx0100005
   NotificationPermissions.tsx000011–14
   NotificationsScreenEmpty.tsx0100006–7
   NotificationsSettingsView.tsx000028–76
src/features/Onboarding100100100100 
   Onboarding.container.tsx100100100100 
   index.ts0000 
src/features/Onboarding/components/OnboardingCarousel9688.8888.8896 
   CarouselFeedback.tsx100100100100 
   CarouselItem.tsx1008010010031
   OnboardingCarousel.tsx91.6610083.3391.6650
   index.ts0000 
   items.tsx100100100100 
src/features/Onboarding/components/OnboardingHeader100100100100 
   OnboardingHeader.tsx100100100100 
   index.ts0000 
src/features/PendingTx0000 
   PendingTx.container.tsx0100006–8
   index.tsx0000 
   utils.tsx000024–170
src/features/PendingTx/components/PendingTxList0000 
   PendingTxList.container.tsx000033–68
   index.ts0000 
src/features/Settings0000 
   Settings.container.tsx00009–25
   Settings.tsx000024–170
   index.tsx0000 
src/features/Settings/components/AppSettings0000 
   AppSettings.container.tsx00007–23
   AppSettings.tsx01000010–11
   index.ts0000 
src/features/Settings/components/IdenticonWithBadge10050100100 
   IdenticonWithBadge.tsx1005010010021–22
   index.ts0000 
src/features/Settings/components/Navbar0000 
   Navbar.tsx0100007–11
   SettingsButton.tsx0100006–15
   SettingsMenu.tsx000021–95
   index.ts0000 
src/features/Share0000 
   Share.container.tsx00008–14
   index.ts0000 
src/features/Share/components100100100100 
   ShareView.tsx100100100100 
   index.ts0000 
src/features/Signer0000 
   Signer.container.tsx000017–100
   index.ts0000 
   schema.ts010010003
   types.ts0000 
src/features/Signer/components0000 
   SignerView.tsx000025–52
src/features/Signers0000 
   Signers.container.tsx000010–26
   constants.ts010010003
   index.tsx0000 
src/features/Signers/components/SignersList0000 
   SignersList.tsx000020–59
   SignersListHeader.tsx000012
   SignersListItem.tsx000023–60
   index.ts0000 
src/features/Signers/components/SignersList/hooks010000 
   useSignersActions.ts0100005–41
src/features/Signers/hooks0000 
   useSignersGroupService.ts000011–34
src/features/TransactionActions0000 
   TransactionActions.container.tsx000015–35
   index.ts0000 
src/features/TransactionActions/components0000 
   TxActionsList.tsx000015–59
src/features/TransactionParameters0000 
   TransactionParameters.container.tsx000015–35
   index.ts0000 
src/features/TransactionParameters/components/TxParametersList0000 
   TxParametersList.tsx01000013–15
   index.ts0000 
   utils.tsx000014–63
src/features/TransactionParameters/components/TxParametersList/formatters0000 
   arrayValue.tsx00008–31
   singleValue.tsx000010–51
src/features/TxHistory90.971.4210090.69 
   TxHistory.container.tsx95.23751009541
   index.tsx0000 
   utils.tsx86.9568.7510086.9526, 37, 52
src/features/TxHistory/components/TxHistoryList10066.66100100 
   TxHistoryList.tsx10066.6610010019–28
   index.ts0000 
src/hooks13.2210.1120.4513.14 
   useBiometrics.ts00006–113
   useGTW.ts000022–140
   useNotificationGTWPermissions.ts76.9283.336081.8114–15
   useNotificationManager.ts40.813.335040.8123–26, 39–47, 52–63, 68–76, 82–89
   useNotificationPayload.ts81.817510081.8124–25
   useRegisterForNotifications.ts000038–329
   useSiwe.ts01000013–32
src/hooks/services100100100100 
   useSafeOverviewService.ts100100100100 
src/hooks/useCopyAndDispatchToast100100100100 
   index.ts100100100100 
src/hooks/useInfiniteScroll72.2262.58072.22 
   index.ts0000 
   useInfiniteScroll.ts72.2262.58072.2228, 39–44
src/hooks/useMakeSafesWithChainId010000 
   useMakeSafesWithChainId.ts0100007–12
src/hooks/usePendingTxs0000 
   index.ts000014–41
src/hooks/usePreventLeaveScreen010000 
   index.ts0100005–17
src/hooks/useSign78.9412.510078.94 
   index.ts0000 
   useSign.ts78.9412.510078.9443–46, 60–63
src/hooks/useTokenDetails90.984.6110090.9 
   index.ts0000 
   useTokenDetails.ts90.984.6110090.921
src/hooks/useTransactionType91.6679.1610091.66 
   index.tsx91.6679.1610091.66116–124
src/navigation0000 
   NavigationGuardHOC.tsx00009–90
   useScrollableHeader.tsx000023–48
src/navigation/hooks0000 
   useModalStyle.ts000013–28
   utils.tsx0100006–17
src/services/exceptions88.8810010088.88 
   utils.ts88.8810010088.8814
src/services/key-storage5.88005.88 
   index.ts100100100100 
   key-storage.service.ts2.32002.3232–137
   types.ts0000 
   wallet.service.ts000010–18
src/services/notifications0000 
   FCMService.ts000012–77
   NotificationService.ts000025–301
src/services/tx0000 
   extractTx.ts00007–111
src/services/tx/tx-sender0000 
   create.ts000016–26
   index.ts0000 
   sign.ts000014–52
src/services/web318.180018.18 
   index.ts18.180018.187–12, 20–27, 31, 42–62
src/store44.295.5522.0746.15 
   activeSafeSlice.ts6005055.5515–24
   activeSignerSlice.ts36.3610004014–20, 28–29
   addressBookSlice.ts3012.527.272525–65, 76–79
   biometricsSlice.ts50100066.6621–27
   constants.ts66.660066.66350–363
   delegatedSlice.ts44.44005028–33
   index.ts92.35010092.364
   myAccountsSlice.ts71.4210033.3366.6613–16
   notificationsSlice.ts39.130052.9418–36
   safesSlice.ts42.110033.3343.7520–38
   settingsSlice.ts71.4210033.3383.3321
   signersBalance.ts31.2502035.7117–33
   signersSlice.ts46.1502545.4514–16, 23–28
   storage.ts7.14007.1412–67
   txHistorySlice.ts100100100100 
src/store/chains69.56255075 
   index.ts69.5625507523, 28, 41–45
src/store/hooks85.715010085.71 
   activeSafe.ts8050100808
   index.ts100100100100 
src/theme100100100100 
   navigation.ts100100100100 
   tamagui.config.ts100100100100 
   tokens.ts100100100100 
src/theme/helpers10081.81100100 
   utils.ts10081.8110010037, 41
src/theme/hooks010000 
   useSafeAreaPaddingBottom.tsx0100004–6
src/theme/palettes100100100100 
   darkPalette.ts100100100100 
   lightPalette.ts100100100100 
src/theme/provider59.0927.776059.09 
   font.tsx90501009034
   safeTheme.tsx10037.510010019–34
   toastProvider.tsx000010–29
src/utils70.154565.6270 
   balance.ts100100100100 
   chains.ts100100100100 
   date.ts9666.6685.7110031, 35–39
   formatters.ts57.8957.1457.1455.5510, 21, 34–41, 45–48
   logger.ts56.0924505524, 32, 40–45, 50–55, 61–66, 85
   signer.ts100100100100 
   transaction-guards.ts76.1942.856078.6855, 59–65, 76, 80, 84, 106, 125, 139, 143
   transactions.tsx48.2743.337548.2715–39, 59–60
src/utils/notifications010000 
   index.ts01000016–55

Copy link

github-actions bot commented Mar 28, 2025

📦 Next.js Bundle Analysis for @safe-global/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@compojoom compojoom marked this pull request as ready for review March 28, 2025 21:14
Copy link

github-actions bot commented Mar 28, 2025

Coverage report for apps/web

St.
Category Percentage Covered / Total
🟡 Statements
76.86% (-0% 🔻)
14670/19087
🔴 Branches
55.56% (-0.02% 🔻)
3764/6775
🟡 Functions 61.2% 2158/3526
🟡 Lines
78.3% (-0.01% 🔻)
13304/16991
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡
... / safe-message-guards.ts
66.67% (-4.76% 🔻)
100% 50%
75% (-5% 🔻)
🟢
... / SignMessage.tsx
91.67% (-0.08% 🔻)
82.35% 69.23%
92.38% (-0.07% 🔻)
🟢
... / index.tsx
88.89% (-0.4% 🔻)
92.86% 75%
95.83% (-0.17% 🔻)
🟢
... / useSafeMessageNotifications.ts
86.89% (-0.21% 🔻)
78.26% 100%
87.5% (-0.22% 🔻)
🟢
... / index.tsx
96.88% (-0.09% 🔻)
73.33% (+9.7% 🔼)
100%
96.77% (-0.1% 🔻)
🟢
... / index.tsx
94.12%
47.06% (-6.27% 🔻)
50% 93.75%
🟡
... / index.tsx
76% (-0.92% 🔻)
45.45% 33.33%
75% (-1% 🔻)

Test suite run success

1803 tests passing in 253 suites.

Report generated by 🧪jest coverage report action from d0026a3

@@ -46,7 +46,7 @@ const MsgDetails = ({ msg }: { msg: SafeMessage }): ReactElement => {
<EthHashInfo
address={msg.proposedBy.value || ''}
name={msg.proposedBy.name}
customAvatar={msg.proposedBy.logoUri}
customAvatar={msg.proposedBy.logoUri || undefined}
Copy link
Member

Choose a reason for hiding this comment

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

Afaiu logoUri now has the type of string | null | undefined. Is there a benefit of having a fallback here instead of adjusting the EthHashInfo type to also accept null as a value for customAvatar?

Copy link
Member

Choose a reason for hiding this comment

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

Although thinking about it it makes sense to change it here instead of everywhere downstream so we don't have to deal with a null value in potentially many components.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question. The EthHashInfo component has specific requirements. if you pass a prop to it, it should be a string, otherwise you should not pass a customAvatar. The component defines concrete function arguments.
I'm not sure changing the function arguments should be done, because an API we use might return an incompatible type.
On the other hand I agree that it is a bit weird, but not sure that deserves changing the EthHashInfo component.

@compojoom compojoom force-pushed the refactor-data-type branch from ffa3db4 to a27645b Compare April 1, 2025 08:42
@compojoom compojoom force-pushed the refactor-data-type branch from a27645b to d0026a3 Compare April 1, 2025 08:48
@compojoom compojoom merged commit f56e465 into dev Apr 1, 2025
17 of 18 checks passed
@compojoom compojoom deleted the refactor-data-type branch April 1, 2025 08:56
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants