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

499-refactor: Widget alumni #501

Merged
merged 13 commits into from
Sep 27, 2024
Merged

499-refactor: Widget alumni #501

merged 13 commits into from
Sep 27, 2024

Conversation

Wystov
Copy link
Collaborator

@Wystov Wystov commented Sep 6, 2024

What type of PR is this? (select all that apply)

  • πŸ§‘β€πŸ’» Code Refactor

Description

  • converted css to scss modules + classNames lib
  • changed flex to grid (it looked and behave like grid, so i decided that using grid here would be more straightforward and readable)
  • changed in component array length manipulations for different screen width to media queries in scss file.
  • removed unit tests related to deleted functionality and updated playwright tests

Related Tickets & Documents

Screenshots, Recordings

Please replace this line with any relevant images for UI changes.

Added/updated tests?

  • πŸ‘Œ Yes

[optional] What gif best describes this PR or how it makes you feel?

doc_2024-09-06_20-19-47

Summary by CodeRabbit

  • New Features

    • Introduced a responsive design for the alumni interface with new styling classes.
    • Added unit tests for the Alumni component to ensure correct rendering of key elements.
  • Bug Fixes

    • Removed unnecessary complexity from the Alumni component, ensuring it now displays the entire alumni list consistently.
  • Refactor

    • Updated styling approach to use CSS modules for better modularity and maintainability.
    • Enhanced type safety by simplifying type declarations for the alumni constant.

@Wystov Wystov self-assigned this Sep 6, 2024
Copy link
Collaborator

@Quiddlee Quiddlee left a comment

Choose a reason for hiding this comment

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

πŸ”₯πŸ”₯πŸ”₯

@Wystov Wystov marked this pull request as ready for review September 7, 2024 22:05
Copy link

coderabbitai bot commented Sep 7, 2024

πŸ“ Walkthrough
πŸ“ Walkthrough

Walkthrough

The changes in this pull request focus on refactoring the Alumni component, including updates to the constants.ts file to allow TypeScript to infer types for the alumni constant. SCSS styles have been migrated to CSS modules for improved modularity. The Alumni component has been simplified by removing the useWindowSize hook, ensuring consistent rendering of the entire alumni array. Additionally, unit tests have been added to verify the rendering of key elements within the component.

Changes

Files Change Summary
src/widgets/alumni/constants.ts Removed explicit typing from alumni, added as const assertion.
src/widgets/alumni/ui/alumni.module.scss Introduced new styles for responsive design with classes: .info-wrapper, .alumni, .logo-container, and .logo.
src/widgets/alumni/ui/alumni.test.tsx Added unit tests for the Alumni component to verify rendering of title and paragraph.
src/widgets/alumni/ui/alumni.tsx Removed useWindowSize hook, changed to CSS module import, updated JSX to use dynamic class names.

Assessment against linked issues

Objective Addressed Explanation
Refactor scss to scss modules (issue #499) βœ…
Delete AlumniProps type (issue #499) βœ…
Modify constants.ts to remove type annotation from alumni (issue #499) βœ…
Move unit test inside the ui folder (issue #499) βœ…
Move all magic numbers to constants in constants.ts (issue #499) ❌ No changes related to magic numbers were made.

Possibly related PRs


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

github-actions bot commented Sep 9, 2024

Lighthouse Report:

  • Performance: 86 / 100
  • Accessibility: 94 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

src/widgets/alumni/ui/alumni.module.scss Outdated Show resolved Hide resolved
src/widgets/alumni/ui/alumni.module.scss Outdated Show resolved Hide resolved
src/widgets/alumni/ui/alumni.module.scss Outdated Show resolved Hide resolved
src/widgets/alumni/ui/alumni.module.scss Outdated Show resolved Hide resolved
src/widgets/alumni/ui/alumni.test.tsx Show resolved Hide resolved
Copy link

Lighthouse Report:

  • Performance: 94 / 100
  • Accessibility: 98 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@SpaNb4
Copy link
Collaborator

SpaNb4 commented Sep 13, 2024

run visual now

Copy link

Lighthouse Report:

  • Performance: 83 / 100
  • Accessibility: 98 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@SpaNb4
Copy link
Collaborator

SpaNb4 commented Sep 19, 2024

run visual now

src/widgets/alumni/ui/alumni.tsx Outdated Show resolved Hide resolved
src/widgets/alumni/ui/alumni.tsx Outdated Show resolved Hide resolved
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

🧹 Outside diff range and nitpick comments (2)
src/widgets/alumni/ui/alumni.tsx (2)

11-14: Approved: Simplified Alumni component structure.

The removal of screen size-based rendering simplifies the component. Consider adding a comment explaining why all alumni are now rendered unconditionally.


Line range hint 11-29: Approved: Overall Alumni component refactoring.

The simplified structure and removal of unnecessary types improve the component. Consider updating the component's documentation to reflect these changes.

πŸ“œ Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

πŸ“₯ Commits

Files that changed from the base of the PR and between 82a1976 and 44b4e42.

πŸ“’ Files selected for processing (2)
  • src/widgets/alumni/ui/alumni.module.scss (1 hunks)
  • src/widgets/alumni/ui/alumni.tsx (1 hunks)
πŸ”‡ Additional comments (4)
src/widgets/alumni/ui/alumni.module.scss (1)

12-19: LGTM: Alumni list layout.

The grid layout for the alumni list is well-structured with appropriate spacing and alignment.

src/widgets/alumni/ui/alumni.tsx (3)

1-9: Approved: CSS module and classNames setup.

The transition to CSS modules and use of classNames utility aligns with the refactoring objectives.


16-19: Verify styling for Paragraph component.

The removal of the specific class name aligns with the refactoring goals. Please ensure the styling remains correct.


20-23: Approved: Simplified alumni list rendering.

The use of CSS modules and simplified rendering logic improves code clarity.

src/widgets/alumni/ui/alumni.module.scss Show resolved Hide resolved
src/widgets/alumni/ui/alumni.module.scss Show resolved Hide resolved
src/widgets/alumni/ui/alumni.module.scss Show resolved Hide resolved
Copy link

Lighthouse Report:

  • Performance: 88 / 100
  • Accessibility: 100 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@Quiddlee Quiddlee merged commit bcef1a6 into main Sep 27, 2024
4 checks passed
@Quiddlee Quiddlee deleted the refactor/499-widget-alumni branch September 27, 2024 12:03
@coderabbitai coderabbitai bot mentioned this pull request Oct 5, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FSD: Widget Alumni
5 participants