feat(readme): add hideIfNotFound config and refactor components#364
Merged
Conversation
🦋 Changeset detectedLatest commit: 9743cef The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
- Add `hideIfNotFound` boolean config option (default: `false`) to the readme card NFS extension via `configSchema` in `makeWithOverrides` - When `true`, the entire card is hidden when no README.md file is found (404), rather than rendering an error message — mirrors the old `isReadmeAvailable` filter which is not available in NFS - Add JSDoc with yaml example to the config option in `alpha.tsx` - Rename `FetchComponent` to `ReadmeContent` (was a leftover name from the plugin scaffolding template) - Extract README fetch logic into a new `useReadmeContent` hook, making `ReadmeContent` a purely presentational component that accepts pre-fetched state as props - Lift state to `ReadmeCard`: it now owns the single `useReadmeContent()` call and spreads the result to both `ReadmeContent` and `ReadmeDialog`, eliminating the duplicate fetch that previously occurred when the dialog was opened - `ReadmeDialog` now accepts and passes through `ReadmeContentProps` instead of performing its own fetch - Wrap `setFullView` in `useCallback` in `useFullViewParam` to avoid unnecessary re-renders - Update tests for `ReadmeContent` and `ReadmeDialog` to pass props directly — no longer need MSW or context providers since the components are now purely presentational - Update README.md with `hideIfNotFound` usage documentation - Add `hideIfNotFound: false` example to `app-config.yaml`
63730d2 to
899e720
Compare
fridajac
previously approved these changes
Apr 30, 2026
|
I just saw this in the docs/readme |
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
Adds a
hideIfNotFoundconfig option to the readme card extension for the new frontend system, and refactors the plugin's internal component structure.New
hideIfNotFoundconfig optionWhen set to
true, the entire README card is hidden when no README.md file is found (404), instead of showing an error message. This is the NFS equivalent of theisReadmeAvailableentity filter available in the old frontend system.Component refactoring
FetchComponent→ReadmeContent(leftover name from plugin scaffolding template)useReadmeContenthook;ReadmeContentis now a purely presentational component that accepts pre-fetched state as propsReadmeCard: owns the singleuseReadmeContent()call and spreads the result to bothReadmeContentandReadmeDialog, eliminating a duplicate fetch when the dialog was openedsetFullViewinuseCallbackinuseFullViewParamTests
ReadmeContentandReadmeDialogtests — no longer need MSW or context providers since the components are purely presentational