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

chore: Cleanup & Fixes from Display Exact Amount #3419

Merged
merged 2 commits into from
Jan 13, 2025
Merged

Conversation

SahilK-027
Copy link
Contributor

@SahilK-027 SahilK-027 commented Jan 13, 2025

Clickup

Clickup

UI Preview

Please add screenshots for UI changes

Screenshot 2025-01-13 at 11 12 19 AM Screenshot 2025-01-13 at 11 12 30 AM Screenshot 2025-01-13 at 11 19 33 AM Screenshot 2025-01-13 at 10 59 22 AM

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Simplified loading screen component by removing unnecessary configuration properties.
    • Removed conditional class bindings in loading screen and expenses card components.
  • Style Updates

    • Adjusted padding and dimensions of the loading screen component.
    • Modified vertical dotted border styling in the expenses card component based on selection mode.
  • Refactor

    • Streamlined loading screen rendering across multiple pages.
    • Removed deprecated loader configuration properties.

Copy link

coderabbitai bot commented Jan 13, 2025

Walkthrough

In a spectacular display of code optimization, the pull request removes the isNewLoaderEnabled property across multiple components, streamlining the loading screen implementation. The changes span various pages and components, focusing on simplifying the loading mechanism by eliminating an additional configuration flag. The modifications touch the my-advances, my-expenses, my-reports, and team-advance pages, along with the shared loading screen component.

Changes

