Skip to content

Conversation

@Priyank0703
Copy link

@Priyank0703 Priyank0703 commented Jul 28, 2025

fix: #4065

Description

  • Case Studies page table is now mobile responsive

fix: #4065

Summary by CodeRabbit

  • Style

    • Updated JSX attribute values and class names to use double quotes for consistency.
    • Improved formatting and indentation for better readability.
    • Enhanced table styling with additional CSS classes and flexbox centering.
  • Accessibility

    • Updated resource links to open in new tabs securely with appropriate attributes.
  • Documentation

    • Updated a documentation URL in a code comment for accuracy.

@netlify
Copy link

netlify bot commented Jul 28, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e94e0d5
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/68879bd02c9c4100076c5445
😎 Deploy Preview https://deploy-preview-4283--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 project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Walkthrough

This update modifies the Case Studies page to improve table styling and accessibility, including attribute formatting, class updates, and removal of deprecated HTML. Additionally, a documentation comment URL is updated in a TypeScript environment file. No functional or logic changes are introduced.

Changes

Cohort / File(s) Change Summary
Case Studies Page Styling & Accessibility
pages/casestudies/index.tsx
Reformatted JSX for consistent double quotes, improved table styling and accessibility, updated class names, removed <center>, added secure anchor attributes, and enhanced mobile/table alignment.
Documentation Comment Update
next-env.d.ts
Updated the URL in a comment referencing Next.js TypeScript documentation. No code or type changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Assessment against linked issues

