Skip to content

Feature/boe v2 - #100

Open
manishdex25 wants to merge 8 commits into
developfrom
feature/boe-v2
Open

Feature/boe v2#100
manishdex25 wants to merge 8 commits into
developfrom
feature/boe-v2

Conversation

@manishdex25

@manishdex25 manishdex25 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added Bill of Exchange support, including accept, reject, and discharge actions with status tracking and success or failure messages.
    • Added obligation-aware verification, endorsement chains, transfers, and gasless transactions.
    • Added a Partners page and navigation link, plus a Partners section on the Home page.
  • Bug Fixes

    • Improved network handling across numeric, decimal, and hexadecimal chain IDs.
    • Improved dropdown responsiveness, wrapping, and menu positioning.
    • Standardized transaction failure messaging and case-insensitive ownership checks.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 27058d5c-521c-4d38-8939-86244f4c33c2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/common/Navbar/Navbar.tsx (1)

299-322: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Close the mobile menu after Partners navigation.

The new Partners link does not reset isMobileMenuOpen. The mobile overlay remains open after navigation and covers the Partners page. Add the same close handler used by the Settings and Contact links. Add a test that opens the mobile menu, selects Partners, and verifies that the menu closes.

Proposed fix
 <Link
   to="/partners"
+  onClick={() => setIsMobileMenuOpen(false)}
   className="px-4 py-3 text-left text-sm font-bold font-urbanist rounded-lg transition-colors duration-200"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/common/Navbar/Navbar.tsx` around lines 299 - 322, Update the
Partners Link in the mobile navigation to use the same isMobileMenuOpen reset
handler as the Settings and Contact links, so navigation closes the overlay. Add
a test covering opening the mobile menu, selecting Partners, and verifying the
menu is closed.
src/components/AssetManagementPanel/AssetManagementForm/AssetManagementDropdown/AssetManagementDropdown.tsx (1)

154-176: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the document type consistent through the return flow.

If documentLabel is BoE, these menu items use BoE copy. The selected return forms and return overlays still contain hard-coded ETR text. Pass the document label through those views, or use neutral copy. This prevents a BoE action from being labelled as an ETR action after selection.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/components/AssetManagementPanel/AssetManagementForm/AssetManagementDropdown/AssetManagementDropdown.tsx`
around lines 154 - 176, Propagate documentLabel from AssetManagementDropdown
through the AcceptReturnToIssuer and RejectReturnToIssuer form and overlay
views, replacing hard-coded ETR text with the selected label. Ensure the entire
return flow preserves BoE or ETR consistently after an action is selected.
🧹 Nitpick comments (1)
src/hooks/useContractFunctionHook.obligation.test.tsx (1)

127-153: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test reject and discharge routing.

This suite tests accept, but the new obligation map also exposes reject and discharge. Add a send test for each operation. Assert the mapped registry options, keyId, target function, and confirmation state. (raw.githubusercontent.com)

Based on the supplied obligation method map, these are independent lifecycle routes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/useContractFunctionHook.obligation.test.tsx` around lines 127 -
153, Extend the obligation-routing tests alongside the existing accept case to
cover send calls for reject and discharge. In each test, configure
useDocumentContext with the obligation keyId, mock the corresponding registry
method, invoke useContractFunctionHook.send, and assert the mapped registry
options, keyId, target function, and final CONFIRMED state.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/components/AssetManagementPanel/AssetManagementForm/AssetManagementDropdown/AssetManagementDropdown.tsx`:
- Around line 61-94: The lifecycle actions in AssetManagementDropdown are
rendered through non-focusable DropdownItem elements, so make these controls
keyboard-operable by using semantic button elements or enhancing DropdownItem
with focusable menu-item semantics and Enter/Space activation. Preserve the
existing canAcceptObligation, canRejectObligation, canDischargeObligation guards
and onSetFormAction mappings.

In
`@src/components/common/contexts/TokenInformationContext/TokenInformationContext.tsx`:
- Around line 329-363: Update TokenInformationContext’s acceptObligation,
rejectObligation, and dischargeObligation write hooks to use the document-chain
provider and reject requests unless the signer’s normalized chain matches the
document chain. In VerifyResult.tsx at lines 77-85, normalize both chain values
with toChainId and render BoE asset actions only after the network switch
succeeds and currentChainId matches the document chain.

In `@src/components/home/VerifySection/VerifySection.tsx`:
- Line 184: Update the VerifySection call to VerifyResult so BoE obligations are
not marked transferable; pass isObligation separately as the obligation
indicator. In VerifyResult, use that indicator to bypass delegation checks,
stored-paymaster checks, and paymaster-card rendering, preserving gasless
behavior only for non-obligation transfers.

In `@src/hooks/useContractFunctionHook.tsx`:
- Around line 198-203: Update the error-message handling in
useContractFunctionHook around the unsupported-method error and ordinary
contract rejections so unrecognized errors fall back to Error.message when
getMetaMaskErrorMessage returns an empty string. Reuse the fallback behavior
established by makeGaslessHook, preserving existing MetaMask-specific messages.

---

Outside diff comments:
In
`@src/components/AssetManagementPanel/AssetManagementForm/AssetManagementDropdown/AssetManagementDropdown.tsx`:
- Around line 154-176: Propagate documentLabel from AssetManagementDropdown
through the AcceptReturnToIssuer and RejectReturnToIssuer form and overlay
views, replacing hard-coded ETR text with the selected label. Ensure the entire
return flow preserves BoE or ETR consistently after an action is selected.

In `@src/components/common/Navbar/Navbar.tsx`:
- Around line 299-322: Update the Partners Link in the mobile navigation to use
the same isMobileMenuOpen reset handler as the Settings and Contact links, so
navigation closes the overlay. Add a test covering opening the mobile menu,
selecting Partners, and verifying the menu is closed.

