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: Update Matching expense card to display exact amount #3375

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

SahilK-027
Copy link
Contributor

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

Clickup

clickup link

UI Preview

Screenshot 2024-12-18 at 4 26 29 PM Screenshot 2024-12-18 at 4 26 13 PM

Summary by CodeRabbit

  • New Features

    • Enhanced display of transaction details with updated text casing for improved readability.
    • Introduced a new method for formatting currency amounts, improving presentation.
    • Added a new dashed divider to the expense card component for better visual separation.
  • Bug Fixes

    • Adjusted layout and binding logic for currency amount display to enhance clarity.
  • Style

    • Updated color properties, font sizes, and margins across various components for improved visual hierarchy and readability.
  • Tests

    • Expanded testing capabilities by including new currency formatting pipes in the test suites for relevant components.

Copy link

coderabbitai bot commented Dec 18, 2024

Walkthrough

Superstar, listen up! This pull request is a stylish transformation of our expense tracking components. We've revamped the personal cards matched expenses page with sleek text casing updates and a new currency formatting approach. The changes span across HTML, SCSS, and test files, introducing the ExactCurrencyPipe to make our currency display more precise than a Rajini punch dialogue! The modifications enhance visual consistency and improve the way we present financial information across multiple components.

Changes

File Change Summary
src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.html - Capitalization updates to page titles and headers
- Replaced currency display with exactCurrency pipe
src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.scss - Color scheme adjustments
- Font size modifications
- Margin and layout refinements
src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.spec.ts - Added ExactCurrencyPipe and FyCurrencyPipe to testing setup
src/app/shared/components/expense-card-lite/expense-card-lite.component.* - HTML: Added dashed divider and restructured vendor/date display
- SCSS: Comprehensive styling updates with reduced font sizes and layout tweaks
- Spec: Added currency-related pipes to testing module

Possibly related PRs

Suggested Labels

size/M

Suggested Reviewers

  • arjunaj5
  • Chethan-Fyle
  • Dimple16

Poem

💸 Currencies dance with style so bright,
Pipes transform numbers, a Rajini delight!
Expenses aligned, no detail too small,
Code refactored, standing proud and tall!
Superstar coding - that's how we roll! 🚀

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


🪧 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.

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/M Medium PR label Dec 18, 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: 5

🔭 Outside diff range comments (1)
src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.scss (1)

Line range hint 139-145: Style like a superstar! But let's handle long text better

The purpose text needs better overflow handling for those extra-long descriptions!

  &--purpose {
    line-height: 23px;
    color: $black-2;
    font-size: 14px;
    font-weight: 500;
    max-width: 60%;
-    text-overflow: ellipsis;
-    overflow: hidden;
-    white-space: nowrap;
+    display: -webkit-box;
+    -webkit-line-clamp: 2;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0573c6 and fe29671.

📒 Files selected for processing (6)
  • src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.html (1 hunks)
  • src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.scss (4 hunks)
  • src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.spec.ts (3 hunks)
  • src/app/shared/components/expense-card-lite/expense-card-lite.component.html (2 hunks)
  • src/app/shared/components/expense-card-lite/expense-card-lite.component.scss (8 hunks)
  • src/app/shared/components/expense-card-lite/expense-card-lite.component.spec.ts (2 hunks)
🔇 Additional comments (4)
src/app/shared/components/expense-card-lite/expense-card-lite.component.html (1)

38-40: Superstar move using exactCurrency pipe! But verify the implementation

The currency formatting looks sharp as a knife, but we need to ensure the exactCurrency pipe is properly tested.

✅ Verification successful

Mind it! The exactCurrency pipe is tested like a boss!

Listen here, partner! I checked the codebase with the style of a superstar, and what did I find? The exactCurrency pipe is tested with the precision of a perfectly choreographed action sequence!

The test file at src/app/shared/pipes/exact-currency.pipe.spec.ts is packed with test cases that would make even a villain sweat:

  • Tests positive values with style ✨
  • Handles negative numbers like a hero 💪
  • Checks decimal places with surgical precision 🎯
  • Verifies currency symbol skipping with swagger 😎
  • Even tests large numbers that could make a calculator dizzy!

So, my friend, you can use this pipe with the confidence of a superstar making a grand entry! The code is tested, verified, and ready to rock and roll! flips sunglasses

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if exactCurrency pipe is properly tested
rg -l "exactCurrency" --type spec

Length of output: 182


Script:

#!/bin/bash
# Let's find all spec files first to ensure we're searching in the right place
fd "\.spec\." 

# Then let's search for exactCurrency in all files to understand its implementation
rg "exactCurrency" -A 5

Length of output: 32715

src/app/shared/components/expense-card-lite/expense-card-lite.component.scss (1)

101-101: 🧹 Nitpick (assertive)

Watch out! Font sizes might be too small for some users

Mind it! The font sizes have been reduced to 12px and 14px. Let's ensure they meet accessibility guidelines for readability.

Consider defining minimum font size variables in the theme to maintain consistency and accessibility across the app.

Also applies to: 111-111, 139-139

src/app/fyle/personal-cards-matched-expenses/personal-cards-matched-expenses.page.html (2)

13-13: Mind it! The text case changes are spot on, macha!

The shift from uppercase to title/sentence case makes the UI more friendly and readable:

  • "Transaction Details"
  • "Select a matching expense"
  • "In case there is no match"

Also applies to: 49-49, 59-59


23-44: Style ah? Currency display block is looking sharp!

The new currency block structure with exactCurrency pipe is clean and well-organized:

  • Proper separation of currency symbol, amount, and type (DR/CR)
  • Smart conditional styling for credit transactions
  • Excellent use of the new exactCurrency pipe for precise amount display

But remember one thing! Let's verify the exactCurrency pipe implementation:

✅ Verification successful

Mind it! The exactCurrency pipe is a blockbuster implementation, fully tested and ready to rock!

What a performance by this pipe, I tell you! The implementation is style-ah style:

  • Handles positive and negative numbers like a boss
  • Gives perfect control over currency symbol display
  • Fraction digits? No problem, machan!
  • Test coverage is mass - covering all scenarios from zero to negative lakhs!

The pipe is working exactly as shown in your template. You've used it perfectly for the transaction amount display. Simply superb!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the exactCurrency pipe is properly tested
rg -g "*.spec.ts" "exactCurrency"

# Verify the pipe's currency formatting logic
ast-grep --pattern 'class ExactCurrencyPipe {
  $$$
  transform($_) {
    $$$
  }
}'

Length of output: 1598


Script:

#!/bin/bash
# Let's check the exact implementation of the pipe, macha!
rg -g "*.ts" -A 15 "class ExactCurrencyPipe"

# And let's see what tests we're running, thalaiva!
cat src/app/shared/pipes/exact-currency.pipe.spec.ts

Length of output: 6721

Copy link

Unit Test Coverage % values
Statements 95.99% ( 19243 / 20046 )
Branches 91.11% ( 10654 / 11693 )
Functions 94.31% ( 5741 / 6087 )
Lines 96.03% ( 18374 / 19133 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Medium PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants