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

fixed:2527 Refactored CSS files in src/screens/UserPortal #3012

Conversation

gurramkarthiknetha
Copy link
Contributor

@gurramkarthiknetha gurramkarthiknetha commented Dec 28, 2024

What kind of change does this PR introduce?

Issue Number:

Fixes #2527

Did you add tests for your changes?
Yes

Snapshots/Videos:

If relevant, did you update the documentation?

Summary

The goal is to convert the CSS file in this subdirectory and all the components related to this screen to use this new design pattern.

Does this PR introduce a breaking change?
NO

Other information

Have you read the contributing guide?

Yes

Summary by CodeRabbit

  • Styling Consolidation

    • Centralized styling for multiple components by moving from individual module CSS files to a single app.module.css
    • Updated import paths and class names across various user portal screens
  • Removed CSS Modules

    • Deleted CSS module files for Campaigns, Chat, Donate, LeaveOrganization, Organizations, People, Pledges, Posts, Settings, UserScreen, and Volunteer Management
  • New Centralized Stylesheet

    • Created comprehensive app.module.css with new classes for different components
    • Added responsive design classes and UI element styles
    • Enhanced layout and styling for chat components, donation interfaces, and user settings

Copy link
Contributor

coderabbitai bot commented Dec 28, 2024

Walkthrough

This pull request focuses on refactoring CSS files in the UserPortal section of the Talawa Admin application. The primary objective is to consolidate multiple module-specific CSS files into a single global CSS file (src/style/app.module.css). Multiple component-specific CSS files in the UserPortal directory have been removed, and their styles have been merged into the global CSS file. The changes involve updating import statements in corresponding TypeScript components to reference the new global CSS module.

Changes

File Path Change Summary
src/screens/UserPortal/*/**.module.css Deleted multiple CSS module files including Campaigns, Chat, Donate, LeaveOrganization, Organizations, People, Pledges, Posts, Settings, UserScreen, and VolunteerManagement
src/screens/UserPortal/*/**.tsx Updated style import paths to ../../../style/app.module.css and adjusted corresponding class names
src/style/app.module.css Added numerous new classes from deleted module CSS files, expanding the global stylesheet

Assessment against linked issues

Objective Addressed Explanation
Merge CSS files into global file
Delete individual CSS module files
Reference global CSS file
Improve UI/UX for color-blind users Requires further accessibility testing

Possibly related issues

Possibly related PRs

Suggested labels

ignore-sensitive-files-pr

Suggested reviewers

  • palisadoes
  • AVtheking

Poem

🐰 Styles hopping from here to there,
CSS modules dancing without a care!
One file to rule them, global and bright,
Refactoring magic on this coding night!
Hop, hop, hurray for cleaner code! 🎨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 493fa7d and 9538340.

📒 Files selected for processing (1)
  • src/screens/UserPortal/People/People.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/screens/UserPortal/People/People.tsx

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.

Copy link

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

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: 1

🧹 Nitpick comments (3)
src/screens/UserPortal/People/People.tsx (3)

162-162: Ensure naming consistency for maintainability.
styles.mainContainerPeople is a clear naming choice; just verify that this naming convention is consistently applied throughout the refactor for better readability and maintainability.


166-166: Leverage consistent spacing and sizing.
The styles.maxWidthPeople class name is descriptive, but consider ensuring it aligns with typical sizing constraints elsewhere in the app for uniform UX (e.g., reusing universal utility classes if they exist).


208-208: Adopt consistent vertical spacing.
styles.contentPeople appears to govern vertical and horizontal padding. Be mindful of aligning this with the rest of the new design pattern to keep spacing uniform across components.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 81c66d9 and 7be686c.

📒 Files selected for processing (24)
  • src/components/UpdateSession/UpdateSession.spec.tsx (3 hunks)
  • src/screens/UserPortal/Campaigns/Campaigns.module.css (0 hunks)
  • src/screens/UserPortal/Campaigns/Campaigns.tsx (1 hunks)
  • src/screens/UserPortal/Campaigns/PledgeModal.tsx (1 hunks)
  • src/screens/UserPortal/Chat/Chat.module.css (0 hunks)
  • src/screens/UserPortal/Chat/Chat.tsx (2 hunks)
  • src/screens/UserPortal/Donate/Donate.module.css (0 hunks)
  • src/screens/UserPortal/Donate/Donate.tsx (3 hunks)
  • src/screens/UserPortal/LeaveOrganization/LeaveOrganization.module.css (0 hunks)
  • src/screens/UserPortal/Organizations/Organizations.module.css (0 hunks)
  • src/screens/UserPortal/Organizations/Organizations.tsx (3 hunks)
  • src/screens/UserPortal/People/People.module.css (0 hunks)
  • src/screens/UserPortal/People/People.tsx (3 hunks)
  • src/screens/UserPortal/Pledges/Pledges.module.css (0 hunks)
  • src/screens/UserPortal/Pledges/Pledges.tsx (2 hunks)
  • src/screens/UserPortal/Posts/Posts.module.css (0 hunks)
  • src/screens/UserPortal/Posts/Posts.tsx (2 hunks)
  • src/screens/UserPortal/Settings/Settings.module.css (0 hunks)
  • src/screens/UserPortal/Settings/Settings.tsx (2 hunks)
  • src/screens/UserPortal/UserScreen/UserScreen.module.css (0 hunks)
  • src/screens/UserPortal/UserScreen/UserScreen.tsx (1 hunks)
  • src/screens/UserPortal/Volunteer/Invitations/Invitations.tsx (1 hunks)
  • src/screens/UserPortal/Volunteer/VolunteerManagement.module.css (0 hunks)
  • src/style/app.module.css (1 hunks)