---

Nitpick comments:
In `@src/hooks/useContractFunctionHook.obligation.test.tsx`:
- Around line 127-153: Extend the obligation-routing tests alongside the
existing accept case to cover send calls for reject and discharge. In each test,
configure useDocumentContext with the obligation keyId, mock the corresponding
registry method, invoke useContractFunctionHook.send, and assert the mapped
registry options, keyId, target function, and final CONFIRMED state.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5004c5ad-ca44-4b51-a1a6-b0f7cde7ec12

📥 Commits

Reviewing files that changed from the base of the PR and between ef9eaf8 and 0a4f30b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (49)
  • package.json
  • src/App.test.tsx
  • src/__tests__/home.test.tsx
  • src/components/AssetManagementPanel/AssetManagementActions/index.tsx
  • src/components/AssetManagementPanel/AssetManagementApplication/index.tsx
  • src/components/AssetManagementPanel/AssetManagementForm/AssetManagementDropdown/AssetManagementDropdown.tsx
  • src/components/AssetManagementPanel/AssetManagementForm/AssetManagementForm.test.tsx
  • src/components/AssetManagementPanel/AssetManagementForm/AssetManagementForm.tsx
  • src/components/AssetManagementPanel/AssetManagementForm/FormVariants/ActionForm/ActionForm.tsx
  • src/components/AssetManagementPanel/AssetManagementForm/FormVariants/ActionForm/types.ts
  • src/components/AssetManagementPanel/AssetManagementForm/FormVariants/ActionSelectionForm/ActionSelectionForm.obligation.test.tsx
  • src/components/AssetManagementPanel/AssetManagementForm/FormVariants/ActionSelectionForm/ActionSelectionForm.test.tsx
  • src/components/AssetManagementPanel/AssetManagementForm/FormVariants/ActionSelectionForm/ActionSelectionForm.tsx
  • src/components/common/Navbar/Navbar.test.tsx
  • src/components/common/Navbar/Navbar.tsx
  • src/components/common/Overlay/OverlayContent/DocumentTransferMessage.tsx
  • src/components/common/contexts/DocumentContext/DocumentContext.tsx
  • src/components/common/contexts/TokenInformationContext/TokenInformationContext.tsx
  • src/components/common/contexts/providerContext.tsx
  • src/components/home/EndorsementChain/useEndorsementChain.test.ts
  • src/components/home/EndorsementChain/useEndorsementChain.ts
  • src/components/home/VerifySection/VerifyResult.tsx
  • src/components/home/VerifySection/VerifySection.test.tsx
  • src/components/home/VerifySection/VerifySection.tsx
  • src/components/home/VerifySection/useVerify.test.ts
  • src/components/home/VerifySection/useVerify.ts
  • src/constants/index.ts
  • src/constants/obligation.ts
  • src/gasless/gaslessHooks.test.tsx
  • src/gasless/makeGaslessHook.ts
  • src/gasless/useGaslessAcceptReturned.ts
  • src/gasless/useGaslessNominate.ts
  • src/gasless/useGaslessRejectReturned.ts
  • src/gasless/useGaslessRejectTransferBeneficiary.ts
  • src/gasless/useGaslessRejectTransferHolder.ts
  • src/gasless/useGaslessRejectTransferOwners.ts
  • src/gasless/useGaslessReturnToIssuer.ts
  • src/gasless/useGaslessTransferBeneficiary.ts
  • src/gasless/useGaslessTransferHolder.ts
  • src/gasless/useGaslessTransferOwners.ts
  • src/hooks/useContractFunctionHook.obligation.test.tsx
  • src/hooks/useContractFunctionHook.test.tsx
  • src/hooks/useContractFunctionHook.tsx
  • src/hooks/useIsObligation.ts
  • src/hooks/useTitleEscrowContract.ts
  • src/hooks/useTokenRegistryContract.ts
  • src/pages/Home/index.tsx
  • src/routes.tsx
  • src/utils/chain-utils.ts

Comment thread src/components/home/VerifySection/VerifySection.tsx Outdated
Comment thread src/hooks/useContractFunctionHook.tsx
- Added isObligation prop to DocumentStatus and AssetManagementTags components to manage obligation-specific UI behavior.
- Enhanced ActionSelectionForm to display obligation status labels and manage visibility based on isObligation state.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/index.css (1)

4077-4102: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the Stylelint errors.

Stylelint reports empty lines before declarations at Lines 4077, 4097, and 4102. It also reports quoted Urbanist font names at Lines 4109 and 4129. Remove the empty lines and quotes to satisfy the configured stylesheet rules.

Proposed fix
-  font-family: 'Urbanist';
+  font-family: Urbanist;

Also applies to: 4109-4129

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/index.css` around lines 4077 - 4102, Update the CSS declarations around
the dropdown item styles to remove the reported empty lines before declarations
at the referenced locations, and use unquoted Urbanist font names wherever they
appear in the affected styles. Preserve all other styling and formatting
behavior.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/index.css`:
- Around line 4077-4102: Update the CSS declarations around the dropdown item
styles to remove the reported empty lines before declarations at the referenced
locations, and use unquoted Urbanist font names wherever they appear in the
affected styles. Preserve all other styling and formatting behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: aac3827e-faf7-44ea-b21e-6a6253f90ba1

📥 Commits

Reviewing files that changed from the base of the PR and between 5b9f81a and e9e33c2.

📒 Files selected for processing (3)
  • src/components/AssetManagementPanel/AssetManagementForm/AssetManagementDropdown/AssetManagementDropdown.tsx
  • src/components/Dropdown/Dropdown.tsx
  • src/index.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/AssetManagementPanel/AssetManagementForm/AssetManagementDropdown/AssetManagementDropdown.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant