main ← merefield:feature/github-repo-onebox-metadata
opened 01:36PM - 06 Oct 26 UTC
GitHub repository oneboxes currently show the repository title, thumbnail and de…scription, but no repository metadata. Add a compact footer with the primary language and nonzero star and fork counts, similar to GitHub's pinned repository cards.
Counts below 1,000 remain exact. Larger counts use one decimal place and Discourse's localized compact-number units and decimal separator, for example `195.9k stars` and `17.0k forks`. Count labels use localized singular/plural forms. Missing or blank languages and zero or missing counts are omitted, and an empty footer is not rendered.
The footer uses the existing GitHub repository API response without additional requests. Styles follow Discourse's BEM conventions and wrap on narrow screens. A subdued bracketed snapshot note sits to the right of the counts, uses Discourse local-date markup, and retains its original timestamp when the cached onebox is reused. Decorative inline SVG icons follow the existing GitHub onebox templates.
Validation:
- 150 examples passed across GitHub repository, folder, pull request, issue and commit oneboxes, GitHub API handling and onebox previews.
- Tests cover compact-number boundaries, localization, singular labels, missing metadata, escaping, production onebox sanitization, snapshot timestamps/cache reuse and a single API request.
- Ruby, SCSS, YAML and translation lint checks passed.
- `git diff --check` passed.
Browser/theme combinations have not been visually verified.