Skip to content

Conversation

@premiumjibles
Copy link
Collaborator

@premiumjibles premiumjibles commented Nov 12, 2025

Description

Stop the account dropdown from getting giant on the receive modal

Had a go at solving this nicely with dynamic CSS and overflow ellipsis but too painful trying to get the width calcs to work properly. Went with a good enough solution of max char limits. 25 for mobile and 50 for desktop

Issue (if applicable)

closes #11055

Risk

Low risk, just sets character limits on the dropdown

High Risk PRs Require 2 approvals

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

Testing

  • Test that on mobile the account dropdown on receive modal doesn't overflow the screen
  • Test that we don't cut off token names below 50 chars on desktop
  • Test any other instances of account dropdown you can think of and make sure token name rendering looks ok

Engineering

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

Screenshots (if applicable)

image

Summary by CodeRabbit

  • Bug Fixes
    • Account titles and subtitles now truncate responsively by screen size to prevent layout overflow.
    • Truncation no longer adds an ellipsis when text length exactly matches the limit, preserving full content.
    • Added test coverage to ensure consistent trimming behavior across breakpoints and edge cases.

@premiumjibles premiumjibles requested a review from a team as a code owner November 12, 2025 23:59
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

📝 Walkthrough

Walkthrough

Responsive truncation was added to two AccountDropdown components (title and subtitle) using breakpoint-based max lengths and the trimWithEndEllipsis utility. The utility's boundary logic was adjusted to avoid trimming when content length equals the limit, and a test was added to verify that exact-length strings are not ellipsized.

Changes

Cohort / File(s) Summary
Account dropdown UI updates
src/components/AccountDropdown/AccountChildOption.tsx, src/components/AccountDropdown/AccountSegement.tsx
Added useBreakpointValue and useMemo to compute maxLength (base: 25, md: 50) and derive truncated strings via trimWithEndEllipsis. AccountChildOption renders truncated title; AccountSegement renders truncated subtitle. Event flows unchanged.
Utility logic change
src/lib/utils/index.ts
Adjusted trimWithEndEllipsis boundary condition to return original content when length is less than or equal to the max length (prevents adding ellipsis for exact-length inputs).
Tests
src/state/slices/portfolioSlice/utils/index.test.ts
Added a test asserting no ellipsis is appended when input length equals the max length (50 chars).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Account Dropdown Component
  participant BP as useBreakpointValue
  participant MEMO as useMemo
  participant UTIL as trimWithEndEllipsis
  note right of UI `#DDEBF7`: Render phase
  UI->>BP: request maxLength (base:25, md:50)
  UI->>MEMO: compute truncatedText using UTIL and maxLength
  MEMO->>UTIL: trimWithEndEllipsis(content, maxLength)
  UTIL-->>MEMO: truncated or original content
  MEMO-->>UI: memoized truncatedText
  UI->>UI: render truncatedText in UI
  note right of UTIL `#F6F8E8`: Boundary: return original when length <= maxLength
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review points:
    • trimWithEndEllipsis boundary change correctness and edge cases (empty strings, very small maxLength).
    • Confirm breakpoint values (base:25, md:50) match design requirements.
    • Ensure memoization hooks have correct dependency arrays and do not cause unnecessary re-renders.
    • Verify tests cover equality boundary and consider adding more edge cases if needed.

Suggested reviewers

  • 0xApotheosis
  • NeOMakinG

Poem

🐰 I nibbled long names down to size,
Dotted tails where overflow lies.
Now mobile lists are neat and sweet,
Every account fits snug and neat. ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: implementing maximum character width limits for the account dropdown to prevent overflow in the receive modal.
Linked Issues check ✅ Passed The changes directly address issue #11055 by implementing character limits (25 chars mobile, 50 chars desktop) to prevent account dropdown overflow and truncation on mobile.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing responsive character truncation for the account dropdown to address the overflow issue; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 11055_account_limit

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9551fa9 and f614186.

📒 Files selected for processing (4)
  • src/components/AccountDropdown/AccountChildOption.tsx (2 hunks)
  • src/components/AccountDropdown/AccountSegement.tsx (1 hunks)
  • src/lib/utils/index.ts (1 hunks)
  • src/state/slices/portfolioSlice/utils/index.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/AccountDropdown/AccountChildOption.tsx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: premiumjibles
Repo: shapeshift/web PR: 10361
File: src/pages/Markets/components/CardWithSparkline.tsx:83-92
Timestamp: 2025-08-25T23:32:13.876Z
Learning: In shapeshift/web PR #10361, premiumjibles considered the nested button accessibility issue (ChartErrorFallback retry Button inside Card rendered as Button in CardWithSparkline.tsx) out of scope for the error boundaries feature PR, consistent with deferring minor a11y improvements to follow-up PRs.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10418
File: src/plugins/walletConnectToDapps/components/header/WalletConnectToDappsHeaderButton.tsx:0-0
Timestamp: 2025-09-08T22:00:48.005Z
Learning: gomesalexandre dismissed an aria-label accessibility suggestion with "meh" in PR #10418 for WalletConnectToDappsHeaderButton.tsx, consistent with the team's pattern of deferring minor a11y improvements to follow-up PRs rather than expanding feature PR scope.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10231
File: src/components/AssetSearch/components/AssetList.tsx:2-2
Timestamp: 2025-08-08T15:00:49.887Z
Learning: Project shapeshift/web: NeOMakinG prefers avoiding minor a11y/UI nitpicks (e.g., adding aria-hidden to decorative icons in empty states like src/components/AssetSearch/components/AssetList.tsx) within feature PRs; defer such suggestions to a follow-up instead of blocking the PR.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/modals/EIP712MessageDisplay.tsx:21-24
Timestamp: 2025-09-12T13:16:27.004Z
Learning: gomesalexandre declined to add error boundaries to WalletConnect modals in PR #10461, stating "no error boundaries in this pr ser", consistent with his preference to keep PR scope focused and defer tangential improvements to separate efforts.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/components/ButtonWalletPredicate/ButtonWalletPredicate.tsx:7-7
Timestamp: 2025-08-27T09:47:06.275Z
Learning: In shapeshift/web project, NeOMakinG consistently prefers to defer UI/UX improvements and refactoring work (like the Drawer.Close hack fix in ButtonWalletPredicate.tsx) to follow-up PRs rather than expanding the scope of feature PRs, even when the improvements would enhance robustness.
📚 Learning: 2025-08-08T14:59:40.422Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10231
File: src/pages/Explore/ExploreCategory.tsx:231-238
Timestamp: 2025-08-08T14:59:40.422Z
Learning: In src/pages/Explore/ExploreCategory.tsx, for the PageHeader filter trigger, NeOMakinG considers changing a clickable Chakra Icon to IconButton too nitpicky for this PR and prefers to keep the current Icon-based trigger; such minor a11y/UI nitpicks should be deferred to a follow-up if needed.

Applied to files:

  • src/components/AccountDropdown/AccountSegement.tsx
🧬 Code graph analysis (2)
src/components/AccountDropdown/AccountSegement.tsx (2)
src/lib/utils/index.ts (1)
  • trimWithEndEllipsis (22-30)
src/components/Text/Text.tsx (1)
  • RawText (15-17)
src/state/slices/portfolioSlice/utils/index.test.ts (1)
src/lib/utils/index.ts (1)
  • trimWithEndEllipsis (22-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install and Cache
🔇 Additional comments (4)
src/lib/utils/index.ts (1)

27-27: LGTM! Boundary condition fix is correct.

The change from < to <= correctly prevents adding ellipsis when content length exactly matches the max length. This is the expected behavior and aligns with the new test case.

src/state/slices/portfolioSlice/utils/index.test.ts (1)

158-162: LGTM! Test coverage for boundary condition.

The test correctly validates that no ellipsis is added when content length exactly matches the max length, providing good coverage for the boundary condition fix.

src/components/AccountDropdown/AccountSegement.tsx (2)

14-18: LGTM! Responsive truncation implementation is correct.

The implementation correctly uses useBreakpointValue to apply 25-character truncation on mobile and 50-character truncation on desktop, matching the PR objectives. The useMemo optimization and dependency array are appropriate.


30-34: LGTM! Conditional rendering of truncated subtitle.

The truncated subtitle is correctly rendered when present, preventing overflow issues while maintaining the existing component structure.


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.

@premiumjibles premiumjibles marked this pull request as draft November 13, 2025 00:00
Copy link
Contributor

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

🧹 Nitpick comments (2)
src/components/AccountDropdown/AccountChildOption.tsx (1)

34-35: Consider adding a tooltip to show the full account name.

While the truncation fixes the overflow issue, users have no way to see the full account name when it's truncated. Adding a title attribute or Chakra Tooltip would improve the UX for users with long account names.

Example with title attribute:

-          <RawText fontWeight='bold' whiteSpace='nowrap' flex={1}>
+          <RawText fontWeight='bold' whiteSpace='nowrap' flex={1} title={title}>
             {truncatedTitle}
           </RawText>
src/components/AccountDropdown/AccountSegement.tsx (1)

30-33: Consider adding a tooltip to show the full subtitle.

Similar to the title truncation in AccountChildOption, users cannot see the full subtitle when truncated. Adding a title attribute would improve UX for long addresses or balances.

Example with title attribute:

       {subtitle && (
-        <RawText fontFamily='monospace' fontWeight='bold'>
+        <RawText fontFamily='monospace' fontWeight='bold' title={subtitle}>
           {truncatedSubtitle}
         </RawText>
       )}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 425cb96 and 9551fa9.

📒 Files selected for processing (2)
  • src/components/AccountDropdown/AccountChildOption.tsx (2 hunks)
  • src/components/AccountDropdown/AccountSegement.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)

**/*.{ts,tsx}: ALWAYS use Result<T, E> pattern for error handling in swappers and APIs
ALWAYS use Ok() and Err() from @sniptt/monads for monadic error handling
ALWAYS use custom error classes from @shapeshiftoss/errors
ALWAYS provide meaningful error codes for internationalization
ALWAYS include relevant details in error objects
ALWAYS wrap async operations in try-catch blocks
ALWAYS use AsyncResultOf utility for converting promises to Results
ALWAYS provide fallback error handling
ALWAYS use timeoutMonadic for API calls
ALWAYS provide appropriate timeout values for API calls
ALWAYS handle timeout errors gracefully
ALWAYS validate inputs before processing
ALWAYS provide clear validation error messages
ALWAYS use early returns for validation failures
ALWAYS log errors for debugging
ALWAYS use structured logging for errors
ALWAYS include relevant context in error logs
Throwing errors instead of using monadic patterns is an anti-pattern
Missing try-catch blocks for async operations is an anti-pattern
Generic error messages without context are an anti-pattern
Not handling specific error types is an anti-pattern
Missing timeout handling is an anti-pattern
No input validation is an anti-pattern
Poor error logging is an anti-pattern
Using any for error types is an anti-pattern
Missing error codes for internationalization is an anti-pattern
No fallback error handling is an anti-pattern
Console.error without structured logging is an anti-pattern

**/*.{ts,tsx}: ALWAYS use camelCase for variables, functions, and methods
ALWAYS use descriptive names that explain the purpose for variables and functions
ALWAYS use verb prefixes for functions that perform actions
ALWAYS use PascalCase for types, interfaces, and enums
ALWAYS use descriptive names that indicate the structure for types, interfaces, and enums
ALWAYS use suffixes like Props, State, Config, Type when appropriate for types and interfaces
ALWAYS use UPPER_SNAKE_CASE for constants and configuration values
ALWAYS use d...

Files:

  • src/components/AccountDropdown/AccountChildOption.tsx
  • src/components/AccountDropdown/AccountSegement.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)

**/*.tsx: ALWAYS wrap components in error boundaries
ALWAYS provide user-friendly fallback components in error boundaries
ALWAYS log errors for debugging in error boundaries
ALWAYS use useErrorToast hook for displaying errors
ALWAYS provide translated error messages in error toasts
ALWAYS handle different error types appropriately in error toasts
Missing error boundaries in React components is an anti-pattern

**/*.tsx: ALWAYS use PascalCase for React component names
ALWAYS use descriptive names that indicate the component's purpose
ALWAYS match the component name to the file name
Flag components without PascalCase
Flag default exports for components

Files:

  • src/components/AccountDropdown/AccountChildOption.tsx
  • src/components/AccountDropdown/AccountSegement.tsx
**/*

📄 CodeRabbit inference engine (.cursor/rules/naming-conventions.mdc)

**/*: ALWAYS use appropriate file extensions
Flag files without kebab-case

Files:

  • src/components/AccountDropdown/AccountChildOption.tsx
  • src/components/AccountDropdown/AccountSegement.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/react-best-practices.mdc)

**/*.{tsx,jsx}: ALWAYS use useMemo for expensive computations, object/array creations, and filtered data
ALWAYS use useMemo for derived values and computed properties
ALWAYS use useMemo for conditional values and simple transformations
ALWAYS use useCallback for event handlers and functions passed as props
ALWAYS use useCallback for any function that could be passed as a prop or dependency
ALWAYS include all dependencies in useEffect, useMemo, useCallback dependency arrays
NEVER use // eslint-disable-next-line react-hooks/exhaustive-deps unless absolutely necessary
ALWAYS explain why dependencies are excluded if using eslint disable
ALWAYS use named exports for components
NEVER use default exports for components
KEEP component files under 200 lines when possible
BREAK DOWN large components into smaller, reusable pieces
EXTRACT complex logic into custom hooks
USE local state for component-level state
LIFT state up when needed across multiple components
USE Context for avoiding prop drilling
ALWAYS wrap components in error boundaries for production
ALWAYS handle async errors properly
ALWAYS provide user-friendly error messages
ALWAYS use virtualization for lists with 100+ items
ALWAYS implement proper key props for list items
ALWAYS lazy load heavy components
ALWAYS use React.lazy for code splitting
Components receiving props are wrapped with memo

Files:

  • src/components/AccountDropdown/AccountChildOption.tsx
  • src/components/AccountDropdown/AccountSegement.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/react-best-practices.mdc)

USE Redux only for global state shared across multiple places

Files:

  • src/components/AccountDropdown/AccountChildOption.tsx
  • src/components/AccountDropdown/AccountSegement.tsx
🧠 Learnings (10)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10418
File: src/plugins/walletConnectToDapps/components/header/WalletConnectToDappsHeaderButton.tsx:0-0
Timestamp: 2025-09-08T22:00:48.005Z
Learning: gomesalexandre dismissed an aria-label accessibility suggestion with "meh" in PR #10418 for WalletConnectToDappsHeaderButton.tsx, consistent with the team's pattern of deferring minor a11y improvements to follow-up PRs rather than expanding feature PR scope.
Learnt from: premiumjibles
Repo: shapeshift/web PR: 10361
File: src/pages/Markets/components/CardWithSparkline.tsx:83-92
Timestamp: 2025-08-25T23:32:13.876Z
Learning: In shapeshift/web PR #10361, premiumjibles considered the nested button accessibility issue (ChartErrorFallback retry Button inside Card rendered as Button in CardWithSparkline.tsx) out of scope for the error boundaries feature PR, consistent with deferring minor a11y improvements to follow-up PRs.
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/modals/EIP712MessageDisplay.tsx:21-24
Timestamp: 2025-09-12T13:16:27.004Z
Learning: gomesalexandre declined to add error boundaries to WalletConnect modals in PR #10461, stating "no error boundaries in this pr ser", consistent with his preference to keep PR scope focused and defer tangential improvements to separate efforts.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10231
File: src/components/AssetSearch/components/AssetList.tsx:2-2
Timestamp: 2025-08-08T15:00:49.887Z
Learning: Project shapeshift/web: NeOMakinG prefers avoiding minor a11y/UI nitpicks (e.g., adding aria-hidden to decorative icons in empty states like src/components/AssetSearch/components/AssetList.tsx) within feature PRs; defer such suggestions to a follow-up instead of blocking the PR.
Learnt from: 0xApotheosis
Repo: shapeshift/web PR: 10691
File: src/components/AssetHeader/AssetHeader.tsx:98-106
Timestamp: 2025-09-30T05:28:39.685Z
Learning: In the ShapeShift web codebase, the "More" menu on the asset page (containing watch/unwatch, view on explorer, and mark as spam actions) should always be visible on both mobile and desktop, regardless of whether a wallet is connected or whether the wallet supports the asset's chain. Individual actions within the menu can handle their own disabled states, but the menu itself should not be gated behind wallet connection checks.
📚 Learning: 2025-08-08T14:59:40.422Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10231
File: src/pages/Explore/ExploreCategory.tsx:231-238
Timestamp: 2025-08-08T14:59:40.422Z
Learning: In src/pages/Explore/ExploreCategory.tsx, for the PageHeader filter trigger, NeOMakinG considers changing a clickable Chakra Icon to IconButton too nitpicky for this PR and prefers to keep the current Icon-based trigger; such minor a11y/UI nitpicks should be deferred to a follow-up if needed.

Applied to files:

  • src/components/AccountDropdown/AccountChildOption.tsx
  • src/components/AccountDropdown/AccountSegement.tsx
📚 Learning: 2025-08-03T22:10:38.426Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/react-best-practices.mdc:0-0
Timestamp: 2025-08-03T22:10:38.426Z
Learning: Applies to **/*.{tsx,jsx} : BREAK DOWN large components into smaller, reusable pieces

