Skip to content

fix(generate): disable OssInsight while its rankings are paused - #17

Merged
sigmanor merged 1 commit into
mainfrom
fix/ossinsight-paused
Sep 8, 2026
Merged

sigmanor merged 1 commit into
mainfrom
fix/ossinsight-paused

Conversation

@sigmanor

@sigmanor sigmanor commented Sep 8, 2026

Copy link
Copy Markdown
Member

Problem

OssInsight paused its star-based rankings, so choosing it as the collect source in Collect posts returns no repositories at all. The dropdown still offered it as an equal option to GitHub.

Change

Disable, not delete. The endpoint itself is alive and only the metric is gone, so the option stays in place as OssInsight (paused) with disabled, and the resource === 'ossinsight' fields below it are kept. Re-enabling is a one-line change if upstream recovers. SelectItem forwards props to SelectPrimitive.Item and already carries data-[disabled]:opacity-50, so no extra styling was needed.

Normalise the stored value. resource reaches state from three places, not just localStorage:

  • the useState initialiser (localStorage),
  • the settings loaded from the backend — where an existing ossinsight actually lives,
  • the offline fallback in the loadSettings catch branch.

All three now go through normalizeResource, which maps anything in PAUSED_RESOURCES back to github. Without it the form would sit on a hidden source: the trigger would show the disabled OssInsight (paused) and the fields below would render Period and Language instead of Date range and Spoken Language.

The catch branch also now always writes the normalised value to dashboardResource instead of only writing when the key is missing — otherwise a stale ossinsight would survive in localStorage.

Verification

  • npx tsc --noEmit clean, npm run build succeeds, npm test 50/50 (the existing suites do not cover this form, so they only confirm nothing else broke).
  • Not exercised in a browser; worth a quick look that the dropdown shows OssInsight (paused) greyed out and that a stored ossinsight lands on GitHub after a reload.

Related

OssInsight paused its star-based rankings, so picking it as a collect source
returns no repositories. Disable the option instead of removing it, since the
endpoint itself is alive and only the metric is gone.

A stored `ossinsight` value now falls back to GitHub through normalizeResource,
applied to all three places the resource reaches state: the localStorage
initializer, the settings loaded from the backend and the offline fallback.
Without it the form would sit on a hidden source and render the Period and
Language fields instead of Date range and Spoken Language.
@sigmanor
sigmanor merged commit ae02eef into main Sep 8, 2026
1 check passed
@sigmanor
sigmanor deleted the fix/ossinsight-paused branch September 8, 2026 10:27
@sigmanor

sigmanor commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 1.51.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant