Skip to content

Show repo star counts in the Mobile and Desktop dropdowns - #605

Open
simonhamp wants to merge 2 commits into
mainfrom
claude/dropdown-repo-stars-0a822d
Open

simonhamp wants to merge 2 commits into
mainfrom
claude/dropdown-repo-stars-0a822d

Conversation

@simonhamp

@simonhamp simonhamp commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

The "GitHub" item in the header's Mobile dropdown is now titled nativephp/mobile-air, and the one in the Desktop dropdown is nativephp/desktop, with the nativephp/ part in a lighter grey. Their subtext is the repo's star count, like "1.2k stars", instead of "Visit our GitHub repository". The links still go to the same repos. The dropdown item component has a new optional title-prefix prop for the lighter part.

Star counts come from a new github:sync-repo-stars command, scheduled daily at 09:00 next to the other GitHub jobs. It calls the GitHub repos API (using GITHUB_TOKEN when it's set) and stores each count with Cache::forever. Page requests only read the cache, so they never hit GitHub. If a fetch fails, the old count stays in place and the command exits non-zero. The new methods live on the existing App\Support\GitHub class, whose $package is now a public readonly property so the command can print it.

Things to watch:

  • The counts only appear once the command has run. After deploying, warm the cache with php artisan github:sync-repo-stars. Until then the subtext shows "GitHub".
  • This relies on the scheduler running in production. A cache:clear on deploy would also wipe the counts until the next run or a manual one.
  • The item's aria-label comes from the title, so screen readers will now hear "nativephp/mobile-air" and "nativephp/desktop" rather than "GitHub".

Tests are in tests/Feature/GitHubRepositoryStarsTest.php and use Http::fake().

🤖 Generated with Claude Code

simonhamp and others added 2 commits November 10, 2026 11:08
The GitHub items in the header dropdowns are now titled mobile-air and
desktop, with the repo's star count as the subtext. A new
github:sync-repo-stars command fetches both counts once a day and caches
them forever, so a failed fetch keeps the last good value and page
requests never call GitHub. With nothing cached the subtext falls back
to "GitHub".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dropdown items now read nativephp/mobile-air and nativephp/desktop,
with the nativephp/ part at 60% opacity. The item component takes a new
title-prefix prop for this, and the aria-label includes the prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant