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(native-app): minor UI fixes #15405

Merged
merged 9 commits into from
Jul 10, 2024
Merged

feat(native-app): minor UI fixes #15405

merged 9 commits into from
Jul 10, 2024

Conversation

thoreyjona
Copy link
Contributor

@thoreyjona thoreyjona commented Jul 1, 2024

What

Minor UI fixes in the app

  • Remove see all button from applications on applications screen
  • Update settings for notifications to include email settings as well
  • Fix centering of vehicle cards
  • Fix notification icon on android when red dot is present (was cropped)
  • Disabled electric car milage registration button when submitting
  • Fix typo on mileage screen
  • Add localization for app updates and errors on settings screen

Screenshots / Gifs

Change in settings:
Screenshot 2024-07-01 at 13 39 47

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Added new email and in-app notification settings in the Communication section.
    • Introduced a new prop hideSeeAllButton to control button visibility in Applications components.
    • Updated state management and UI for email notifications in Settings.
  • Bug Fixes

    • Improved the logic for disabling the submit button in Vehicle Mileage Screen when loading.
  • Style

    • Updated Vehicle Card text styling to use Typography component.
  • Refactor

    • Adjusted corner radius for icons in settings.
    • Removed unused logic for registering vehicle mileage.
    • Removed unnecessary imports in Vehicles component.

@thoreyjona thoreyjona requested a review from a team as a code owner July 1, 2024 16:25
Copy link
Contributor

coderabbitai bot commented Jul 1, 2024

Walkthrough

The recent updates primarily involve restructuring communication settings, particularly focusing on notification preferences for email and in-app alerts. Additionally, state management and asynchronous updates for email notifications have been introduced. UI adjustments in various components, including the replacement of text styling utilities and changes to button visibility and condition rendering, have also been made. Furthermore, minor updates include modifying properties such as cornerRadius and removing outdated logic.

Changes

File/Location Change Summary
apps/native/app/src/messages/en.ts, is.ts Restructured notification settings keys to reflect new email and in-app notification preferences.
apps/native/app/src/screens/applications/... Added hideSeeAllButton prop in ApplicationsScreen and ApplicationsModule.
apps/native/app/src/screens/settings/settings.tsx Introduced state management and asynchronous updates for email notifications.
apps/native/app/src/ui/lib/card/vehicle-card.tsx Replaced font utility with Typography component for styling text elements in VehicleCard.
apps/native/app/src/utils/get-main-root.ts Adjusted cornerRadius value from 8 to 4 in the iconBackground object within getRightButtons function.
apps/native/app/src/screens/vehicles/... Removed canRegisterMileage logic in VehicleItem, updated mileage submission logic in VehicleMileageScreen.
apps/native/app/src/screens/vehicles/vehicles.tsx Removed getRightButtons function import from utils/get-main-root.

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

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ac05f77 and 5f3900a.

Files selected for processing (7)
  • apps/native/app/src/messages/en.ts (1 hunks)
  • apps/native/app/src/messages/is.ts (1 hunks)
  • apps/native/app/src/screens/applications/applications.tsx (1 hunks)
  • apps/native/app/src/screens/home/applications-module.tsx (4 hunks)
  • apps/native/app/src/screens/settings/settings.tsx (4 hunks)
  • apps/native/app/src/ui/lib/card/vehicle-card.tsx (3 hunks)
  • apps/native/app/src/utils/get-main-root.ts (1 hunks)
Additional context used
Path-based instructions (7)
apps/native/app/src/ui/lib/card/vehicle-card.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/screens/home/applications-module.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/utils/get-main-root.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/screens/applications/applications.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/screens/settings/settings.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/messages/en.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/messages/is.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
Additional comments not posted (13)
apps/native/app/src/ui/lib/card/vehicle-card.tsx (5)

6-6: Good practice: Use of Typography for consistent text styling.

The import of Typography improves the consistency of text styling across the application.


31-31: Improvement: Consistent padding and margin for Title.

Using theme spacing for padding and margin ensures consistent spacing across the application.


36-36: Improvement: Consistent padding for Text.

Using theme spacing for padding ensures consistent spacing across the application.


44-46: Addition: Label styled component.

The introduction of the Label component adds flexibility for additional content and maintains consistent spacing with the theme.


59-63: Usage: Proper use of Typography component for Title and Text.

The use of Typography for Title and Text ensures consistent text styling.

apps/native/app/src/screens/home/applications-module.tsx (3)

27-27: Addition: hideSeeAllButton prop in ApplicationsModuleProps.

The new prop hideSeeAllButton allows control over the visibility of the "See All" button.


36-36: Default value: hideSeeAllButton set to false.

Setting a default value for hideSeeAllButton ensures backward compatibility.


82-82: Conditional rendering: "See All" button based on hideSeeAllButton prop.

The "See All" button is conditionally rendered based on the hideSeeAllButton prop, providing flexibility in UI.

apps/native/app/src/utils/get-main-root.ts (1)

19-19: Minor UI adjustment: cornerRadius value change.

The change in cornerRadius from 8 to 4 is a minor UI adjustment for the icon background.

apps/native/app/src/screens/applications/applications.tsx (1)

206-206: Usage: hideSeeAllButton prop set to true in ApplicationsModule.

The hideSeeAllButton prop is correctly set to true to hide the "See All" button in the ApplicationsModule.

apps/native/app/src/screens/settings/settings.tsx (1)

224-224: Ensure dependency array in useEffect hook is exhaustive.

