Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mattupham/fe 944 portfolio add chart expand minimize #3703

Merged
merged 36 commits into from
Aug 9, 2024

Conversation

mattupham
Copy link
Contributor

@mattupham mattupham commented Aug 8, 2024

What is the purpose of the change:

Add chart minimzation / transitions

Linear Task

Brief Changelog

  • add transitions for chart
  • add minimzed chart
  • reset chart styles to neutral
  • clean up layout

note - a handful of design side changes to the mini chart and portfolio performance as well

Testing and Verifying

chart.transitions.mov

Copy link

vercel bot commented Aug 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
osmosis-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2024 5:47am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
osmosis-frontend-datadog ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2024 5:47am
osmosis-frontend-dev ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2024 5:47am
osmosis-frontend-edgenet ⬜️ Ignored (Inspect) Aug 9, 2024 5:47am
osmosis-testnet ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2024 5:47am

@mattupham mattupham marked this pull request as draft August 8, 2024 05:37
Copy link
Contributor

coderabbitai bot commented Aug 8, 2024

Walkthrough

The recent updates enhance the configurability and interactivity of chart components within the application. Key features include optional properties for controlling scale visibility, the introduction of a minimized chart view with refined state management, and streamlined rendering logic for improved responsiveness. These changes collectively boost user experience and maintainability across chart-related components, enabling smoother interactions and more flexible layouts.

Changes

Files Change Summary
packages/web/components/chart/historical-chart.tsx Added showScales and hideScales properties for controlling scale visibility; updated rendering logic accordingly.
packages/web/components/complex/portfolio/historical-chart.tsx, packages/web/components/complex/portfolio/assets-overview.tsx Refactored to use dedicated props interfaces; introduced a minimized chart view and streamlined rendering logic.
packages/web/components/complex/portfolio/portfolio-page.tsx Removed RecentTransfers component for a simplified interface; adjusted class names for improved styling.
packages/web/components/assets/highlights-categories.tsx, packages/web/components/assets/price.tsx, packages/web/components/table/asset-info.tsx Enhanced styling through the addition and removal of specific classes in several components.
packages/web/components/complex/portfolio/user-positions.tsx, packages/web/components/table/asset-balances.tsx Updated classes in section and layout components for better styling and layout improvements.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 23035fa and 042dda9.

Files selected for processing (1)
  • packages/web/components/complex/portfolio/assets-overview.tsx (4 hunks)
Additional context used
Biome
packages/web/components/complex/portfolio/assets-overview.tsx

[error] 141-141: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 206-206: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

Additional comments not posted (3)
packages/web/components/complex/portfolio/assets-overview.tsx (3)

Line range hint 1-21:
Imports are well-structured.

The imports correctly include new components for chart transitions and state management, aligning with the PR objectives.


127-129: State management for chart visibility is clear.

The addition of isChartMinimized and setIsChartMinimized aligns with the objective of managing chart visibility effectively.


132-276: Rendering logic for chart transitions is well-structured.

The use of Transition for smooth transitions between minimized and expanded chart states is effective and aligns with the PR objectives.

Consider using optional chaining for safety.

Optional chaining can prevent runtime errors when accessing properties of potentially undefined objects. This suggestion was previously made and remains valid.

- disabled={totalValue && totalValue.toDec().isZero()}
+ disabled={totalValue?.toDec().isZero()}
- const totalDisplayValue = new PricePretty(DEFAULT_VS_CURRENCY, new Dec(dataPoint.value || 0)) || totalValue?.toString();
+ const totalDisplayValue = new PricePretty(DEFAULT_VS_CURRENCY, new Dec(dataPoint.value || 0)) || totalValue?.toString();
Tools
Biome

[error] 141-141: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 206-206: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mattupham mattupham changed the title Mattupham/fe 944 portfolio add chart expand minimize [draft] Mattupham/fe 944 portfolio add chart expand minimize Aug 8, 2024
Copy link
Contributor

mergify bot commented Aug 8, 2024

⚠️ The sha of the head commit of this PR conflicts with #3701. Mergify cannot evaluate rules on this PR. ⚠️

1 similar comment
Copy link
Contributor

mergify bot commented Aug 8, 2024

⚠️ The sha of the head commit of this PR conflicts with #3701. Mergify cannot evaluate rules on this PR. ⚠️

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

Outside diff range, codebase verification and nitpick comments (2)
packages/web/components/complex/portfolio/assets-overview.tsx (2)

142-142: Consider using optional chaining.

Consider using optional chaining to simplify the expression and handle potential undefined values safely.

- {wallet && wallet.isWalletConnected && wallet.address ? (
+ {wallet?.isWalletConnected && wallet.address ? (
Tools
Biome

[error] 142-142: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


207-207: Consider using optional chaining.

Consider using optional chaining to simplify the expression and handle potential undefined values safely.

- disabled={totalValue && totalValue.toDec().isZero()}
+ disabled={totalValue?.toDec().isZero()}
Tools
Biome

[error] 207-207: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

@mattupham mattupham requested a review from a team August 9, 2024 00:20
@mattupham mattupham changed the title [draft] Mattupham/fe 944 portfolio add chart expand minimize Mattupham/fe 944 portfolio add chart expand minimize Aug 9, 2024
@mattupham mattupham marked this pull request as ready for review August 9, 2024 00:20
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: 2

@mattupham mattupham merged commit 64943c6 into stage Aug 9, 2024
31 checks passed
@mattupham mattupham deleted the mattupham/fe-944-portfolio-add-chart-expand-minimize branch August 9, 2024 15:22
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