Skip to content

Conversation

@Nagmani001
Copy link

@Nagmani001 Nagmani001 commented Nov 30, 2025

Fixes #4648

Description
When the browser window width is reduced to around 1032px, the navigation bar layout breaks. Specifically, the GitHub button wraps to the next line, causing misalignment in the navbar. The UI becomes inconsistent until the screen reaches the mobile breakpoint, where the hamburger menu appears and the layout becomes stable again.

This issue affects the visual consistency of the navbar on medium-sized screens.

async_api_nav_bar_fix

Summary by CodeRabbit

  • Style
    • Improved styling for the GitHub button to ensure consistent spacing, layout and responsiveness across screen sizes and when custom classes are applied.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit db7ae25
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/692bcda0a4df620008828ff8
😎 Deploy Preview https://deploy-preview-4649--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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 2025

Walkthrough

The GitHub button component now uses twMerge to merge default Tailwind classes with any incoming className, ensuring default spacing and layout classes are combined with consumer-provided classes.

Changes

Cohort / File(s) Summary
GitHub Button Styling Enhancement
components/buttons/GithubButton.tsx
Added twMerge import and updated the component to merge default responsive spacing and layout classes (ml-2 px-2 py-2 md:px-4 md:py-3 flex items-center whitespace-nowrap) with incoming className prop to consolidate Tailwind classes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single-file change; verify twMerge import and class precedence.
  • Confirm responsive classes (md:) produce expected behavior in navbar.

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • derberg
  • akshatnema
  • magicmatatjahu
  • Mayaleeeee
  • sambhavgupta0705
  • anshgoyalevil

Poem

🐰 I stitched classes, small and bright,
twMerge hummed through day and night,
No more wraps at tablet size,
The navbar smiles with tidy ties,

Pre-merge checks and finishing touches

✅ Passed checks (5 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: fixing the GitHub button wrapping issue on mid-size screens, which directly addresses the PR's core objective.
Linked Issues check ✅ Passed The code change (adding twMerge to merge Tailwind classes with spacing/layout utilities) directly addresses the issue of preventing the GitHub button from wrapping by adding the 'whitespace-nowrap' class, which prevents text wrapping.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to only the GithubButton component styling, with no unrelated modifications present in the changeset.
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

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.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Nov 30, 2025

⚡️ Lighthouse report for the changes in this PR:

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

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

@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #4649   +/-   ##
=========================================
  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.

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)
components/buttons/GithubButton.tsx (1)

2-40: twMerge usage looks good; consider scoping the left margin to navbar use only

Using twMerge with the default classes first and the incoming className second is a solid approach here: it gives the GitHub button sane defaults (flex, items-center, responsive padding, whitespace-nowrap to avoid wrapping in the navbar) while still letting consumers override spacing/layout via className. This should directly help with the mid-size breakpoint wrapping issue.

One minor refinement: ml-2 is now applied unconditionally, which might not be ideal if GithubButton is reused outside the navbar where that left margin isn’t desired. You could gate the margin on inNav (or push that concern to the navbar container) while keeping the rest of the defaults global, for example:

-      className={twMerge('ml-2 px-2 py-2 md:px-4 md:py-3 flex items-center whitespace-nowrap', className)}
+      className={twMerge(
+        'px-2 py-2 md:px-4 md:py-3 flex items-center whitespace-nowrap',
+        inNav ? 'ml-2' : '',
+        className
+      )}

Please also double-check the preview around the ~1032px width and at other breakpoints to confirm the button no longer wraps and that non-navbar usages (if any) still look correct.

📜 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 e86b04c and db7ae25.

📒 Files selected for processing (1)
  • components/buttons/GithubButton.tsx (2 hunks)

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] Navbar inconsistent between desktop and tablet widths (GitHub button overflow)

2 participants