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

564-refactor: Widget speakers #668

Merged
merged 13 commits into from
Dec 16, 2024
Merged

564-refactor: Widget speakers #668

merged 13 commits into from
Dec 16, 2024

Conversation

Quiddlee
Copy link
Member

@Quiddlee Quiddlee commented Nov 29, 2024

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

  • πŸ• Feature
  • πŸ› Bug Fix
  • 🚧 Breaking Change
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ“ Documentation Update

Description

Related Tickets & Documents

Screenshots, Recordings

Screenshot 2024-11-29 at 10 14 06β€―PM

Added/updated tests?

  • πŸ‘Œ Yes
  • πŸ™…β€β™‚οΈ No, because they aren't needed
  • πŸ™‹β€β™‚οΈ No, because I need help

[optional] Are there any post deployment tasks we need to perform?

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

image

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new constant for email (RS_EMAIL) to enhance contact functionality.
    • Added new styles for the speakers module, improving layout and responsiveness.
    • Updated the Speakers component with improved semantic HTML and styling practices.
  • Bug Fixes

    • Removed the deprecated EmailIcon component to streamline the codebase.
  • Tests

    • Updated test identifiers for improved clarity and consistency in the Speakers component tests.

@Quiddlee Quiddlee self-assigned this Nov 29, 2024
@github-actions github-actions bot changed the title Refactor/564 widget speakers 564-refactor: Widget speakers Nov 29, 2024
@Quiddlee Quiddlee added preview and removed preview labels Nov 29, 2024
Copy link

Lighthouse Report:

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

View detailed report

@Quiddlee Quiddlee requested a review from SpaNb4 December 6, 2024 21:05
Copy link

github-actions bot commented Dec 7, 2024

Lighthouse Report:

  • Performance: 73 / 100
  • Accessibility: 99 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@Quiddlee Quiddlee marked this pull request as ready for review December 7, 2024 11:26
@Quiddlee Quiddlee requested a review from andron13 as a code owner December 7, 2024 11:26
Copy link
Contributor

coderabbitai bot commented Dec 7, 2024

Warning

Rate limit exceeded

@Quiddlee has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 17 seconds before requesting another review.

βŒ› How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 5bc0b2c and 915f46d.

πŸ“’ Files selected for processing (3)
  • src/widgets/speakers/ui/speakers.module.scss (1 hunks)
  • src/widgets/speakers/ui/speakers.test.tsx (1 hunks)
  • src/widgets/speakers/ui/speakers.tsx (2 hunks)
πŸ“ Walkthrough
πŸ“ Walkthrough

Walkthrough

This pull request introduces several changes across multiple files. A new constant RS_EMAIL is added to src/shared/constants.ts. The EmailIcon component is removed from src/shared/icons/email.tsx, and its export is also removed from src/shared/icons/index.tsx. A new SCSS file for the speakers module is created, replacing the deleted speakers.scss. The Speakers component in src/widgets/speakers/ui/speakers.tsx is updated to use the new constant and improve semantic HTML. Additionally, the test file for the Speakers component is modified to reflect these changes.

Changes

File Path Change Summary
src/shared/constants.ts Added constant RS_EMAIL with value '[email protected]'.
src/shared/icons/email.tsx Deleted EmailIcon functional component.
src/shared/icons/index.tsx Removed export of EmailIcon from ./email.
src/widgets/speakers/ui/speakers.module.scss Introduced new SCSS file with styles for .speakers and nested classes.
src/widgets/speakers/ui/speakers.scss Deleted old SCSS file that contained styles for .speakers.
src/widgets/speakers/ui/speakers.test.tsx Updated import path for Speakers component and modified test identifiers.
src/widgets/speakers/ui/speakers.tsx Updated imports, replaced EmailIcon with LinkCustom, added RS_EMAIL, and improved structure.

Assessment against linked issues

Objective Addressed Explanation
Refactor speakers.tsx to replace divs with HTML5 tags (#564) βœ…
Rename image variable to something more meaningful (#564) βœ…
Add descriptive alt attribute for images (#564) βœ…
Encapsulate email inside shared constant (#564) βœ…
Replace EmailIcon with plain Image component (#564) βœ…

Possibly related PRs

Suggested reviewers

  • dzmitry-varabei
  • andron13
  • natanchik
  • SpaNb4
  • ansivgit

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
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)
src/widgets/speakers/ui/speakers.tsx (1)

40-44: Consider combining className props.

The className could be more concise.

-className={cx('right', 'picture')}
+className={cx('picture')}

Consider handling the 'right' positioning within the CSS module directly.

πŸ“œ Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between bc2e937 and 5bc0b2c.

πŸ“’ Files selected for processing (7)
  • src/shared/constants.ts (1 hunks)
  • src/shared/icons/email.tsx (0 hunks)
  • src/shared/icons/index.tsx (0 hunks)
  • src/widgets/speakers/ui/speakers.module.scss (1 hunks)
  • src/widgets/speakers/ui/speakers.scss (0 hunks)
  • src/widgets/speakers/ui/speakers.test.tsx (3 hunks)
  • src/widgets/speakers/ui/speakers.tsx (2 hunks)
πŸ’€ Files with no reviewable changes (3)
  • src/shared/icons/email.tsx
  • src/shared/icons/index.tsx
  • src/widgets/speakers/ui/speakers.scss
βœ… Files skipped from review due to trivial changes (2)
  • src/shared/constants.ts
  • src/widgets/speakers/ui/speakers.module.scss
πŸ”‡ Additional comments (6)
src/widgets/speakers/ui/speakers.test.tsx (3)

3-3: LGTM! Import path update looks good.


36-38: LGTM! Improved alt text for better accessibility.


23-23: Verify test ID consistency with the Subtitle component.

The test now uses 'subtitle' test ID instead of 'contact-name'.

βœ… Verification successful

Test ID 'subtitle' is correctly used in the Subtitle component

The Subtitle component consistently uses the test ID 'subtitle' in its implementation, matching the test's expectation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if Subtitle component consistently uses 'subtitle' as test ID
ast-grep --pattern 'const Subtitle = $$$' -A 10

Length of output: 869

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

1-13: LGTM! Clean import organization and proper CSS modules setup.


Line range hint 16-32: LGTM! Improved semantic HTML structure.

Good use of semantic tags (article) and components (Subtitle).


33-38: LGTM! Email implementation follows best practices.

Good implementation of the mailto link with proper semantic structure.

src/widgets/speakers/ui/speakers.test.tsx Outdated Show resolved Hide resolved
src/widgets/speakers/ui/speakers.test.tsx Outdated Show resolved Hide resolved
src/widgets/speakers/ui/speakers.module.scss Outdated Show resolved Hide resolved
src/widgets/speakers/ui/speakers.module.scss Outdated Show resolved Hide resolved
src/widgets/speakers/ui/speakers.module.scss Outdated Show resolved Hide resolved
@Quiddlee
Copy link
Member Author

run visual now

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Copy link

Lighthouse Report:

  • Performance: 74 / 100
  • Accessibility: 99 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@Quiddlee Quiddlee merged commit c01dbbd into main Dec 16, 2024
3 of 4 checks passed
@Quiddlee Quiddlee deleted the refactor/564-widget-speakers branch December 16, 2024 11:57
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 Speakers
5 participants