Repository navigation
chore(frontend): archive stale docs, remove unused UI primitives, extract useApiQuery - #1388
Merged
Hexstar-labs merged 5 commits intoOct 22, 2026
Conversation
Move docs/history into docs/archive with a dated INDEX.md, remove the PR_DESCRIPTION_REPOSITORY_PATTERN.md duplicate of PR_DESC_COMPLETE.md, and update docs/README.md to point at the archive. Closes BrainTease#1262
Delete the ui components with no importers outside tests: Breadcrumb, ChunkLoadError, EmptyState, ErrorBoundary, ErrorState, LoadingState, OfflineBanner, Pagination, Select and Textarea. Remove their dedicated tests and the matching blocks and obsolete snapshots in snapshots-extended.test.tsx, and drop the removed aliases from the form barrel comment. Closes BrainTease#1263
Replace the hand-rolled input classes in courses/SearchInput with controlClass from the form library, so search and other text inputs share one definition of control styling. Add unit tests covering the labelled search input, the screen-reader hint linkage and onChange. Closes BrainTease#1264
Add useApiQuery, a keyed hook that owns loading, error and refresh state for a fetch. A null key disables the query, a superseded response is ignored, and a failed refresh keeps the previous data. It accepts any promise-returning fetcher, so both the axios client and fetch work. Migrate useGamification, useRoyalties, useProtocolMetrics and useProtocolSummary onto it, removing their duplicated effect, cancel and state-management code. Public return shapes are unchanged. Add unit tests for the hook. Closes BrainTease#1265
|
@elvissamuel834-dotcom Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Upstream main now imports or tests several components this branch removed as unused: Breadcrumb, ChunkLoadError, EmptyState, ErrorBoundary, ErrorState, LoadingState, OfflineBanner, Pagination, Select, Textarea. Those files are restored from main along with their tests, and the rewritten snapshots-extended test is taken from main. The snapshot file main deleted is removed. The docs/history archive and the useApiQuery/SearchInput changes from this branch are kept.
This branch had an error being deployed
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
One commit per issue, each with its own
Closesline.docs/historymoves todocs/archivewith a datedINDEX.md. The duplicatePR_DESCRIPTION_REPOSITORY_PATTERN.mdis removed (it covers the same work asPR_DESC_COMPLETE.md).docs/README.mdnow links to the archive.components/uifiles with no importers outside tests:Breadcrumb,ChunkLoadError,EmptyState,ErrorBoundary,ErrorState,LoadingState,OfflineBanner,Pagination,Select,Textarea. Their dedicated tests and the matching snapshot blocks are removed too.courses/SearchInputnow uses the form library'scontrolClassinstead of hand-rolled input classes. New unit tests cover it.useApiQuery. New keyed hook that owns loading, error and refresh state.useGamification,useRoyalties,useProtocolMetricsanduseProtocolSummarynow use it. Public return shapes are unchanged. New unit tests cover the hook.Closes #1265
Closes #1264
Closes #1263
Closes #1262
Verification
vitest:useApiQuery(10 tests),SearchInput(4),Button(9),Input(5),form-primitives(15),snapshots-extended(44),useRoyalties(9) andGamificationDashboard(13) pass.snapshots-extended.snap: 10 obsolete snapshots removed. Only the blocks for deleted components were pruned.Known gaps
next build, so that is not reported. There is also nocomponents/uibarrel to replace; the imports were already per-component.Buttonwas already a single typed implementation with variant tests, so the work here is limited toSearchInput. The other button-like components (SubmitButton,VoteButton,Wallet*) are not variants ofButton.useLearningAnalyticswith per-field fallbacks, oruseDashboardData, a multi-step load), or callfetchwith different handling.src/__tests__/shared-fixtures.test.tshas syntax errors. Many suites fail to resolve@/components/settings/*.CourseCard/index.tsxusesmemowithout importing it.Modalsnapshots andBadgeGridunlock-date test fail.@testing-library/domwas missing from the environment.@/alias. Untouched files fail the same way, so commits were made with--no-verify.