💤 Files with no reviewable changes (11)
  • src/screens/UserPortal/Organizations/Organizations.module.css
  • src/screens/UserPortal/LeaveOrganization/LeaveOrganization.module.css
  • src/screens/UserPortal/Volunteer/VolunteerManagement.module.css
  • src/screens/UserPortal/Settings/Settings.module.css
  • src/screens/UserPortal/UserScreen/UserScreen.module.css
  • src/screens/UserPortal/Campaigns/Campaigns.module.css
  • src/screens/UserPortal/Pledges/Pledges.module.css
  • src/screens/UserPortal/Chat/Chat.module.css
  • src/screens/UserPortal/People/People.module.css
  • src/screens/UserPortal/Posts/Posts.module.css
  • src/screens/UserPortal/Donate/Donate.module.css
✅ Files skipped from review due to trivial changes (6)
  • src/screens/UserPortal/Volunteer/Invitations/Invitations.tsx
  • src/screens/UserPortal/Campaigns/Campaigns.tsx
  • src/screens/UserPortal/UserScreen/UserScreen.tsx
  • src/screens/UserPortal/Organizations/Organizations.tsx
  • src/screens/UserPortal/Campaigns/PledgeModal.tsx
  • src/screens/UserPortal/Donate/Donate.tsx
🔇 Additional comments (15)
src/screens/UserPortal/Settings/Settings.tsx (2)

3-3: Verify the new global CSS import path.
Ensure that the path specified (../../../style/app.module.css) is correct and that all relevant styles (e.g., containerHeightSettings) exist in this file.


261-261: Confirm that containerHeightSettings is declared.
You've switched from containerHeight to containerHeightSettings. Ensure that this new CSS class is defined in app.module.css and verify that all references to containerHeight in dependent components (if any) have been properly updated.

src/screens/UserPortal/Chat/Chat.tsx (1)

10-10: Great move to a centralized style file.

Switching from a module-specific CSS import to a global CSS file is consistent with the PR’s refactoring objective. Validate that any styles previously used in Chat.module.css are either migrated or removed to avoid dead code.

✅ Verification successful

Styles successfully migrated from module to global CSS file

Based on the git diff output, I can see that the Chat.module.css file was removed and its styles were properly migrated to the centralized app.module.css file. The styles from the removed file are now part of the global stylesheet, maintaining consistency with the refactoring objective.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Checking for Chat.module.css references to verify it’s no longer in use.
rg "Chat\.module\.css"

Length of output: 253


Script:

#!/bin/bash
# Let's check if there was a Chat.module.css file that was removed
git diff HEAD~1 | grep -A 5 "Chat.module.css"

# Also check for any .css files in the Chat directory
fd -e css . src/screens/UserPortal/Chat

# Let's see the content of app.module.css to verify if styles were migrated
fd -g "app.module.css" . src/style --exec cat {}

Length of output: 66201

src/components/UpdateSession/UpdateSession.spec.tsx (3)

107-107: Consider reintroducing clientX for more accurate slider testing.

Commenting out clientX can weaken test accuracy, as the slider’s position may not be properly simulated. Keeping clientX (with an appropriately chosen value) ensures full coverage of min-value scenarios.


127-127: Consider reintroducing clientX for more accurate slider testing.

Commenting out clientX can weaken test accuracy, as the slider’s position may not be properly simulated. Keeping clientX (with an appropriately chosen value) ensures full coverage of max-value scenarios.


147-147: Consider adjusting the slider test logic for invalid values.

By commenting out clientX, it may be unclear whether the test truly confirms invalid scenario handling. Reintroduce or mock an appropriate clientX value to ensure robust coverage.

src/screens/UserPortal/Posts/Posts.tsx (3)

276-277: Renamed style classes to reflect component-specific usage
The introduction of containerHeightPosts and mainContainerPosts maintains clarity and consistency throughout the refactored code.


282-282: Refined width styling
Changing from maxWidth to maxWidthPosts is consistent with the new naming convention.


