Skip to content

fix(components): resolve layout issue on GitHub star button (#7859) - #7899

Open
superezzdev wants to merge 5 commits into
layer5io:masterfrom
superezzdev:fix/github-star-button-7859
Open

fix(components): resolve layout issue on GitHub star button (#7859)#7899
superezzdev wants to merge 5 commits into
layer5io:masterfrom
superezzdev:fix/github-star-button-7859

Conversation

@superezzdev

@superezzdev superezzdev commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes #7859 by resolving the layout rendering issue on the GitHub Star Button component.

Changes Made

  • Corrected styling and container alignment for the GitHub Star Button component.
  • Ensured proper responsiveness and layout stability across viewports.

Before
Screenshot 2026-07-28 at 3 12 11 PM
After
Screenshot 2026-07-28 at 3 12 38 PM

Notes for Reviewers

  • Verified locally on gatsby develop.
  • Checked layout behavior across different browser widths.

Signed commits

  • Yes, I signed my commits.

Summary by CodeRabbit

  • New Features
    • Added a GitHub Star banner to the Meshery landing page with a repo-derived link.
    • Shows star count with a loading indicator, compact “k” formatting, and short-lived caching for smoother repeated views.
  • Bug Fixes
    • Fixed responsive spacing for the banner button on smaller screens.
  • Improvements
    • Updated hero/banner and callout heading structure for better readability.
    • Refreshed the Features section layout and carousel visuals, including improved dot focus/keyboard accessibility and responsive behavior.

Copilot AI review requested due to automatic review settings July 28, 2026 09:43
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • src/sections/Meshery/Features-section/features-section.style.js
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 00b7f531-b3a1-43bb-94a8-0dcc3ba59ee4

📥 Commits

Reviewing files that changed from the base of the PR and between faad070 and ad3918e.

📒 Files selected for processing (1)
  • src/sections/Meshery/Features-section/features-section.style.js

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a styled GitHub star banner with cached repository star counts, integrates it into the Meshery hero section, revises feature-section and carousel styling, and corrects mobile banner spacing.

Changes

Meshery landing page updates

Layer / File(s) Summary
Star banner component and star-count flow
src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js
Adds the styled external banner, GitHub star-count fetching, one-hour localStorage caching, loading and fallback states, and abbreviated count formatting.
Meshery hero integration and content markup
src/sections/Meshery/index.js
Replaces the inline GitHub control with GitHubStarButtonBanner and reformats hero and callout JSX.
Feature section and carousel layout
src/sections/Meshery/Features-section/features-section.style.js
Updates section geometry, typography, carousel presentation, Slick controls, management controls, and responsive breakpoints.
Mobile banner spacing correction
src/sections/Meshery/meshery.style.js
Replaces the invalid mobile .banner-btn margin token with theme spacing values and fallbacks.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MesheryPage
  participant GitHubStarButtonBanner
  participant localStorage
  participant GitHubAPI
  MesheryPage->>GitHubStarButtonBanner: Render repository banner
  GitHubStarButtonBanner->>localStorage: Read cached star count
  alt Cache missing or expired
    GitHubStarButtonBanner->>GitHubAPI: Fetch repository data
    GitHubAPI-->>GitHubStarButtonBanner: Return stargazer count
    GitHubStarButtonBanner->>localStorage: Store count and timestamp
  end
  GitHubStarButtonBanner-->>MesheryPage: Render formatted count or fallback
Loading

Possibly related PRs

Suggested labels: area/core-styles

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Features-section style refactor appears unrelated to the GitHub star button fix and goes beyond the linked issue scope. Remove or justify the Features-section styling changes if they are not required to fix the GitHub star button issue.
✅ 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 clearly matches the main change: fixing the Meshery GitHub star button layout.
Linked Issues check ✅ Passed The PR satisfies #7859 by replacing the rounded star button with a distinctive GitHub star banner that shows the star count.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes the GitHub Star Button layout issue on the Meshery page by correcting a CSS typo and replacing the previous “Star the Repository” button with a dedicated banner component that includes stable styling and star-count display.

Changes:

  • Fixes a CSS margin typo affecting banner button spacing.
  • Replaces the GitHub star CTA button with a new GitHubStarButtonBanner component.
  • Adds client-side fetching + caching of GitHub star count and a custom styled banner button.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
src/sections/Meshery/meshery.style.js Fixes a margin value typo that could break layout.
src/sections/Meshery/index.js Swaps old GitHub star button for the new banner component and reformats JSX.
src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js Introduces the new banner button with styling, GitHub API fetch, and localStorage caching.

Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js
Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js
Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js Outdated
Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js Outdated
Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js
Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js
Comment thread src/sections/Meshery/index.js
Comment thread src/sections/Meshery/index.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js`:
- Around line 98-100: Update GitHubStarButtonBanner so its default url is
derived from the effective repo value, ensuring an overridden repo fetches,
labels, and links to the same repository; preserve the existing Meshery defaults
when neither prop is provided.
- Around line 75-79: Update the .banner-count styling to reserve a fixed width
sufficient for the selected formatted count, loading ellipsis, and “Star”
fallback. Keep the existing spacing and divider styling, ensuring the
inline-flex banner does not resize when the asynchronous count loads.
- Around line 107-156: Update the useEffect tied to repo so it resets the star
count when a new repository begins loading and tracks whether the effect is
still active. In the fetch success path and any related state updates, ignore
results after cleanup so responses from previous repos cannot overwrite the
current state; return cleanup that marks the request stale.

In `@src/sections/Meshery/meshery.style.js`:
- Line 148: Replace the hardcoded margin in the affected styled-components rule
with the appropriate existing theme spacing token, or define a new token if no
suitable one exists. Preserve the current spacing values and ensure the rule
accesses spacing through the theme.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a9e6bc57-23d6-4bd4-bbe5-0bf37bb41348

📥 Commits

Reviewing files that changed from the base of the PR and between c443dee and 9e935d8.

📒 Files selected for processing (3)
  • src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js
  • src/sections/Meshery/index.js
  • src/sections/Meshery/meshery.style.js

Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js
Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js Outdated
Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js
Comment thread src/sections/Meshery/meshery.style.js Outdated
@superezzdev

Copy link
Copy Markdown
Contributor Author

Hi @Maanvi212006,
whenever you have a moment, could you please review this PR? I’ve addressed the changes and verified everything locally. Thanks!

@Maanvi212006

Copy link
Copy Markdown
Contributor

@superezzdev Keep in mind that in order to improve your code pull request, you must address all bot comments by accepting them with new changes or rejecting them. In both the cases, justify your choice by commenting below that review. Repeat this cycle until zero unresolved comments remain so your code is ready for human review.

…sponsive controls

Signed-off-by: GitHub <noreply@github.com>
…w, and focus state

Signed-off-by: GitHub <noreply@github.com>
@superezzdev
superezzdev force-pushed the fix/github-star-button-7859 branch from 9e935d8 to 18a8297 Compare July 28, 2026 14:37
@superezzdev
superezzdev force-pushed the fix/github-star-button-7859 branch from 18a8297 to 0626645 Compare July 28, 2026 14:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (3)
src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js (1)

6-106: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the responsive rules mobile-first.

The base styles are desktop values and the max-width block overrides them for mobile. Set mobile values by default, then restore desktop values with @media (min-width: 769px).

Proposed adjustment
-  min-width: 200px;
-  padding: 12px 30px;
+  min-width: 180px;
+  padding: 12px 24px;
...
-  font-size: 15px;
+  font-size: 14px;
...
   .banner-count {
-    padding-left: 16px;
-    margin-left: 16px;
+    padding-left: 12px;
+    margin-left: 12px;
     border-left: 1px dashed ${({ theme }) => theme.bannerAccent || "`#2bb77c`"};
-    min-width: 55px;
+    min-width: 48px;
   }

-  `@media` (max-width: 768px) {
-    min-width: 180px;
-    padding: 12px 24px;
-    font-size: 14px;
+  `@media` (min-width: 769px) {
+    min-width: 200px;
+    padding: 12px 30px;
+    font-size: 15px;

     .banner-count {
-      padding-left: 12px;
-      margin-left: 12px;
-      min-width: 48px;
+      padding-left: 16px;
+      margin-left: 16px;
+      min-width: 55px;
     }
   }

As per coding guidelines, use “responsive mobile-first design.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js` around lines
6 - 106, Update the BannerButton responsive styles to use mobile-first defaults:
move the current mobile min-width, padding, and font-size values into the base
declarations, and replace the max-width media query with a min-width: 769px
block that restores the desktop values. Apply the same inversion to the nested
.banner-count spacing and min-width rules while preserving all other styling.

Source: Coding guidelines

src/sections/Meshery/Features-section/features-section.style.js (2)

168-172: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Dot thumbnails may overflow their 5rem-wide reserved area.

p img inside .slick-dots li is constrained only by height: 3.5rem with width: auto. If the actual thumbnails (Slide1, etc., used as customPaging images) are wider than tall, the rendered width at 3.5rem height could exceed the 5rem .slick-dots width, spilling over into the main carousel image area since there's no overflow/max-width clamp here.

♻️ Suggested guard
   p img {
     height: 3.5rem;
     width: auto;
+    max-width: 100%;
+    object-fit: cover;
     border-radius: 0.25rem;
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/sections/Meshery/Features-section/features-section.style.js` around lines
168 - 172, Update the p img rule within the slick-dots styling to constrain
thumbnail width to the dots’ 5rem reserved area while preserving the existing
3.5rem height and auto sizing behavior where possible. Add the minimal overflow
or max-width guard needed to prevent wide customPaging images such as Slide1
from spilling into the carousel area.

4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Hardcoded colors instead of theme tokens.

background-color: black, #c9fcf6 (repeated), color: white (repeated across .section-data, .smp-section, .smp-section-data), and rgba(255,255,255,0.7) are hardcoded rather than sourced from props.theme, even though theme.secondaryColor is correctly used elsewhere in this same file (e.g. lines 26, 33, 67, 163). This makes future theme/dark-mode changes error-prone and inconsistent.

♻️ Example fix pattern
-  background-color: black;
+  background-color: ${(props) => props.theme.primaryBackground || "black"};
...
-    background: `#c9fcf6`;
+    background: ${(props) => props.theme.accentColor || "`#c9fcf6`"};
...
-    h1, h2, p { color: white; }
+    h1, h2, p { color: ${(props) => props.theme.textOnDark || "white"}; }

As per coding guidelines, "Use theme values for styled-components, maintain responsive design with media queries, and follow BEM-like naming for CSS classes when used."

Also applies to: 19-19, 40-40, 55-59, 95-98, 100-106, 187-187, 192-192

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/sections/Meshery/Features-section/features-section.style.js` at line 4,
Replace the hardcoded color values throughout the styled components, including
background-color, repeated `#c9fcf6` and white text colors, and
rgba(255,255,255,0.7), with appropriate props.theme tokens. Update the affected
selectors including .section-data, .smp-section, and .smp-section-data while
preserving the existing theme.secondaryColor usage and responsive rules.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/sections/Meshery/Features-section/features-section.style.js`:
- Around line 138-140: Update the .slick-arrow rule in the features section
styles to hide react-slick arrows reliably by preserving the display:none
declaration with !important, or disable arrow rendering through the arrows
option in the Features-section component.

In `@src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js`:
- Around line 141-143: Update the cache validity condition in the GitHub star
cache parsing flow to reject future-dated entries by requiring the timestamp age
to be non-negative as well as less than one hour. Preserve the existing numeric
count validation and expiration behavior.

---

Nitpick comments:
In `@src/sections/Meshery/Features-section/features-section.style.js`:
- Around line 168-172: Update the p img rule within the slick-dots styling to
constrain thumbnail width to the dots’ 5rem reserved area while preserving the
existing 3.5rem height and auto sizing behavior where possible. Add the minimal
overflow or max-width guard needed to prevent wide customPaging images such as
Slide1 from spilling into the carousel area.
- Line 4: Replace the hardcoded color values throughout the styled components,
including background-color, repeated `#c9fcf6` and white text colors, and
rgba(255,255,255,0.7), with appropriate props.theme tokens. Update the affected
selectors including .section-data, .smp-section, and .smp-section-data while
preserving the existing theme.secondaryColor usage and responsive rules.

In `@src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js`:
- Around line 6-106: Update the BannerButton responsive styles to use
mobile-first defaults: move the current mobile min-width, padding, and font-size
values into the base declarations, and replace the max-width media query with a
min-width: 769px block that restores the desktop values. Apply the same
inversion to the nested .banner-count spacing and min-width rules while
preserving all other styling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2bb00b86-a5b1-47bb-b7a3-9809995442f4

📥 Commits

Reviewing files that changed from the base of the PR and between 9e935d8 and 18a8297.

📒 Files selected for processing (4)
  • src/sections/Meshery/Features-section/features-section.style.js
  • src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js
  • src/sections/Meshery/index.js
  • src/sections/Meshery/meshery.style.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/sections/Meshery/meshery.style.js
  • src/sections/Meshery/index.js

Comment thread src/sections/Meshery/Features-section/features-section.style.js Outdated
Comment thread src/sections/Meshery/GitHubStarButton/GitHubStarButtonBanner.js Outdated
…amp guard

Signed-off-by: GitHub <noreply@github.com>
@superezzdev

Copy link
Copy Markdown
Contributor Author

@Maanvi212006
I have replied to and resolved all Copilot and CodeRabbit bot comments with code fixes. The DCO check is passing as well. Please let me know if anything else is needed for human review!

@Maanvi212006

Copy link
Copy Markdown
Contributor

Thanks @superezzdev ! I will take a look

@superezzdev

Copy link
Copy Markdown
Contributor Author

Hi @Maanvi212006
Thankyou fir your consideration .
Please inform me if any changes needed

Signed-off-by: 𝙰𝚁𝚈𝙰 𝚁𝙲𝙱 <248160976+superezzdev@users.noreply.github.com>

@superezzdev superezzdev left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mistakenly commited in Github Button issue
this file changes was from Layout issue

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.

Enhance or replace the "Star the Repo" button

3 participants