Repository navigation
Conversation
Re-running the CI gates locally showed the baseline was broken well beyond any single PR: `eslint src` crashed at config load, `tsc --noEmit` reported 500 errors across 115 files, and every Jest suite died inside `src/app/lib/env.ts` before a single test ran. This change repairs those sources so the checks can actually execute and so the claims-list (V2-FE-109) contract is correct. - repair merge-corrupted and truncated sources: (dashboard)/page.tsx, claims/[id]/page.tsx, SiweSessionPanel, AdminDashboard, the transaction-states a11y test, the e2e production route smoke spec, and the six governance-role components plus their story and test - env.ts: stop reading NEXT_PUBLIC_* as bare identifiers (this crashed Jest and next.config), add the missing assertProductionEnv export, and validate chains from wagmi/chains - format.ts: add formatLocalDateTime/formatUtcDateTime/formatRelativeAge/ getPaginationWindow, which protocol-time, ClaimSettlement and the worldcoin cards already import, and fix invalid Intl option values - claims list: derive the visible row range from rendered rows, keep the previous projection across filter/page changes, report age-stale projections, export classifyClaimsListError, reject unsupported params, and give the scrollable table a labelled, keyboard-focusable region without a repeated landmark - tests: move stale consumers onto ActiveClaimsTableContainer, convert six suites off vitest imports that Jest cannot load, and complete the truncated governance-role story/test Verified locally: 10 suites / 131 tests pass across protocol-time, the claims table and its hook, the governance screens, and the accessibility gates. Full lint and type-check still report pre-existing baseline errors in unrelated files; the PR description records every remaining failure with counts. Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Resolves the conflict in src/app/lib/env.ts introduced by upstream's "Restore frontend CI baseline" (807f017), which added its own copies of assertProductionEnv on top of the ones this branch repairs. The merged file now exports exactly one production-only guard: an unconditional validator would fail `next build` for development and test targets, because next.config.ts calls it on every target. Verified on the merged tree: 10 suites / 131 tests pass; no lint or type errors in any file this PR touches. Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Contributor
|
resolve conflicts @felixumeh |
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.
##closes #402
Linked task
Closes: #402
Head SHA reviewed:
076bb8684a58b70a84e4a37d8e86bb5d1d1c27bbSummary
This PR repairs the sources that stop the frontend gates from executing at all, and makes the claims-list work (V2-FE-109) contract-correct. It was produced by running the CI checks locally —
lint,type-check, the Jest suites, and the Playwright spec inventory — and fixing what they actually failed on, rather than assuming the baseline was healthy.Baseline measured on
main@9d200c7(the base this work started from):mainnpm run lintA configuration object specifies rule "jsx-a11y/alt-text", but could not find plugin "jsx-a11y"(Jest.snapfiles matched the**/__tests__/**/*rule block)npm run type-checknpm run testReferenceError: NEXT_PUBLIC_CHAIN_ID is not definedfromsrc/app/lib/env.ts, loaded throughnext.config.tsplaywright test --list39328267623onmainMotivation
Several merges left
mainin a state where no check could run:5237cf7(merge offeat/v2-fe-109-active-claims-table-ownership) concatenated two different versions ofsrc/app/(dashboard)/page.tsx, a set of files were committed truncated mid-JSX, andenv.tswas shipped referencingNEXT_PUBLIC_*as if they were declared identifiers. Becauseeslint srcandjestboth die at load time, every downstream gate is skipped, so these defects have stayed invisible in review.Changes
1. Merge-corrupted and truncated sources
src/app/(dashboard)/page.tsx5237cf7: a public landing page fused with fragments of the old claimant dashboard67aa6b9established it as the home route), kept the public dispute register entry point from #702, added the#main-contentlandmark the route smoke spec asserts, and moved the landing ontoclaims.envelopesrc/app/(dashboard)/claims/[id]/page.tsxdiv,h-tentypo,VerificationActionsmissing its requiredstakeAmount, implicitly-anyhandlersstakeAmount, typed thegetClaimByIdhandlers, and made the rejection checkinstanceof Errorsrc/components/auth/SiweSessionPanel.tsxuseMemo; the container half was missinguseSiweAuthreturn shape (toSiweSignInIntent,ConnectButtonslot, correctSiweSignInIntenttype name)src/components/features/admin-dashboard/AdminDashboard.tsxref=errorSummaryRef}— invalid JSX that blocked the whole fileref={errorSummaryRef}src/__tests__/accessibility/transaction-states.test.tsxexpect(onRetry).toH`aveBeenCalledTimes(1);expect(onRetry).toHaveBeenCalledTimes(1)e2e/e2e/production-route-smoke.spec.ts@playwright/testimported with smart quotes;test(`${route.name}…missing backticksplaywright test --listnow reports 14 testsRoleAdministration, its story and test,RoleMemberList,PendingRoleChangeList,AuthoritySourceSummary,GrantRevokePreparationForm,RoleAdministrationUnavailableState)src/app/types/governance-roles.tsanduseRoleAdministrationData: loading/empty/unavailable states, authoritative source-class table, timelock labelling, and a preparation form whose submission stays disabled2. Runtime blockers
src/app/lib/env.ts—NEXT_PUBLIC_CHAIN_IDand friends were used as bare identifiers insidevalidateEnv, so the module threwReferenceErroron import. That single defect failed every Jest suite and blockednext.config.ts. Also added theassertProductionEnvexport thatnext.config.tsalready imported (it did not exist on this base), and validate supported chain IDs fromwagmi/chainsinstead of a nonexistentchainsexport fromwagmi.src/app/lib/format.ts—formatLocalDateTime/formatUtcDateTimewere imported byprotocol-time.ts,ClaimSettlement.tsx, and both worldcoin cards but never existed;formatRelativeAgeandgetPaginationWindowwere specified byclaim-list.helpers.test.tsbut also missing. Added all four, removed re-exports offormatRelativeTime/formatTimeZone/formatWalletAddress(never present in@/lib/format), and fixedhour: "two-digit"→"2-digit"andIntl.DateTimeFormatPartType→Intl.DateTimeFormatPartTypes.3. Claims-list contract (V2-FE-109)
pageSize→ a 1-row page read "Showing 1–10 of 42 claims"placeholderData: keepPreviousDatakeeps the projection on screen until the next resolvesfreshnessmarked a projection stalestaleAfterMsis reportedready-staleerrorregardless of contextclassifyClaimsListErrormapsPROJECTION_STALEtoready-stale; everything else fails closed toerror4. Accessibility
ConfidenceMeterdropped therole="region"wrapper. Rendering one landmark per table row tripped axe'slandmark-unique; the accessible name stays on the<meter>, so nothing is lost for assistive tech.ActiveClaimsTablescroll container is now a labelled, keyboard-focusable region (role="region",aria-label,tabIndex={0},min-w-[640px]) so the horizontal data table can be scrolled without a pointer (WCAG 2.1.1). The search row now stacks full-width belowsmand can shrink instead of overflowing.eslint.config.mjs— two configuration fixes that unblock the lint gate itself, both justified in-file: ignore**/*.snap(generated artifacts matching the__tests__rule block crash plugin resolution), and excludesrc/testing/**from the fixture-import boundary (it is test-only harness code, not production).5. Test-suite repairs
useClaimSubmissionWizard,evidence,validation,privileged-separation,ClaimDetailsStep,RoleAdministration) importedvitest, which cannot be loaded from a CommonJS Jest run; converted to Jest globals.mobile-workflows(accessibility + responsive) andPublicClaimantJourneystill rendered<ActiveClaimsTable />with no props and expected fetch-driven rows. Perdocs/ACTIVE_CLAIMS_TABLE_ARCHITECTURE.md, query behaviour belongs toActiveClaimsTableContainer; the journey harness now feeds canonicalClaimListItemfixtures.useClaimsList.test.tsxwas updated to the hook's real result shape (envelope) and param names (initialPage), while keeping the fail-closed assertion for unsupported params.stakeAmountto theVerificationActionscall in the claim-detail page.Merge with
upstream/mainupstream/mainmoved 34 commits while this branch was open, including its own807f017 Restore frontend CI baseline. The merge had a single conflict, insrc/app/lib/env.ts, and it was resolved by de-duplicatingassertProductionEnv: after the merge the file exported three copies (two of them from upstream, one unconditional validator that returnsEnv). An unconditional guard is wrong here —next.config.tscalls it on every target, so it would failnext buildfor development and test. The merged file keeps exactly one production-only, void-returning guard.Numbers below are measured on the merged tree.
Verification
Run locally against the final files; exit statuses are captured directly, not via output filters.
Repo-wide, on the merged tree:
main@9d200c7eslint srctsc --noEmit(The counts moved between the two columns partly because upstream landed its own baseline work; both figures were re-measured after the merge.)
Known baseline gaps (out of scope, untouched)
These remain red on
mainand are not introduced or worsened by this PR:@/components/ui/FormErrorSummary,@/hooks/useFormErrorSummary,@/lib/routes/redirects,@/lib/api/claims,@/lib/telemetry/redact,@/lib/health/composeOperationalHealth,@/components/evidence/evidence-upload-preflight. They blockclaim-detail-canonicalandAdminDashboardsuites from loading.react-hooks/refsduring render, redundant ARIA roles, unescaped entities, explicitany).src/__tests__/integration/offline-read-resilience.test.tsx(6 failures) still imports@/app/(dashboard)/pageas a claimant dashboard.67aa6b9turned that route into the public landing page without updating the test.responsive/mobile-workflows(1 failure):IdentityPagerenders an undefined Worldcoin component.next buildand E2E were not run. Note for CI:assertProductionEnvgenuinely validates production configuration, so the build job needs realNEXT_PUBLIC_*values; today it fails closed.main's last CI run was red on Lint, Accessibility, Artifacts, and provider drift.Reviewer notes
eslint-disable(jsx-a11y/no-noninteractive-tabindex) covers the scrollable data-table region. The rule has no scroll-container exception, and the responsive contract requirestabindex="0"for keyboard scrolling.Issues
Follow-up to #558 (STAB-FE-003 — Restore the Post-Wave-9 Frontend CI Baseline), which tracks the repo-wide remainder listed above.
Related: #378 (V2-FE-109 — Stabilize Claim Search, Filtering, and Pagination) and #636 (UI-FE-065 — Add Production-Build Smoke Coverage for Every Canonical Route).