feat(frontend): add star on github button for self-hosted instances - #848
Conversation
- Closes HelpCode-ai#847 - Files: packages/frontend/src/components/github-star-button.tsx, packages/frontend/src/components/app-sidebar.tsx Signed-off-by: Aditya Waghamare <adityawaghamare7620@gmail.com>
|
👋 Welcome, @adityawaghamare, and thanks for opening your first PR on AnythingMCP! A few quick pointers:
Someone from the core team will look at this within ~48h. If you don't hear back, please ping us in Discussions / Q&A. ⭐ While you wait — if you find AnythingMCP useful, a star helps others discover it. |
|
All contributors have signed the CLA ✍️ ✅ |
keysersoft
left a comment
There was a problem hiding this comment.
Thanks for picking this up! The button itself is close to what we want: no request to GitHub, hidden on Cloud, the env var and the dismiss in localStorage are all there.
The problem is app-sidebar.tsx. The PR replaces the whole file with an excerpt (it even starts with // File: ... (Excerpt showing integration) and has // ... existing code ... in the middle). That removes 'use client', the navigation, the icons and the workspace switcher, and it uses collapsed, navLinks and menuRef, which don't exist, so the frontend doesn't build.
Could you:
- Put
app-sidebar.tsxback as it is onmainand only add<GithubStarButton />right above the footer ({/* Footer: Settings + workspace switcher */}). That's a two-line change. - Use an SVG icon instead of the ⭐ emoji, in the same style as the other sidebar icons (stroke, 17px), so it matches light and dark theme.
- Make the close button a bit easier to hit: the
×is very small and quite faint right now. - Document
NEXT_PUBLIC_HIDE_GITHUB_STARnext to the other frontend variables (.env.example). - Sign the CLA (one comment, the bot explains it) and add the light and dark screenshots the issue asks for.
I tried your component in the real sidebar to see how it looks, it fits well at the bottom. Happy to review again as soon as you push.
- Restore complete app-sidebar.tsx from main and cleanly integrate GithubStarButton - Replace emoji with native SVG star matching sidebar icon stroke style - Enlarge dismiss close button target for better accessibility - Document NEXT_PUBLIC_HIDE_GITHUB_STAR in .env.example Signed-off-by: Aditya Waghamare <adityawaghmare8694@gmail.com>
|
I have read the CLA Document and I hereby sign the CLA |
|
Hi @keysersoft, thanks for the review! I have addressed all the feedback:
Ready for review! |
…e set on the Docker image; the dismiss button covers it
keysersoft
left a comment
There was a problem hiding this comment.
This looks good now, thanks for restoring the sidebar properly. I pushed one small commit on top: merged main and took out NEXT_PUBLIC_HIDE_GITHUB_STAR. NEXT_PUBLIC_ vars get baked in when the frontend is built, so on the Docker image people actually run it could never be switched on, and the dismiss button already covers the "I don't want this" case. Your CLA check was red only because the push and the signature landed at the same moment, a rerun fixed it.
I'll merge once CI is green on the new commit.
Summary
Adds an unobtrusive "⭐ Star on GitHub" button to the sidebar for self-hosted instances of AnythingMCP, fulfilling the October Challenge #847 requirements. It uses
useEdition()to ensure it only appears on self-hosted instances, respectsNEXT_PUBLIC_HIDE_GITHUB_STAR=trueenvironment variable, remembers user dismissal vialocalStoragewrapped in try/catch, and has zero external tracking or API calls.Changes
packages/frontend/src/components/github-star-button.tsxcomponent implementing edition check, env variable hide flag, and localStorage dismissal.GithubStarButtoninto the bottom ofpackages/frontend/src/components/app-sidebar.tsx.Verification
Closes #847