Skip to content

fix: address react doctor findings#280

Open
paulbalaji wants to merge 1 commit intomainfrom
fix/react-doctor-findings
Open

fix: address react doctor findings#280
paulbalaji wants to merge 1 commit intomainfrom
fix/react-doctor-findings

Conversation

@paulbalaji
Copy link
Collaborator

@paulbalaji paulbalaji commented Feb 20, 2026

Summary

Addresses React Doctor findings from #279. Minimal changes only.

Errors fixed:

  • TokenIcon.tsx: add missing alt={title} on <img>
  • og.tsx: add missing alt="" on background <img>

Warnings fixed:

  • ContentDetailsCard.tsx: replace useEffect with render-time state sync for bodyDecodeType; change unassociated <label> to <span>
  • SearchFilterBar.tsx: sync local DatetimeSelector state when props change externally
  • CollateralCards.tsx: use txHash as stable React key instead of array index
  • IcaDetailsCard.tsx: use destinationAddress in key; change <label> to <span>
  • GasDetailsCard.tsx: extract default {} to module-level constant; use composite key
  • WarpTransferDetailsCard.tsx: parallelize 3 independent awaits with Promise.all()
  • MessageSearch.tsx: wrap useState initializers calling tryToDecimalNumber() / parseStatusFilter() in lazy arrow functions

Intentionally skipped (legitimate patterns):

  • [messageId].tsx:38 — pages router redirect in useEffect (standard pattern)
  • useMessageDeliveryStatus.tsx:78useEffect for toast on error state from React Query
  • _app.tsx:42useIsSsr hook controls SSR/client render split (needed for pino-pretty workaround)
  • MessageSearch.tsx:51 — 6 useState calls are independent filter state (refactor not warranted)
  • MessageSearch.tsx:116 — 6 setState in hydration useEffect is a one-time URL sync guarded by ref

Test plan

  • pnpm run typecheck passes
  • pnpm run lint passes
  • pnpm run prettier — no formatting changes
  • pnpm run test — unit tests pass (PI chain integration tests fail pre-existing, unrelated)
  • Manual smoke test: search, filter, message detail pages render correctly

🤖 Generated with Claude Code


Note

Medium Risk
Mostly UI-level correctness and accessibility fixes, but it introduces render-time state synchronization (conditional setState during render) that could cause unexpected re-render behavior if edge cases aren’t covered.

Overview
Addresses React Doctor findings across the UI by adding missing image alt attributes (e.g., TokenIcon, OG image background) and replacing unassociated <label> elements with <span>.

Improves React state correctness/perf by lazily initializing filter state in MessageSearch, syncing DatetimeSelector local state when props change, and updating ContentDetailsCard to sync bodyDecodeType when decodedBody changes without an effect.

Reduces rendering warnings and minor perf issues by using stable/composite React keys in message cards, extracting a module-level default for igpPayments, and parallelizing block explorer link lookups with Promise.all in WarpTransferDetailsCard.

Written by Cursor Bugbot for commit 8a382a8. This will update automatically on new commits. Configure here.

Fixes from React Doctor analysis (#279):

Errors:
- Add missing alt={title} on <img> in TokenIcon.tsx
- Add missing alt="" on background <img> in og.tsx

Warnings fixed:
- ContentDetailsCard: replace useEffect with render-time state sync for bodyDecodeType
- SearchFilterBar: sync local DatetimeSelector state with prop changes
- CollateralCards: use txHash as stable key instead of array index
- IcaDetailsCard: use destinationAddress in key, change <label> to <span>
- GasDetailsCard: extract default {} to module-level constant, use composite key
- ContentDetailsCard: change unassociated <label> to <span>
- WarpTransferDetailsCard: parallelize 3 independent awaits with Promise.all
- MessageSearch: wrap useState initializers in lazy arrow functions

Skipped (legitimate patterns):
- [messageId].tsx: pages router redirect in useEffect
- useMessageDeliveryStatus: useEffect for toast on error state
- _app.tsx: useIsSsr hook controls SSR/client render split
- MessageSearch: 6 useState calls (independent filter state)
- MessageSearch: 6 setState in hydration useEffect (one-time URL sync)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 20, 2026

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

Project Deployment Actions Updated (UTC)
hyperlane-explorer Ready Ready Preview, Comment Feb 20, 2026 5:42pm

Request Review

Copy link

@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 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@paulbalaji paulbalaji marked this pull request as ready for review February 20, 2026 18:59
@paulbalaji paulbalaji requested a review from Xaroz as a code owner February 20, 2026 18:59
@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

Warning

Rate limit exceeded

@paulbalaji has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 56 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/react-doctor-findings

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 and usage tips.

Comment on lines +136 to +143
if (startValue !== prevStartValue) {
setPrevStartValue(startValue);
setStartTime(startValue);
}
if (endValue !== prevEndValue) {
setPrevEndValue(endValue);
setEndTime(endValue);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

generally wanna avoid calling if inside components and prefer ternary but even better would be a function

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