fix(gnome-extensions): render missing and unavailable extension data states - #1122
Open
castrojo wants to merge 1 commit into
Open
fix(gnome-extensions): render missing and unavailable extension data states#1122castrojo wants to merge 1 commit into
castrojo wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1095.
GnomeExtensions.tsx(the single-extension card used in docs liketips.mdx)never transitioned out of
Loading...when the requestedextensionIdwasabsent from the generated array, and it would throw if the fetch script ever
emitted the repo's documented unavailable payload (
{ unavailable: true, stateReason }, perAGENTS.md→ Data pipelines) instead of an array, since.find()isn't defined on that shape.Separately,
scripts/fetch-gnome-extensions.jsviolated that same documentedrule: when every extension fetch failed it called
console.error+process.exit(1), failing the build, instead of writing the unavailablepayload and exiting 0 like every other
fetch-*.jsscript in this repo.Changes
src/components/GnomeExtensions.tsx: replaced the single nullableextensionstate with an explicitloading | found | not-found | unavailablestate machine. The unavailable payload is now detected via atype guard before calling
.find(), and a not-found id renders a messageinstead of hanging at
Loading...forever.scripts/fetch-gnome-extensions.js: addedunavailablePayload()/writeUnavailable(), used both when all extension fetches fail and in thetop-level
catch, so the script never exits non-zero and always leaves avalid, visible-reason JSON file behind.
scripts/fetch-gnome-extensions.test.js: added a test for the newunavailablePayload()export.Verification
npm test(486/486 passing)npx tsc --noEmit— no new errors (one pre-existing, unrelated error inMusicPlaylist.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