Applied to files:

  • src/components/AccountDropdown/AccountChildOption.tsx
  • src/components/AccountDropdown/AccountSegement.tsx
📚 Learning: 2025-08-22T12:59:01.210Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/components/Layout/Header/ActionCenter/components/RewardDistributionActionCard.tsx:26-29
Timestamp: 2025-08-22T12:59:01.210Z
Learning: In src/components/Layout/Header/ActionCenter/components/RewardDistributionActionCard.tsx, NeOMakinG declined wrapping the RewardDistributionActionCard component with React.memo, saying it was "too much", suggesting that like other action center components, memoization is not beneficial for this specific use case.

Applied to files:

  • src/components/AccountDropdown/AccountChildOption.tsx
📚 Learning: 2025-10-07T03:44:27.350Z
Learnt from: 0xApotheosis
Repo: shapeshift/web PR: 10760
File: src/components/ManageHiddenAssets/ManageHiddenAssetsList.tsx:78-84
Timestamp: 2025-10-07T03:44:27.350Z
Learning: In the ShapeShift web codebase, the following are stable references and do not need to be included in useCallback/useMemo dependency arrays:
- `navigate` from `useBrowserRouter()` hook
- Modal control objects (like `walletDrawer`) from `useModal()` hook (including their `isOpen`, `close`, and `open` methods)
- These are backed by stable context providers

Applied to files:

  • src/components/AccountDropdown/AccountChildOption.tsx
📚 Learning: 2025-09-16T09:32:21.333Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10490
File: src/components/Layout/Header/NavBar/NavigationDropdown.tsx:96-103
Timestamp: 2025-09-16T09:32:21.333Z
Learning: In the shapeshift/web codebase, gomesalexandre confirms that using `item.icon && <Icon as={item.icon} boxSize={4} />` for Chakra UI MenuItem.icon prop is valid and acceptable - the boolean short-circuit pattern works fine with Chakra components and doesn't need to be changed to explicit undefined.

Applied to files:

  • src/components/AccountDropdown/AccountChildOption.tsx
📚 Learning: 2025-08-27T09:47:59.394Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/components/Modal/components/DialogCloseButton.tsx:29-37
Timestamp: 2025-08-27T09:47:59.394Z
Learning: In shapeshift/web, for DialogCloseButton.tsx, the onClick handler must remain on Drawer.Close (not moved to IconButton with asChild) because stopPropagation() needs to be called at the Drawer.Close level to properly handle drawer closing behavior; moving event handling to the child IconButton would break the event flow that Drawer.Close expects.

