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

Website clean air Forum Updates #2467

Merged
merged 4 commits into from
Feb 14, 2025
Merged

Website clean air Forum Updates #2467

merged 4 commits into from
Feb 14, 2025

Conversation

OchiengPaul442
Copy link
Contributor

@OchiengPaul442 OchiengPaul442 commented Feb 14, 2025

Summary of Changes (What does this PR do?)

  • Fixed the styling issue on html insert sections

Status of maturity (all need to be checked before merging):

  • I've tested this locally
  • I consider this code done
  • This change ready to hit production in its current state

Screenshots (optional)

Summary by CodeRabbit

  • New Dependencies

    • Integrated a new Tailwind CSS typography utility to enhance text styling.
  • Style

    • Updated layouts and visual elements across various pages for improved readability.
    • Adjusted spacing, padding, and text formatting by replacing some flex-based structures with a unified prose style.
    • Added visual dividers to better separate content sections.
  • Refactor

    • Streamlined component structures and styling for a more consistent and engaging user experience.

Copy link

coderabbitai bot commented Feb 14, 2025

📝 Walkthrough

Walkthrough

This pull request introduces styling and configuration updates across multiple parts of the project. The package.json and Tailwind configuration now include the typography plugin, enabling enhanced text styling. Several page components across the clean-air-forum, Forum views, and event pages have updated container and child element class names, moving toward a consistent "prose max-w-none" layout alongside adjusted padding and spacing. The MemberCard component also received client-rendering hints and layout refinements. These modifications solely affect presentation without altering core functionality.

Changes

File(s) Change Summary
website2/package.json, website2/tailwind.config.ts Added @tailwindcss/typography dependency in package.json and integrated the typography plugin in Tailwind config.
website2/src/app/clean-air-forum/{glossary, logistics, partners, program-committee, resources, sessions, speakers, sponsorships}/page.tsx Updated container and child element class names to adopt a consistent "prose max-w-none" layout; added/remodeled padding and Divider components to enhance spacing and structure.
website2/src/views/Forum/{AboutPage, SectionDisplay, TabNavigation}.tsx Refined layout styling: added Divider components in AboutPage, streamlined content rendering in SectionDisplay, and replaced underline with no-underline in TabNavigation links.
website2/src/views/cleanairforum/{PaginatedSection.tsx, events/SingleEvent.tsx}, website2/src/views/events/SingleEvent.tsx Adjusted class names in event pages and paginated sections to improve responsiveness and remove fixed sizing constraints.
website2/src/components/ui/MemberCard.tsx Introduced the 'use client'; directive, updated the default button text to "Read Bio", and restructured layout elements for enhanced visual presentation.

Suggested reviewers

  • Baalmart
  • Codebmk

Poem

In the realm of code where styles align,
A sprinkle of prose makes every page shine.
New plugins and classes join the show,
Refining layouts with a designer’s glow.
With each commit, fresh vibes arise—
A visual symphony before our eyes!
🚀✨

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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 or @coderabbitai title anywhere in the PR title to generate the title automatically.

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

@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)
website2/src/views/cleanairforum/PaginatedSection.tsx (1)

67-67: Consider using responsive width for better mobile experience.

While the current styling works well, consider making the min-width responsive:

-className="object-contain w-full h-full max-h-[144px] min-w-[271px] p-3 max-w-[271px] mix-blend-multiply transition-transform duration-500 ease-in-out transform hover:scale-110"
+className="object-contain w-full h-full max-h-[144px] min-w-[200px] sm:min-w-[271px] p-3 max-w-[271px] mix-blend-multiply transition-transform duration-500 ease-in-out transform hover:scale-110"
website2/src/app/clean-air-forum/logistics/page.tsx (1)

50-52: Consider extracting HTML rendering logic into a reusable component.

Multiple instances of dangerouslySetInnerHTML with DOMPurify could be consolidated into a shared component for better maintainability and consistency.

+// components/SafeHTML.tsx
+import DOMPurify from 'dompurify';
+
+interface SafeHTMLProps {
+  content: string;
+  className?: string;
+}
+
+export const SafeHTML: React.FC<SafeHTMLProps> = ({ content, className }) => (
+  <div
+    className={className}
+    dangerouslySetInnerHTML={{
+      __html: DOMPurify.sanitize(content),
+    }}
+  />
+);

Also applies to: 72-74

🧰 Tools
🪛 Biome (1.9.4)

[error] 50-50: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)

website2/src/app/clean-air-forum/program-committee/page.tsx (1)

19-24: Consider adding type safety for person category filtering.

Using string literals for category filtering could lead to maintenance issues.

+type PersonCategory = 'Committee Member' | 'Committee Member and Key Note Speaker' | 'Speaker and Committee Member';
+
+interface Person {
+  id: string;
+  category: PersonCategory;
+  // ... other properties
+}
+
 const committeeMembers = useMemo(
   () =>
-    data?.persons?.filter(
-      (person: any) =>
+    data?.persons?.filter((person: Person) =>
         person.category === 'Committee Member' ||
         person.category === 'Committee Member and Key Note Speaker' ||
         person.category === 'Speaker and Committee Member',
     ) || [],
   [data?.persons],
 );
website2/src/app/clean-air-forum/glossary/page.tsx (1)

56-69: Enhance accessibility for external links.

Links opening in new tabs should indicate this behavior to users.

 <Link
   href={href}
   target="_blank"
+  rel="noopener noreferrer"
   onClick={(e) => {
     e.preventDefault();
     window.open(href, '_blank');
   }}
   className={`text-blue-600 hover:underline ${
     selectedEventIndex === index ? 'font-bold' : ''
   }`}
+  aria-label={`Open ${event.title} in new tab`}
 >
   {event.title}
 </Link>
website2/src/app/clean-air-forum/resources/page.tsx (1)

114-114: Consider adding responsive padding for better mobile experience.

While the prose class enhances typography, consider adding responsive padding classes for improved mobile readability.

-    <div className="px-4 prose max-w-none lg:px-0">
+    <div className="px-4 md:px-6 prose max-w-none lg:px-8">
website2/src/components/ui/MemberCard.tsx (1)

62-70: Enhance image loading with priority prop.

Consider adding the priority prop for above-the-fold images to improve LCP (Largest Contentful Paint).

 <Image
   src={member.picture_url || member.picture || PlaceholderImage}
   alt={member.name}
   fill
   sizes="(max-width: 640px) 100vw, 300px"
+  priority={true}
   className="object-cover transition-transform duration-300 ease-in-out hover:scale-105"
 />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e08c96b and 3af280c.

⛔ Files ignored due to path filters (1)
  • website2/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (17)
  • website2/package.json (1 hunks)
  • website2/src/app/clean-air-forum/glossary/page.tsx (3 hunks)
  • website2/src/app/clean-air-forum/logistics/page.tsx (2 hunks)
  • website2/src/app/clean-air-forum/partners/page.tsx (1 hunks)
  • website2/src/app/clean-air-forum/program-committee/page.tsx (1 hunks)
  • website2/src/app/clean-air-forum/resources/page.tsx (2 hunks)
  • website2/src/app/clean-air-forum/sessions/page.tsx (2 hunks)
  • website2/src/app/clean-air-forum/speakers/page.tsx (1 hunks)
  • website2/src/app/clean-air-forum/sponsorships/page.tsx (1 hunks)
  • website2/src/components/ui/MemberCard.tsx (5 hunks)
  • website2/src/views/Forum/AboutPage.tsx (4 hunks)
  • website2/src/views/Forum/SectionDisplay.tsx (1 hunks)
  • website2/src/views/Forum/TabNavigation.tsx (1 hunks)
  • website2/src/views/cleanairforum/PaginatedSection.tsx (1 hunks)
  • website2/src/views/cleanairforum/events/SingleEvent.tsx (1 hunks)
  • website2/src/views/events/SingleEvent.tsx (1 hunks)
  • website2/tailwind.config.ts (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • website2/src/views/events/SingleEvent.tsx
  • website2/src/views/Forum/TabNavigation.tsx
  • website2/src/app/clean-air-forum/speakers/page.tsx
  • website2/src/views/cleanairforum/events/SingleEvent.tsx
🧰 Additional context used
🪛 Biome (1.9.4)
website2/src/views/Forum/SectionDisplay.tsx

[error] 33-33: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)


[error] 60-60: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)


[error] 72-72: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)

website2/src/app/clean-air-forum/program-committee/page.tsx

[error] 72-72: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)

website2/src/components/ui/MemberCard.tsx

[error] 188-188: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)

website2/src/app/clean-air-forum/sponsorships/page.tsx

[error] 49-49: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-push-website2-deploy-preview
🔇 Additional comments (16)
website2/tailwind.config.ts (1)

80-80:

❓ Verification inconclusive

LGTM! Typography plugin addition looks good.

The addition of @tailwindcss/typography plugin aligns well with the styling updates needed for the HTML insert sections.

Let's verify that the plugin is properly installed:


🏁 Script executed:

#!/bin/bash
# Check if @tailwindcss/typography is installed
npm list @tailwindcss/typography

Length of output: 62


Below is an updated review comment that flags the need for further manual verification of the plugin’s installation:


Typography Plugin Installation Verification

The updated configuration for @tailwindcss/typography in website2/tailwind.config.ts looks great and works well with the HTML insert styling. However, the previous npm list @tailwindcss/typography check didn’t display any output, so it isn’t clear whether the package is properly installed.

  • Action Item: Please verify that @tailwindcss/typography is declared in your package.json (or package-lock.json) and properly installed as a dependency.
  • Use a command like the following to check for its entry:
    grep -E '"@tailwindcss/typography":' package.json
    grep -E '"@tailwindcss/typography":' package-lock.json

Once confirmed, the configuration can confidently be approved.

website2/src/views/Forum/SectionDisplay.tsx (2)

31-33: LGTM! Class name changes and comments look good.

The addition of prose max-w-none classes aligns with the typography plugin, and the comments clearly explain the styling decisions.

🧰 Tools
🪛 Biome (1.9.4)

[error] 33-33: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)


33-33:

❓ Verification inconclusive

Verify XSS protection measures.

While dangerouslySetInnerHTML is being used with DOMPurify.sanitize, let's ensure we're using the latest version with all security patches:

Also applies to: 60-60, 72-72


🌐 Web query:

What is the latest version of DOMPurify and are there any known security vulnerabilities?

💡 Result:

The latest version of DOMPurify is 3.2.4, released on January 30, 2025[1][6]. This version includes critical security fixes for bypass vulnerabilities and improvements to prevent XSS attacks[1].

Known Security Vulnerabilities:

  1. CVE-2024-45801 (Prototype Pollution)

    • Impact: Allows XSS attacks via malicious HTML nesting and prototype pollution to bypass depth checks[2][3].
    • Fixed in:
      • v2.x branch: 2.5.4
      • v3.x branch: 3.1.3[2][3].
  2. CVE-2020-26870 (Mutation XSS)

    • Impact: Serialize-parse roundtrip flaws enabling namespace changes (HTML → MathML) for XSS[8].
    • Fixed in: v2.0.17[8].

Key Updates in Recent Releases:

  • v3.x Branch:
    • Added TypeScript support (v3.2)[1].
    • Enhanced sanitizer bypass protections (v3.1–v3.2)[1][7].
  • v2.x Branch:
    • Backported critical fixes for older environments (e.g., IE support)[6].

Recommendations:

  • Upgrade to v3.x for modern environments or v2.x if legacy browser support is required[6].
  • Use npm install dompurify@latest or yarn add dompurify to ensure protection against known exploits[6][10].

For projects needing server-side sanitization, consider isomorphic-dompurify (latest: v2.20 as of January 2025)[4].

Citations:


XSS Protection: Confirm and Upgrade DOMPurify Version

Please verify that your project is using an up-to-date DOMPurify version. According to the latest information, DOMPurify v3.2.4 (released January 30, 2025) includes critical fixes—such as the mitigation for CVE-2024-45801—so ensure that your dependency is at least on v3.1.3 or, ideally, v3.2.4. This is particularly important given the use of dangerouslySetInnerHTML in this file (lines 33, 60, and 72 in website2/src/views/Forum/SectionDisplay.tsx).

🧰 Tools
🪛 Biome (1.9.4)

[error] 33-33: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)

website2/src/app/clean-air-forum/sponsorships/page.tsx (1)

41-41: LGTM! Improved structure and styling.

The changes enhance readability with better structure and consistent typography styling using the new plugin.

Also applies to: 44-54

website2/src/app/clean-air-forum/logistics/page.tsx (1)

34-35: LGTM! Styling update enhances readability.

The addition of prose max-w-none class improves text styling while maintaining full width layout.

website2/src/views/Forum/AboutPage.tsx (1)

58-58: LGTM! Consistent styling improvements.

The addition of max-w-none to prose classes maintains consistent styling across sections while preventing unwanted width constraints.

Also applies to: 73-73, 87-87

website2/src/app/clean-air-forum/program-committee/page.tsx (1)

63-63: LGTM! Styling update aligns with project standards.

The addition of prose max-w-none class maintains consistency with other pages.

website2/src/app/clean-air-forum/glossary/page.tsx (1)

39-39: LGTM! Styling update enhances readability.

The addition of prose max-w-none class improves text styling while maintaining layout flexibility.

website2/src/app/clean-air-forum/resources/page.tsx (1)

22-22: LGTM! Padding adjustment improves visual balance.

The change from p-4 to py-2 px-4 provides better vertical spacing while maintaining horizontal padding.

website2/src/app/clean-air-forum/sessions/page.tsx (2)

38-38: LGTM! Consistent styling with resources page.

