Skip to content

fix: render tiny balances with unicode subscript#168

Draft
tansawit wants to merge 22 commits intomainfrom
fix/tiny-balance-subscript-display
Draft

fix: render tiny balances with unicode subscript#168
tansawit wants to merge 22 commits intomainfrom
fix/tiny-balance-subscript-display

Conversation

@tansawit
Copy link
Copy Markdown
Contributor

@tansawit tansawit commented Feb 18, 2026

Summary

This PR improves tiny-balance display so non-zero amounts that previously looked like 0.000000 are shown with compact Unicode subscript notation (for example 0.0₆3159).

User impact

Users can now distinguish tiny non-zero balances from zero across bridge, asset selection, transfer, send, portfolio, activity, and fee surfaces while keeping the existing 6-decimal display budget.

Root cause

The previous formatter truncated many tiny values to zero-looking output. During refactors, the codebase also kept an exported structured-parts formatter path intended for HTML <sub> rendering even though the UI intentionally renders Unicode subscript strings, and formatFees in bridge/data/format.ts became dead production code.

Changes

  • Kept Unicode-based rendering in FormattedAmount and aligned lib/format to that path.
  • Removed the exported formatDisplayAmountParts API and inlined it as an internal helper used only by formatDisplayAmount.
  • Removed dead formatFees production utility from bridge/data/format.ts.
  • Removed obsolete formatFees test cases from bridge/data/format.test.ts.

Notes

This intentionally uses Unicode subscript glyphs (not HTML <sub>) to match the requested visual style.


Note

Medium Risk
Medium risk because it changes amount/fee rendering and dropdown search labels across many transaction and bridge flows; formatting or accessibility regressions could affect user decisions but no auth or data-write logic is touched.

Overview
Introduces FormattedAmount (with accessible plain-text output) and a shared formatDisplayAmountParts formatter to show tiny non-zero values using compact Unicode subscript notation instead of appearing as 0.000000.

Replaces formatAmount/formatFees usage across bridge, deposit/transfer, tx approval/simulation, send, portfolio, and activity UI with FormattedAmount/FormattedFeeList, and removes the now-dead formatFees helper/tests. Updates Dropdown options to accept ReactNode labels and adds searchLabel support, plus minor layout fixes to scroll/page containers and QuantityInput.ReadOnly placeholder handling.

Reviewed by Cursor Bugbot for commit a11ec46. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • New formatted display components for amounts and fee lists used across the app
    • Dropdowns now support richer React content for labels and triggers
  • Refactor

    • Replaced string-based number formatting with the new components for consistent rendering across pages
    • Quantity input read-only view accepts flexible content and explicit placeholder control
    • Improved scroll/page layout to prevent scroll chaining and enable smooth iOS momentum
  • Tests

    • Added tests covering the new amount formatting behavior

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds accessible amount formatting utilities and components (subscript-capable formatDisplayAmountParts, toSubscript, FormattedAmount, FormattedFeeList), replaces many string-formatting calls with these components across the React app, widens Dropdown label types to ReactNode, adjusts QuantityInput.ReadOnly props, and updates layout/scroll CSS and a few page wrappers.

Changes

Cohort / File(s) Summary
Core format lib & tests
packages/interwovenkit-react/src/lib/format.ts, packages/interwovenkit-react/src/lib/format.test.ts
Added toSubscript(), FormatDisplayAmountParts type, and formatDisplayAmountParts() to produce plain or subscript parts; updated/added tests covering plain and subscript scenarios.
New formatting components
packages/interwovenkit-react/src/components/FormattedAmount.tsx, packages/interwovenkit-react/src/components/FormattedFeeList.tsx
Added FormattedAmount (accessible rendering using formatDisplayAmountParts, visually-hidden accessible text, visible subscript rendering) and FormattedFeeList (maps FeeJson[] to formatted spans).
Dropdown API change
packages/interwovenkit-react/src/components/Dropdown.tsx
Widened DropdownOption.label and triggerLabel? from string to ReactNode; trigger uses triggerLabel ?? label to preserve explicit falsy nodes.
QuantityInput.ReadOnly API
packages/interwovenkit-react/src/components/form/QuantityInput.tsx
ReadOnly now accepts children: ReactNode and a required isPlaceholder: boolean; removed numeric placeholder detection logic.
Scrollable / page layout CSS
packages/interwovenkit-react/src/components/Scrollable.module.css, packages/interwovenkit-react/src/pages/.../EnableAutoSign.module.css, packages/interwovenkit-react/src/pages/.../TxRequest.module.css
Updated .scrollable to include min-height: 0, -webkit-overflow-scrolling: touch, overscroll-behavior: contain; added .page classes with flex column, height: 100%, min-height: 0, and overflow: hidden.
Replace formatAmount → FormattedAmount (bridge & ops)
packages/interwovenkit-react/src/pages/bridge/...
packages/interwovenkit-react/src/pages/bridge/BridgeFields.tsx, .../BridgeHistoryItem.tsx, .../OperationItem.tsx, .../SelectRouteOption.tsx, .../op/ClaimableList.tsx, .../op/WithdrawalAsset.tsx
Replaced formatAmount usages with <FormattedAmount /> and fee formatting with <FormattedFeeList />; removed related utility imports and intermediate formatted strings.
Replace formatAmount → FormattedAmount (deposit/transfer)
packages/interwovenkit-react/src/pages/deposit/...
.../SelectExternalAsset.tsx, .../TransferFields.tsx, .../TransferFooter.tsx, .../TransferTxDetails.tsx
Swapped utility formatting for component-based FormattedAmount/FormattedFeeList; removed getDp zero-special-case logic in TransferFooter and returned ReactNode labels.
Replace formatAmount → FormattedAmount (tx flows)
packages/interwovenkit-react/src/pages/tx/...
.../TxFee.tsx, .../TxFeeInsufficient.tsx, .../TxSimulate.tsx, .../TxRequest.tsx
Replaced formatAmount with FormattedAmount; TxFee now returns ReactNode labels and uses FormattedAmount in UI; TxRequest root now wrapped with styles.page.
Replace formatAmount → FormattedAmount (wallet & send)
packages/interwovenkit-react/src/pages/wallet/..., packages/interwovenkit-react/src/pages/wallet/txs/send/SendFields.tsx
Replaced local formatAmount formatting with FormattedAmount component rendering in activity, portfolio and send UIs.
Form / Asset options update
packages/interwovenkit-react/src/components/form/AssetOptions.tsx
Replaced formatAmount import with FormattedAmount and render balances via the component.
Remove formatFees util & tests
packages/interwovenkit-react/src/pages/bridge/data/format.ts, packages/interwovenkit-react/src/pages/bridge/data/format.test.ts
Deleted exported formatFees() and its associated tests; fee formatting consolidated into FormattedFeeList.
EnableAutoSign wrapper update
packages/interwovenkit-react/src/pages/autosign/EnableAutoSign.tsx
Root fragment replaced with <div className={styles.page}> to apply the new page layout class.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰
I nibbled numbers, tiny and slight,
tucked zeros below out of sight,
fees parade neat in lined-up rows,
labels now welcome petals and prose,
the garden of components hums soft and bright.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: rendering tiny balances using Unicode subscript notation instead of plain zeros. It directly reflects the primary objective of the changeset.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tiny-balance-subscript-display

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Feb 18, 2026

Deploying interwovenkit-staging with  Cloudflare Pages  Cloudflare Pages

Latest commit: a11ec46
Status: ✅  Deploy successful!
Preview URL: https://834cc3cc.interwovenkit-staging.pages.dev
Branch Preview URL: https://fix-tiny-balance-subscript-d.interwovenkit-staging.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Feb 18, 2026

Deploying interwovenkit-testnet with  Cloudflare Pages  Cloudflare Pages

Latest commit: a11ec46
Status: ✅  Deploy successful!
Preview URL: https://2f37cd5b.interwovenkit-testnet.pages.dev
Branch Preview URL: https://fix-tiny-balance-subscript-d.interwovenkit-testnet.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Feb 18, 2026

Deploying interwovenkit with  Cloudflare Pages  Cloudflare Pages

Latest commit: a11ec46
Status: ✅  Deploy successful!
Preview URL: https://5b9554fe.interwovenkit.pages.dev
Branch Preview URL: https://fix-tiny-balance-subscript-d.interwovenkit.pages.dev

View logs

Comment thread packages/interwovenkit-react/src/components/FormattedAmount.tsx
Comment thread packages/interwovenkit-react/src/pages/bridge/BridgeFields.tsx Outdated
@cursor

This comment has been minimized.

@tansawit tansawit changed the title fix: render tiny balances with typographic subscript fix: render tiny balances with unicode subscript Feb 18, 2026
Comment thread packages/interwovenkit-react/src/lib/format.ts
@cursor

This comment has been minimized.

@tansawit
Copy link
Copy Markdown
Contributor Author

@cursor push 132bafb

- Removed SubscriptParts and DisplayAmountParts interfaces
- Removed getDisplayAmountParts function
- Inlined logic directly into formatDisplayAmount
- Simplifies code while maintaining same functionality

Applied via @cursor push command
@tansawit tansawit self-assigned this Feb 18, 2026
@tansawit tansawit added the type:enhancement New feature or request label Feb 18, 2026
@tansawit tansawit force-pushed the fix/tiny-balance-subscript-display branch from 5d35e2b to e966ad4 Compare February 18, 2026 08:37
Comment thread packages/interwovenkit-react/src/components/FormattedAmount.tsx
Comment thread packages/interwovenkit-react/src/lib/format.ts
@cursor
Copy link
Copy Markdown

cursor Bot commented Feb 22, 2026

Bugbot Autofix prepared fixes for 2 of the 2 bugs found in the latest run.

  • ✅ Fixed: FormattedAmount renders HTML sub instead of Unicode subscript
    • FormattedAmount now uses toSubscript() to render Unicode subscript characters (₀-₉) instead of HTML tags, matching the PR's intended visual style.
  • ✅ Fixed: Exported formatDisplayAmount is unused in production code
    • Removed the unused formatDisplayAmount function entirely and updated tests to use formatDisplayAmountParts and toSubscript directly.

Create PR

Or push these changes by commenting:

@cursor push 69a73104c0
Preview (69a73104c0)
diff --git a/packages/interwovenkit-react/src/components/FormattedAmount.tsx b/packages/interwovenkit-react/src/components/FormattedAmount.tsx
--- a/packages/interwovenkit-react/src/components/FormattedAmount.tsx
+++ b/packages/interwovenkit-react/src/components/FormattedAmount.tsx
@@ -1,4 +1,4 @@
-import { formatDisplayAmountParts } from "@/lib/format"
+import { formatDisplayAmountParts, toSubscript } from "@/lib/format"
 
 import type { ComponentPropsWithoutRef } from "react"
 
@@ -18,7 +18,7 @@
   return (
     <span {...props}>
       {parts.prefix}
-      <sub>{parts.hiddenZeroCount}</sub>
+      {toSubscript(parts.hiddenZeroCount)}
       {parts.significant}
     </span>
   )

diff --git a/packages/interwovenkit-react/src/lib/format.test.ts b/packages/interwovenkit-react/src/lib/format.test.ts
--- a/packages/interwovenkit-react/src/lib/format.test.ts
+++ b/packages/interwovenkit-react/src/lib/format.test.ts
@@ -1,7 +1,16 @@
 import { describe, expect, it } from "vitest"
