Skip to content
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

Feat(Tx flow): show full raw data in advanced details #5102

Merged
merged 1 commit into from
Feb 24, 2025
Merged

Conversation

katspaugh
Copy link
Member

What it solves

Show full raw data in the tx flow.

Screenshot 2025-02-24 at 15 50 40

@katspaugh katspaugh requested a review from compojoom February 24, 2025 14:51
Copy link

github-actions bot commented Feb 24, 2025

Copy link

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

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

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 1.06 MB (🟡 +68.19 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Thirty-two Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 509 B (🟢 -1 B) 1.06 MB
/address-book 23.21 KB (🟡 +143 B) 1.08 MB
/apps 31.93 KB (🟢 -1.79 KB) 1.09 MB
/apps/custom 29.99 KB (🟢 -1.79 KB) 1.08 MB
/apps/open 51.53 KB (🟢 -2.08 KB) 1.11 MB
/balances 30.02 KB (🟡 +320 B) 1.08 MB
/balances/nfts 9.52 KB (🟢 -23 B) 1.06 MB
/bridge 2.55 KB (🟢 -5 B) 1.06 MB
/cookie 8.77 KB (🟡 +1 B) 1.06 MB
/home 57.5 KB (🟢 -1.75 KB) 1.11 MB
/licenses 2.46 KB (🟢 -1 B) 1.06 MB
/new-safe/advanced-create 26.38 KB (🟢 -75 B) 1.08 MB
/new-safe/create 25.52 KB (🟢 -67 B) 1.08 MB
/privacy 14.57 KB (🟡 +2 B) 1.07 MB
/settings/appearance 2.25 KB (🟡 +1 B) 1.06 MB
/settings/cookies 1.87 KB (🟡 +1 B) 1.06 MB
/settings/modules 4.1 KB (🟡 +41 B) 1.06 MB
/settings/notifications 7.52 KB (🟢 -13.8 KB) 1.06 MB
/settings/safe-apps 16.32 KB (🟢 -1.96 KB) 1.07 MB
/settings/security 2.34 KB (🟡 +2 B) 1.06 MB
/settings/setup 30.97 KB (🟡 +246 B) 1.09 MB
/share/safe-app 7.55 KB (🟢 -8 B) 1.06 MB
/stake 617 B (🟢 -2 B) 1.06 MB
/swap 763 B (🟡 +3 B) 1.06 MB
/terms 12.93 KB (🟡 +1 B) 1.07 MB
/transactions 94.52 KB (🟢 -2.05 KB) 1.15 MB
/transactions/history 94.48 KB (🟢 -2.05 KB) 1.15 MB
/transactions/messages 56.21 KB (🟢 -2.09 KB) 1.11 MB
/transactions/msg 52.47 KB (🟢 -2.09 KB) 1.11 MB
/transactions/queue 45.32 KB (🟢 -2.08 KB) 1.1 MB
/transactions/tx 44.68 KB (🟢 -2.08 KB) 1.1 MB
/welcome/accounts 408 B (🟡 +1 B) 1.06 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

Coverage report for apps/web

Caution

Test run failed

St.
Category Percentage Covered / Total
🟡 Statements
77.55% (-0.01% 🔻)
14047/18114
🔴 Branches
57.12% (+0.01% 🔼)
3557/6227
🟡 Functions 62.93% 2117/3364
🟡 Lines
78.97% (-0.01% 🔻)
12675/16051

Test suite run failed

Failed tests: 4/1819. Failed suites: 2/248.
  ● ConfirmationView › should display a confirmation screen for a SETTINGS_CHANGE transaction

    expect(received).toMatchSnapshot()

    Snapshot name: `ConfirmationView should display a confirmation screen for a SETTINGS_CHANGE transaction 1`

    - Snapshot  - 35
    + Received  + 37

    @@ -511,55 +511,57 @@
                              </div>
                            </div>
                          </div>
                        </div>
                        <div
    -                     class="MuiGrid-root MuiGrid-container css-86qz5o-MuiGrid-root"
    +                     class="MuiBox-root css-164r41r"
                        >
                          <div
    -                       class="MuiGrid-root MuiGrid-item css-1wehkfy-MuiGrid-root"
    -                       data-testid="tx-row-title"
    -                       style="word-break: break-word;"
    +                       class="MuiGrid-root MuiGrid-container css-86qz5o-MuiGrid-root"
                          >
    -                       <p
    -                         class="MuiTypography-root MuiTypography-body1 css-shf88x-MuiTypography-root"
    +                       <div
    +                         class="MuiGrid-root MuiGrid-item css-1wehkfy-MuiGrid-root"
    +                         data-testid="tx-row-title"
    +                         style="word-break: break-word;"
                            >
    -                         Raw data:
    -                       </p>
    -                     </div>
    -                     <div
    -                       class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root"
    -                       data-testid="tx-data-row"
    -                     >
    +                         <p
    +                           class="MuiTypography-root MuiTypography-body1 css-shf88x-MuiTypography-root"
    +                         >
    +                           Raw data:
    +                         </p>
    +                       </div>
                            <div
    -                         class="MuiBox-root css-70qvj9"
    +                         class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root"
                              data-testid="tx-data-row"
                            >
    -                         <div>
    -                           0
    -                            bytes
    -                         </div>
    -                         <span
    -                           aria-label="Copy to clipboard"
    -                           class=""
    -                           data-mui-internal-clone-element="true"
    -                           style="cursor: pointer;"
    +                         <div
    +                           class="encodedData MuiBox-root css-0"
    +                           data-testid="tx-hexData"
                              >
    -                           <button
    +                           <span
                                  aria-label="Copy to clipboard"
    -                             class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-xyrzjn-MuiButtonBase-root-MuiIconButton-root"
    -                             tabindex="0"
    -                             type="button"
    +                             class=""
    +                             data-mui-internal-clone-element="true"
    +                             style="cursor: pointer;"
                                >
    -                             <mock-icon
    -                               aria-hidden=""
    -                               class="MuiSvgIcon-root MuiSvgIcon-colorBorder MuiSvgIcon-fontSizeSmall css-gvpe62-MuiSvgIcon-root"
    -                               data-testid="copy-btn-icon"
    -                               focusable="false"
    -                             />
    -                           </button>
    -                         </span>
    +                             <button
    +                               aria-label="Copy to clipboard"
    +                               class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-xyrzjn-MuiButtonBase-root-MuiIconButton-root"
    +                               tabindex="0"
    +                               type="button"
    +                             >
    +                               <mock-icon
    +                                 aria-hidden=""
    +                                 class="MuiSvgIcon-root MuiSvgIcon-colorBorder MuiSvgIcon-fontSizeSmall css-gvpe62-MuiSvgIcon-root"
    +                                 data-testid="copy-btn-icon"
    +                                 focusable="false"
    +                               />
    +                             </button>
    +                           </span>
    +                           0x
    +                            
    +                         </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>

      116 |     )
      117 |
    > 118 |     expect(container).toMatchSnapshot()
          |                       ^
      119 |   })
      120 |
      121 |   it("should display a confirmation with method call when the transaction type is not found in the ConfirmationView's mapper", () => {

      at Object.toMatchSnapshot (src/components/tx/confirmation-views/ConfirmationView.test.tsx:118:23)

  ● ConfirmationView › should display a confirmation with method call when the transaction type is not found in the ConfirmationView's mapper

    expect(received).toMatchSnapshot()

    Snapshot name: `ConfirmationView should display a confirmation with method call when the transaction type is not found in the ConfirmationView's mapper 1`

    - Snapshot  - 35
    + Received  + 37

    @@ -400,55 +400,57 @@
                              </div>
                            </div>
                          </div>
                        </div>
                        <div
    -                     class="MuiGrid-root MuiGrid-container css-86qz5o-MuiGrid-root"
    +                     class="MuiBox-root css-164r41r"
                        >
                          <div
    -                       class="MuiGrid-root MuiGrid-item css-1wehkfy-MuiGrid-root"
    -                       data-testid="tx-row-title"
    -                       style="word-break: break-word;"
    +                       class="MuiGrid-root MuiGrid-container css-86qz5o-MuiGrid-root"
                          >
    -                       <p
    -                         class="MuiTypography-root MuiTypography-body1 css-shf88x-MuiTypography-root"
    +                       <div
    +                         class="MuiGrid-root MuiGrid-item css-1wehkfy-MuiGrid-root"
    +                         data-testid="tx-row-title"
    +                         style="word-break: break-word;"
                            >
    -                         Raw data:
    -                       </p>
    -                     </div>
    -                     <div
    -                       class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root"
    -                       data-testid="tx-data-row"
    -                     >
    +                         <p
    +                           class="MuiTypography-root MuiTypography-body1 css-shf88x-MuiTypography-root"
    +                         >
    +                           Raw data:
    +                         </p>
    +                       </div>
                            <div
    -                         class="MuiBox-root css-70qvj9"
    +                         class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root"
                              data-testid="tx-data-row"
                            >
    -                         <div>
    -                           0
    -                            bytes
    -                         </div>
    -                         <span
    -                           aria-label="Copy to clipboard"
    -                           class=""
    -                           data-mui-internal-clone-element="true"
    -                           style="cursor: pointer;"
    +                         <div
    +                           class="encodedData MuiBox-root css-0"
    +                           data-testid="tx-hexData"
                              >
    -                           <button
    +                           <span
                                  aria-label="Copy to clipboard"
    -                             class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-xyrzjn-MuiButtonBase-root-MuiIconButton-root"
    -                             tabindex="0"
    -                             type="button"
    +                             class=""
    +                             data-mui-internal-clone-element="true"
    +                             style="cursor: pointer;"
                                >
    -                             <mock-icon
    -                               aria-hidden=""
    -                               class="MuiSvgIcon-root MuiSvgIcon-colorBorder MuiSvgIcon-fontSizeSmall css-gvpe62-MuiSvgIcon-root"
    -                               data-testid="copy-btn-icon"
    -                               focusable="false"
    -                             />
    -                           </button>
    -                         </span>
    +                             <button
    +                               aria-label="Copy to clipboard"
    +                               class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-xyrzjn-MuiButtonBase-root-MuiIconButton-root"
    +                               tabindex="0"
    +                               type="button"
    +                             >
    +                               <mock-icon
    +                                 aria-hidden=""
    +                                 class="MuiSvgIcon-root MuiSvgIcon-colorBorder MuiSvgIcon-fontSizeSmall css-gvpe62-MuiSvgIcon-root"
    +                                 data-testid="copy-btn-icon"
    +                                 focusable="false"
    +                               />
    +                             </button>
    +                           </span>
    +                           0x
    +                            
    +                         </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>

      131 |     )
      132 |
    > 133 |     expect(container).toMatchSnapshot()
          |                       ^
      134 |   })
      135 | })
      136 |

      at Object.toMatchSnapshot (src/components/tx/confirmation-views/ConfirmationView.test.tsx:133:23)


  ● SignOrExecute › should display a confirmation screen

    expect(received).toMatchSnapshot()

    Snapshot name: `SignOrExecute should display a confirmation screen 1`

    - Snapshot  - 35
    + Received  + 37

    @@ -104,55 +104,57 @@
                                  0
                                </div>
                              </div>
                            </div>
                            <div
    -                         class="MuiGrid-root MuiGrid-container css-86qz5o-MuiGrid-root"
    +                         class="MuiBox-root css-164r41r"
                            >
                              <div
    -                           class="MuiGrid-root MuiGrid-item css-1wehkfy-MuiGrid-root"
    -                           data-testid="tx-row-title"
    -                           style="word-break: break-word;"
    +                           class="MuiGrid-root MuiGrid-container css-86qz5o-MuiGrid-root"
                              >
    -                           <p
    -                             class="MuiTypography-root MuiTypography-body1 css-shf88x-MuiTypography-root"
    +                           <div
    +                             class="MuiGrid-root MuiGrid-item css-1wehkfy-MuiGrid-root"
    +                             data-testid="tx-row-title"
    +                             style="word-break: break-word;"
                                >
    -                             Raw data:
    -                           </p>
    -                         </div>
    -                         <div
    -                           class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root"
    -                           data-testid="tx-data-row"
    -                         >
    +                             <p
    +                               class="MuiTypography-root MuiTypography-body1 css-shf88x-MuiTypography-root"
    +                             >
    +                               Raw data:
    +                             </p>
    +                           </div>
                                <div
    -                             class="MuiBox-root css-70qvj9"
    +                             class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root"
                                  data-testid="tx-data-row"
                                >
    -                             <div>
    -                               0
    -                                bytes
    -                             </div>
    -                             <span
    -                               aria-label="Copy to clipboard"
    -                               class=""
    -                               data-mui-internal-clone-element="true"
    -                               style="cursor: pointer;"
    +                             <div
    +                               class="encodedData MuiBox-root css-0"
    +                               data-testid="tx-hexData"
                                  >
    -                               <button
    +                               <span
                                      aria-label="Copy to clipboard"
    -                                 class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-xyrzjn-MuiButtonBase-root-MuiIconButton-root"
    -                                 tabindex="0"
    -                                 type="button"
    +                                 class=""
    +                                 data-mui-internal-clone-element="true"
    +                                 style="cursor: pointer;"
                                    >
    -                                 <mock-icon
    -                                   aria-hidden=""
    -                                   class="MuiSvgIcon-root MuiSvgIcon-colorBorder MuiSvgIcon-fontSizeSmall css-gvpe62-MuiSvgIcon-root"
    -                                   data-testid="copy-btn-icon"
    -                                   focusable="false"
    -                                 />
    -                               </button>
    -                             </span>
    +                                 <button
    +                                   aria-label="Copy to clipboard"
    +                                   class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-xyrzjn-MuiButtonBase-root-MuiIconButton-root"
    +                                   tabindex="0"
    +                                   type="button"
    +                                 >
    +                                   <mock-icon
    +                                     aria-hidden=""
    +                                     class="MuiSvgIcon-root MuiSvgIcon-colorBorder MuiSvgIcon-fontSizeSmall css-gvpe62-MuiSvgIcon-root"
    +                                     data-testid="copy-btn-icon"
    +                                     focusable="false"
    +                                   />
    +                                 </button>
    +                               </span>
    +                               0x
    +                                
    +                             </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>

      60 |
      61 |     expect(getByTestId('sign-btn')).toBeInTheDocument()
    > 62 |     expect(container).toMatchSnapshot()
         |                       ^
      63 |   })
      64 |
      65 |   it('should display an error screen', async () => {

      at Object.toMatchSnapshot (src/components/tx/SignOrExecuteForm/__tests__/SignOrExecute.test.tsx:62:23)

  ● SignOrExecute › should display an error screen

    expect(received).toMatchSnapshot()

    Snapshot name: `SignOrExecute should display an error screen 1`

    - Snapshot  - 35
    + Received  + 37

    @@ -104,55 +104,57 @@
                                  0
                                </div>
                              </div>
                            </div>
                            <div
    -                         class="MuiGrid-root MuiGrid-container css-86qz5o-MuiGrid-root"
    +                         class="MuiBox-root css-164r41r"
                            >
                              <div
    -                           class="MuiGrid-root MuiGrid-item css-1wehkfy-MuiGrid-root"
    -                           data-testid="tx-row-title"
    -                           style="word-break: break-word;"
    +                           class="MuiGrid-root MuiGrid-container css-86qz5o-MuiGrid-root"
                              >
    -                           <p
    -                             class="MuiTypography-root MuiTypography-body1 css-shf88x-MuiTypography-root"
    +                           <div
    +                             class="MuiGrid-root MuiGrid-item css-1wehkfy-MuiGrid-root"
    +                             data-testid="tx-row-title"
    +                             style="word-break: break-word;"
                                >
    -                             Raw data:
    -                           </p>
    -                         </div>
    -                         <div
    -                           class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root"
    -                           data-testid="tx-data-row"
    -                         >
    +                             <p
    +                               class="MuiTypography-root MuiTypography-body1 css-shf88x-MuiTypography-root"
    +                             >
    +                               Raw data:
    +                             </p>
    +                           </div>
                                <div
    -                             class="MuiBox-root css-70qvj9"
    +                             class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-true css-1vd824g-MuiGrid-root"
                                  data-testid="tx-data-row"
                                >
    -                             <div>
    -                               0
    -                                bytes
    -                             </div>
    -                             <span
    -                               aria-label="Copy to clipboard"
    -                               class=""
    -                               data-mui-internal-clone-element="true"
    -                               style="cursor: pointer;"
    +                             <div
    +                               class="encodedData MuiBox-root css-0"
    +                               data-testid="tx-hexData"
                                  >
    -                               <button
    +                               <span
                                      aria-label="Copy to clipboard"
    -                                 class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-xyrzjn-MuiButtonBase-root-MuiIconButton-root"
    -                                 tabindex="0"
    -                                 type="button"
    +                                 class=""
    +                                 data-mui-internal-clone-element="true"
    +                                 style="cursor: pointer;"
                                    >
    -                                 <mock-icon
    -                                   aria-hidden=""
    -                                   class="MuiSvgIcon-root MuiSvgIcon-colorBorder MuiSvgIcon-fontSizeSmall css-gvpe62-MuiSvgIcon-root"
    -                                   data-testid="copy-btn-icon"
    -                                   focusable="false"
    -                                 />
    -                               </button>
    -                             </span>
    +                                 <button
    +                                   aria-label="Copy to clipboard"
    +                                   class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeSmall css-xyrzjn-MuiButtonBase-root-MuiIconButton-root"
    +                                   tabindex="0"
    +                                   type="button"
    +                                 >
    +                                   <mock-icon
    +                                     aria-hidden=""
    +                                     class="MuiSvgIcon-root MuiSvgIcon-colorBorder MuiSvgIcon-fontSizeSmall css-gvpe62-MuiSvgIcon-root"
    +                                     data-testid="copy-btn-icon"
    +                                     focusable="false"
    +                                   />
    +                                 </button>
    +                               </span>
    +                               0x
    +                                
    +                             </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>

      81 |
      82 |     expect(container.querySelector('sign-btn')).not.toBeInTheDocument()
    > 83 |     expect(container).toMatchSnapshot()
         |                       ^
      84 |   })
      85 | })
      86 |

      at Object.toMatchSnapshot (src/components/tx/SignOrExecuteForm/__tests__/SignOrExecute.test.tsx:83:23)

Report generated by 🧪jest coverage report action from ebb86b0

@katspaugh katspaugh merged commit 6524453 into release Feb 24, 2025
7 of 11 checks passed
@katspaugh katspaugh deleted the rawdata branch February 24, 2025 15:06
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 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.

2 participants