The padding adjustments maintain visual consistency across the forum pages.


107-107: LGTM! Typography enhancement with proper sanitization.

The use of prose class enhances readability while maintaining proper HTML sanitization with DOMPurify.

website2/src/app/clean-air-forum/partners/page.tsx (1)

60-60: LGTM! Consistent styling with other forum pages.

The container styling maintains consistency while properly accommodating the partner logo grid layout.

website2/src/components/ui/MemberCard.tsx (2)

1-1: LGTM! Proper client-side rendering directive.

The 'use client' directive correctly marks this interactive component for client-side rendering.


188-190:

❓ Verification inconclusive

Verify HTML sanitization for bio content.

While renderContent processes the content, ensure proper sanitization before using dangerouslySetInnerHTML.


🏁 Script executed:

#!/bin/bash
# Search for sanitization in renderContent implementation
rg -A 5 "renderContent.*=.*" | grep -i "sanitize\|purify\|clean"

Length of output: 66


Action Required: Verify HTML Sanitization in renderContent

The code in website2/src/components/ui/MemberCard.tsx uses dangerouslySetInnerHTML to display the bio content provided by member.bio. Our initial automated search did not find any sanitization calls (e.g., to functions or libraries like sanitize, purify, or clean) within or near the renderContent implementation.

  • Next Step: Please manually verify that the renderContent function properly sanitizes the HTML before rendering. Check if it employs a robust sanitization mechanism (such as DOMPurify, sanitize-html, etc.) to mitigate XSS risks. If no sanitization is implemented, you should consider adding one.
🧰 Tools
🪛 Biome (1.9.4)

[error] 188-188: Avoid passing content using the dangerouslySetInnerHTML prop.

Setting content using code can expose users to cross-site scripting (XSS) attacks

(lint/security/noDangerouslySetInnerHtml)

website2/package.json (2)

26-26: LGTM! Good choice adding @tailwindcss/typography.

The addition of @tailwindcss/typography aligns well with the PR's objective to address styling issues in HTML insert sections. The typography plugin provides robust styling defaults that will help maintain consistent text presentation.


26-26:

✅ Verification successful

Verify Tailwind typography plugin configuration.

Please ensure the plugin is properly configured in your Tailwind config file.

Let's verify the plugin configuration:

Also, verify the latest version and any potential issues:


🏁 Script executed:

#!/bin/bash
# Check if the typography plugin is properly configured in the Tailwind config
rg -l "@tailwindcss/typography" website2/tailwind.config.*

Length of output: 87


🌐 Web query:

What is the latest version of @tailwindcss/typography and are there any known issues?

💡 Result:

The latest version of @tailwindcss/typography as of February 2025 is v0.5.x, designed for compatibility with Tailwind CSS v3.x[1][6]. Here's an overview of its features and known issues:


Key Features

  • Dark mode support via prose-invert for automatic color inversion[1]
  • Customizable gray scales matching Tailwind's default palettes (e.g., prose-slate, prose-gray)[1]
  • Improved customization API for typography elements like headings and blockquotes[1]

Known Issues

1. Font Size Customization Errors

Using theme('fontSize.base') directly in configuration can output [object Object] in CSS due to array-based theme values[6].
Workaround: Access specific array indices:

fontSize: theme('fontSize.base')[0]

2. Build Tool Integration Problems

  • Incorrect font paths when using local fonts with some build systems[2]
  • Font Manager conflicts in CMS integrations like Cwicly[3]

3. CSS Specificity Conflicts

  • Requires !important modifiers to override default styles in nested elements[10]
  • Text size overrides sometimes need inline styles instead of Tailwind classes[10]

4. Upgrade Challenges

  • Breaking changes when migrating between major Tailwind versions (v2 → v3 → v4)[4][7]
  • Deprecated utilities require manual replacement (e.g., gap utilities)[7]

The Tailwind team has acknowledged these pain points and plans to revamp the plugin's customization approach in future versions[10]. For now, developers often combine prose with not-prose classes for targeted overrides[1][10].

Citations:


Typography Plugin Configuration Verified

  • The typography plugin is indeed configured in website2/tailwind.config.ts.
  • The installed version (^0.5.16) aligns with the latest v0.5.x release compatible with Tailwind CSS v3.x.
  • No configuration issues or known version-related concerns were detected.

Copy link
Contributor

New Website2 changes available for preview here

@Baalmart Baalmart merged commit 33be02b into staging Feb 14, 2025
31 checks passed
@Baalmart Baalmart deleted the website-clean-air branch February 14, 2025 04:05
@Baalmart Baalmart mentioned this pull request Feb 14, 2025
1 task
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.

2 participants