Skip to content

Conversation

@Priyank0703
Copy link

@Priyank0703 Priyank0703 commented Sep 5, 2025

fix: #4381
Description

  • made the buttons responsive
  • here is the screenshot for that
image

fix: #4381

Summary by CodeRabbit

  • Style

    • Refined Generator page layout and spacing for clearer structure.
    • Improved responsive behavior for action buttons on small screens (better alignment and centering).
    • Standardized heading usage for consistent presentation; no content changes.
  • Refactor

    • Cleaned up JSX markup for consistency and readability without altering functionality.
  • Chores

    • Development-only TypeScript configuration updated to improve type coverage; no runtime impact for end users.

@netlify
Copy link

netlify bot commented Sep 5, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6b03a6c
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/68bafad391263b0008d7a592
😎 Deploy Preview https://deploy-preview-4390--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 Sep 5, 2025

Walkthrough

Added a Next.js route types reference to next-env.d.ts and adjusted JSX/layout classes in pages/tools/generator.tsx to modify spacing and alignment of UI elements, including responsive container classes around the action buttons. No functional logic or exported API changes.

Changes

Cohort / File(s) Change Summary
Type declarations update
next-env.d.ts
Added triple-slash reference to ./.next/types/routes.d.ts to include Next.js generated route types in TypeScript.
Generator page layout/markup
pages/tools/generator.tsx
Reformatted JSX, switched to double-quoted attributes, adjusted headings/sections, and updated container classes (e.g., responsive flex/justify) around action buttons for alignment. No logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix misalignment of "View on Github" and "View Docs" buttons with consistent responsive spacing [#4381]
Ensure uniform margins across screen sizes on Generator page [#4381]

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Add Next.js route types reference (next-env.d.ts) Type reference inclusion is unrelated to button alignment or responsive spacing on the Generator page.

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • derberg
  • akshatnema
  • sambhavgupta0705
  • anshgoyalevil
  • Mayaleeeee
  • asyncapi-bot-eve

Poem

I hop through grids where buttons live,
Nudging margins—gentle, swift.
Left and right now balance true,
Docs and GitHub side by two.
With tidy flex and space just right,
My paws applaud this aligned delight. 🐰✨

✨ 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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

⚡️ Lighthouse report for the changes in this PR:

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

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

@Priyank0703 Priyank0703 closed this Sep 5, 2025
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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pages/tools/generator.tsx (1)

1-1: Remove unused React value import (likely causing ESLint error).

You’re only using the React namespace as a type in renderButtons. With the automatic JSX runtime, the value import isn’t needed and will trip no-unused-vars.

-import React from 'react';
+// React import not required with the automatic JSX runtime
🧹 Nitpick comments (4)
next-env.d.ts (1)

3-3: Typed routes reference is brittle; prefer the recommended pattern.

Hardcoding ./.next/types/routes.d.ts may break when Next updates the generated types. Use the Next.js recommended reference so all generated route type files are picked up.

Consider this change:

-/// <reference path="./.next/types/routes.d.ts" />
+/// <reference path="./.next/types/**/*.ts" />

Please confirm your Next.js version supports typed routes and that CI/type-checks pass with this reference.

pages/tools/generator.tsx (3)

65-71: Alt text: make it descriptive or mark decorative.

“generator diagram” is vague. Either describe the content or set alt="" if the image is decorative and already explained by nearby headings.

Example:

-  alt="generator diagram"
+  alt="AsyncAPI Generator architecture diagram"
# or
-  alt="generator diagram"
+  alt=""

104-112: Decorative icons should be hidden from assistive tech.

These icons are purely visual; add aria-hidden="true" on the SVGs to reduce noise for screen readers. This requires updating the icon components to forward props.

Proposed change in each icon component (e.g., components/icons/Documents.tsx):

-export default function IconDocuments({ className = '' }) {
+export default function IconDocuments({ className = '', ...props }) {
   return (
-    <svg className={className || 'inline-block'} fill='currentColor' viewBox='0 0 20 20'>
+    <svg
+      className={className || 'inline-block'}
+      fill='currentColor'
+      viewBox='0 0 20 20'
+      aria-hidden='true'
+      focusable='false'
+      {...props}
+    >

I can open a follow-up PR if you like.

Also applies to: 131-136, 157-163


21-21: Optional: center buttons on mobile for consistency with the bottom CTA.

This matches the bottom section’s centering and looks better on narrow screens.

-    <div className="mt-8 flex flex-wrap gap-4">
+    <div className="mt-8 flex flex-wrap justify-center gap-4 sm:justify-start">
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e32d416 and 6b03a6c.

📒 Files selected for processing (2)
  • next-env.d.ts (1 hunks)
  • pages/tools/generator.tsx (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
pages/tools/generator.tsx (8)
components/buttons/Button.tsx (1)
  • Button (53-106)
components/layout/GenericLayout.tsx (1)
  • GenericLayout (25-51)
components/typography/Heading.tsx (1)
  • Heading (30-85)
components/typography/Paragraph.tsx (1)
  • Paragraph (28-56)
components/GeneratorInstallation.tsx (1)
  • GeneratorInstallation (23-98)
components/icons/Documents.tsx (1)
  • IconDocuments (7-13)
components/icons/Code.tsx (1)
  • IconCode (7-13)
components/icons/PowerPlug.tsx (1)
  • IconPowerPlug (7-13)
🪛 GitHub Actions: PR testing - if Node project
pages/tools/generator.tsx

[error] 21-200: Prettier/ESLint formatting errors detected in pages/tools/generator.tsx. Run 'prettier --write' and fix ESLint issues.

⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Lighthouse CI
🔇 Additional comments (3)
pages/tools/generator.tsx (3)

21-39: Nice: responsive button layout reads well.

w-full on mobile and sm:w-fit with flex/gap achieves the objective of responsive stacking and spacing.


200-203: Good: repeated CTA is centered on small screens.

sm:flex sm:justify-center plus the inner w-full/sm:w-fit gives consistent alignment across breakpoints.


29-33: No changes needed for GitHub button link behavior
GithubButton already defaults to target="_blank", and the underlying Button component renders links with rel="noopener noreferrer".

Comment on lines 19 to 20
function renderButtons(): React.JSX.Element {
return (
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

Drop explicit React.JSX.Element return type or switch to a type-only import.

Avoid pulling in a value import just for the type. Keep it simple and let TS infer the return type.

-function renderButtons(): React.JSX.Element {
+function renderButtons() {

Alternatively:

- import React from 'react';
+ import type { JSX } from 'react';
- function renderButtons(): React.JSX.Element {
+ function renderButtons(): JSX.Element {
📝 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
function renderButtons(): React.JSX.Element {
return (
function renderButtons() {
return (
🤖 Prompt for AI Agents
In pages/tools/generator.tsx around lines 19-20, remove the explicit value
import-based return type "React.JSX.Element" from the renderButtons signature so
TypeScript infers the return type (i.e., change to function renderButtons() {
... }), or if you must keep an explicit type, replace the value import with a
type-only import and use a type from React (e.g., import type { JSX } from
'react' and annotate as (): JSX.Element) — implement one of these two fixes and
ensure no runtime value import is pulled in solely for typing.

Comment on lines +30 to +31
text="View on Github"
className="w-full text-center sm:w-fit sm:text-left"
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

Fix brand capitalization: GitHub.

User-facing copy should use “GitHub”.

-        text="View on Github"
+        text="View on GitHub"
📝 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
text="View on Github"
className="w-full text-center sm:w-fit sm:text-left"
text="View on GitHub"
className="w-full text-center sm:w-fit sm:text-left"
🤖 Prompt for AI Agents
In pages/tools/generator.tsx around lines 30 to 31, the user-facing copy uses
the incorrect brand capitalization "Github"; update the string value to "GitHub"
(e.g., change text="View on Github" to text="View on GitHub") so the UI displays
the correct brand name.

Comment on lines +31 to 38
className="w-full text-center sm:w-fit sm:text-left"
href="https://www.github.com/asyncapi/generator"
/>
<Button
text="View Docs"
href="/docs/tools/generator"
className="w-full text-center sm:w-fit sm:text-left"
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify Tailwind version supports w-fit and align with project’s quote style.

  • Ensure Tailwind ≥ v3 for w-fit. Otherwise use w-auto.
  • Repo codebase uses single quotes in JSX; this file switched to double quotes and is causing the CI failure.

Run:


🏁 Script executed:

#!/bin/bash
# Check Tailwind version
rg -n '"tailwindcss"\s*:\s*"' -n package.json -C1

# Show Prettier JSX quote setting
rg -n '"jsxSingleQuote"\s*:\s*true' -S --glob '{.prettierrc,.prettierrc.*,package.json}'

# Auto-fix formatting issues in this file
npx prettier --write pages/tools/generator.tsx
npx eslint pages/tools/generator.tsx --fix

Length of output: 1056


🏁 Script executed:

#!/bin/bash
set -eux

# List Prettier config files
ls -1 .prettierrc* || true
grep -R '"prettier"' -n package.json || true

# If .prettierrc*.json exists, dump its contents
for file in .prettierrc .prettierrc.json .prettierrc.js .prettierrc.yaml .prettierrc.yml; do
  [ -f "$file" ] && echo "==== $file ====" && sed -n '1,200p' "$file"
done

# Inspect quote usage in other JSX/TSX files
echo "---- pages/index.tsx ----"
rg -n "className=" -C2 pages/index.tsx || true

echo "---- components/Header.tsx (if exists) ----"
rg -n "className=" -C2 components/Header.tsx || true

echo "---- pages/tools/generator.tsx ----"
rg -n "className=" -C2 pages/tools/generator.tsx || true

Length of output: 7125


Use single quotes for JSX attributes; Tailwind’s w-fit is supported

  • Tailwind CSS is at v3.4.3, so w-fit is valid—no fallback needed.
  • In pages/tools/generator.tsx (lines 31–38), replace double quotes with single quotes to match the rest of the codebase. For example:
    - className="w-full text-center sm:w-fit sm:text-left"
    + className='w-full text-center sm:w-fit sm:text-left'
📝 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
className="w-full text-center sm:w-fit sm:text-left"
href="https://www.github.com/asyncapi/generator"
/>
<Button
text="View Docs"
href="/docs/tools/generator"
className="w-full text-center sm:w-fit sm:text-left"
/>
className='w-full text-center sm:w-fit sm:text-left'
href="https://www.github.com/asyncapi/generator"
/>
<Button
text="View Docs"
href="/docs/tools/generator"
className='w-full text-center sm:w-fit sm:text-left'
/>
🤖 Prompt for AI Agents
In pages/tools/generator.tsx around lines 31 to 38, the JSX attributes use
double quotes while the codebase standard is single quotes; update all JSX
attribute strings in this block (className and href values on both Button
components) to use single quotes instead, keeping the same values (retain the
Tailwind w-fit utility as-is).

Comment on lines +81 to 85
<Paragraph className="mt-3 lg:pr-4">
Start using Generator really quickly. Select one of the multiple
templates we offer and start generating documentation and code
in a few seconds.
</Paragraph>
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

Grammar: “seat” → “sit”.

Minor but user-facing.

-                        that will seat along with your code? Perfect!
+                        that will sit alongside your code? Perfect!

Also applies to: 124-127

🤖 Prompt for AI Agents
In pages/tools/generator.tsx around lines 81-85 (and also apply same change at
lines 124-127), there is a grammar issue: replace the word "seat" with "sit"
where used in the UI copy; update the text strings accordingly so they read
"sit" instead of "seat" in both locations.

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.

Fix: View on Github and View Docs buttons inconsistency in Generator page

2 participants