Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Oct 6, 2025


PR-Codex overview

This PR focuses on enhancing the onBack functionality in the ExecutingTxScreen component across different files, allowing for better navigation management in transaction workflows.

Detailed summary

  • In TransactionWidget.tsx, onBack is updated to set the screen to "init-ui".
  • In TransactionModal.tsx, onBack now sets the screen to "deposit".
  • In ExecutingScreen.tsx, the onBack prop is changed from optional to required (onBack: (() => void) | undefined).

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features
    • Added back-navigation from the executing transaction screen so users can return to the previous step without closing the modal.
    • Consistent back-button behavior across transaction and bridge flows for a smoother experience.
    • Enables returning to the deposit/init step during long-running executions.
    • Navigation change is purely UI flow—transaction processing remains unchanged.

@linear
Copy link

linear bot commented Oct 6, 2025

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2025

⚠️ No Changeset found

Latest commit: 68b48f4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Oct 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Oct 6, 2025 10:42pm
nebula Ready Ready Preview Comment Oct 6, 2025 10:42pm
thirdweb_playground Ready Ready Preview Comment Oct 6, 2025 10:42pm
thirdweb-www Ready Ready Preview Comment Oct 6, 2025 10:42pm
wallet-ui Ready Ready Preview Comment Oct 6, 2025 10:42pm

@MananTank MananTank marked this pull request as ready for review October 6, 2025 16:08
@MananTank MananTank requested review from a team as code owners October 6, 2025 16:08
@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Oct 6, 2025
Copy link
Member Author

MananTank commented Oct 6, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 6, 2025

Walkthrough

Adds a back-navigation handler to the executing-transaction UI by wiring an onBack prop to ExecutingTxScreen at TransactionWidget and TransactionModal; ExecutingTxScreen's prop type was adjusted to require the property (allowing undefined).

Changes

Cohort / File(s) Summary
Executing screen API
packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx
Prop signature changed: onBack?: () => void → `onBack: (() => void)
TransactionWidget wiring
packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
Passes onBack to ExecutingTxScreen that sets screen to "init-ui" when invoked.
TransactionModal wiring
packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
Passes onBack to ExecutingTxScreen that sets screen to "deposit" when invoked.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant ETS as ExecutingTxScreen
  participant TW as TransactionWidget
  note over ETS,TW: Execute-tx -> init-ui back path added

  U->>ETS: Click Back
  ETS->>TW: onBack()
  TW->>TW: set screen = "init-ui"
  TW-->>U: show init UI
Loading
sequenceDiagram
  autonumber
  actor U as User
  participant ETS as ExecutingTxScreen
  participant TM as TransactionModal
  note over ETS,TM: Execute-tx -> deposit back path added

  U->>ETS: Click Back
  ETS->>TM: onBack()
  TM->>TM: set screen = "deposit"
  TM-->>U: show deposit UI
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The pull request also adds back-navigation logic in TransactionModal and changes the ExecutingScreen prop signature, which were not requested by issue MNY-232 and extend beyond the single-purpose scope of restoring a back button in TransactionWidget. Split the TransactionModal and API signature changes into a separate PR or update the linked issues to cover these additional enhancements.
Description Check ⚠️ Warning The pull request description does not follow the required template: it only contains the commented-out template and a PR-Codex overview, but lacks the “Notes for the reviewer” and “How to test” sections specified in the repository’s template. Please complete the template by filling in the “## Notes for the reviewer” and “## How to test” sections with relevant testing instructions and reviewer guidance.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly references the issue ID and concisely describes the main change of restoring a back button on the ExecutingTxScreen within TransactionWidget, matching the core intent of the PR.
Linked Issues Check ✅ Passed The changes introduce the requested back-navigation in TransactionWidget as specified by issue MNY-232 and correctly implement the onBack callback in the executing transaction screen to return users to the prior UI state.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mny-232

📜 Recent 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.

📥 Commits

Reviewing files that changed from the base of the PR and between e911a66 and 68b48f4.

📒 Files selected for processing (3)
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling @example and a custom tag (@beta, @internal, @experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g., const { jsPDF } = await import("jspdf"))

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.6 KB (0%) 1.3 s (0%) 183 ms (+103.37% 🔺) 1.5 s
thirdweb (cjs) 365.75 KB (0%) 7.4 s (0%) 898 ms (+22.31% 🔺) 8.3 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 67 ms (+1533.59% 🔺) 181 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 63 ms (+2407.64% 🔺) 73 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 80 ms (+1559.8% 🔺) 463 ms

@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.04%. Comparing base (1c660d4) to head (68b48f4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...dweb/src/react/web/ui/Bridge/TransactionWidget.tsx 0.00% 3 Missing ⚠️
...eact/web/ui/TransactionButton/TransactionModal.tsx 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8193      +/-   ##
==========================================
- Coverage   55.04%   55.04%   -0.01%     
==========================================
  Files         919      919              
  Lines       60563    60569       +6     
  Branches     4125     4127       +2     
==========================================
  Hits        33338    33338              
- Misses      27121    27127       +6     
  Partials      104      104              
Flag Coverage Δ
packages 55.04% <0.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
...react/web/ui/TransactionButton/ExecutingScreen.tsx 11.57% <ø> (ø)
...dweb/src/react/web/ui/Bridge/TransactionWidget.tsx 7.91% <0.00%> (-0.07%) ⬇️
...eact/web/ui/TransactionButton/TransactionModal.tsx 12.60% <0.00%> (-0.33%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@graphite-app graphite-app bot changed the base branch from mny-231 to graphite-base/8193 October 6, 2025 19:22
@graphite-app graphite-app bot changed the base branch from graphite-base/8193 to main October 6, 2025 20:11
graphite-app bot pushed a commit that referenced this pull request Oct 6, 2025
…onWidget (#8193)

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the transaction handling in the `TransactionWidget` and `TransactionModal` components by ensuring that the `onBack` function is defined and properly utilized.

### Detailed summary
- In `TransactionWidget.tsx`, added `onBack` function to `ExecutingTxScreen` that sets the screen to `init-ui`.
- In `TransactionModal.tsx`, modified `onBack` to set the screen to `"deposit"`.
- In `ExecutingScreen.tsx`, changed `onBack` from optional to required.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx (1)

66-66: Avoid back during in-flight send; limit back to failure state

Allowing back while “loading” can unmount mid-send, leading to async setState on an unmounted component and confusing UX. Show the back button only on failure (as per MNY‑232 intent).

Apply:

-      <ModalHeader onBack={props.onBack} title="Transaction" />
+      <ModalHeader
+        onBack={status === "failed" ? props.onBack : undefined}
+        title="Transaction"
+      />

Alternative: keep back always visible but add an isMounted guard to prevent setState after unmount. Happy to provide that patch if preferred.

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 86461f9 and e911a66.

📒 Files selected for processing (3)
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
  • packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
  • packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling @example and a custom tag (@beta, @internal, @experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g., const { jsPDF } = await import("jspdf"))

Files:

  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
  • packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx
🪛 GitHub Check: codecov/patch
packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx

[warning] 136-138: packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx#L136-L138
Added lines #L136 - L138 were not covered by tests

packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx

[warning] 773-775: packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx#L773-L775
Added lines #L773 - L775 were not covered by tests

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
packages/thirdweb/src/react/web/ui/TransactionButton/ExecutingScreen.tsx (1)

23-23: Prop type tightening is safe – all callers pass onBack
Verified both TransactionModal.tsx and TransactionWidget.tsx pass an onBack prop to ExecutingTxScreen; no breaking changes.

Comment on lines +773 to +775
onBack={() => {
setScreen({ id: "init-ui" });
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

LGTM: back action to init-ui; add coverage

Passing onBack to reset to "init-ui" is correct for recovery. Please add a test asserting the back button sets the screen back from "execute-tx".

Quick grep to help find all call sites to cover:


🏁 Script executed:

#!/bin/bash
rg -nP -C2 '<ExecutingTxScreen\b' 

Length of output: 997


Add tests for back action in ExecutingTxScreen

Add tests verifying that clicking the back button in <ExecutingTxScreen>
– in TransactionModal it resets the screen to "deposit",
– in TransactionWidget it resets the screen to { id: "init-ui" }.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 773-775: packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx#L773-L775
Added lines #L773 - L775 were not covered by tests

🤖 Prompt for AI Agents
In packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx around lines
773-775, the review requests tests for the back action: add unit tests that
render ExecutingTxScreen inside both TransactionModal and TransactionWidget,
simulate clicking the back button, and assert the resulting screen state;
specifically, in TransactionModal the screen should reset to the string
"deposit", and in TransactionWidget the screen should reset to an object { id:
"init-ui" }. Implement tests that (1) mount or render each parent component with
a controlled screen state or mock state setter, (2) find and click the back
button in ExecutingTxScreen, and (3) assert the screen setter was called with
the expected value ("deposit" for TransactionModal, { id: "init-ui" } for
TransactionWidget), using your test utilities/mocks consistent with the repo
testing patterns.

Comment on lines +136 to +138
onBack={() => {
setScreen("deposit");
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

LGTM: back action wired for deposit flow; add a test

Wiring onBack to return to "deposit" looks correct. Please add a simple state-transition test to cover this path.

Example check:


🏁 Script executed:

#!/bin/bash
# List usages to guide adding tests for back navigation in deposit modal
rg -nP -C2 '<ExecutingTxScreen\b' packages/thirdweb/src/react/web/ui

Length of output: 997


Add state-transition test for back action
Add a unit test in packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.test.tsx that mounts TransactionModal, navigates to "execute-tx", invokes the onBack callback on ExecutingTxScreen, and asserts that screen resets to "deposit".

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 136-138: packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx#L136-L138
Added lines #L136 - L138 were not covered by tests

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 6, 2025

Merge activity

…onWidget (#8193)

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the `onBack` functionality in the `TransactionWidget` and `TransactionModal` components, ensuring that the back navigation behavior is more consistent across these components.

### Detailed summary
- In `TransactionWidget.tsx`, `onBack` now sets the screen to `init-ui`.
- In `TransactionModal.tsx`, `onBack` sets the screen to `deposit`.
- In `ExecutingScreen.tsx`, the `onBack` prop is changed from optional to required.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added back navigation from the executing transaction screen, allowing users to return to the previous step without closing the modal.
  * Unified back-button behavior across transaction flows for a more consistent experience.
  * Provides clearer control during long-running executions with an explicit back option.
  * Navigation enhancement applies to both bridge and transaction modal flows, improving step-to-step control while keeping transaction processing unchanged.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants