Skip to content

feat(frontend): add star on github button for self-hosted instances - #848

Merged
keysersoft merged 5 commits into
HelpCode-ai:mainfrom
adityawaghamare:fix/issue-847-7376
Oct 6, 2026
Merged

keysersoft merged 5 commits into
HelpCode-ai:mainfrom
adityawaghamare:fix/issue-847-7376

Conversation

@adityawaghamare

Copy link
Copy Markdown
Contributor

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, respects NEXT_PUBLIC_HIDE_GITHUB_STAR=true environment variable, remembers user dismissal via localStorage wrapped in try/catch, and has zero external tracking or API calls.

Changes

  • Created packages/frontend/src/components/github-star-button.tsx component implementing edition check, env variable hide flag, and localStorage dismissal.
  • Integrated GithubStarButton into the bottom of packages/frontend/src/components/app-sidebar.tsx.

Verification

  • Verified build and TypeScript compatibility.
  • Checked light and dark mode styles and responsiveness in sidebar.

Closes #847

- 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>
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

👋 Welcome, @adityawaghamare, and thanks for opening your first PR on AnythingMCP!

A few quick pointers:

  • Make sure CI is green before requesting review (Backend, Frontend, Playwright, CodeQL, Trivy).
  • If this is a new adapter, the parametrised catalog.spec.ts test will validate it automatically.
  • Sign off your commits if you can — it's not blocking, just nice to have.

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.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@keysersoft keysersoft 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.

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:

  1. Put app-sidebar.tsx back as it is on main and only add <GithubStarButton /> right above the footer ({/* Footer: Settings + workspace switcher */}). That's a two-line change.
  2. 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.
  3. Make the close button a bit easier to hit: the × is very small and quite faint right now.
  4. Document NEXT_PUBLIC_HIDE_GITHUB_STAR next to the other frontend variables (.env.example).
  5. 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>
@adityawaghamare

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@adityawaghamare

Copy link
Copy Markdown
Contributor Author

Hi @keysersoft, thanks for the review! I have addressed all the feedback:

  1. Restored app-sidebar.tsx: Restored the full component from main with all navigation, icons, and workspace switcher intact, placing <GithubStarButton /> right above {/* Footer: Settings + workspace switcher */}.
  2. Native SVG Icon: Replaced the emoji with the exact 17px stroke SVG star (strokeWidth="1.9") matching the sidebar design system.
  3. Accessible Close Button: Enlarged the dismiss button hit area to h-6 w-6 with hover background feedback and a crisp SVG cross icon.
  4. Documented Env Var: Added NEXT_PUBLIC_HIDE_GITHUB_STAR under the Frontend section in .env.example.
  5. CLA Signed: Posted the CLA signature comment.

Ready for review!

github-actions Bot added a commit that referenced this pull request Oct 6, 2026

@keysersoft keysersoft 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.

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.

@keysersoft
keysersoft merged commit 66b6b9e into HelpCode-ai:main Oct 6, 2026
13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🎃 Add a "Star on GitHub" button to self-hosted instances

2 participants