File Change Summary
src/app/fyle/*/my-*.page.html Removed [isNewLoaderEnabled]="true" from loading screen components
src/app/shared/components/expenses-card-v2/expenses-card.component.html Added conditional class binding for vertical dotted border
src/app/shared/components/expenses-card-v2/expenses-card.component.scss Added new styles for vertical border positioning and margin
src/app/shared/components/fy-loading-screen/* Removed isNewLoaderEnabled related configurations and styles

Possibly related PRs

Suggested Reviewers

  • Dimple16

Poem

Behold, code warriors, a transformation grand! 🚀
Loading screens dance to a simpler command
Properties shed like a stylish disguise
Efficiency rising before your eyes! 💥
Rajinikanth of code strikes again today! 😎


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b9c6be2 and f4d5f89.

📒 Files selected for processing (1)
  • src/app/shared/components/fy-loading-screen/fy-loading-screen.component.spec.ts (1 hunks)
🔇 Additional comments (2)
src/app/shared/components/fy-loading-screen/fy-loading-screen.component.spec.ts (2)

Line range hint 1-48: Mind it! These tests are looking sharp!

The test structure is clean and comprehensive, covering all the essential scenarios. The organization of test cases is top-notch, macha!

Also applies to: 51-56, 58-60


50-50: Hey, what's this new size all about?

The column size expectations have changed significantly:

  • Selection mode enabled: from '4.68' to '6.0'
  • Selection mode disabled: from '6' to '7.0'

Let's verify if these new sizes match the component's template and styling, boss!

Also applies to: 57-57

✅ Verification successful

Mind-blowing revelation, boss! The column sizes are perfectly balanced, like a well-choreographed dance sequence! 🕺

The test expectations match exactly with what's written in the template, where the content block size is dynamically set to '6.0' when selection mode is enabled and '7.0' when disabled. All columns add up perfectly, maintaining the rhythm of the layout!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the column sizes in the component template

# Check the template file for size definitions
echo "Checking template file for column sizes..."
rg -A 5 'size=' src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html

# Check the component class for size-related logic
echo "Checking component class for size calculations..."
rg -A 5 'size' src/app/shared/components/fy-loading-screen/fy-loading-screen.component.ts

# Check the stylesheet for any size-related styles
echo "Checking stylesheet for size-related styles..."
rg -A 5 'width|flex' src/app/shared/components/fy-loading-screen/fy-loading-screen.component.scss

Length of output: 921


Script:

#!/bin/bash
# Search for ion-col elements and their configurations
echo "Checking for ion-col elements in template..."
rg -A 5 'ion-col' src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html

echo "Checking for size-related variables or constants..."
rg -A 5 '\bsize\b|\[size\]' src/app/shared/components/fy-loading-screen/

echo "Checking for any configuration files in the component directory..."
fd -e ts -e json . src/app/shared/components/fy-loading-screen/ --exec echo "=== {} ===" \; cat {} \;

Length of output: 6640

Finishing Touches

  • 📝 Generate Docstrings (Beta)

🪧 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 Jan 13, 2025
@SahilK-027 SahilK-027 self-assigned this Jan 13, 2025
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: 3

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e4dd85f and b9c6be2.

📒 Files selected for processing (9)
  • src/app/fyle/my-advances/my-advances.page.html (1 hunks)
  • src/app/fyle/my-expenses/my-expenses.page.html (0 hunks)
  • src/app/fyle/my-reports/my-reports.page.html (1 hunks)
  • src/app/fyle/team-advance/team-advance.page.html (1 hunks)
  • src/app/shared/components/expenses-card-v2/expenses-card.component.html (1 hunks)
  • src/app/shared/components/expenses-card-v2/expenses-card.component.scss (3 hunks)
  • src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html (1 hunks)
  • src/app/shared/components/fy-loading-screen/fy-loading-screen.component.scss (2 hunks)
  • src/app/shared/components/fy-loading-screen/fy-loading-screen.component.ts (0 hunks)
💤 Files with no reviewable changes (2)
  • src/app/shared/components/fy-loading-screen/fy-loading-screen.component.ts
  • src/app/fyle/my-expenses/my-expenses.page.html
🧰 Additional context used
📓 Learnings (3)
src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html (2)
Learnt from: SahilK-027
PR: fylein/fyle-mobile-app#3312
File: src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html:19-22
Timestamp: 2024-12-09T07:08:28.540Z
Learning: In `src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html`, the conditional size logic for `[attr.size]` will be removed after the new design changes are applied across the entire mobile app, so refactoring is unnecessary at this time.
Learnt from: SahilK-027
PR: fylein/fyle-mobile-app#3312
File: src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html:8-8
Timestamp: 2024-12-09T07:07:41.827Z
Learning: When implementing temporary fixes in the `fy-loading-screen` component, avoid adding constants for column sizes and keep the code straightforward.
src/app/shared/components/expenses-card-v2/expenses-card.component.scss (1)
Learnt from: SahilK-027
PR: fylein/fyle-mobile-app#3311
File: src/app/shared/components/expenses-card-v2/expenses-card.component.scss:115-118
Timestamp: 2024-12-09T06:28:38.240Z
Learning: Do not suggest adding smooth transitions to the `&--receipt-container` class in `expenses-card.component.scss`.
src/app/shared/components/fy-loading-screen/fy-loading-screen.component.scss (2)
Learnt from: SahilK-027
PR: fylein/fyle-mobile-app#3312
File: src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html:19-22
Timestamp: 2024-12-09T07:08:28.540Z
Learning: In `src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html`, the conditional size logic for `[attr.size]` will be removed after the new design changes are applied across the entire mobile app, so refactoring is unnecessary at this time.
Learnt from: SahilK-027
PR: fylein/fyle-mobile-app#3312
File: src/app/shared/components/fy-loading-screen/fy-loading-screen.component.html:8-8
Timestamp: 2024-12-09T07:07:41.827Z
Learning: When implementing temporary fixes in the `fy-loading-screen` component, avoid adding constants for column sizes and keep the code straightforward.
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (12.x)
🔇 Additional comments (6)
src/app/shared/components/fy-loading-screen/fy-loading-screen.component.scss (1)

4-4: Mind-blowing style optimization, but let's verify the impact!

The reduction in padding and icon dimensions creates a more compact loading screen. However, we should ensure these changes maintain visual consistency across different screen sizes.

Also applies to: 15-16

✅ Verification successful

Mind-blowing style changes, perfectly aligned with the design system, partner!

These dimensions are not just random numbers, they are part of a grand design symphony! The 12px padding and icon dimensions (72px height, 56px width) are used consistently across many components in the app, maintaining perfect visual harmony.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if these dimensions are used consistently across the app
rg -g '*.scss' -g '*.css' "72px|56px|12px" 

Length of output: 48263

src/app/fyle/team-advance/team-advance.page.html (1)

32-32: Simplicity is the ultimate sophistication, like my punch dialogues!

Clean removal of the redundant isNewLoaderEnabled property. The loading screen now depends solely on the isLoading condition, making the code more maintainable.

src/app/fyle/my-advances/my-advances.page.html (1)

39-39: When I do something, I do it with style! This cleanup is perfect!

Consistent with other pages, removing the redundant property makes the code cleaner and more maintainable.

src/app/shared/components/expenses-card-v2/expenses-card.component.scss (3)

39-42: Mind it! This style change is perfectly balanced!

The new shift class elegantly handles the dotted border positioning when selection mode is enabled. A masterful stroke of 96px to the left!


84-84: Style! What a style!

The 6px margin-left creates the perfect breathing space for the header content. Perfectly balanced, as all things should be!


110-110: When I do something, I do it with style!

The consistent 6px margin-left in the content maintains perfect visual rhythm with the header. That's what I call attention to detail!

Copy link

Unit Test Coverage % values
Statements 95.97% ( 19296 / 20106 )
Branches 91.11% ( 10660 / 11700 )
Functions 94.26% ( 5736 / 6085 )
Lines 96% ( 18422 / 19188 )

@SahilK-027 SahilK-027 merged commit 09a3422 into master Jan 13, 2025
10 checks passed
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.

3 participants