Skip to content

Feat/vai error show#5605

Open
cuzz-venus wants to merge 3 commits into
mainfrom
feat/vai-error-show
Open

Feat/vai error show#5605
cuzz-venus wants to merge 3 commits into
mainfrom
feat/vai-error-show

Conversation

@cuzz-venus
Copy link
Copy Markdown
Contributor

@cuzz-venus cuzz-venus commented May 27, 2026

Jira ticket(s)

VPD-1256

Changes

  • remove description

before:
image

after:
image

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

🦋 Changeset detected

Latest commit: c85bf96

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@venusprotocol/evm Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

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

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview May 27, 2026 1:28pm
dapp-testnet Ready Ready Preview May 27, 2026 1:28pm
venus.io Ready Ready Preview May 27, 2026 1:28pm

Request Review

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 27, 2026

Greptile Summary

This PR removes the duplicate inline error message shown below the VAI Borrow and Repay amount inputs by adding an opt-in hideErrorDescription prop to RhfTokenTextField. The previous behaviour rendered a raw translation key as red text under the field; errors are now shown exclusively via the existing NoticeError components on those pages.

  • RhfTokenTextField gains a hideErrorDescription prop (defaults to false), so all other usages — including VaultCard/TransactionForm which sets errors programmatically — continue to show inline error text unchanged.
  • VAI Borrow and Repay pages pass hideErrorDescription to suppress the redundant inline description while keeping the NoticeError block as the single error display.

Confidence Score: 5/5

Safe to merge — the change is narrowly scoped to VAI pages and preserves existing behaviour for all other consumers of RhfTokenTextField.

The new prop defaults to false, so every existing callsite (including VaultCard/TransactionForm, which relies on inline error text for price-impact and Pendle-quote errors) is unaffected. The VAI Borrow and Repay pages already have dedicated NoticeError components, making the suppressed inline description genuinely redundant. No logic is removed — only the duplicate display path on those two pages is hidden.

No files require special attention.

Important Files Changed

Filename Overview
apps/evm/src/containers/Form/RhfTokenTextField/index.tsx Adds optional hideErrorDescription prop (defaults to false) to suppress the inline red error paragraph; all existing callers without the prop retain the current behavior, including VaultCard/TransactionForm.
apps/evm/src/pages/Vai/Borrow/index.tsx Passes hideErrorDescription to suppress the inline field-level error text; errors are already surfaced via the NoticeError component below the input.
apps/evm/src/pages/Vai/Repay/index.tsx Same pattern as Borrow: hideErrorDescription hides the duplicate inline error text; the existing NoticeError below the input remains the sole error display.
.changeset/fast-drinks-stop.md Patch-level changeset entry for the VAI error display fix.

Reviews (2): Last reviewed commit: "feat: remove raw translate key" | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 81.32% 45828 / 56353
🔵 Statements 81.32% 45828 / 56353
🔵 Functions 62.35% 651 / 1044
🔵 Branches 72.33% 5173 / 7151
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/containers/Form/RhfTokenTextField/index.tsx 100% 87.5% 100% 100%
apps/evm/src/pages/Vai/Borrow/index.tsx 95.31% 86.27% 100% 95.31% 63, 86-87, 102, 112, 214-218, 235-236
apps/evm/src/pages/Vai/Repay/index.tsx 94.95% 69.23% 100% 94.95% 67-68, 154-158, 181-182, 190-192
Generated in workflow #13522 for commit c85bf96 by the Vitest Coverage Report Action

@cuzz-venus
Copy link
Copy Markdown
Contributor Author

@greptile review again

@cuzz-venus cuzz-venus requested a review from therealemjy May 28, 2026 06:29
name="amountTokens"
rules={{ required: true }}
disabled={!isUserConnected || isUserMissingPrimeToken}
hideErrorDescription
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd recommend taking a different approach.

This form is behaving differently in the sense that we use a custom UI to show errors. The designs were made quite a while ago and so I think we'd be better off staying consistent with the newest form.

So the approach I propose is to update the useForm hook of this component so that the error that's set on the field isn't an error code but rather the full error message. This means the RhfTokenTextField component won't need to be updated and will natively display the human-friendly error message.

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.

2 participants