Skip to content

fix(gnome-extensions): render missing and unavailable extension data states - #1122

Open
castrojo wants to merge 1 commit into
projectbluefin:v4from
castrojo:fix/gnome-extensions-render-states
Open

fix(gnome-extensions): render missing and unavailable extension data states#1122
castrojo wants to merge 1 commit into
projectbluefin:v4from
castrojo:fix/gnome-extensions-render-states

Conversation

@castrojo

@castrojo castrojo commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1095.

GnomeExtensions.tsx (the single-extension card used in docs like tips.mdx)
never transitioned out of Loading... when the requested extensionId was
absent from the generated array, and it would throw if the fetch script ever
emitted the repo's documented unavailable payload ({ unavailable: true, stateReason }, per AGENTS.md → Data pipelines) instead of an array, since
.find() isn't defined on that shape.

Separately, scripts/fetch-gnome-extensions.js violated that same documented
rule: when every extension fetch failed it called console.error +
process.exit(1), failing the build, instead of writing the unavailable
payload and exiting 0 like every other fetch-*.js script in this repo.

Changes

  • src/components/GnomeExtensions.tsx: replaced the single nullable
    extension state with an explicit loading | found | not-found | unavailable state machine. The unavailable payload is now detected via a
    type guard before calling .find(), and a not-found id renders a message
    instead of hanging at Loading... forever.
  • scripts/fetch-gnome-extensions.js: added unavailablePayload() /
    writeUnavailable(), used both when all extension fetches fail and in the
    top-level catch, so the script never exits non-zero and always leaves a
    valid, visible-reason JSON file behind.
  • scripts/fetch-gnome-extensions.test.js: added a test for the new
    unavailablePayload() export.

Verification

  • npm test (486/486 passing)
  • npx tsc --noEmit — no new errors (one pre-existing, unrelated error in
    MusicPlaylist.tsx)
  • npx eslint src/components/GnomeExtensions.tsx scripts/fetch-gnome-extensions.js scripts/fetch-gnome-extensions.test.js
    — 0 errors, only pre-existing Docusaurus-link/heading warnings

— hive: backend=copilot model=claude-sonnet-5

🐝 Hive Agent: contributor | SHA: 2a8eefab

…states

- GnomeExtensions.tsx now models loading/found/not-found/unavailable
  states explicitly instead of a single nullable extension, so a
  requested id absent from the array renders a message instead of
  staying at 'Loading...' forever.
- Guard against the documented { unavailable: true, stateReason }
  payload before calling .find() on it, which previously would throw.
- fetch-gnome-extensions.js now follows the repo's data-pipeline rule
  (AGENTS.md: never fail the build) by writing that unavailable
  payload and exiting 0 instead of process.exit(1) when every
  extension fetch fails.

Closes projectbluefin#1095

Assisted-by: Claude Sonnet 5 via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: castrojo <castrojo@users.noreply.github.com>
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