Skip to content

feat: add client-side Kmesh version badge - #344

Open
hudazaan wants to merge 1 commit into
kmesh-net:mainfrom
hudazaan:feat/version-badge
Open

feat: add client-side Kmesh version badge#344
hudazaan wants to merge 1 commit into
kmesh-net:mainfrom
hudazaan:feat/version-badge

Conversation

@hudazaan

Copy link
Copy Markdown
  • Add a small version badge that shows the latest Kmesh release in the top navbar.
  • Badge is fetched client-side and degrades gracefully if the API is unavailable.
  • Verified that the badge appears immediately left of the search and does not shift other header elements.

Fixes #290

Signed-off-by: hudazaan <naazhuda2000@gmail.com>
Copilot AI lite review requested due to automatic review settings August 11, 2026 15:28
@kmesh-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jayesh9747 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for kmesh-net ready!

Name Link
🔨 Latest commit 0df11c4
🔍 Latest deploy log https://app.netlify.com/projects/kmesh-net/deploys/6a7b3f8b8e333f00083e8fda
😎 Deploy Preview https://deploy-preview-344--kmesh-net.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.

@kmesh-bot

Copy link
Copy Markdown
Collaborator

Welcome @hudazaan! It looks like this is your first PR to kmesh-net/website 🎉

Copilot AI 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.

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds a client-side “latest Kmesh release” version badge to the top navbar by fetching the latest GitHub release tag and rendering it into the existing navbar DOM via a React portal.

Changes:

  • Add a Docusaurus theme override for Navbar that fetches the latest GitHub release tag and portals a badge into the navbar’s right-side area.
  • Add CSS for the version badge and its container (including dark theme + mobile hiding behavior).

Reviewed changes

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

File Description
src/theme/Navbar/index.js Fetches latest release from GitHub API and injects/portals a version badge into the navbar near search.
src/css/custom.css Styles the badge/container and hides it on smaller viewports.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/theme/Navbar/index.js
Comment on lines +24 to +40
const searchEl = document.querySelector('.navbar__search, .DocSearch-Button');
const navRight = document.querySelector('.navbar__items--right');
if (searchEl) {
const searchItem = searchEl.closest('.navbar__item') || searchEl.parentNode;
const container = navRight || (searchItem && searchItem.parentNode);
if (container && searchItem) {

let existing = container.querySelector('.kmesh-version-container');
if (!existing) {
const wrapper = document.createElement('div');
wrapper.className = 'kmesh-version-container';
wrapper.style.display = 'inline-flex';
wrapper.style.alignItems = 'center';
wrapper.style.margin = '0 0.5rem 0 0';
wrapper.style.padding = '0';
container.insertBefore(wrapper, searchItem);
setContainerEl(wrapper);
Comment thread src/theme/Navbar/index.js
Comment on lines +33 to +38
const wrapper = document.createElement('div');
wrapper.className = 'kmesh-version-container';
wrapper.style.display = 'inline-flex';
wrapper.style.alignItems = 'center';
wrapper.style.margin = '0 0.5rem 0 0';
wrapper.style.padding = '0';
Comment thread src/theme/Navbar/index.js
Comment on lines +78 to +80
return () => {
mounted = false;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add version badge in navbar for better visibility

3 participants