feat: seal of reliability analysis page official stable - #193
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🟡 Changes recommended
A lint-blocking unused import and unresolved caching, routing, state-copy, and accessibility issues must be fixed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds the production Seal of Reliability analysis page, including criterion states, API integration, caching, localization, and error handling.
Changes:
- Adds Official and Stable criterion presentation.
- Integrates reliability endpoints with six-hour caching and revalidation.
- Adds authenticated/guest routes, tests, translations, and loading/error states.
File summaries
| File | Review summary |
|---|---|
src/app/utils/revalidate-feeds.ts |
Adds seal route invalidation. |
src/app/utils/revalidate-feeds.spec.ts |
Tests seal invalidation. |
src/app/services/feeds/types.ts |
Adds seal API types. |
src/app/services/feeds/index.ts |
Adds supporting endpoint clients. |
src/app/screens/Feed/FeedView.tsx |
Uses shared feed presentation. |
src/app/screens/Feed/Feed.functions.tsx |
Extracts feed helpers. |
src/app/screens/Feed/components/SealSection.tsx |
Adds the status banner. Critical (1 vote): unused import fails lint. Moderate (2 votes): some chip labels lack sufficient contrast. |
src/app/screens/Feed/components/SealSection.spec.tsx |
Tests banner states. |
src/app/screens/Feed/components/SealQualitySummary.tsx |
Shares seal status logic. |
src/app/screens/Feed/components/FeedSummary.tsx |
Supplies criterion context. |
src/app/screens/Feed/components/FeedReliabilityView.tsx |
Implements the analysis view. |
src/app/screens/Feed/components/FeedNavigationControls.tsx |
Extends subpage breadcrumbs. |
src/app/screens/Feed/components/FeedDetailHeader.tsx |
Extracts the shared header. |
src/app/screens/Feed/components/DataQualitySummary.tsx |
Supports unlinked seal chips. |
src/app/screens/Feed/components/CriterionStatusChip.tsx |
Adds criterion chips. Moderate (1 vote): “At Risk” label contrast is insufficient. |
src/app/screens/Feed/components/CriterionSection.tsx |
Renders criterion details. |
src/app/screens/Feed/components/CriterionSection.spec.tsx |
Tests criterion presentation. |
src/app/screens/Feed/components/AboutSealButton.tsx |
Adds the informational link. |
src/app/constants/sealCriteria.ts |
Centralizes state logic. Moderate (2 votes): fallback copy contradicts several statuses. Moderate (1 vote): unknown and never_evaluated are presented identically. |
src/app/constants/sealCriteria.spec.ts |
Tests status utilities. |
src/app/components/SealOfReliabilityChip.tsx |
Supports non-link rendering. |
src/app/components/SealOfReliability.tsx |
Adds an extra-large seal size. |
src/app/api/revalidate/route.spec.ts |
Updates invalidation assertions. |
src/app/[locale]/seal-of-reliability/how-it-is-calculated/components/HowItIsCalculatedPage.tsx |
Adds criterion anchors. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/static/seal-of-reliability/page.tsx |
Loads guest analysis. Moderate (1 vote): seal-loading failures are incorrectly converted into 404 responses. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/static/seal-of-reliability/loading.tsx |
Adds guest loading UI. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/static/seal-of-reliability/error.tsx |
Adds the guest error boundary. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/lib/seal-analysis-data.ts |
Fetches and caches analysis data. Moderate (2 votes): reliability failures are cached for six hours, preventing effective retries. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/lib/seal-analysis-data.spec.ts |
Tests analysis loading. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/lib/feed-data-shared.ts |
Refines reliability fetching. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/lib/feed-data-shared.spec.ts |
Tests reliability failures. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/components/SealReliabilitySkeleton.tsx |
Adds the page skeleton. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/components/SealReliabilityError.tsx |
Adds full-page error UI. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/authed/seal-of-reliability/page.tsx |
Loads authenticated analysis. Moderate (1 vote): missing feeds return successful responses instead of using notFound(). |
src/app/[locale]/feeds/[feedDataType]/[feedId]/authed/seal-of-reliability/loading.tsx |
Adds authenticated loading UI. |
src/app/[locale]/feeds/[feedDataType]/[feedId]/authed/seal-of-reliability/error.tsx |
Adds the authenticated error boundary. |
messages/fr.json |
Adds French seal copy. |
messages/en.json |
Adds English seal copy. |
external_types/DatabaseCatalogAPI.yaml |
Extends the API contract. |
Review details
Suppressed comments (2)
src/app/[locale]/feeds/[feedDataType]/[feedId]/authed/seal-of-reliability/page.tsx:37
fetchAuthedSealAnalysisDatareturnsundefinedwhen the feature is disabled or the feed type is not GTFS, but this renders an empty analysis page with HTTP 200. Match the guest route by rejecting this inapplicable state withnotFound()(or redirecting to the feed) instead of rendering the shell.
return (
<FeedReliabilityView feed={feedData.feed} sealAnalysis={sealAnalysis} />
src/app/[locale]/feeds/[feedDataType]/[feedId]/static/seal-of-reliability/page.tsx:65
fetchGuestSealAnalysisDatareturnsundefinedwhen the feature flag is off or the route is for GTFS-RT/GBFS. This still renders the analysis header with no seal or criterion content, leaving a directly visited disabled/inapplicable route as an empty 200 page. Return 404 (or redirect to the feed) when no analysis is applicable.
return (
<FeedReliabilityView feed={feedData.feed} sealAnalysis={sealAnalysis} />
- Files reviewed: 39/39 changed files
- Comments generated: 8
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| }; | ||
| } | ||
|
|
||
| return { ...base, variant: 'default' }; |
| icon={<StatusIcon aria-hidden />} | ||
| label={t(CRITERION_STATUS_LABEL_KEYS[displayStatus])} | ||
| sx={{ | ||
| color, |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/ * (Desktop)
*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/feeds * (Desktop)
*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
|
emmambd
left a comment
There was a problem hiding this comment.
This looks great! Some very minor comments from me:
- The On Probation and Unofficial states need periods at the end of the last sentence:
- The seasonal not applicable state looks good for the seal summary. I'd expect the Fresh: Rolling 7 Day Window component to describe in more depth that the feed is seasonal and therefore the criterion is not applicable. Just sharing as an FYI for the future.
|
try again on a different feed or incognito mode, I fixed a setting |
|
LGTM! |


Summary:
closes #186
Expected behavior:
When going on the seal of analysis page you should see the main status of the seal, it's criteria, as well as the official and stable criterion in all of their states: Pass, Fail, Grace period, probation, not evaluated, not applicable
Testing tips:
Here is a list of feed ids where you can test specific scenarios related to the seal. Assure that given the scenario it displays the correct UI state
The link to the seal page ex
feeds/gtfs/seal_dev_stable_fail_unstable_url/seal-of-reliabilityNotes
Technical Notes
/reliabilityavailablecontinuous_coverageare collectively cached for 6 hours (auth or guest). They will refresh early on a feed revalidation (feed change, or seal status change)Please make sure these boxes are checked before submitting your pull request - thanks!
yarn testto make sure you didn't break anything