Applied to files:

  • src/components/AccountDropdown/AccountChildOption.tsx
📚 Learning: 2025-07-29T15:04:28.083Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10139
File: src/components/MultiHopTrade/components/TradeConfirm/components/ExpandableStepperSteps.tsx:109-115
Timestamp: 2025-07-29T15:04:28.083Z
Learning: In src/components/MultiHopTrade/components/TradeConfirm/components/ExpandableStepperSteps.tsx, the component is used under an umbrella that 100% of the time contains the quote, making the type assertion `activeTradeQuote?.steps[currentHopIndex] as TradeQuoteStep` safe. Adding conditional returns before hooks would violate React's Rules of Hooks.

Applied to files:

  • src/components/AccountDropdown/AccountChildOption.tsx
📚 Learning: 2025-07-29T10:27:23.424Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10128
File: .cursor/rules/react-best-practices.mdc:8-14
Timestamp: 2025-07-29T10:27:23.424Z
Learning: The ShapeShift team practices aggressive memoization in React components as documented in .cursor/rules/react-best-practices.mdc. They use useMemo for all transformations, derived values, and conditional values, and useCallback for all event handlers and functions that could be passed as props. This approach was adopted after experiencing performance issues ("had hard time") and is their current established practice, though they acknowledge it may evolve in the future.

Applied to files:

  • src/components/AccountDropdown/AccountChildOption.tsx
📚 Learning: 2025-08-03T22:10:38.426Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/react-best-practices.mdc:0-0
Timestamp: 2025-08-03T22:10:38.426Z
Learning: Applies to **/*.{tsx,jsx} : KEEP component files under 200 lines when possible

Applied to files:

  • src/components/AccountDropdown/AccountSegement.tsx
🧬 Code graph analysis (2)
src/components/AccountDropdown/AccountChildOption.tsx (2)
src/lib/utils/index.ts (1)
  • trimWithEndEllipsis (22-30)
src/components/Text/Text.tsx (1)
  • RawText (15-17)
src/components/AccountDropdown/AccountSegement.tsx (2)
src/lib/utils/index.ts (1)
  • trimWithEndEllipsis (22-30)
src/components/Text/Text.tsx (1)
  • RawText (15-17)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Install and Cache
🔇 Additional comments (2)
src/components/AccountDropdown/AccountChildOption.tsx (1)

28-29: LGTM! Responsive truncation correctly implemented.

The responsive character limits (25 for mobile, 50 for desktop) correctly address the mobile overflow issue. The useMemo dependencies are correct, and the implementation gracefully handles the initial undefined from useBreakpointValue via trimWithEndEllipsis.

src/components/AccountDropdown/AccountSegement.tsx (1)

14-18: LGTM! Responsive subtitle truncation correctly implemented.

The subtitle truncation uses the same responsive breakpoints (25/50 chars) as AccountChildOption, ensuring consistency. The useMemo dependencies are correct, and the implementation handles undefined maxLength gracefully.

@premiumjibles premiumjibles marked this pull request as ready for review November 13, 2025 00:03
Copy link
Member

@0xApotheosis 0xApotheosis left a comment

Choose a reason for hiding this comment

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

Looks good! I found an edge case - if the asset name has a length of exactly 50 characters we don't truncate but still show the ellipsis.

Image Image

@premiumjibles
Copy link
Collaborator Author

@0xApotheosis should be sorted now

Copy link
Collaborator

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

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

image

Looks like doing the do!

@NeOMakinG NeOMakinG dismissed 0xApotheosis’s stale review November 19, 2025 10:09

For the sake of progression!

@NeOMakinG NeOMakinG enabled auto-merge (squash) November 19, 2025 10:09
@NeOMakinG NeOMakinG merged commit c19504b into develop Nov 19, 2025
4 checks passed
@NeOMakinG NeOMakinG deleted the 11055_account_limit branch November 19, 2025 10:14
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.

On mobile, the account name in the drop down on receive page getting cut off if too long

4 participants