Repository navigation
Wrap long toast text so it stops overflowing the toast - #108
Merged
Merged
Conversation
humanizeError can surface a raw ~220-char error/object id with no spaces (moveErrors.ts), which sonner's default description does not break — so it ran past the toast's right edge. Add break-words to the toast title + description classNames. Mirrors the bell-inbox fix (#105/#102) on the other notification surface. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #105 (which fixed the bell inbox for #102) — the other notification surface, the sonner toast, had the same defect.
Problem
humanizeError()returns the raw error message (sliced to 220 chars) for any error it does not specifically map (web/lib/moveErrors.ts:147). That string can be an unbroken token with no spaces — a long Move type path, an object id, or a JSON-RPC blob — and it flows straight intotoast.error(humanizeError(e))across the app. Sonner's default description does not break an unbreakable string, so it ran past the toast's right edge.Fix
web/components/ui/sonner.tsx— addbreak-wordsto the toasttitleanddescriptionviatoastOptions.classNames.overflow-wrap: break-wordbreaks the otherwise-unbreakable run so it wraps inside the toast. className-only, one file.Verification
bunx tsc --noEmitclean ·bun run lint0 errors (pre-existing warnings only).Easy to confirm on a preview: trigger any action that throws an unmapped on-chain error (or temporarily
toast.error("0x"+"a".repeat(200))) and watch it wrap instead of overflow.🤖 Generated with Claude Code