The useEffect hook's dependency array should include all variables that are used within the effect. Ensure that userProfile.data is included to avoid potential stale data issues.

- }, [userProfile])
+ }, [userProfile.data])
apps/native/app/src/messages/en.ts (1)

80-86: LGTM! Ensure consistency across translations.

The new keys for email and in-app notifications are correctly formatted and contextually appropriate.

Verify that these changes are consistently reflected in other translation files.

apps/native/app/src/messages/is.ts (1)

79-86: LGTM! Ensure consistency across translations.

The new keys for email and in-app notifications are correctly formatted and contextually appropriate.

Verify that these changes are consistently reflected in other translation files.

apps/native/app/src/screens/settings/settings.tsx Outdated Show resolved Hide resolved
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 and nitpick comments (1)
apps/native/app/src/screens/vehicles/components/vehicle-item.tsx (1)

[!TIP]
Codebase Verification

Verify the impact of removing canRegisterMileage logic.

The canRegisterMileage logic is still present and actively used in the codebase. Here are some specific locations where it is used:

  • apps/native/app/src/screens/vehicles/vehicle-mileage.screen.tsx
  • libs/service-portal/assets/src/screens/VehicleMileage/VehicleMileage.tsx
  • libs/api/domains/vehicles/src/models/usersVehicles.model.ts
  • libs/api/domains/vehicles/src/models/getVehicleMileage.model.ts
  • libs/api/domains/vehicles/src/utils/basicVehicleInformationMapper.ts
  • libs/api/domains/vehicles/src/models/getVehicleDetail.model.ts
  • libs/api/domains/vehicles/src/models/getVehicleSearch.model.ts
  • libs/api/domains/vehicles/src/lib/api-domains-vehicles.service.ts
  • libs/api/domains/vehicles/src/lib/api-domains-vehicles-mileage.resolver.ts

Ensure that the removal of canRegisterMileage logic from the VehicleItem component does not affect the functionality in these areas.

Analysis chain

Line range hint 1-47: Verify the impact of removing canRegisterMileage logic.

The removal of the canRegisterMileage logic might affect the rendering logic of the VehicleItem component. Ensure that this logic is no longer needed and verify its impact on the codebase.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the impact of removing `canRegisterMileage` logic in the codebase.

# Test: Search for the usage of `canRegisterMileage` in the codebase. Expect: No remaining usage.
rg --type typescript $'canRegisterMileage'

Length of output: 76



Script:

#!/bin/bash
# Description: Verify the impact of removing `canRegisterMileage` logic in the codebase.

# Test: Search for the usage of `canRegisterMileage` in the codebase. Expect: No remaining usage.
ast-grep --lang ts --pattern 'canRegisterMileage'

Length of output: 49



Script:

#!/bin/bash
# Description: Verify the impact of removing `canRegisterMileage` logic in the codebase.

# Test: Search for the usage of `canRegisterMileage` in the codebase. Expect: No remaining usage.
rg 'canRegisterMileage' --glob '**/*.ts' --glob '**/*.tsx'

Length of output: 1915

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5f3900a and 7e1eeab.

Files selected for processing (4)
  • apps/native/app/src/messages/is.ts (2 hunks)
  • apps/native/app/src/screens/vehicles/components/vehicle-item.tsx (1 hunks)
  • apps/native/app/src/screens/vehicles/vehicle-mileage.screen.tsx (2 hunks)
  • apps/native/app/src/screens/vehicles/vehicles.tsx (1 hunks)
Files not reviewed due to errors (1)
  • apps/native/app/src/screens/vehicles/vehicle-mileage.screen.tsx (no review received)
Files skipped from review due to trivial changes (1)
  • apps/native/app/src/screens/vehicles/vehicles.tsx
Files skipped from review as they are similar to previous changes (1)
  • apps/native/app/src/messages/is.ts
Additional context used
Path-based instructions (2)
apps/native/app/src/screens/vehicles/components/vehicle-item.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/screens/vehicles/vehicle-mileage.screen.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
Biome
apps/native/app/src/screens/vehicles/vehicle-mileage.screen.tsx

[error] 138-147: This else clause can be omitted because previous branches break early.

Unsafe fix: Omit the else clause.

(lint/style/noUselessElse)

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7e1eeab and fbd4ece.

Files selected for processing (3)
  • apps/native/app/src/messages/en.ts (2 hunks)
  • apps/native/app/src/messages/is.ts (3 hunks)
  • apps/native/app/src/screens/settings/settings.tsx (6 hunks)
Files skipped from review as they are similar to previous changes (3)
  • apps/native/app/src/messages/en.ts
  • apps/native/app/src/messages/is.ts
  • apps/native/app/src/screens/settings/settings.tsx

@thoreyjona thoreyjona added the automerge Merge this PR as soon as all checks pass label Jul 10, 2024
@kodiakhq kodiakhq bot merged commit fb8a640 into main Jul 10, 2024
25 checks passed
@kodiakhq kodiakhq bot deleted the feat/app-minor-ui-fixes branch July 10, 2024 14:59
oskarjs pushed a commit that referenced this pull request Aug 20, 2024
* fix: update settings for notifications

* fix: remove see all button on applications page

* fix: no space below text on vehicle card if no label

* fix: no cropping of bell with red dot on android

* fix: disable car milage button while submitting

* fix: update vehicle milage copy

* fix: remove unused code

* fix: add translations for settings

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
@coderabbitai coderabbitai bot mentioned this pull request Oct 14, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants