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

refactor: misalignment in the filter field of tools section #3645

Conversation

Bharath-dev05
Copy link
Contributor

@Bharath-dev05 Bharath-dev05 commented Feb 3, 2025

Description

refactoring the filter field (commercial $) which is misaligned in the tools section.

Before
Screenshot (76)

After fixing.
Screenshot (82)

Related issue(s)

fixes #3644

Summary by CodeRabbit

  • Style
    • Enhanced spacing and alignment for filter options, ensuring clearer visual separation for both "Open Source" and "Commercial" items.

refactoring the filter field ( commercial $ ) which is misaligned in the tools section.
Copy link
Contributor

coderabbitai bot commented Feb 3, 2025

Walkthrough

The pull request updates the Filters.tsx component by refining the presentation of the "Open Source" and "Commercial" filter options. The changes involve adding specific margin classes to text and image elements to address misalignment issues. Additionally, the conditional rendering structure for the "Commercial" option has been slightly adjusted by relocating a closing tag.

Changes

Files Change Summary
components/.../Filters.tsx Added margin classes to improve spacing for "Open Source" (mt-2.5 for label, mt-3 for image) and "Commercial" options (mt-4 for label, multiple margin classes for image). Adjusted closing tag placement for proper conditional rendering.

Assessment against linked issues