Objective Addressed Explanation
Make Case Studies page table mobile responsive (#4065) No code for responsive behavior (e.g., media queries, responsive wrappers, or table-to-list transformation) is present. Only styling and accessibility improvements are made.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Update of documentation comment URL (next-env.d.ts) This change is unrelated to the Case Studies page or mobile responsiveness.

Suggested labels

ready-to-merge

Suggested reviewers

  • derberg
  • akshatnema
  • Mayaleeeee
  • anshgoyalevil
  • sambhavgupta0705

Poem

A rabbit hopped through code today,
Tidying tables in a neat array.
With quotes aligned and links anew,
The docs got a fresh review!
Though mobile dreams remain unmet,
This bunny’s work is not done yet.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this 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.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Jul 28, 2025

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 37
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-4283--asyncapi-website.netlify.app/

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

🧹 Nitpick comments (2)
pages/casestudies/index.tsx (2)

110-113: Hard-coded min-w-[600px] still forces horizontal scroll on narrow phones

The new container adds overflow-x-auto, but the table itself is fixed at a minimum width of 600 px.
On devices ≤360 px this still overflows and requires scrolling.

Consider a fully responsive pattern—e.g. convert the table into stacked cards under md breakpoint or remove the rigid min-w:

-<table className="my-8 min-w-[600px] w-full border-collapse border">
+<table className="my-8 w-full border-collapse border md:min-w-[600px]">

(or use CSS grid / flexbox representation for small screens).


115-120: Add semantic scope for table headers

To improve accessibility for screen-reader users, add scope="col" on each <th>:

-<th className='border p-2 font-bold text-left'>Company name</th>
+<th scope="col" className='border p-2 font-bold text-left'>Company name</th>

Repeat for the other two headers.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dc8ec1a and e94e0d5.

📒 Files selected for processing (2)
  • next-env.d.ts (1 hunks)
  • pages/casestudies/index.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: asyncapi-bot
PR: asyncapi/website#0
File: :0-0
Timestamp: 2025-02-18T12:07:42.211Z
Learning: The following PR commands are supported in the asyncapi/website repository:
- `/please-take-a-look` or `/ptal`: Requests attention from reviewers who haven't reviewed the PR
- `/ready-to-merge` or `/rtm`: Triggers automerge when all conditions are met
- `/do-not-merge` or `/dnm`: Blocks automerge even if all conditions are met
- `/autoupdate` or `/au`: Adds autoupdate label to keep PR in sync with target branch
- `/update` or `/u`: One-time update of PR with latest changes from target branch
next-env.d.ts (5)

Learnt from: anshgoyalevil
PR: #3950
File: scripts/utils/check-locales.ts:122-129
Timestamp: 2025-04-20T16:05:16.482Z
Learning: In the AsyncAPI website project, Next.js throws errors at runtime when locale files are missing, making additional validation for missing files unnecessary in the check-locales script.

Learnt from: akshatnema
PR: #3423
File: tests/index.test.js:2-7
Timestamp: 2025-01-18T08:44:43.614Z
Learning: In the AsyncAPI website project, JavaScript test files must include the .ts extension when importing TypeScript files (e.g., require('../scripts/build-rss.ts')). This is enforced by the project's configuration which uses moduleResolution: "bundler" in tsconfig.json and TypeScript-aware ESLint plugins. The .ts extensions are required even though the files are imported using CommonJS require statements.

Learnt from: akshatnema
PR: #3423
File: tests/index.test.js:2-7
Timestamp: 2025-01-18T08:44:43.614Z
Learning: In the AsyncAPI website project, JavaScript test files must include the .ts extension when importing TypeScript files (e.g., require('../scripts/build-rss.ts')). This is a project-specific requirement enforced by the linting rules and build setup, even though it differs from typical Node.js behavior.

Learnt from: anshgoyalevil
PR: #3557
File: tests/fixtures/markdown/check-edit-links-data.js:3-11
Timestamp: 2025-01-19T04:51:41.255Z
Learning: In the AsyncAPI website repository, the test data in tests/fixtures/markdown/check-edit-links-data.js intentionally includes inconsistent paths (with and without 'docs' prefix) to verify the script's ability to normalize and handle ambiguous path structures.

Learnt from: akshatnema
PR: #3423
File: tests/index.test.js:2-7
Timestamp: 2025-01-18T08:44:43.614Z
Learning: In JavaScript test files within the AsyncAPI website project, TypeScript file imports must include the .ts extension to avoid lint errors, even though the files being imported are JavaScript files.

pages/casestudies/index.tsx (3)

Learnt from: akshatnema
PR: #3262
File: components/Avatar.tsx:35-44
Timestamp: 2024-10-11T10:46:58.882Z
Learning: In Next.js, when avoiding nested <a> tags due to hydration issues, use accessible non-link elements like <button> or <span> with appropriate roles, tabIndex, and event handlers to maintain accessibility and SEO.

Learnt from: akshatnema
PR: #3262
File: components/newsroom/FeaturedBlogPost.tsx:90-92
Timestamp: 2024-10-11T07:38:35.745Z
Learning: In Next.js, nested <a> tags cause hydration issues due to invalid HTML. To fix this, avoid nesting <a> tags by replacing inner <a> tags with non-interactive elements like <span>, and use click handlers to maintain interactivity if needed.

Learnt from: akshatnema
PR: #3262
File: components/navigation/BlogPostItem.tsx:95-119
Timestamp: 2024-10-11T11:32:30.226Z
Learning: In the BlogPostItem component (components/navigation/BlogPostItem.tsx), nesting <a> tags inside the parent Link component leads to hydration issues; therefore, we should avoid nesting <a> tags inside Link components in this component.

🪛 GitHub Actions: PR testing - if Node project
pages/casestudies/index.tsx

[error] 30-141: Prettier formatting errors and jsx-quotes linting errors detected. Multiple instances of double quotes used instead of single quotes and unnecessary line breaks. Run 'prettier --write' to fix code style issues.

🔇 Additional comments (1)
next-env.d.ts (1)

5-5: Comment-only change looks good

The comment URL update is correct and has no impact on typings. Nothing further to do here.

Comment on lines +38 to +150
className="relative mx-auto max-w-xl px-4 py-10 sm:px-6 lg:max-w-screen-xl lg:px-8"
data-testid="CaseStudy-main"
>
<div className='grid lg:grid-cols-9 lg:gap-8 lg:text-center'>
<div className='col-span-5 col-start-3'>
<div className="grid lg:grid-cols-9 lg:gap-8 lg:text-center">
<div className="col-span-5 col-start-3">
<Heading level={HeadingLevel.h1} typeStyle={HeadingTypeStyle.lg}>
{title}
</Heading>
<Paragraph typeStyle={ParagraphTypeStyle.md} className='my-4 max-w-4xl'>
The best way to learn how to use AsyncAPI is not only through documentation that usually is focused on
recommendations and best practices. It is also good to confront with real-life case studies that explain
how people really use AsyncAPI and what are their flows.
<Paragraph
typeStyle={ParagraphTypeStyle.md}
className="my-4 max-w-4xl"
>
The best way to learn how to use AsyncAPI is not only through
documentation that usually is focused on recommendations and best
practices. It is also good to confront with real-life case studies
that explain how people really use AsyncAPI and what are their
flows.
</Paragraph>
<Paragraph typeStyle={ParagraphTypeStyle.md} className='my-4 max-w-4xl'>
Feel free to submit your case study. We have a template for you. For more details
<TextLink href='https://github.com/asyncapi/website/blob/master/README.md#case-studies' target='_blank'>
<Paragraph
typeStyle={ParagraphTypeStyle.md}
className="my-4 max-w-4xl"
>
Feel free to submit your case study. We have a template for you.
For more details
<TextLink
href="https://github.com/asyncapi/website/blob/master/README.md#case-studies"
target="_blank"
>
read our FAQ
</TextLink>
.
</Paragraph>
</div>
</div>
<div data-testid='CaseStudy-card'>
<div data-testid="CaseStudy-card">
<CaseStudyCard studies={CaseStudiesList as ICaseStudies} />
</div>

<div className='adopters'>
<div className='mt-8 grid lg:grid-cols-9 lg:gap-8 lg:text-center'>
<div className='col-span-5 col-start-3'>
<div className="adopters">
<div className="mt-8 grid lg:grid-cols-9 lg:gap-8 lg:text-center">
<div className="col-span-5 col-start-3">
<Heading level={HeadingLevel.h1} typeStyle={HeadingTypeStyle.lg}>
Adopters
</Heading>
<Paragraph typeStyle={ParagraphTypeStyle.md} className='my-4 max-w-4xl'>
Check out how different companies use AsyncAPI and what problems they solve.
<Paragraph
typeStyle={ParagraphTypeStyle.md}
className="my-4 max-w-4xl"
>
Check out how different companies use AsyncAPI and what problems
they solve.
</Paragraph>
<Paragraph typeStyle={ParagraphTypeStyle.md} className='my-4 max-w-4xl'>
<Paragraph
typeStyle={ParagraphTypeStyle.md}
className="my-4 max-w-4xl"
>
Feel free to{' '}
<a className='underline' href='https://github.com/asyncapi/website/blob/master/config/adopters.yml'>
<a
className="underline"
href="https://github.com/asyncapi/website/blob/master/config/adopters.yml"
>
submit a pull request
</a>{' '}
with information about how your company uses AsyncAPI. We know that writing an official case study might
be time consuming and requires too much internal paper work. Let&apos;s make sure we can at least
capture a use case that is already a great learning information for the community.
with information about how your company uses AsyncAPI. We know
that writing an official case study might be time consuming and
requires too much internal paper work. Let&apos;s make sure we
can at least capture a use case that is already a great learning
information for the community.
</Paragraph>
</div>
</div>
</div>

<center>
<div className='overflow-x-auto'>
<table className='my-8 w-full max-w-full border-collapse border'>
<div className="w-full flex justify-center">
<div className="overflow-x-auto w-full">
<table className="my-8 min-w-[600px] w-full border-collapse border">
<thead>
<tr>
<th className='border p-2 font-bold'>Company name</th>
<th className='border-2 p-2 font-bold'>Use Case</th>
<th className='border-2 p-2 font-bold'>Resources</th>
<th className="border p-2 font-bold text-left">
Company name
</th>
<th className="border p-2 font-bold text-left">Use Case</th>
<th className="border p-2 font-bold text-left">Resources</th>
</tr>
</thead>
<tbody>
{AdoptersList.map((entry: Adopter, index: number) => (
<tr key={index} data-testid='Adopters'>
<td className='border-2 p-2'>{entry.companyName}</td>
<td className='border-2 p-2'>{entry.useCase}</td>
<td className='border-2 p-2'>
<ul>
{entry.resources.map((resource: Resource, resourceIndex: number) => (
<li className='p-2' key={resourceIndex}>
<a className='text-cyan-500 underline' href={resource.link}>
{resource.title}
</a>
</li>
))}
<tr key={index} data-testid="Adopters">
<td className="border p-2">{entry.companyName}</td>
<td className="border p-2">{entry.useCase}</td>
<td className="border p-2">
<ul className="list-disc pl-4">
{entry.resources.map(
(resource: Resource, resourceIndex: number) => (
<li key={resourceIndex} className="py-1">
<a
className="text-cyan-500 underline"
href={resource.link}
target="_blank"
rel="noopener noreferrer"
>
{resource.title}
</a>
</li>
),
)}
</ul>
</td>
</tr>
))}
</tbody>
</table>
</div>
</center>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Formatting breaks project style ‑ fix Prettier / jsx-quotes violations

All newly-added JSX attributes were switched to double quotes and extra line-breaks.
The repo ESLint/Prettier config (jsx-quotes: "prefer-single") expects single quotes and no manual wrapping.
CI is already red (Prettier formatting errors and jsx-quotes linting errors detected).

Run the project formatter to revert to canonical style or explicitly use single quotes when writing JSX:

-<div className="relative mx-auto max-w-xl px-4 py-10 sm:px-6 lg:max-w-screen-xl lg:px-8">
+<div className='relative mx-auto max-w-xl px-4 py-10 sm:px-6 lg:max-w-screen-xl lg:px-8'>

…and so on for every JSX literal introduced in this PR.

After fixing the quotes, execute:

pnpm prettier --write .
pnpm eslint --fix .

to ensure the file passes the pipeline.

🤖 Prompt for AI Agents
In pages/casestudies/index.tsx from lines 38 to 150, the JSX attributes use
double quotes and have extra line breaks, which violates the project's Prettier
and eslint jsx-quotes rule that prefers single quotes and no manual wrapping. To
fix this, replace all double quotes in JSX attributes with single quotes and
remove unnecessary line breaks. Then run the project formatter with pnpm
prettier --write . and pnpm eslint --fix . to ensure the file conforms to the
project's style and passes the CI checks.

Comment on lines 123 to 146
{AdoptersList.map((entry: Adopter, index: number) => (
<tr key={index} data-testid='Adopters'>
<td className='border-2 p-2'>{entry.companyName}</td>
<td className='border-2 p-2'>{entry.useCase}</td>
<td className='border-2 p-2'>
<ul>
{entry.resources.map((resource: Resource, resourceIndex: number) => (
<li className='p-2' key={resourceIndex}>
<a className='text-cyan-500 underline' href={resource.link}>
{resource.title}
</a>
</li>
))}
<tr key={index} data-testid="Adopters">
<td className="border p-2">{entry.companyName}</td>
<td className="border p-2">{entry.useCase}</td>
<td className="border p-2">
<ul className="list-disc pl-4">
{entry.resources.map(
(resource: Resource, resourceIndex: number) => (
<li key={resourceIndex} className="py-1">
<a
className="text-cyan-500 underline"
href={resource.link}
target="_blank"
rel="noopener noreferrer"
>
{resource.title}
</a>
</li>
),
)}
</ul>
</td>
</tr>
))}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid using array indices as React keys

<tr key={index}> and <li key={resourceIndex}> rely on positional indices.
If the underlying lists ever re-order, React will mis-match DOM nodes, causing subtle UI bugs.

Use a stable, unique identifier instead (company name, resource link):

-<tr key={index} data-testid="Adopters">
+<tr key={entry.companyName} data-testid="Adopters">
 ...
-  <li key={resourceIndex} className="py-1">
+  <li key={resource.link} className="py-1">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{AdoptersList.map((entry: Adopter, index: number) => (
<tr key={index} data-testid='Adopters'>
<td className='border-2 p-2'>{entry.companyName}</td>
<td className='border-2 p-2'>{entry.useCase}</td>
<td className='border-2 p-2'>
<ul>
{entry.resources.map((resource: Resource, resourceIndex: number) => (
<li className='p-2' key={resourceIndex}>
<a className='text-cyan-500 underline' href={resource.link}>
{resource.title}
</a>
</li>
))}
<tr key={index} data-testid="Adopters">
<td className="border p-2">{entry.companyName}</td>
<td className="border p-2">{entry.useCase}</td>
<td className="border p-2">
<ul className="list-disc pl-4">
{entry.resources.map(
(resource: Resource, resourceIndex: number) => (
<li key={resourceIndex} className="py-1">
<a
className="text-cyan-500 underline"
href={resource.link}
target="_blank"
rel="noopener noreferrer"
>
{resource.title}
</a>
</li>
),
)}
</ul>
</td>
</tr>
))}
{AdoptersList.map((entry: Adopter, index: number) => (
<tr key={entry.companyName} data-testid="Adopters">
<td className="border p-2">{entry.companyName}</td>
<td className="border p-2">{entry.useCase}</td>
<td className="border p-2">
<ul className="list-disc pl-4">
{entry.resources.map(
(resource: Resource, resourceIndex: number) => (
<li key={resource.link} className="py-1">
<a
className="text-cyan-500 underline"
href={resource.link}
target="_blank"
rel="noopener noreferrer"
>
{resource.title}
</a>
</li>
),
)}
</ul>
</td>
</tr>
))}
🤖 Prompt for AI Agents
In pages/casestudies/index.tsx between lines 123 and 146, replace the array
index keys used in the <tr> and <li> elements with stable, unique identifiers.
Use entry.companyName as the key for the <tr> elements and resource.link as the
key for the <li> elements to ensure React can correctly track list items even if
the order changes.

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.

[BUG] Case Studies page table is not mobile responsive

2 participants