Skip to content

feat: add asset headers#577

Merged
gamalielhere merged 1 commit intodevelopfrom
feat/add-24hr-ticker
Jan 9, 2025
Merged

feat: add asset headers#577
gamalielhere merged 1 commit intodevelopfrom
feat/add-24hr-ticker

Conversation

@gamalielhere
Copy link
Contributor

@gamalielhere gamalielhere commented Dec 17, 2024

Summary by CodeRabbit

  • New Features

    • Introduced new color variables to enhance the styling options.
    • Added a "Last 24h" text display in the asset detail view for better context on price changes.
    • Implemented a header section in the network assets view for improved organization of asset information.
  • Style

    • Updated styles for the new visual elements and headers to improve user interface presentation.

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2024

Walkthrough

This pull request introduces new color variables in the color.less file and makes UI improvements to the asset detail and network assets views. The changes add two new color variables (@black06 and @grayPrimary) and enhance the visual presentation of token and network asset information by adding headers and styling for displaying price change percentages and asset details.

Changes

File Change Summary
packages/extension/src/ui/action/styles/color.less Added two new color variables:
- @black06: rgba(0, 0, 0, 0.6)
- @grayPrimary: rgba(95, 99, 104, 1)
packages/extension/src/ui/action/views/asset-detail-view/index.vue Added a new <span> element with asset-detail-view__last-24 class to display "Last 24h" next to price change percentage
packages/extension/src/ui/action/views/network-assets/index.vue Added a new header row with columns "TOKEN", "LAST 24HR", and "VALUE" when not loading

Possibly related PRs

Suggested reviewers

  • NickKelly1
  • kvhnuke

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@github-actions
Copy link

github-actions bot commented Dec 17, 2024

💼 Build Files
chrome: enkrypt-chrome-6a8dcf45.zip
firefox: enkrypt-firefox-6a8dcf45.zip

💉 Virus total analysis
chrome: 6a8dcf45
firefox: 6a8dcf45

Copy link

@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)
packages/extension/src/ui/action/views/network-assets/index.vue (2)

17-21: LGTM! Consider adding ARIA attributes for better accessibility.

The header structure is well-organized and logically placed. The conditional rendering prevents header flash during loading states.

Consider adding ARIA attributes to improve accessibility:

-          <div v-if="!isLoading" class="network-assets__headers">
+          <div v-if="!isLoading" class="network-assets__headers" role="row" aria-label="Asset list headers">
-            <div>TOKEN</div>
-            <div>LAST 24HR</div>
-            <div>VALUE</div>
+            <div role="columnheader">TOKEN</div>
+            <div role="columnheader">LAST 24HR</div>
+            <div role="columnheader">VALUE</div>
           </div>

184-204: Consider making the header layout more responsive.

The header styling is well-structured, but the fixed width and paddings might cause issues on different screen sizes.

Consider these improvements:

   &__headers {
     display: flex;
     align-items: center;
     justify-content: space-between;
-    width: 350px;
+    width: 100%;
+    max-width: 350px;
     height: 21px;
-    padding: 0 20px 0 65px;
+    padding: 0 var(--spacing-lg) 0 var(--spacing-4xl); /* Consider using design system variables */
     margin: 12px 12px 0;
     font-size: 10px;
     color: @black06;
     font-weight: 500;
     line-height: 11px;

     div {
       text-align: left;
+      white-space: nowrap;
     }

     div:nth-child(2) {
-      width: 65px;
+      min-width: 65px;
+      margin: 0 var(--spacing-md);
     }
   }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eec3ed6 and 6a8dcf4.

📒 Files selected for processing (3)
  • packages/extension/src/ui/action/styles/color.less (1 hunks)
  • packages/extension/src/ui/action/views/asset-detail-view/index.vue (2 hunks)
  • packages/extension/src/ui/action/views/network-assets/index.vue (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/extension/src/ui/action/styles/color.less
🔇 Additional comments (3)
packages/extension/src/ui/action/views/asset-detail-view/index.vue (2)

42-42: LGTM! Clean addition of the time period indicator.

The span element is well-placed and follows the existing conditional rendering pattern.


160-167: Verify the @grayPrimary color variable.

The styling follows the BEM methodology and is consistent with the design system. However, let's verify that the @grayPrimary color variable is properly defined.

✅ Verification successful

@grayPrimary color variable is properly defined

The color variable is defined in packages/extension/src/ui/action/styles/color.less with the value rgba(95, 99, 104, 1). The usage is correct and follows the design system.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if @grayPrimary color variable is defined in theme.less or related files

# Search for @grayPrimary definition in less files
echo "Searching for @grayPrimary definition:"
rg "@grayPrimary\s*:" "packages/extension/src/ui/action/styles/"

# Check if the variable is imported from another file
echo -e "\nChecking for imports containing grayPrimary:"
rg -i "gray.*primary" "packages/extension/src/ui/action/styles/"

Length of output: 495

packages/extension/src/ui/action/views/network-assets/index.vue (1)

Line range hint 22-28: Verify header alignment with network-assets-item content.

Let's ensure the headers align properly with the content columns in the network-assets-item components.

✅ Verification successful

Based on the search results, I can see that the network-assets component has proper header alignment with the content columns. In the parent component (network-assets/index.vue), there are three header columns defined that match with the content structure:

<div v-if="!isLoading" class="network-assets__headers">
  <div>TOKEN</div>
  <div>LAST 24HR</div>
  <div>VALUE</div>
</div>

And the network-assets-item component displays the corresponding content in a token info structure that aligns with these headers. The implementation shows proper structural alignment between headers and content.

Headers are properly aligned with network-assets-item content.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the network-assets-item component to verify column structure
ast-grep --pattern 'class="network-assets-item" {
  $$$
}'

# Backup: Search for any template structure in the item component
fd -e vue -e ts -e js -g "*network-assets-item*" | xargs rg -A 10 "<template"

Length of output: 583


Script:

#!/bin/bash
# Let's check the parent component (network-assets) for header structure
fd -e vue -g "network-assets/index.vue" | xargs rg -A 20 "<template"

# Also check for any CSS classes related to headers or alignment
fd -e vue -g "network-assets/index.vue" | xargs rg "network-assets.*header|network-assets.*head"

Length of output: 131070

@gamalielhere gamalielhere merged commit 82e7958 into develop Jan 9, 2025
3 checks passed
@gamalielhere gamalielhere deleted the feat/add-24hr-ticker branch January 9, 2025 22:21
@coderabbitai coderabbitai bot mentioned this pull request Jan 9, 2025
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.

3 participants

Comments