Skip to content

feat: show github stars on addon cards and details view#34

Merged
jmaxdev merged 2 commits intoTrixtyAI:mainfrom
matiaspalmac:feat/addon-github-stars
Apr 19, 2026
Merged

feat: show github stars on addon cards and details view#34
jmaxdev merged 2 commits intoTrixtyAI:mainfrom
matiaspalmac:feat/addon-github-stars

Conversation

@matiaspalmac
Copy link
Copy Markdown
Contributor

Changes

Implements #14 — resolves the live GitHub stargazers_count for each marketplace entry at catalog load time and surfaces it in both the card grid and the details view.

Backend (Rust):

  • apps/desktop/src-tauri/src/extensions.rs: adds fetch_extension_stars(repo_url) -> Result<Option<u32>, String>. Parses owner/repo out of GitHub HTTPS URLs, calls https://api.github.com/repos/{owner}/{repo} with a required User-Agent, and extracts stargazers_count. Any failure (non-GitHub URL, network error, 403 rate-limit, 404, parse error) silently returns Ok(None) so the UI degrades gracefully with no console noise.
  • apps/desktop/src-tauri/src/lib.rs: registers the new command in invoke_handler.

Frontend:

  • apps/desktop/src/api/tauri.ts: adds the fetch_extension_stars signature to TauriInvokeMap.
  • apps/desktop/src/context/ExtensionContext.tsx: adds stars?: number to MarketplaceEntry; refreshCatalog now fetches manifest and stars concurrently per entry using Promise.allSettled so a stars failure doesn't drop the manifest (and vice versa).
  • apps/desktop/src/components/MarketplaceView.tsx:
    • DetailsView header: replaces the {t('marketplace.github_stars')} placeholder label with the actual count (entry.stars.toLocaleString()), rendered only when stars were resolved.
    • Card grid: adds a small <Star size={10}> {count} next to the version pill, same conditional render.

Not in scope (by design):

  • No caching layer — catalog refresh happens once on mount; if a refresh button is added later that's when caching makes sense.
  • No GitHub token auth — 60 req/hour anonymous covers the current marketplace size. If the registry grows significantly, adding token-based auth would be a follow-up.

Issues

Copilot AI review requested due to automatic review settings April 19, 2026 04:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds GitHub star counts to marketplace addons by resolving stargazers_count at catalog load time via a new Tauri (Rust) command and rendering the count in both the card grid and details header.

Changes:

  • Backend: introduce fetch_extension_stars Tauri command that queries the GitHub repos API and returns Option<u32> for graceful UI degradation.
  • Frontend: enrich MarketplaceEntry with stars and fetch manifest + stars concurrently per entry using Promise.allSettled.
  • UI: conditionally render star counts in marketplace cards and the details view header when available.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
apps/desktop/src-tauri/src/extensions.rs Adds fetch_extension_stars command that parses GitHub repo URLs and calls the GitHub API.
apps/desktop/src-tauri/src/lib.rs Registers the new fetch_extension_stars command in the Tauri invoke handler.
apps/desktop/src/api/tauri.ts Extends TauriInvokeMap with the fetch_extension_stars signature.
apps/desktop/src/context/ExtensionContext.tsx Adds stars to MarketplaceEntry and enriches catalog entries by fetching manifest + stars concurrently.
apps/desktop/src/components/MarketplaceView.tsx Displays stars (when present) on addon cards and in the details header.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/desktop/src-tauri/src/extensions.rs Outdated
Comment thread apps/desktop/src-tauri/src/extensions.rs
Comment thread apps/desktop/src-tauri/src/extensions.rs Outdated
Comment thread apps/desktop/src/context/ExtensionContext.tsx
@jmaxdev jmaxdev force-pushed the feat/addon-github-stars branch from b1462c3 to e495523 Compare April 19, 2026 04:15
@jmaxdev jmaxdev merged commit 5d294ed into TrixtyAI:main Apr 19, 2026
4 checks passed
@matiaspalmac matiaspalmac deleted the feat/addon-github-stars branch April 19, 2026 05:31
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.

Feat: Show Addon github stars

3 participants