Skip to content

Conversation

@BensOmnitrix
Copy link

@BensOmnitrix BensOmnitrix commented Nov 12, 2025

Description
Fixes [#4575 ]

    1. Added the utils/windowSize.ts file which is exporting the size of the window after it resizes
    1. In the components/buttons/GithubButton.tsx file just imported the the size and put the check on it so that if the width greater than 1144px it remains the same when window size becomes less than 1144px it changes to IconGithub
      -3. Also encapsulated the IconButton in the Link so that after clicking it one could be redirected to the asyncapi github repo.

Final Look
Screenshot 2025-11-12 134832

Related issue(s)

Summary by CodeRabbit

  • Style

    • GitHub button is now responsive: full button on large screens and a compact, accessible icon link on small screens for improved layout and accessibility.
  • Bug Fixes

    • Made the finance data check more robust to avoid runtime errors when no yearly data is present.

@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit cd3450c
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/691739ce43a23e0008ee9dd6
😎 Deploy Preview https://deploy-preview-4580--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 Nov 12, 2025

Walkthrough

GithubButton now renders a full Button on large viewports and an icon-only Link on smaller viewports using Tailwind visibility utilities and Next.js Link; scripts/index.ts adds a truthiness check for yearsList before accessing .length.

Changes

Cohort / File(s) Summary
Responsive GitHub Button
components/buttons/GithubButton.tsx
Reworked rendering to include two elements: a desktop full Button visible at xl and up (hidden xl:inline-block), and a mobile-only icon Link using next/link (xl:hidden). Added aria-label and adjusted className.
Finance data guard
scripts/index.ts
Added a truthiness check for yearsList before testing .length to avoid runtime errors when the finance directory returns no data.

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant GithubButton
  participant NextLink
  participant Icon

  rect rgba(135,206,235,0.12)
    Browser->>GithubButton: render (with viewport size)
    alt viewport >= xl
      GithubButton->>GithubButton: render full Button (visible at xl and up)
      note right of GithubButton `#eef6ff`: Desktop flow
    else viewport < xl
      GithubButton->>NextLink: render Link with Icon (icon-only)
      NextLink->>Icon: show GitHub icon
      note right of NextLink `#fff8e6`: Mobile flow (icon-only)
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review attention:
    • components/buttons/GithubButton.tsx — accessibility (aria-label), responsive classNames, and Next.js Link semantics.
    • scripts/index.ts — confirm yearsList guard aligns with existing error handling and downstream logic.

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

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

Poem

🐰 I hopped through code with nimble paws,
I split the button for screens and laws.
Big displays get a friendly face,
Small ones get an icon—swift and space.
Hop, click, the GitHub door now draws.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting the GitHub Button to an IconGithub Button on small screens for responsive design.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7fa0830 and 511bf24.

📒 Files selected for processing (1)
  • components/buttons/GithubButton.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: asyncapi-bot
Repo: asyncapi/website PR: 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
Learnt from: akshatnema
Repo: asyncapi/website 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: amanbhoria
Repo: asyncapi/website PR: 3373
File: components/AlgoliaSearch.tsx:313-313
Timestamp: 2024-11-11T21:30:32.478Z
Learning: In the `SearchButton` component within `components/AlgoliaSearch.tsx`, if the component re-renders on every button click and the `useEffect` runs accordingly, adding dependencies to the dependency array might not be necessary.
📚 Learning: 2024-10-11T10:46:58.882Z
Learnt from: akshatnema
Repo: asyncapi/website 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.

Applied to files:

  • components/buttons/GithubButton.tsx
📚 Learning: 2024-10-11T07:38:35.745Z
Learnt from: akshatnema
Repo: asyncapi/website 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.

Applied to files:

  • components/buttons/GithubButton.tsx
📚 Learning: 2024-10-11T11:32:30.226Z
Learnt from: akshatnema
Repo: asyncapi/website 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.

Applied to files:

  • components/buttons/GithubButton.tsx
🧬 Code graph analysis (1)
components/buttons/GithubButton.tsx (2)
components/buttons/Button.tsx (1)
  • Button (53-106)
components/icons/Github.tsx (1)
  • IconGithub (7-13)
🔇 Additional comments (1)
components/buttons/GithubButton.tsx (1)

1-1: LGTM: Link import added correctly.

The import is needed for the new responsive Link component on line 46.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@BensOmnitrix BensOmnitrix changed the title Fix: Updated the Github Button to IconGithub Button when screen size becomes small fix: Updated the Github Button to IconGithub Button when screen size becomes small Nov 12, 2025
@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b87dd1b) to head (cd3450c).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #4580   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines          799       799           
  Branches       146       146           
=========================================
  Hits           799       799           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BensOmnitrix BensOmnitrix changed the title fix: Updated the Github Button to IconGithub Button when screen size becomes small fix: updated the Github Button to IconGithub Button when screen size becomes small Nov 12, 2025
@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Nov 12, 2025

⚡️ Lighthouse report for the changes in this PR:

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

Lighthouse ran on https://deploy-preview-4580--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 (1)
components/buttons/GithubButton.tsx (1)

37-37: Consider consistent spacing between responsive variants.

The desktop Button uses ml-1 while the mobile icon Link uses ml-2, creating inconsistent left margins between the two responsive states. Additionally, the icon sizes differ (size-6 in the Button vs size-8 in the mobile Link).

While the larger mobile icon might be intentional for better touch-target visibility, the margin inconsistency could create a visual shift when resizing the viewport.

Consider standardizing the left margin to ensure consistent spacing:

-        className={`${className} ml-1 hidden xl:inline-block`}
+        className={`${className} ml-2 hidden xl:inline-block`}

Or if ml-1 is preferred:

-        <IconGithub className='-mt-1 ml-2 inline-block size-8 xl:hidden' />
+        <IconGithub className='-mt-1 ml-1 inline-block size-8 xl:hidden' />

Also applies to: 41-41, 47-47

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 722963b and 9d8f5c0.

📒 Files selected for processing (1)
  • components/buttons/GithubButton.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: akshatnema
Repo: asyncapi/website 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
Repo: asyncapi/website 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.
📚 Learning: 2024-10-11T10:46:58.882Z
Learnt from: akshatnema
Repo: asyncapi/website 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.

Applied to files:

  • components/buttons/GithubButton.tsx
📚 Learning: 2024-10-11T07:38:35.745Z
Learnt from: akshatnema
Repo: asyncapi/website 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.

Applied to files:

  • components/buttons/GithubButton.tsx
📚 Learning: 2024-10-11T11:32:30.226Z
Learnt from: akshatnema
Repo: asyncapi/website 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.

Applied to files:

  • components/buttons/GithubButton.tsx
🧬 Code graph analysis (1)
components/buttons/GithubButton.tsx (2)
components/buttons/Button.tsx (1)
  • Button (53-106)
components/icons/Github.tsx (1)
  • IconGithub (7-13)
⏰ 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). (4)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Lighthouse CI
🔇 Additional comments (1)
components/buttons/GithubButton.tsx (1)

1-1: LGTM!

The Link import is correctly added to support the responsive icon-only navigation.

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 (1)
scripts/index.ts (1)

62-62: Reasonable defensive check, but unrelated to PR scope.

The added null/undefined guard is a reasonable defensive improvement. However, this change appears unrelated to the PR's stated objective of making the GitHub button responsive on small screens.

Consider separating unrelated changes into different PRs to maintain clear change tracking and make reviews more focused.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d8f5c0 and 59b57c9.

📒 Files selected for processing (1)
  • scripts/index.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: akshatnema
Repo: asyncapi/website 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.
⏰ 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). (5)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Test NodeJS PR - macos-13
  • GitHub Check: Test NodeJS PR - windows-latest

@BensOmnitrix
Copy link
Author

/ready-to-merge

@princerajpoot20
Copy link
Member

@BensOmnitrix tests are failing. Please look into it.

@BensOmnitrix
Copy link
Author

BensOmnitrix commented Nov 14, 2025

@princerajpoot20 All the checks have been passed. Kindly check and approve if it looks good 😊

@princerajpoot20
Copy link
Member

@BensOmnitrix FYI: #4575 (comment)

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.

3 participants