23-23: Switched import path to global app.module.css
This updated path aligns with the new centralized styling pattern.

You can run the following script to confirm there are no remaining references to Posts.module.css across the repository:

✅ Verification successful

Import path change to global app.module.css verified

The verification confirms:

  • No instances of Posts.module.css exist in the repository
  • The file correctly imports styles from the centralized src/style/app.module.css
  • This aligns with the project's pattern where component-specific styles are being consolidated into a global stylesheet
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verifies that all references to `Posts.module.css` have been removed
rg 'Posts\.module\.css'

Length of output: 25


Script:

#!/bin/bash
# Let's first check if Posts.module.css file exists anywhere in the repository
fd "Posts.module.css"

# Let's also check for any CSS imports in Posts.tsx to understand the styling pattern
rg "import.*\.css'" "src/screens/UserPortal/Posts/Posts.tsx"

# Let's check for other module.css files to verify the centralized styling pattern
fd "module.css"

Length of output: 5055

src/screens/UserPortal/People/People.tsx (2)

11-11: Good consolidation of styles.
Importing ../../../style/app.module.css instead of a local CSS module aligns with the wider design refactor and consolidates shared styles into a single reusable source.


210-210: Good approach for applying custom border radius.
Using a dedicated class like styles.topRadiusPeople makes it easy to manage design changes. This is consistent with the naming pattern used for People-specific styles.

src/screens/UserPortal/Pledges/Pledges.tsx (2)

3-3: Global style import aligns with the refactor goal.
This single import helps maintain a cohesive look and feel across components.


193-193: Custom table header style validated.
styles.tableHeaderPledges properly isolates Pledges-specific styling from more general or shared styles, improving clarity in the global CSS refactor.

src/style/app.module.css (2)

3677-3953: Large-scale style consolidation looks good, but verify usage.
You’ve introduced or updated a wide range of classes (e.g., .accordionSummary, .progress, .collapseSidebarButton). Ensure each newly introduced class is referenced correctly and unused classes are removed in the PR. This helps avoid confusion and maintain a lean, maintainable stylesheet.


3955-4601: Maintain consistent design tokens and structure.
Numerous additions like .mainContainerDonate, .content, and .chatContainer indicate a further push towards uniform naming conventions. Continue enforcing design tokens (e.g., color variables, spacing, border radius) to ensure global consistency. Additionally, confirm you are removing old or redundant class references in components so that the final CSS remains clean.

src/screens/UserPortal/Chat/Chat.tsx Outdated Show resolved Hide resolved
@palisadoes
Copy link
Contributor

  1. Merge your local branch with the latest upstream
  2. Commit and push to your origin
  3. It should fix some of the PR check failures
  4. We merged some recent updates that may have been after you initially submitted your PR

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: 3

🧹 Nitpick comments (3)
src/style/app.module.css (3)

3767-3783: Consider using CSS custom properties for color values

The accordion styles are well-structured, but the color values are hardcoded. Consider extracting these into CSS custom properties for better maintainability.

.accordionSummary button:hover {
-  background-color: #31bb6a50 !important;
-  color: #31bb6b !important;
+  background-color: var(--accordion-hover-bg, #31bb6a50) !important;
+  color: var(--accordion-hover-color, #31bb6b) !important;
}

3809-3817: Optimize animations for performance and compatibility

The expand/contract animations could benefit from:

  1. Hardware acceleration
  2. Vendor prefixes for better browser support
  3. Reduced properties to improve performance
.expand {
  padding-left: 4rem;
-  animation: moveLeft 0.9s ease-in-out;
+  transform: translateZ(0);
+  -webkit-animation: moveLeft 0.9s ease-in-out;
+  animation: moveLeft 0.9s ease-in-out;
+  will-change: padding-left;
}

.contract {
  padding-left: calc(300px);
-  animation: moveRight 0.5s ease-in-out;
+  transform: translateZ(0);
+  -webkit-animation: moveRight 0.5s ease-in-out;
+  animation: moveRight 0.5s ease-in-out;
+  will-change: padding-left;
}

Line range hint 1-4681: Consider splitting the CSS module into smaller, feature-specific files

This CSS module is quite large and handles styles for many different components. Consider:

  1. Splitting it into smaller, feature-specific modules (e.g., accordion.module.css, chat.module.css, etc.)
  2. Creating a separate file for CSS custom properties/variables
  3. Implementing a CSS architecture pattern like BEM or ITCSS

This will improve:

  • Code maintainability
  • Style isolation
  • Build performance (through better code splitting)
  • Team collaboration (reduced merge conflicts)
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7be686c and c1b0976.

📒 Files selected for processing (3)
  • src/screens/UserPortal/Campaigns/PledgeModal.tsx (3 hunks)
  • src/screens/UserPortal/Chat/Chat.tsx (2 hunks)
  • src/style/app.module.css (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/screens/UserPortal/Campaigns/PledgeModal.tsx
  • src/screens/UserPortal/Chat/Chat.tsx

src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css 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

🧹 Nitpick comments (5)
src/style/app.module.css (5)

3796-3799: Make progress bar width responsive

The progress bar has a fixed width which may cause layout issues on smaller screens. Consider using relative units.

.progress {
-  width: 100%;
-  max-width: 45rem;
+  width: 100%;
+  min-width: 0;
}

3820-3830: Improve sidebar button responsiveness

The collapse button has a fixed width that may not match the sidebar width on all screen sizes.

.collapseSidebarButton {
  position: fixed;
  height: 40px;
  bottom: 0;
  z-index: 9999;
-  width: 300px;
+  width: 100%;
+  max-width: 300px;
  background-color: rgba(245, 245, 245, 0.7);
  color: black;
  border: none;
  border-radius: 0px;
}

3842-3871: Improve chat container responsiveness and cross-browser compatibility

The chat container styles have several issues:

  1. Fixed width percentages may not work well on all screen sizes
  2. Scrollbar styles only target webkit browsers
.mainContainerChat {
  width: 100%;
  max-width: 800px;
  margin-left: 20px;
  flex-grow: 3;
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: row;
  border: 1px solid rgb(220, 220, 220);
  margin-top: 15px;
  border-radius: 24px;
  background-color: white;
}

.chatContainer {
  flex-grow: 6;
  display: flex;
  flex-direction: column;
  margin: 20px;
  border: 1px solid rgb(220, 220, 220);
  border-radius: 24px;
  overflow-y: scroll;
  margin-left: 0px;
+  /* Add Firefox scrollbar style */
+  scrollbar-width: none;
+  /* Add IE scrollbar style */
+  -ms-overflow-style: none;
  &::-webkit-scrollbar {
    display: none;
  }
}

4544-4565: Consolidate overlapping media queries

There are multiple overlapping media queries with similar breakpoints and duplicate rules. Consider consolidating them to reduce code duplication and improve maintainability.

- @media screen and (max-width: 1280px) {
-   /* ... */
- }
- @media (max-width: 1120px) {
-   /* ... */
- }
- @media (max-height: 650px) {
-   /* ... */
- }
+ @media screen and (max-width: 1280px) {
+   /* Common styles for all screens below 1280px */
+   @media (max-width: 1120px) {
+     /* Styles specific to 1120px and below */
+   }
+   @media (max-height: 650px) {
+     /* Height-specific styles */
+   }
+ }

Also applies to: 4649-4673


3767-3783: Improve maintainability and accessibility

Consider the following improvements:

  1. Use CSS variables for colors instead of hardcoded values
  2. Add reduced motion media query for animations
+ :root {
+   --accordion-hover-bg: #31bb6a50;
+   --accordion-hover-color: #31bb6b;
+ }

.accordionSummary button:hover {
-  background-color: #31bb6a50 !important;
-  color: #31bb6b !important;
+  background-color: var(--accordion-hover-bg) !important;
+  color: var(--accordion-hover-color) !important;
}

+ @media (prefers-reduced-motion: reduce) {
+   .expand {
+     animation: none;
+   }
+ }

Also applies to: 3810-3813

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c1b0976 and e1d6e7f.

📒 Files selected for processing (1)
  • src/style/app.module.css (1 hunks)

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: 1

🧹 Nitpick comments (3)
src/style/app.module.css (3)

4237-4269: Consolidate overlapping media queries for better maintainability

The file contains multiple overlapping media queries with similar breakpoints. Consider consolidating them to reduce code duplication and improve maintainability.

- @media (max-width: 1280px) {
-   .imgContianer {
-     margin: 1rem auto;
-   }
-   .profileContainer {
-     flex-direction: column;
-   }
- }
- @media (max-width: 1120px) {
-   .contract {
-     padding-left: calc(276px + 2rem + 1.5rem);
-   }
-   .collapseSidebarButton {
-     width: calc(250px + 2rem);
-   }
- }

+ @media (max-width: 1280px) {
+   /* Common styles for all screens below 1280px */
+   .imgContianer {
+     margin: 1rem auto;
+   }
+   .profileContainer {
+     flex-direction: column;
+   }
+   
+   @media (max-width: 1120px) {
+     /* Additional styles for screens below 1120px */
+     .contract {
+       padding-left: calc(276px + 2rem + 1.5rem);
+     }
+     .collapseSidebarButton {
+       width: calc(250px + 2rem);
+     }
+   }
+ }

Also applies to: 4808-4828, 4912-4936


4073-4081: Enhance animation accessibility and browser support

The animations lack proper vendor prefixes and reduced motion support for accessibility.

+ @media (prefers-reduced-motion: reduce) {
+   .expand,
+   .contract {
+     animation: none;
+   }
+ }

.expand {
  padding-left: 4rem;
-  animation: moveLeft 0.9s ease-in-out;
+  -webkit-animation: moveLeft 0.9s ease-in-out;
+          animation: moveLeft 0.9s ease-in-out;
}

.contract {
  padding-left: calc(300px);
-  animation: moveRight 0.5s ease-in-out;
+  -webkit-animation: moveRight 0.5s ease-in-out;
+          animation: moveRight 0.5s ease-in-out;
}

4286-4300: Use CSS variables for consistent theming

The filter button styles use hardcoded colors instead of the defined CSS variables.

.filterButton {
  border-radius: 14px;
  padding: 5px 10px;
-  background-color: white;
-  color: #a5a5a5;
+  background-color: var(--bs-white);
+  color: var(--bs-secondary);
  border: none;
-  border: 1px solid #a5a5a5;
+  border: 1px solid var(--bs-secondary);
}

.selectedBtn,
.filterButton:hover {
-  border: 1px solid #98e0b6;
-  background-color: #98e0b6;
-  color: rgb(255, 255, 255);
+  border: 1px solid var(--bs-primary);
+  background-color: var(--bs-primary);
+  color: var(--bs-white);
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e1d6e7f and 838f3cb.

📒 Files selected for processing (1)
  • src/style/app.module.css (1 hunks)
🔇 Additional comments (1)
src/style/app.module.css (1)

4105-4134: 🛠️ Refactor suggestion

Improve chat container responsiveness and cross-browser compatibility

The chat container styles have several issues:

  1. Fixed width percentages may not work well on all screen sizes
  2. Scrollbar styles only target webkit browsers
.mainContainerChat {
-  width: 100%;
+  width: 100%;
+  min-width: 320px;
  max-width: 800px;
  margin-left: 20px;
  flex-grow: 3;
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: row;
  border: 1px solid rgb(220, 220, 220);
  margin-top: 15px;
  border-radius: 24px;
  background-color: white;
}

.chatContainer {
  flex-grow: 6;
  display: flex;
  flex-direction: column;
  margin: 20px;
  border: 1px solid rgb(220, 220, 220);
  border-radius: 24px;
  overflow-y: scroll;
  margin-left: 0px;
-  scrollbar-width: none;
-  -ms-overflow-style: none;
-  &::-webkit-scrollbar {
-    display: none;
-  }
+  /* Cross-browser scrollbar hiding */
+  scrollbar-width: none; /* Firefox */
+  -ms-overflow-style: none; /* IE and Edge */
+  &::-webkit-scrollbar {
+    display: none; /* Chrome, Safari, Opera */
+  }
}

Likely invalid or redundant comment.

src/style/app.module.css 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: 1

🧹 Nitpick comments (2)
src/style/app.module.css (2)

4030-4046: Enhance accordion styles for better accessibility and user experience

Consider the following improvements:

  1. Use CSS variables instead of hardcoded colors
  2. Add focus states for keyboard navigation
  3. Include smooth transitions for hover effects
 .accordionSummary {
   width: 100% !important;
   padding-right: 0.75rem;
   display: flex;
   justify-content: space-between !important;
   align-items: center;
 }

 .accordionSummary button {
   height: 2.25rem;
   padding-top: 0.35rem;
+  transition: background-color 0.2s ease;
 }

 .accordionSummary button:hover {
-  background-color: #31bb6a50 !important;
-  color: #31bb6b !important;
+  background-color: var(--bs-primary-rgb, 49, 187, 107, 0.3) !important;
+  color: var(--bs-primary) !important;
 }

+.accordionSummary button:focus-visible {
+  outline: 2px solid var(--bs-primary);
+  outline-offset: 2px;
+}

4805-4826: Consolidate overlapping media queries

The file contains multiple media queries with similar breakpoints that could be consolidated to reduce code duplication and improve maintainability.

-@media screen and (max-width: 1280px) {
-  .imgContianer {
-    margin: 1rem auto;
-  }
-  .profileContainer {
-    flex-direction: column;
-  }
-  @media (min-width: 992px) {
-    .profileContainer {
-      align-items: center;
-      justify-content: center;
-    }
-  }
-}

+@media screen and (max-width: 1280px) {
+  .imgContianer {
+    margin: 1rem auto;
+  }
+  .profileContainer {
+    flex-direction: column;
+  }
+}

+@media screen and (min-width: 992px) and (max-width: 1280px) {
+  .profileContainer {
+    align-items: center;
+    justify-content: center;
+  }
+}

Also applies to: 4910-4934

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 838f3cb and 4380edd.

📒 Files selected for processing (1)
  • src/style/app.module.css (1 hunks)
🔇 Additional comments (1)
src/style/app.module.css (1)

4102-4131: 🛠️ Refactor suggestion

Improve chat container responsiveness and cross-browser compatibility

The chat container styles have several issues:

  1. Fixed width percentages may not work well on all screen sizes
  2. Scrollbar styles only target webkit browsers
  3. Hardcoded border colors should use CSS variables
 .mainContainerChat {
   width: 100%;
   max-width: 800px;
   margin-left: 20px;
   flex-grow: 3;
   max-height: 100%;
   overflow: auto;
   display: flex;
   flex-direction: row;
-  border: 1px solid rgb(220, 220, 220);
+  border: 1px solid var(--grey-border-box-color);
   margin-top: 15px;
   border-radius: 24px;
   background-color: white;
 }

 .chatContainer {
   flex-grow: 6;
   display: flex;
   flex-direction: column;
   margin: 20px;
-  border: 1px solid rgb(220, 220, 220);
+  border: 1px solid var(--grey-border-box-color);
   border-radius: 24px;
   overflow-y: scroll;
   margin-left: 0px;
+  /* Hide scrollbar for all browsers */
   scrollbar-width: none;
   -ms-overflow-style: none;
-  &::-webkit-scrollbar {
-    display: none;
-  }
+  scrollbar-gutter: stable;
 }

+.chatContainer::-webkit-scrollbar {
+  display: none;
+}

Likely invalid or redundant comment.

src/style/app.module.css Outdated Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 29, 2024
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

🧹 Nitpick comments (6)
src/style/app.module.css (6)

4023-4026: Consider consolidating duplicate input styles

There are multiple input style definitions throughout the file. Consider consolidating them into a single reusable class.

- .btnsContainer input {
-   outline: 1px solid var(--bs-gray-400);
-   background-color: white;
- }

+ /* Add to existing input styles */
+ .input-base {
+   outline: 1px solid var(--bs-gray-400);
+   background-color: white;
+ }

+ .btnsContainer input {
+   composes: input-base;
+ }

4028-4044: Use CSS variables for color values

Replace hardcoded color values with CSS variables to maintain consistency across the application.

- background-color: #31bb6a50 !important;
- color: #31bb6b !important;
+ background-color: var(--bs-primary-light) !important;
+ color: var(--bs-primary) !important;

4090-4119: Enhance cross-browser compatibility for chat container

The chat container has good layout but could benefit from improved cross-browser compatibility.

.chatContainer {
  flex-grow: 6;
  display: flex;
  flex-direction: column;
  margin: 20px;
  border: 1px solid rgb(220, 220, 220);
  border-radius: 24px;
  overflow-y: scroll;
  margin-left: 0px;
  scrollbar-width: none;
  -ms-overflow-style: none;
-  &::-webkit-scrollbar {
-    display: none;
-  }
+  /* Standardize scrollbar hiding across browsers */
+  scrollbar-width: none; /* Firefox */
+  -ms-overflow-style: none; /* IE and Edge */
+  &::-webkit-scrollbar {
+    display: none; /* Chrome, Safari, Opera */
+  }
+  /* Add fallback for older browsers */
+  @supports not (scrollbar-width: none) {
+    overflow: -moz-scrollbars-none;
+  }
}

4783-4804: Optimize and consolidate media queries

The media queries can be optimized to reduce code duplication and improve maintainability.

- @media screen and (max-width: 1280px) {
-   .imgContianer {
-     margin: 1rem auto;
-   }
-   .profileContainer {
-     flex-direction: column;
-   }
-   @media (min-width: 992px) {
-     .profileContainer {
-       align-items: center;
-       justify-content: center;
-     }
-   }
-   @media (max-width: 991px) {
-     .imgContianer {
-       margin: 1rem auto;
-     }
-     .profileContainer {
-       flex-direction: column;
-     }
-   }
- }

+ /* Consolidated media queries */
+ @media screen and (max-width: 1280px) {
+   .imgContianer {
+     margin: 1rem auto;
+   }
+   .profileContainer {
+     flex-direction: column;
+   }
+ }

+ @media screen and (min-width: 992px) and (max-width: 1280px) {
+   .profileContainer {
+     align-items: center;
+     justify-content: center;
+   }
+ }

4816-4860: Follow consistent naming conventions

Consider using more semantic class names and following a consistent naming convention (e.g., BEM).

- .profileContainer {
+ .profile-container {

- .profileText {
+ .profile-container__text {

- .primaryText {
+ .profile-container__text--primary {

- .secondaryText {
+ .profile-container__text--secondary {

4914-4917: Use CSS variables for consistent spacing and sizing

Replace hardcoded values with CSS variables for better maintainability.

.chip {
-  height: 1.5rem !important;
-  margin: 0.15rem 0 0 1.25rem;
+  height: var(--chip-height, 1.5rem) !important;
+  margin: var(--chip-margin-top, 0.15rem) 0 0 var(--chip-margin-left, 1.25rem);
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4380edd and 11d1ff1.

📒 Files selected for processing (1)
  • src/style/app.module.css (1 hunks)
🔇 Additional comments (2)
src/style/app.module.css (2)

4919-4920: 🛠️ Refactor suggestion

Consolidate progress styles

This progress style declaration should be consolidated with the earlier progress styles to avoid duplication.

- .progress {
-   display: flex;
- }

+ /* Combine with existing .progress styles at lines 4543-4547 */

Likely invalid or redundant comment.


4543-4557: 🛠️ Refactor suggestion

Remove duplicate progress bar declarations

There are multiple declarations of progress bar styles that can be consolidated.

- .progress {
-   display: flex;
-   width: 100%;
-   max-width: 45rem;
- }

- /* Consolidated styles */
- .progressBar {
-   margin: 0 0.75rem;
-   width: 100%;
-   font-size: 0.9rem;
-   height: 1.25rem;
-   transition: width 0.3s ease-in-out;
-   border-radius: 0.625rem;
- }

+ /* Single consolidated declaration */
+ .progress {
+   display: flex;
+   width: 100%;
+   max-width: 45rem;
+ }

+ .progressBar {
+   margin: 0 0.75rem;
+   width: 100%;
+   font-size: 0.9rem;
+   height: 1.25rem;
+   transition: width 0.3s ease-in-out;
+   border-radius: 0.625rem;
+ }

Likely invalid or redundant comment.

coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 29, 2024
@AVtheking
Copy link
Contributor

Please make sure you didn't duplicate the css which are being added to the app.module.css file

@gurramkarthiknetha
Copy link
Contributor Author

Please make sure you didn't duplicate the css which are being added to the app.module.css file

Thank you for pointing that out! I'll double-check to ensure there are no duplicate CSS styles being added to the app.module.css file. Let me know if you notice anything specific that needs adjustment.

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

🧹 Nitpick comments (6)
src/style/app.module.css (6)

4024-4027: Use CSS variable for background color.

For better maintainability and consistency, replace the hardcoded white background color with the CSS variable.

.btnsContainer input {
  outline: 1px solid var(--bs-gray-400);
-  background-color: white;
+  background-color: var(--bs-white);
}

4029-4045: Improve accordion styles maintainability.

Consider these improvements:

  1. Replace hardcoded colors with CSS variables
  2. Avoid using !important by increasing selector specificity
.accordionSummary button:hover {
-  background-color: #31bb6a50 !important;
-  color: #31bb6b !important;
+  background-color: var(--bs-primary-rgb, 49, 187, 107, 0.3);
+  color: var(--bs-primary);
}

4059-4067: Make padding values responsive.

Use relative units for better responsiveness across different screen sizes.

.expand {
-  padding-left: 4rem;
+  padding-left: clamp(2rem, 4vw, 4rem);
  animation: moveLeft 0.9s ease-in-out;
}

.contract {
-  padding-left: calc(300px);
+  padding-left: clamp(200px, 30vw, 300px);
  animation: moveRight 0.5s ease-in-out;
}

4106-4120: Improve cross-browser scrollbar handling.

Consolidate scrollbar styles into a reusable utility class for better maintainability.

+.hideScrollbar {
+  scrollbar-width: none;
+  -ms-overflow-style: none;
+  &::-webkit-scrollbar {
+    display: none;
+  }
+}

.chatContainer {
  flex-grow: 6;
  display: flex;
  flex-direction: column;
  margin: 20px;
  border: 1px solid rgb(220, 220, 220);
  border-radius: 24px;
  overflow-y: scroll;
  margin-left: 0px;
-  scrollbar-width: none;
-  -ms-overflow-style: none;
-  &::-webkit-scrollbar {
-    display: none;
-  }
+  @extend .hideScrollbar;
}

4266-4286: Enhance filter button styles for better maintainability and accessibility.

Consider these improvements:

  1. Use CSS variables for colors
  2. Add focus states for accessibility
  3. Add transition for smoother hover effects
.filterButton {
  border-radius: 14px;
  padding: 5px 10px;
-  background-color: white;
-  color: #a5a5a5;
+  background-color: var(--bs-white);
+  color: var(--bs-gray-600);
  border: none;
-  border: 1px solid #a5a5a5;
+  border: 1px solid var(--bs-gray-600);
+  transition: all 0.2s ease-in-out;
+  
+  &:focus-visible {
+    outline: 2px solid var(--bs-primary);
+    outline-offset: 2px;
+  }
}

.selectedBtn,
.filterButton:hover {
-  border: 1px solid #98e0b6;
-  background-color: #98e0b6;
-  color: rgb(255, 255, 255);
+  border: 1px solid var(--bs-primary-light);
+  background-color: var(--bs-primary-light);
+  color: var(--bs-white);
}

4440-4464: Consolidate border radius utility classes.

Consider using a more systematic approach to utility classes:

-/* Individual border radius classes */
-.borderRounded5 {
-  border-radius: 5px;
-}
-.borderRounded8 {
-  border-radius: 8px;
-}
-.borderRounded24 {
-  border-radius: 24px;
-}

+/* Systematic border radius scale */
+:root {
+  --radius-sm: 5px;
+  --radius-md: 8px;
+  --radius-lg: 24px;
+}
+
+.rounded {
+  &-sm { border-radius: var(--radius-sm); }
+  &-md { border-radius: var(--radius-md); }
+  &-lg { border-radius: var(--radius-lg); }
+  
+  &-top {
+    border-top-left-radius: var(--radius-lg);
+    border-top-right-radius: var(--radius-lg);
+  }
+  
+  &-bottom {
+    border-bottom-left-radius: var(--radius-lg);
+    border-bottom-right-radius: var(--radius-lg);
+  }
+}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 11d1ff1 and 350f221.

📒 Files selected for processing (1)
  • src/style/app.module.css (1 hunks)
🔇 Additional comments (1)
src/style/app.module.css (1)

4223-4255: Consolidate media queries and use CSS variables for breakpoints.

The previous review comment about consolidating overlapping media queries is still valid. Additionally:

  1. Define breakpoints as CSS variables
  2. Use mobile-first approach
  3. Group related media queries

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 1, 2025
Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

  1. Though you have completed the work. The use of green:
    1. is not in keeping with our new design system as explained previously
    2. with a variable name for grey is not in keeping with the spirit of our community. It is an unwelcome shortcut and is not appreciated.

src/style/app.module.css Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
@palisadoes
Copy link
Contributor

See comments. You can do better.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 1, 2025
Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0
  3. There are appropriate blue/grey colors that have been used in other screens
  4. Using variables named --grey-light to reference a color that is clearly green is not in keeping with our design system in the figma and PR above. It is also not in keeping with the spirit of our community.
  5. You deleted my previous review comment regarding this and made no change. You can do better.

image

src/style/app.module.css Outdated Show resolved Hide resolved
src/style/app.module.css Outdated Show resolved Hide resolved
@palisadoes
Copy link
Contributor

  1. We are migrating away from the green theme as part of our support for color blind users.
  2. Take cues from other similar elements in this file and the PR mentioned in the issue.
    1. Chore/css changes #2466
    2. https://www.figma.com/design/dmKt00m9GVSeA1nebnkxql/Untitled?node-id=0-1&node-type=canvas&t=TPzfh1DE9IxjzsEe-0
  3. There are appropriate blue/grey colors that have been used in other screens
  4. Using variables named --grey-light to reference a color that is clearly green is not in keeping with our design system in the figma and PR above. It is also not in keeping with the spirit of our community.
  5. You deleted my previous review comment regarding this and made no change. You can do better.

image

@palisadoes
Copy link
Contributor

Please make changes in keeping with our design pattern and my review comments

@gurramkarthiknetha
Copy link
Contributor Author

@palisadoes I’ve made changes to the app.module.css file. Please let me know if any further modifications are needed. Thank you!

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 2, 2025
Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once again, this is not correct.
--grey-light: #31bb6b1f;

@duplixx Please take a look at my previous comments before approvals

@palisadoes
Copy link
Contributor

Closing. I'm also going to unsign the issue because you have repeatedly not addressed my concerns in good faith

@palisadoes palisadoes closed this Jan 4, 2025
@palisadoes
Copy link
Contributor

Open another PR. This one is closed

@gurramkarthiknetha
Copy link
Contributor Author

Open another PR. This one is closed

The pull request (PR) has been closed, but automated commits are still being pushed to it. I’ll be taking over the issue from here. Could you please reassign the issue to me? I will create a new PR to continue the work and address any outstanding tasks.

@palisadoes
Copy link
Contributor

No.

You are using automation which explains why you were not addressing my concerns.

There were about a dozen commit attempts on the closed issue.

I have unassigned you from the issue. Someone else can give it a try.

Your actions in this PR are not in keeping with the spirit of the organization, its community and our desire to have a better product for all users especially the color blind

I repeatedly asked you to fix the colors to no avail most likely because of the automation. There is ample evidence of this in this PR.

@palisadoes
Copy link
Contributor

Open another PR. This one is closed

The pull request (PR) has been closed, but automated commits are still being pushed to it. I’ll be taking over the issue from here. Could you please reassign the issue to me? I will create a new PR to continue the work and address any outstanding tasks.

This is precisely why this PR was closed. The use of an automated PR generator and commit updater without any input from you.

It explains why you didn't make the suggested updates by me.

@gurramkarthiknetha
Copy link
Contributor Author

I apologize for not properly addressing the color accessibility issues you raised in the PR. The use of automated tools led to mistakes and caused me to miss your key feedback, especially regarding the needs of colorblind users. I understand why you unassigned me, and I respect that decision. Moving forward, I’ll make sure to be more careful and responsive to feedback.

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.

4 participants