Objective Addressed Explanation
Fix misalignment in filter field of tools section [#3644]

Suggested labels

ready-to-merge

Suggested reviewers

  • derberg
  • akshatnema
  • magicmatatjahu
  • sambhavgupta0705
  • devilkiller-ag
  • Mayaleeeee
  • asyncapi-bot-eve
  • anshgoyalevil

Poem

I'm a little rabbit, hopping through the code,
Delighting in margins that now smoothly unfold.
Labels and images align in playful dance,
As every component gets a second glance.
With a twitch of my nose, I cheer this change today!
🐇✨


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

netlify bot commented Feb 3, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1ff8975
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67a0e7461c96d20008260f0c
😎 Deploy Preview https://deploy-preview-3645--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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 (2)
components/tools/Filters.tsx (2)

142-143: Enhanced Margin Classes for "Open Source" Filter

The updated margin classes (mt-2.5 for the text and mt-3 for the image) should help correct the misalignment of the "Open Source" option. Please verify that the Tailwind CSS class order meets your project’s conventions, as static analysis hints suggest a potential reordering.

🧰 Tools
🪛 GitHub Actions: PR testing - if Node project

[warning] 142-142: Invalid Tailwind CSS classnames order tailwindcss/classnames-order


[warning] 143-143: Invalid Tailwind CSS classnames order tailwindcss/classnames-order


145-150: Improved Alignment & Formatting for "Commercial" Filter

The "Commercial" filter changes introduce a mt-4 margin for the label and adjust the image’s margin classes to pr-6 md:pr-5 lg:pr-8 mt-2 ml-1 mb-1 to fix the misalignment issue. However, static analysis and pipeline logs indicate a few formatting issues:

  • Prettier Formatting:
    • A newline should be inserted after the opening tag (line 145).
    • The image element (line 149) should be reformatted into a multi-line structure to conform with prettier standards.
    • Any extraneous spaces (line 150) should be removed.
  • Tailwind CSS Class Order:
    Review the order of the class names if your project's linting rules require a specific order.

Consider applying the following diff to address these issues:

-<div className={`flex cursor-pointer gap-1 rounded-md border bg-gray-200 px-4 py-2 hover:border-secondary-500 hover:bg-secondary-100 ${checkPaid === 'paid' ? 'border-secondary-500 bg-secondary-100' : ''}`}
-  onClick={() => (checkPaid === 'paid' ? setCheckPaid('all') : setCheckPaid('paid'))}
->
-  <div className='text-sm mt-4'>Commercial</div>
-  <img className='pr-6 md:pr-5 lg:pr-8 mt-2 ml-1 mb-1' src='/img/illustrations/icons/PaidIcon.svg' alt='Paid' />
-  </div>
+<div
+  className={`flex cursor-pointer gap-1 rounded-md border bg-gray-200 px-4 py-2 hover:border-secondary-500 hover:bg-secondary-100 ${
+    checkPaid === 'paid' ? 'border-secondary-500 bg-secondary-100' : ''
+  }`}
+  onClick={() => (checkPaid === 'paid' ? setCheckPaid('all') : setCheckPaid('paid'))}
+>
+  <div className="mt-4 text-sm">Commercial</div>
+  <img
+    className="pr-6 md:pr-5 lg:pr-8 mt-2 ml-1 mb-1"
+    src="/img/illustrations/icons/PaidIcon.svg"
+    alt="Paid"
+  />
+</div>

This updated diff reformats the div structure and the image element to satisfy prettier and Tailwind CSS linting requirements while preserving the intended visual improvement.

🧰 Tools
🪛 ESLint

[error] 145-145: Insert ⏎·············

(prettier/prettier)


[error] 149-149: Replace <img·className='pr-6·md:pr-5·lg:pr-8·mt-2·ml-1·mb-1'·src='/img/illustrations/icons/PaidIcon.svg'·alt='Paid' with ··<img⏎················className='pr-6·md:pr-5·lg:pr-8·mt-2·ml-1·mb-1'⏎················src='/img/illustrations/icons/PaidIcon.svg'⏎················alt='Paid'⏎·············

(prettier/prettier)


[error] 150-150: Delete ··

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project

[error] 145-145: Insert ⏎············· prettier/prettier


[warning] 148-148: Invalid Tailwind CSS classnames order tailwindcss/classnames-order


[error] 149-149: Replace <img·className='pr-6·md:pr-5·lg:pr-8·mt-2·ml-1·mb-1'·src='/img/illustrations/icons/PaidIcon.svg'·alt='Paid' with ··<img⏎················className='pr-6·md:pr-5·lg:pr-8·mt-2·ml-1·mb-1'⏎················src='/img/illustrations/icons/PaidIcon.svg'⏎················alt='Paid'⏎············· prettier/prettier


[warning] 149-149: Invalid Tailwind CSS classnames order tailwindcss/classnames-order


[error] 150-150: Delete ·· prettier/prettier

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 326082b and 1ff8975.

📒 Files selected for processing (1)
  • components/tools/Filters.tsx (1 hunks)
🧰 Additional context used
🪛 ESLint
components/tools/Filters.tsx

[error] 145-145: Insert ⏎·············

(prettier/prettier)


[error] 149-149: Replace <img·className='pr-6·md:pr-5·lg:pr-8·mt-2·ml-1·mb-1'·src='/img/illustrations/icons/PaidIcon.svg'·alt='Paid' with ··<img⏎················className='pr-6·md:pr-5·lg:pr-8·mt-2·ml-1·mb-1'⏎················src='/img/illustrations/icons/PaidIcon.svg'⏎················alt='Paid'⏎·············

(prettier/prettier)


[error] 150-150: Delete ··

(prettier/prettier)

🪛 GitHub Actions: PR testing - if Node project
components/tools/Filters.tsx

[warning] 142-142: Invalid Tailwind CSS classnames order tailwindcss/classnames-order


[warning] 143-143: Invalid Tailwind CSS classnames order tailwindcss/classnames-order


[error] 145-145: Insert ⏎············· prettier/prettier


[warning] 148-148: Invalid Tailwind CSS classnames order tailwindcss/classnames-order


[error] 149-149: Replace <img·className='pr-6·md:pr-5·lg:pr-8·mt-2·ml-1·mb-1'·src='/img/illustrations/icons/PaidIcon.svg'·alt='Paid' with ··<img⏎················className='pr-6·md:pr-5·lg:pr-8·mt-2·ml-1·mb-1'⏎················src='/img/illustrations/icons/PaidIcon.svg'⏎················alt='Paid'⏎············· prettier/prettier


[warning] 149-149: Invalid Tailwind CSS classnames order tailwindcss/classnames-order


[error] 150-150: Delete ·· prettier/prettier

⏰ Context from checks skipped due to timeout of 180000ms (1)
  • GitHub Check: Lighthouse CI

@anshgoyalevil
Copy link
Member

Not relevant. Closing.
Please read contributing guidelines

@Bharath-dev05 Bharath-dev05 deleted the misalignment-in-the-filter-of-tools-section branch February 5, 2025 10:43
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.

[Docs Bug 🐞 report]: misalignment in filter field of tools section
2 participants