Skip to content

Conversation

@raajpatre
Copy link

@raajpatre raajpatre commented Nov 6, 2025

Closes #4495

What this PR does

This PR fixes a visual bug where the announcement banner's alignment (padding and margin) was inconsistent on non-home pages (like /tools or /docs) compared to the homepage.

How it was fixed

The issue was in the components/campaigns/AnnouncmentBanner.tsx component.

The Tailwind CSS logic for the small prop was not applying the same horizontal margin (mx-3) and padding (p-6) as the main banner.

I updated the className logic to apply consistent p-6 and mx-3 padding/margins regardless of whether the small prop is true or false, while keeping the vertical margin (mb-4 vs my-6) logic.

How to test it:

Run the site locally (npm run dev).

Go to the homepage (/). Observe the banner's alignment.

Go to the Tools page (/tools).

Observe: The banner on /tools should now have the exact same padding and alignment as the banner on the homepage.

Summary by CodeRabbit

  • Chores
    • Improved internal code organization and formatting for better maintainability.

@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 825f54f
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/690ccfe0bf76ce0008abb789
😎 Deploy Preview https://deploy-preview-4552--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.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Nov 6, 2025

We require all PRs to follow Conventional Commits specification.
More details 👇🏼

 The subject "Correct banner alignment on non-home pages (closes #4495)" found in the pull request title "fix(ui): Correct banner alignment on non-home pages (closes #4495)" should start with a lowercase character.

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 6, 2025

Walkthrough

The PR makes two changes: restructuring the className layout in the AnnouncementBanner component to adjust padding from py-6 to p-6 with mx-3 and reorder transition-related classes, and adding a trailing space in config/tools.json.

Changes

Cohort / File(s) Summary
Banner styling refactor
components/campaigns/AnnouncementBanner.tsx
Reworked root className construction: shifted padding scheme from py-6 to p-6 with mx-3, reorganized layout of transition-transform and activeBanner conditional classes within the template string. Functional outcome unchanged.
Configuration whitespace
config/tools.json
Added trailing whitespace after AsyncAPI Server API websiteUrl value. No behavioral changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • The AnnouncementBanner change requires verifying that className reordering produces the expected visual alignment across pages (referenced in linked issue #4495)
  • The config/tools.json change is purely whitespace and requires minimal scrutiny

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • Mayaleeeee
  • sambhavgupta0705
  • derberg
  • akshatnema

Poem

🐰 A banner in motion, now properly aligned,
With padding and margins in harmony designed,
From py-six to p-six, the spacing flows right,
Across every page now, the layout's just tight! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning One change appears out-of-scope: config/tools.json only has a trailing whitespace modification unrelated to fixing banner alignment. Remove the trailing whitespace change from config/tools.json as it's not required to fix the banner alignment issue and introduces unnecessary modifications.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Correct banner alignment on non-home pages' accurately describes the main change: fixing banner alignment issues on non-homepage pages, directly addressing the linked issue #4495.
Linked Issues check ✅ Passed The PR successfully addresses issue #4495 by correcting banner alignment on non-home pages through updated Tailwind CSS classes (p-6, mx-3) in the AnnouncementBanner component.
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

⚡️ Lighthouse report for the changes in this PR:

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

Lighthouse ran on https://deploy-preview-4552--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: 1

📜 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 b5a86b7 and 825f54f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • components/campaigns/AnnouncementBanner.tsx (1 hunks)
  • config/tools.json (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 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
📚 Learning: 2025-01-19T04:51:41.255Z
Learnt from: anshgoyalevil
Repo: asyncapi/website 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.

Applied to files:

  • config/tools.json
⏰ 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 (1)
components/campaigns/AnnouncementBanner.tsx (1)

51-54: LGTM! Banner alignment fix looks correct.

The changes successfully address the alignment inconsistency by applying p-6 and mx-3 consistently regardless of the small prop, while preserving the intended vertical margin differences (mb-4 vs my-6). This ensures the banner has consistent horizontal spacing across all pages.

"description": "Server API providing official AsyncAPI tools",
"links": {
"websiteUrl": "https://api.asyncapi.com/v1",
"websiteUrl": "https://api.asyncapi.com/v1",
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 | 🟡 Minor

Remove trailing whitespace.

There's a trailing space after the URL that appears unrelated to the banner fix. This should be removed to maintain clean formatting.

Apply this diff:

-          "websiteUrl": "https://api.asyncapi.com/v1", 
+          "websiteUrl": "https://api.asyncapi.com/v1",
📝 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
"websiteUrl": "https://api.asyncapi.com/v1",
"websiteUrl": "https://api.asyncapi.com/v1",
🤖 Prompt for AI Agents
In config/tools.json around line 26, the "websiteUrl" entry contains a trailing
space after the URL; remove the extra space so the line ends with
"https://api.asyncapi.com/v1" (no trailing whitespace) and save the file to keep
formatting clean.

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] Alignment of Banner in other pages

2 participants