-import { formatDisplayAmount, formatValue } from "./format"
+import { formatDisplayAmountParts, formatValue, toSubscript } from "./format"
 
 describe("formatDisplayAmount", () => {
+  function formatDisplayAmount(
+    amount: Parameters<typeof formatDisplayAmountParts>[0],
+    options: Parameters<typeof formatDisplayAmountParts>[1],
+  ) {
+    const parts = formatDisplayAmountParts(amount, options)
+    if (parts.kind === "plain") return parts.value
+    return `${parts.prefix}${toSubscript(parts.hiddenZeroCount)}${parts.significant}`
+  }
+
   it("matches default amount formatting for regular amounts", () => {
     expect(formatDisplayAmount("1234567", { decimals: 6 })).toBe("1.234567")
     expect(formatDisplayAmount("1000000", { decimals: 6 })).toBe("1.000000")

diff --git a/packages/interwovenkit-react/src/lib/format.ts b/packages/interwovenkit-react/src/lib/format.ts
--- a/packages/interwovenkit-react/src/lib/format.ts
+++ b/packages/interwovenkit-react/src/lib/format.ts
@@ -9,7 +9,7 @@
   dp?: number
 }
 
-function toSubscript(value: number) {
+export function toSubscript(value: number) {
   return String(value)
     .split("")
     .map((digit) => SUBSCRIPT_DIGITS[Number(digit)] ?? digit)
@@ -56,16 +56,6 @@
   return { kind: "subscript", prefix, hiddenZeroCount, significant }
 }
 
-export function formatDisplayAmount(
-  amount: Parameters<typeof formatAmountBase>[0],
-  options: FormatAmountOptions,
-) {
-  const parts = formatDisplayAmountParts(amount, options)
-  if (parts.kind === "plain") return parts.value
-
-  return `${parts.prefix}${toSubscript(parts.hiddenZeroCount)}${parts.significant}`
-}
-
 export function formatValue(value?: Parameters<typeof formatNumber>[0]) {
   const absValue = value ? BigNumber(value).abs() : undefined
   if (absValue && absValue.gt(0) && absValue.lt(0.01)) return "< $0.01"

@tansawit
Copy link
Copy Markdown
Contributor Author

@cursor push 69a7310

cursoragent and others added 2 commits February 22, 2026 14:02
- Use Unicode subscript characters instead of HTML <sub> tags in FormattedAmount component
- Export toSubscript function for production use
- Remove unused formatDisplayAmount function and update tests to use formatDisplayAmountParts + toSubscript

Applied via @cursor push command
…cript-display

# Conflicts:
#	packages/interwovenkit-react/src/pages/deposit/TransferFields.tsx
Copy link
Copy Markdown

@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: 7

🧹 Nitpick comments (2)
packages/interwovenkit-react/src/public/app/Drawer.module.css (1)

75-85: Fix empty line formatting to pass Stylelint.

Static analysis flagged empty lines before declarations at lines 78, 81, and 83. Remove these to conform to the project's CSS linting rules.

♻️ Proposed fix
 .routes {
   flex: 1;
-
   display: flex;
   flex-direction: column;
-
   height: 100%;
-
   min-height: 0;
   overflow: hidden;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/interwovenkit-react/src/public/app/Drawer.module.css` around lines
75 - 85, The .routes CSS rule contains stray blank lines before several
declarations which violates Stylelint; open the .routes block in
Drawer.module.css and remove the empty lines so each declaration (flex, display,
flex-direction, height, min-height, overflow) immediately follows the previous
line with no blank lines between them, preserving the same property order and
values.
packages/interwovenkit-react/src/lib/format.test.ts (1)

19-38: Add one negative tiny-amount regression.

packages/interwovenkit-react/src/lib/format.ts, Lines 55-56 has dedicated sign handling, but this suite never exercises the subscript path for negative values. One assertion here would lock that branch down.

💡 Suggested test addition
   it("shows subscript notation for tiny non-zero amounts hidden by 6dp", () => {
     expect(formatDisplayAmount("1", { decimals: 8 })).toBe("0.0₆1")
     expect(formatDisplayAmount("3159", { decimals: 10 })).toBe("0.0₅3159")
+    expect(formatDisplayAmount("-3159", { decimals: 10 })).toBe("-0.0₅3159")
   })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/interwovenkit-react/src/lib/format.test.ts` around lines 19 - 38,
The test suite for formatDisplayAmount does not cover negative tiny amounts so
the sign-handling branch in format.ts (the sign stripping/handling logic around
formatDisplayAmount) is untested; add one assertion that passes a negative tiny
amount string (e.g. formatDisplayAmount("-1", { decimals: 8 })) and expect the
subscripted output to preserve the negative sign (e.g. "-0.0₆1"), thereby
exercising the negative sign path and ensuring subscript logic and trailing-zero
trimming behave the same for negatives.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/interwovenkit-react/src/components/FormattedAmount.tsx`:
- Around line 18-23: The rendered span in FormattedAmount currently replaces
numeric characters with decorative Unicode glyphs
(toSubscript(parts.hiddenZeroCount)), breaking screen-reader access; restore a
plain-text accessible numeric value by including the original numeric string
(e.g., concatenation of parts.prefix, hidden zeros, and parts.significant) as a
visible-to-assistive-tech element and keep the visual subscript run decorative —
mark the decorative glyph span produced by toSubscript(...) with
aria-hidden="true" (or role="presentation") and add a
screen-reader-only/plain-text span for the full numeric value so assistive tech
reads the real number while sighted users see the styled glyphs.

In `@packages/interwovenkit-react/src/components/FormattedFeeList.tsx`:
- Around line 9-13: Keep the zero fallback for missing fee amounts: in the JSX
returned by fees.map inside the FormattedFeeList component, ensure you pass a
default "0" for fee.amount (i.e., use fee.amount ?? "0") to the FormattedAmount
component so the shared fee list never renders an empty amount before the
symbol; update the JSX where FormattedAmount is used and keep the existing
decimals fallback (fee.origin_asset.decimals ?? 0).

In `@packages/interwovenkit-react/src/components/Scrollable.module.css`:
- Around line 2-9: Remove the extra blank lines inside the CSS declaration block
in Scrollable.module.css so there are no empty lines between declarations (flex,
min-height, overflow, -webkit-overflow-scrolling, overflow-y,
overscroll-behavior). Edit the block that contains those properties so each
declaration appears on its own line with no blank lines between them, which will
satisfy stylelint's declaration-empty-line-before rule; preserve the existing
property order and values.

In `@packages/interwovenkit-react/src/pages/autosign/EnableAutoSign.module.css`:
- Around line 1-11: The .page CSS block contains extra blank lines between
declarations that trigger stylelint's declaration-empty-line-before rule; edit
the .page rule (class selector ".page") to remove the unnecessary empty lines so
declarations are adjacent (or otherwise conform to your project's
declaration-empty-line-before configuration), ensuring no blank lines precede
property declarations inside the .page block.

In `@packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx`:
- Around line 115-117: getDp currently forces an 8-decimal display for amounts
that formatAmountBase(...) === "0.000000", which prevents the fee footer from
using the new tiny-amount compact/subscript rendering; change getDp so it does
not return 8 in that case (leave dp undefined) — i.e., remove the conditional
that returns 8 (or always return undefined) so the fee footer will opt into the
tiny-balance rendering path that formatAmountBase supports.

In `@packages/interwovenkit-react/src/pages/tx/TxRequest.module.css`:
- Around line 1-11: The .page CSS rule in TxRequest.module.css has extra blank
lines between declarations triggering stylelint's declaration-empty-line-before;
remove the blank lines so declarations are consecutively listed (e.g., collapse
the spacing between "flex: 1;", "display: flex;", "flex-direction: column;",
"height: 100%;", "min-height: 0;", and "overflow: hidden;") to satisfy the
linter while keeping the same properties and order.

In `@packages/interwovenkit-react/src/public/app/Drawer.tsx`:
- Around line 109-111: The .routes container in Drawer.tsx (where AsyncBoundary
renders {children}) likely applies overflow constraints that will clip many
routed pages; update the routed components (BridgeForm, BridgeHistory,
BridgePreview, Connect, Deposit, ManageAutoSign, NftDetails, Receive, Send,
SendNft, Settings, TransferCompleted, Withdraw, Withdrawals) so their top-level
render is wrapped in a Scrollable component or a div with
className={styles.page}, or alternatively change the styles.routes rules to not
constrain overflow/height so children can manage scrolling; locate the top-level
return in each component (or the AsyncBoundary render in Drawer.tsx) and apply
one of those two fixes consistently.

---

Nitpick comments:
In `@packages/interwovenkit-react/src/lib/format.test.ts`:
- Around line 19-38: The test suite for formatDisplayAmount does not cover
negative tiny amounts so the sign-handling branch in format.ts (the sign
stripping/handling logic around formatDisplayAmount) is untested; add one
assertion that passes a negative tiny amount string (e.g.
formatDisplayAmount("-1", { decimals: 8 })) and expect the subscripted output to
preserve the negative sign (e.g. "-0.0₆1"), thereby exercising the negative sign
path and ensuring subscript logic and trailing-zero trimming behave the same for
negatives.

In `@packages/interwovenkit-react/src/public/app/Drawer.module.css`:
- Around line 75-85: The .routes CSS rule contains stray blank lines before
several declarations which violates Stylelint; open the .routes block in
Drawer.module.css and remove the empty lines so each declaration (flex, display,
flex-direction, height, min-height, overflow) immediately follows the previous
line with no blank lines between them, preserving the same property order and
values.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 357dd31b-dbe3-403a-8418-ab18d0561cad

📥 Commits

Reviewing files that changed from the base of the PR and between 7a8ec2d and e2f5ebc.

📒 Files selected for processing (32)
  • packages/interwovenkit-react/src/components/Dropdown.tsx
  • packages/interwovenkit-react/src/components/FormattedAmount.tsx
  • packages/interwovenkit-react/src/components/FormattedFeeList.tsx
  • packages/interwovenkit-react/src/components/Scrollable.module.css
  • packages/interwovenkit-react/src/components/form/AssetOptions.tsx
  • packages/interwovenkit-react/src/components/form/QuantityInput.tsx
  • packages/interwovenkit-react/src/lib/format.test.ts
  • packages/interwovenkit-react/src/lib/format.ts
  • packages/interwovenkit-react/src/pages/autosign/EnableAutoSign.module.css
  • packages/interwovenkit-react/src/pages/autosign/EnableAutoSign.tsx
  • packages/interwovenkit-react/src/pages/bridge/BridgeFields.tsx
  • packages/interwovenkit-react/src/pages/bridge/BridgeHistoryItem.tsx
  • packages/interwovenkit-react/src/pages/bridge/OperationItem.tsx
  • packages/interwovenkit-react/src/pages/bridge/SelectRouteOption.tsx
  • packages/interwovenkit-react/src/pages/bridge/data/format.test.ts
  • packages/interwovenkit-react/src/pages/bridge/data/format.ts
  • packages/interwovenkit-react/src/pages/bridge/op/ClaimableList.tsx
  • packages/interwovenkit-react/src/pages/bridge/op/WithdrawalAsset.tsx
  • packages/interwovenkit-react/src/pages/deposit/SelectExternalAsset.tsx
  • packages/interwovenkit-react/src/pages/deposit/TransferFields.tsx
  • packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
  • packages/interwovenkit-react/src/pages/deposit/TransferTxDetails.tsx
  • packages/interwovenkit-react/src/pages/tx/TxFee.tsx
  • packages/interwovenkit-react/src/pages/tx/TxFeeInsufficient.tsx
  • packages/interwovenkit-react/src/pages/tx/TxRequest.module.css
  • packages/interwovenkit-react/src/pages/tx/TxRequest.tsx
  • packages/interwovenkit-react/src/pages/tx/TxSimulate.tsx
  • packages/interwovenkit-react/src/pages/wallet/tabs/activity/ActivityChanges.tsx
  • packages/interwovenkit-react/src/pages/wallet/tabs/portfolio/AssetBalance.tsx
  • packages/interwovenkit-react/src/pages/wallet/txs/send/SendFields.tsx
  • packages/interwovenkit-react/src/public/app/Drawer.module.css
  • packages/interwovenkit-react/src/public/app/Drawer.tsx
💤 Files with no reviewable changes (1)
  • packages/interwovenkit-react/src/pages/bridge/data/format.ts

Comment thread packages/interwovenkit-react/src/components/FormattedAmount.tsx
Comment thread packages/interwovenkit-react/src/components/FormattedFeeList.tsx
Comment thread packages/interwovenkit-react/src/components/Scrollable.module.css
Comment thread packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx Outdated
Comment thread packages/interwovenkit-react/src/pages/tx/TxRequest.module.css
Comment thread packages/interwovenkit-react/src/public/app/Drawer.tsx Outdated
Copy link
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/interwovenkit-react/src/components/Dropdown.tsx`:
- Around line 11-12: The Dropdown component uses the prop triggerLabel (typed as
ReactNode) and currently falls back using the logical OR operator; update the
fallback to use the nullish coalescing operator so valid falsy ReactNodes (like
0 or "") are not treated as absent—replace the usage of "triggerLabel || <...>"
with "triggerLabel ?? <...>" where the Dropdown renders or computes the trigger
label (search for triggerLabel in the Dropdown component to locate the
expression).
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4ddeedef-046e-4231-bddc-51f1bb2e18f0

📥 Commits

Reviewing files that changed from the base of the PR and between e2f5ebc and 294481e.

📒 Files selected for processing (16)
  • packages/interwovenkit-react/src/components/Dropdown.tsx
  • packages/interwovenkit-react/src/components/form/QuantityInput.tsx
  • packages/interwovenkit-react/src/lib/format.test.ts
  • packages/interwovenkit-react/src/lib/format.ts
  • packages/interwovenkit-react/src/pages/autosign/EnableAutoSign.tsx
  • packages/interwovenkit-react/src/pages/bridge/BridgeFields.tsx
  • packages/interwovenkit-react/src/pages/bridge/BridgeHistoryItem.tsx
  • packages/interwovenkit-react/src/pages/bridge/SelectRouteOption.tsx
  • packages/interwovenkit-react/src/pages/bridge/data/format.ts
  • packages/interwovenkit-react/src/pages/deposit/SelectExternalAsset.tsx
  • packages/interwovenkit-react/src/pages/deposit/TransferFields.tsx
  • packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
  • packages/interwovenkit-react/src/pages/deposit/TransferTxDetails.tsx
  • packages/interwovenkit-react/src/pages/tx/TxRequest.tsx
  • packages/interwovenkit-react/src/pages/wallet/txs/send/SendFields.tsx
  • packages/interwovenkit-react/src/public/app/Drawer.tsx
💤 Files with no reviewable changes (1)
  • packages/interwovenkit-react/src/pages/bridge/data/format.ts
✅ Files skipped from review due to trivial changes (6)
  • packages/interwovenkit-react/src/public/app/Drawer.tsx
  • packages/interwovenkit-react/src/pages/tx/TxRequest.tsx
  • packages/interwovenkit-react/src/pages/deposit/SelectExternalAsset.tsx
  • packages/interwovenkit-react/src/pages/wallet/txs/send/SendFields.tsx
  • packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
  • packages/interwovenkit-react/src/pages/autosign/EnableAutoSign.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/interwovenkit-react/src/pages/bridge/SelectRouteOption.tsx
  • packages/interwovenkit-react/src/pages/bridge/BridgeHistoryItem.tsx
  • packages/interwovenkit-react/src/pages/bridge/BridgeFields.tsx
  • packages/interwovenkit-react/src/lib/format.test.ts
  • packages/interwovenkit-react/src/pages/deposit/TransferTxDetails.tsx
  • packages/interwovenkit-react/src/lib/format.ts

Comment thread packages/interwovenkit-react/src/components/Dropdown.tsx
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Dead formatFees function and tests not removed
    • Removed the unused formatFees export and its obsolete tests, along with now-unused imports.

Create PR

Or push these changes by commenting:

@cursor push 1d13597572
Preview (1d13597572)
diff --git a/packages/interwovenkit-react/src/pages/bridge/data/format.test.ts b/packages/interwovenkit-react/src/pages/bridge/data/format.test.ts
--- a/packages/interwovenkit-react/src/pages/bridge/data/format.test.ts
+++ b/packages/interwovenkit-react/src/pages/bridge/data/format.test.ts
@@ -1,4 +1,4 @@
-import { calculateMinimumReceived, formatDuration, formatFees } from "./format"
+import { calculateMinimumReceived, formatDuration } from "./format"
 
 describe("calculateMinimumReceived", () => {
   it("applies slippage to amount", () => {
@@ -61,26 +61,3 @@
     expect(formatDuration(3600)).toBe("1h")
   })
 })
-
-describe("formatFees", () => {
-  it("formats a single fee entry", () => {
-    const fees = [{ amount: "1234567", origin_asset: { decimals: 6, symbol: "INIT" } }]
-    // @ts-expect-error unused values are not defined
-    expect(formatFees(fees)).toBe("1.234567 INIT")
-  })
-
-  it("formats multiple fee entries", () => {
-    const fees = [
-      { amount: "1000000", origin_asset: { decimals: 6, symbol: "INIT" } },
-      { amount: "500", origin_asset: { decimals: 0, symbol: "USDC" } },
-    ]
-    // @ts-expect-error unused values are not defined
-    expect(formatFees(fees)).toBe("1.000000 INIT, 500 USDC")
-  })
-
-  it("limits decimal places to 6", () => {
-    const fees = [{ amount: "123456789", origin_asset: { decimals: 8, symbol: "ETH" } }]
-    // @ts-expect-error unused values are not defined
-    expect(formatFees(fees)).toBe("1.234567 ETH")
-  })
-})

diff --git a/packages/interwovenkit-react/src/pages/bridge/data/format.ts b/packages/interwovenkit-react/src/pages/bridge/data/format.ts
--- a/packages/interwovenkit-react/src/pages/bridge/data/format.ts
+++ b/packages/interwovenkit-react/src/pages/bridge/data/format.ts
@@ -1,6 +1,4 @@
-import type { FeeJson } from "@skip-go/client"
 import BigNumber from "bignumber.js"
-import { formatAmount } from "@initia/utils"
 const TIME_UNIT_DEFINITIONS = [
   ["d", 24 * 60 * 60], // day
   ["h", 60 * 60], // hour
@@ -33,12 +31,3 @@
     .integerValue(BigNumber.ROUND_FLOOR)
     .toFixed(0)
 }
-
-export function formatFees(fees?: FeeJson[]) {
-  return fees
-    ?.map((fee) => {
-      const { amount, origin_asset } = fee
-      return `${formatAmount(amount, { decimals: origin_asset.decimals ?? 0 })} ${origin_asset.symbol}`
-    })
-    .join(", ")
-}

You can send follow-ups to this agent here.

Comment thread packages/interwovenkit-react/src/pages/bridge/data/format.ts
Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
packages/interwovenkit-react/src/pages/bridge/data/format.test.ts (1)

50-55: Test label/comments are inconsistent with the constructed duration.

Line 50 mentions “weeks,” but the case asserts 1d 2h 3m 4s; and Lines 52-55 comments (“2 days”, “3 hours”, etc.) don’t match the multipliers. Please align wording/comments to prevent confusion.

🧹 Suggested cleanup
-  it("formats combined weeks, days, hours, minutes, seconds", () => {
+  it("formats combined days, hours, minutes, seconds", () => {
     const combinedSeconds =
-      1 * 24 * 3600 + // 2 days
-      2 * 3600 + // 3 hours
-      3 * 60 + // 4 minutes
-      4 // 5 seconds
+      1 * 24 * 3600 + // 1 day
+      2 * 3600 + // 2 hours
+      3 * 60 + // 3 minutes
+      4 // 4 seconds
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/interwovenkit-react/src/pages/bridge/data/format.test.ts` around
lines 50 - 55, The test label in the it("formats combined weeks, days, hours,
minutes, seconds", ...) does not match the constructed duration or inline
comments; update the test name and comments to reflect the actual values (e.g.,
if you intend 1 day, 2 hours, 3 minutes, 4 seconds change the title to "formats
combined days, hours, minutes, seconds" and fix the comment multipliers to
1*24*3600 // 1 day, 2*3600 // 2 hours, 3*60 // 3 minutes, 4 // 4 seconds) or
alternatively adjust the numeric multipliers and comment text to include weeks
if that was intended (modify the combinedSeconds expression accordingly). Ensure
the test description, inline comments, and the combinedSeconds expression are
consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/interwovenkit-react/src/pages/bridge/data/format.test.ts`:
- Around line 50-55: The test label in the it("formats combined weeks, days,
hours, minutes, seconds", ...) does not match the constructed duration or inline
comments; update the test name and comments to reflect the actual values (e.g.,
if you intend 1 day, 2 hours, 3 minutes, 4 seconds change the title to "formats
combined days, hours, minutes, seconds" and fix the comment multipliers to
1*24*3600 // 1 day, 2*3600 // 2 hours, 3*60 // 3 minutes, 4 // 4 seconds) or
alternatively adjust the numeric multipliers and comment text to include weeks
if that was intended (modify the combinedSeconds expression accordingly). Ensure
the test description, inline comments, and the combinedSeconds expression are
consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 340f878e-8c55-4aaf-9662-992b7c88eacc

📥 Commits

Reviewing files that changed from the base of the PR and between 294481e and 2621869.

📒 Files selected for processing (7)
  • packages/interwovenkit-react/src/components/Dropdown.tsx
  • packages/interwovenkit-react/src/components/FormattedAmount.tsx
  • packages/interwovenkit-react/src/components/FormattedFeeList.tsx
  • packages/interwovenkit-react/src/lib/format.test.ts
  • packages/interwovenkit-react/src/pages/bridge/data/format.test.ts
  • packages/interwovenkit-react/src/pages/bridge/data/format.ts
  • packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
💤 Files with no reviewable changes (1)
  • packages/interwovenkit-react/src/pages/bridge/data/format.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/interwovenkit-react/src/components/FormattedFeeList.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/interwovenkit-react/src/components/FormattedAmount.tsx
  • packages/interwovenkit-react/src/lib/format.test.ts

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Leftover getDp suppresses subscript notation in TxFee
    • Removed the leftover getDp override and unused formatAmountBase import so TxFee now lets FormattedAmount apply subscript notation consistently.

Create PR

Or push these changes by commenting:

@cursor push 92a9026b8a
Preview (92a9026b8a)
diff --git a/packages/interwovenkit-react/src/pages/tx/TxFee.tsx b/packages/interwovenkit-react/src/pages/tx/TxFee.tsx
--- a/packages/interwovenkit-react/src/pages/tx/TxFee.tsx
+++ b/packages/interwovenkit-react/src/pages/tx/TxFee.tsx
@@ -1,6 +1,5 @@
 import type { StdFee } from "@cosmjs/amino"
 import BigNumber from "bignumber.js"
-import { formatAmount as formatAmountBase } from "@initia/utils"
 import Dropdown, { type DropdownOption } from "@/components/Dropdown"
 import FormattedAmount from "@/components/FormattedAmount"
 import { useFindAsset } from "@/data/assets"
@@ -21,18 +20,12 @@
   const chain = useChain(txRequest.chainId)
   const findAsset = useFindAsset(chain)
 
-  const getDp = (amount: string, decimals: number) => {
-    if (formatAmountBase(amount, { decimals }) === "0.000000") return 8
-    return undefined
-  }
-
   const getLabel = ({ amount: [{ amount, denom }] }: StdFee): ReactNode => {
     if (BigNumber(amount).isZero()) return "0"
     const { symbol, decimals } = findAsset(denom)
-    const dp = getDp(amount, decimals)
     return (
       <>
-        <FormattedAmount amount={amount} decimals={decimals} dp={dp} /> {symbol}
+        <FormattedAmount amount={amount} decimals={decimals} /> {symbol}
       </>
     )
   }
@@ -57,11 +50,10 @@
 
   const [{ amount, denom }] = selected.amount
   const { decimals } = findAsset(denom)
-  const dp = getDp(amount, decimals)
 
   return (
     <div className={styles.root}>
-      <FormattedAmount amount={amount} decimals={decimals} dp={dp} className="monospace" />
+      <FormattedAmount amount={amount} decimals={decimals} className="monospace" />
       <Dropdown options={dropdownOptions} value={value} onChange={onChange} classNames={styles} />
     </div>
   )

You can send follow-ups to this agent here.

Comment thread packages/interwovenkit-react/src/pages/tx/TxFee.tsx
Copy link
Copy Markdown

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

♻️ Duplicate comments (1)
packages/interwovenkit-react/src/components/Scrollable.module.css (1)

2-8: ⚠️ Potential issue | 🟡 Minor

Remove the empty line before min-height to satisfy stylelint.

Line 3 introduces an empty line before Line 4, which violates declaration-empty-line-before.

Proposed cleanup
 .scrollable {
   flex: 1;
-
   min-height: 0;
   overflow: hidden;
   -webkit-overflow-scrolling: touch;
   overflow-y: auto;
   overscroll-behavior: contain;
   padding: var(--padding);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/interwovenkit-react/src/components/Scrollable.module.css` around
lines 2 - 8, Remove the stray blank line between the `flex: 1;` and `min-height:
0;` declarations in Scrollable.module.css to satisfy stylelint's
declaration-empty-line-before rule; open the ruleset containing `flex: 1;`,
delete the empty line so `min-height: 0;` immediately follows `flex: 1;`, then
run stylelint to confirm the warning is resolved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/interwovenkit-react/src/components/Scrollable.module.css`:
- Around line 2-8: Remove the stray blank line between the `flex: 1;` and
`min-height: 0;` declarations in Scrollable.module.css to satisfy stylelint's
declaration-empty-line-before rule; open the ruleset containing `flex: 1;`,
delete the empty line so `min-height: 0;` immediately follows `flex: 1;`, then
run stylelint to confirm the warning is resolved.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6f267907-15f5-487c-a3a3-b9d3eab4e46d

📥 Commits

Reviewing files that changed from the base of the PR and between 18f517a and a2cfbe9.

📒 Files selected for processing (1)
  • packages/interwovenkit-react/src/components/Scrollable.module.css

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: ReactNode labels break Select keyboard text navigation
    • Added explicit string typeahead labels for fee dropdown items so Base UI no longer derives garbled navigation text from ReactNode content.

Create PR

Or push these changes by commenting:

@cursor push 9d38895e19
Preview (9d38895e19)
diff --git a/packages/interwovenkit-react/src/components/Dropdown.tsx b/packages/interwovenkit-react/src/components/Dropdown.tsx
--- a/packages/interwovenkit-react/src/components/Dropdown.tsx
+++ b/packages/interwovenkit-react/src/components/Dropdown.tsx
@@ -10,6 +10,7 @@
   value: T
   label: ReactNode
   triggerLabel?: ReactNode
+  typeaheadLabel?: string
 }
 
 interface DropdownProps<T = string> {
@@ -23,6 +24,12 @@
   }
 }
 
+function getTypeaheadLabel<T>(option: DropdownOption<T>): string | undefined {
+  if (option.typeaheadLabel) return option.typeaheadLabel
+  if (typeof option.label === "string" || typeof option.label === "number")
+    return String(option.label)
+}
+
 function Dropdown<T extends string | number = string>({
   options,
   value,
@@ -62,6 +69,7 @@
                 className={clsx(styles.item, classNames?.item)}
                 value={String(option.value)}
                 key={String(option.value)}
+                label={getTypeaheadLabel(option)}
               >
                 <Select.ItemText className={clsx(styles.itemText, classNames?.itemText)}>
                   {option.label}

diff --git a/packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx b/packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
--- a/packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
+++ b/packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
@@ -3,6 +3,7 @@
 import type { TxJson } from "@skip-go/client"
 import BigNumber from "bignumber.js"
 import { useState } from "react"
+import { formatAmount } from "@initia/utils"
 import Dropdown, { type DropdownOption } from "@/components/Dropdown"
 import FormattedAmount from "@/components/FormattedAmount"
 import { useBalances } from "@/data/account"
@@ -202,12 +203,13 @@
     if (!selectedFee || !feeDenom) return null
 
     const dropdownOptions: DropdownOption<string>[] = feeOptions.map((option) => {
-      const [{ denom }] = option.amount
-      const { symbol } = findAsset(denom)
+      const [{ amount, denom }] = option.amount
+      const { symbol, decimals } = findAsset(denom)
 
       return {
         value: denom,
         label: getFeeLabel(option),
+        typeaheadLabel: `${formatAmount(amount, { decimals })} ${symbol}`,
         triggerLabel: symbol,
       }
     })

diff --git a/packages/interwovenkit-react/src/pages/tx/TxFee.tsx b/packages/interwovenkit-react/src/pages/tx/TxFee.tsx
--- a/packages/interwovenkit-react/src/pages/tx/TxFee.tsx
+++ b/packages/interwovenkit-react/src/pages/tx/TxFee.tsx
@@ -1,4 +1,5 @@
 import type { StdFee } from "@cosmjs/amino"
+import { formatAmount } from "@initia/utils"
 import Dropdown, { type DropdownOption } from "@/components/Dropdown"
 import FormattedAmount from "@/components/FormattedAmount"
 import { useFindAsset } from "@/data/assets"
@@ -29,12 +30,13 @@
   }
 
   const dropdownOptions: DropdownOption<string>[] = options.map((option) => {
-    const [{ denom }] = option.amount
-    const { symbol } = findAsset(denom)
+    const [{ amount, denom }] = option.amount
+    const { symbol, decimals } = findAsset(denom)
 
     return {
       value: denom,
       label: getLabel(option),
+      typeaheadLabel: `${formatAmount(amount, { decimals })} ${symbol}`,
       triggerLabel: symbol,
     }
   })

You can send follow-ups to this agent here.

Comment thread packages/interwovenkit-react/src/pages/tx/TxFee.tsx
Comment thread packages/interwovenkit-react/src/pages/tx/TxFee.tsx Outdated
@tansawit
Copy link
Copy Markdown
Contributor Author

tansawit commented Apr 3, 2026

Addressed the unresolved review items in commit 80d780e:

  1. TxFee keyboard navigation label: Added explicit plain-text searchLabel support on Dropdown options and wired it in both TxFee and TransferFooter, while preserving visual FormattedAmount rendering in item labels.
  2. CSS spacing threads (EnableAutoSign.module.css, TxRequest.module.css): rechecked against current HEAD and reran stylelint directly on both files; no declaration-empty-line-before violations are reproduced now.

Local verification run on this branch:

  • pnpm --filter interwovenkit-react lint
  • pnpm --filter interwovenkit-react typecheck
  • pnpm --filter interwovenkit-react test

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Redundant inline reimplementation of formatDisplayAmountPlainText
    • Replaced the duplicated inline formatting logic in TransferFooter.tsx with the shared formatDisplayAmountPlainText helper.

Create PR

Or push these changes by commenting:

@cursor push ac05c21922
Preview (ac05c21922)
diff --git a/packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx b/packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
--- a/packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
+++ b/packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
@@ -9,7 +9,7 @@
 import { useFindAsset } from "@/data/assets"
 import { useChain } from "@/data/chains"
 import { useGasPrices, useLastFeeDenom } from "@/data/fee"
-import { formatDisplayAmountParts } from "@/lib/format"
+import { formatDisplayAmountParts, formatDisplayAmountPlainText } from "@/lib/format"
 import { DEFAULT_GAS_ADJUSTMENT } from "@/public/data/constants"
 import BridgePreviewFooter from "../bridge/BridgePreviewFooter"
 import { useAllSkipAssets } from "../bridge/data/assets"
@@ -195,10 +195,7 @@
     const [{ amount, denom }] = fee.amount
     const { symbol, decimals } = findAsset(denom)
     const parts = formatDisplayAmountParts(amount, { decimals })
-    const amountText =
-      parts.kind === "plain"
-        ? parts.value
-        : `${parts.prefix}${"0".repeat(parts.hiddenZeroCount)}${parts.significant}`
+    const amountText = formatDisplayAmountPlainText(parts)
     return `${amountText} ${symbol}`
   }

You can send follow-ups to this agent here.

Comment thread packages/interwovenkit-react/src/pages/deposit/TransferFooter.tsx
@tansawit
Copy link
Copy Markdown
Contributor Author

tansawit commented Apr 3, 2026

Addressed follow-up review items in this branch:\n\n- Replaced inline fee search-label formatting in with the shared helper path.\n- Kept the existing shared format helper API consistent with tests and callers.\n- Normalized declaration spacing in and per stylelint suggestion.\n\nValidation run:\n- on touched files ✅\n- on touched TS/TSX ✅\n-

@initia/interwovenkit-react@2.5.1 test /private/tmp/interwovenkit-pr168-review/packages/interwovenkit-react
vitest run -- src/lib/format.test.ts

�[1m�[46m RUN �[49m�[22m �[36mv4.0.9 �[39m�[90m/private/tmp/interwovenkit-pr168-review/packages/interwovenkit-react�[39m

�[32m✓�[39m src/data/clamm/calculateTokens.test.ts �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[32m 4�[2mms�[22m�[39m
�[32m✓�[39m src/data/minity/utilities.test.ts �[2m(�[22m�[2m78 tests�[22m�[2m)�[22m�[32m 54�[2mms�[22m�[39m
�[32m✓�[39m src/data/initia-staking.test.ts �[2m(�[22m�[2m12 tests�[22m�[2m)�[22m�[32m 50�[2mms�[22m�[39m
�[32m✓�[39m src/pages/deposit/state.test.ts �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[32m 13�[2mms�[22m�[39m
�[32m✓�[39m src/lib/format.test.ts �[2m(�[22m�[2m21 tests�[22m�[2m)�[22m�[32m 19�[2mms�[22m�[39m
�[32m✓�[39m src/pages/autosign/data/derivation.test.ts �[2m(�[22m�[2m9 tests�[22m�[2m)�[22m�[32m 243�[2mms�[22m�[39m
�[32m✓�[39m src/pages/bridge/data/locationState.test.ts �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 10�[2mms�[22m�[39m
�[32m✓�[39m src/pages/wallet/txs/send/max.test.ts �[2m(�[22m�[2m27 tests�[22m�[2m)�[22m�[32m 7�[2mms�[22m�[39m
�[32m✓�[39m src/data/clamm/sqrtPriceMath.test.ts �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 4�[2mms�[22m�[39m
�[32m✓�[39m src/pages/autosign/data/website.test.ts �[2m(�[22m�[2m17 tests�[22m�[2m)�[22m�[32m 8�[2mms�[22m�[39m
�[32m✓�[39m src/components/explorer.test.ts �[2m(�[22m�[2m18 tests�[22m�[2m)�[22m�[32m 9�[2mms�[22m�[39m
�[32m✓�[39m src/data/errors.test.ts �[2m(�[22m�[2m15 tests�[22m�[2m)�[22m�[32m 8�[2mms�[22m�[39m
�[32m✓�[39m src/pages/bridge/footerWithErc20ApprovalState.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m
�[32m✓�[39m src/pages/wallet/tabs/activity/changes/changes.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 9�[2mms�[22m�[39m
�[32m✓�[39m src/pages/bridge/data/format.test.ts �[2m(�[22m�[2m12 tests�[22m�[2m)�[22m�[32m 7�[2mms�[22m�[39m
�[32m✓�[39m src/pages/bridge/bridgePreviewFooterState.test.ts �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 4�[2mms�[22m�[39m
�[32m✓�[39m src/data/patches/amino.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 7�[2mms�[22m�[39m
�[32m✓�[39m src/pages/autosign/data/validation.test.ts �[2m(�[22m�[2m40 tests�[22m�[2m)�[22m�[32m 61�[2mms�[22m�[39m
�[32m✓�[39m src/pages/autosign/data/wallet.test.ts �[2m(�[22m�[2m23 tests�[22m�[2m)�[22m�[32m 239�[2mms�[22m�[39m
�[32m✓�[39m src/data/initia-liquidity.test.ts �[2m(�[22m�[2m25 tests�[22m�[2m)�[22m�[32m 32�[2mms�[22m�[39m
�[32m✓�[39m src/data/portfolio.test.ts �[2m(�[22m�[2m12 tests�[22m�[2m)�[22m�[32m 39�[2mms�[22m�[39m
�[32m✓�[39m src/pages/bridge/data/bridgeTxUtils.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 6�[2mms�[22m�[39m
�[32m✓�[39m src/lib/promise.test.ts �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[32m 14�[2mms�[22m�[39m
�[32m✓�[39m src/data/query-client.test.ts �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[32m 5�[2mms�[22m�[39m
�[32m✓�[39m src/pages/deposit/emptyDepositCopy.test.ts �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[32m 4�[2mms�[22m�[39m
�[32m✓�[39m src/data/tx.autosign-signing.test.ts �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[32m 13�[2mms�[22m�[39m
�[32m✓�[39m src/data/tx.confirmation.test.ts �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[32m 21�[2mms�[22m�[39m
�[32m✓�[39m src/data/tx.autosign-fee.test.ts �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[32m 17�[2mms�[22m�[39m
�[32m✓�[39m src/pages/connect/normalizeWalletName.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m
�[32m✓�[39m src/pages/deposit/transferBalanceGate.test.ts �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m
�[32m✓�[39m src/data/clamm/tickMath.test.ts �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m
�[32m✓�[39m src/pages/wallet/tabs/nft/queries.test.ts �[2m(�[22m�[2m7 tests�[22m�[2m)�[22m�[32m 8�[2mms�[22m�[39m
�[32m✓�[39m src/pages/bridge/FooterWithMsgs.test.ts �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m
�[32m✓�[39m src/data/clamm/calculateAsset.test.ts �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m
�[32m✓�[39m src/data/clamm/const.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m
�[32m✓�[39m src/data/clamm/util.test.ts �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 84�[2mms�[22m�[39m
�[32m✓�[39m src/pages/deposit/TransferFields.test.ts �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m
�[32m✓�[39m src/pages/bridge/confirmLabel.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 4�[2mms�[22m�[39m
�[32m✓�[39m src/data/signer.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 7�[2mms�[22m�[39m
�[32m✓�[39m src/pages/autosign/data/actions.test.ts �[2m(�[22m�[2m14 tests�[22m�[2m)�[22m�[32m 5�[2mms�[22m�[39m
�[32m✓�[39m src/pages/wallet/tabs/activity/queries.test.ts �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[32m 6�[2mms�[22m�[39m
�[32m✓�[39m src/pages/autosign/data/queries.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m
�[32m✓�[39m src/pages/autosign/data/fetch.test.ts �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[32m 4�[2mms�[22m�[39m
�[32m✓�[39m src/pages/deposit/hooks.test.ts �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m

�[2m Test Files �[22m �[1m�[32m44 passed�[39m�[22m�[90m (44)�[39m
�[2m Tests �[22m �[1m�[32m429 passed�[39m�[22m�[90m (429)�[39m
�[2m Start at �[22m 05:26:00
�[2m Duration �[22m 21.27s�[2m (transform 3.08s, setup 0ms, collect 161.54s, tests 1.05s, environment 10ms, prepare 731ms)�[22m currently also runs broader suites in this repo; passed, but there is an unrelated flaky timeout in ( alphabetical sort case).

@tansawit
Copy link
Copy Markdown
Contributor Author

tansawit commented Apr 4, 2026

Addressed the unresolved low-severity review thread in TransferFooter.tsx by reusing the shared formatDisplayAmountPlainText helper (commit 4a7c165) instead of duplicating the formatting logic in getFeeSearchLabel.

Current unresolved threads are now only the two earlier CodeRabbit CSS spacing suggestions in EnableAutoSign.module.css and TxRequest.module.css (stale/non-blocking bot suggestions).

CI snapshot is green on this head commit.

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

Labels

priority:low type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants