Skip to content

Wrap long toast text so it stops overflowing the toast - #108

Merged
dadadave80 merged 1 commit into
mainfrom
fix/toast-text-overflow
Jun 21, 2026
Merged

dadadave80 merged 1 commit into
mainfrom
fix/toast-text-overflow

Conversation

@dadadave80

Copy link
Copy Markdown
Member

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 into toast.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 — add break-words to the toast title and description via toastOptions.classNames. overflow-wrap: break-word breaks the otherwise-unbreakable run so it wraps inside the toast. className-only, one file.

Verification

bunx tsc --noEmit clean · bun run lint 0 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

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

vercel Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
hostit-sui Ready Ready Preview, Comment Jun 21, 2026 9:15pm

@dadadave80
dadadave80 merged commit 24704d2 into main Jun 21, 2026
7 checks passed
@dadadave80
dadadave80 deleted the fix/toast-text-overflow branch June 21, 2026 21:23

This branch was successfully deployed

1 active deployment
Preview — 765ef499 Deployed Jun 21, 2026 by vercel[bot]
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