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

feat: Expense card section (small screens) #3323

Merged
merged 2 commits into from
Dec 10, 2024
Merged

Conversation

SahilK-027
Copy link
Contributor

@SahilK-027 SahilK-027 commented Dec 10, 2024

Clickup

clickup link

UI Preview

Please add screenshots for UI changes
Screenshot 2024-12-10 at 5 59 33 PM
Screenshot 2024-12-10 at 5 59 25 PM

Summary by CodeRabbit

  • Style
    • Enhanced spacing with added padding to category and icon sections of the expenses card.
    • Removed max-width restriction for category icon container, allowing for flexible width.
    • Corrected typo in class name from .expenses-card--deatils-block to .expenses-card--details-block.

Copy link

coderabbitai bot commented Dec 10, 2024

Walkthrough

The pull request introduces modifications to the SCSS file of the expenses-card component. Key changes include the addition of padding to specific classes, the removal of a max-width property for improved flexibility, and a correction of a typo in a class name. The overall structure and hierarchy of the SCSS remain unchanged, with no impact on the component's functionality or layout.

Changes

File Path Change Summary
src/app/shared/components/expenses-card-v2/expenses-card.component.scss - Corrected class name from .expenses-card--deatils-block to .expenses-card--details-block
- Added padding-right: 4px; to .expenses-card--category and .expenses-card--icons
- Removed max-width: 170px; from .expenses-card--category-icon-container

Possibly related PRs

Suggested labels

size/S

Suggested reviewers

  • Dimple16
  • Chethan-Fyle

🎉 In the realm of styles, adjustments made,
Padding and corrections, a fine upgrade!
Flexibility shines, with details in sight,
The expenses card glows, oh what a delight!
With every tweak, it stands tall and bright! 🌟


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. (Experiment)
  • @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.

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.

@github-actions github-actions bot added the size/XS Extra Small PR label Dec 10, 2024
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: 1

🧹 Outside diff range comments (2)
src/app/shared/components/expenses-card-v2/expenses-card.component.scss (2)

Line range hint 1-365: One more thing, thalaiva style!

While these spacing improvements are good, we could make the component even more responsive for different screen sizes.

Consider adding media queries for better control over spacing and layout on various screen sizes:

// Example media query for extra small screens
@media screen and (max-width: 320px) {
  .expenses-card {
    &--category {
      max-width: 140px; // Adjusted for smaller screens
    }
    
    &--currency-amount-exchange-rate-container {
      gap: 2px; // Tighter spacing on smaller screens
    }
  }
}

Mind it! This typo is spreading like wildfire across our components, macha!

The misspelled class expenses-card--deatils-block is used in three different component templates:

  • src/app/shared/components/expenses-card/expenses-card.component.html
  • src/app/shared/components/expenses-card-v2/expenses-card.component.html
  • src/app/shared/components/expense-card-lite/expense-card-lite.component.html

You need to fix this spelling in both the SCSS file and all these HTML templates. When style meets perfection, even a small typo can't escape my eyes! Make these changes:

-.expenses-card--deatils-block
+.expenses-card--details-block
🔗 Analysis chain

Line range hint 24-29: Mind it! There's a spelling mistake that needs fixing, macha!

The class name .expenses-card--deatils-block has a typo. It should be .expenses-card--details-block.

Let me check if this class name is used anywhere else, da:

Apply this style, boss:

-.expenses-card--deatils-block {
+.expenses-card--details-block {
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any usage of the misspelled class
rg -l "expenses-card--deatils-block"

# Search for any existing correct spelling to avoid conflicts
rg -l "expenses-card--details-block"

Length of output: 291


Script:

#!/bin/bash
# Let's check the actual usage of this class in the HTML files
echo "=== expenses-card.component.html ==="
rg -C 2 "expenses-card--deatils-block" src/app/shared/components/expenses-card/expenses-card.component.html

echo -e "\n=== expenses-card-v2.component.html ==="
rg -C 2 "expenses-card--deatils-block" src/app/shared/components/expenses-card-v2/expenses-card.component.html

echo -e "\n=== expense-card-lite.component.html ==="
rg -C 2 "expenses-card--deatils-block" src/app/shared/components/expense-card-lite/expense-card-lite.component.html

Length of output: 1412

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Reviewing files that changed from the base of the PR and between cb5be41 and 5e10d01.

📒 Files selected for processing (1)
  • src/app/shared/components/expenses-card-v2/expenses-card.component.scss (1 hunks)
🔇 Additional comments (1)
src/app/shared/components/expenses-card-v2/expenses-card.component.scss (1)

197-197: Superstar approves this padding change!

The padding-right: 4px addition gives better breathing space to category text on small screens, perfectly complementing the existing max-width and text overflow handling. What a style, what a style!

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

🧹 Outside diff range comments (2)
src/app/shared/components/expenses-card-v2/expenses-card.component.scss (2)

Line range hint 22-27: Listen here, macha! There's a spelling that needs some style!

The class name .expenses-card--deatils-block has a typo. Let's fix it with the swagger it deserves!

-.expenses-card--deatils-block {
+.expenses-card--details-block {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 0;
}

Line range hint 1-1: Time to add some responsive style power, macha! 💪

For a truly responsive design on small screens, consider adding media queries. When I make an entry, I make it grand - let's do the same with our styles!

Add this to your arsenal:

@mixin for-small-screens {
  @media (max-width: 576px) {
    @content;
  }
}

// Usage example:
.expenses-card {
  &--category {
    @include for-small-screens {
      // Small screen specific styles
      padding-right: 4px;
    }
  }
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Reviewing files that changed from the base of the PR and between 5e10d01 and e8d28bc.

📒 Files selected for processing (1)
  • src/app/shared/components/expenses-card-v2/expenses-card.component.scss (1 hunks)
🔇 Additional comments (1)
src/app/shared/components/expenses-card-v2/expenses-card.component.scss (1)

197-204: Mind-blowing spacing adjustments, partner! 🎯

The padding and gap additions are perfectly timed for small screens - just like my punch dialogues! These changes will keep your UI looking sharp and crisp.

Copy link

Unit Test Coverage % values
Statements 96.03% ( 19280 / 20075 )
Branches 91.13% ( 10660 / 11697 )
Functions 94.4% ( 5741 / 6081 )
Lines 96.08% ( 18410 / 19161 )

@SahilK-027 SahilK-027 merged commit 3bb9dbf into FYLE-86cx5qh03 Dec 10, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Extra Small PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants