Skip to content

feat: seal of reliability analysis page official stable - #193

Merged
Alessandro100 merged 21 commits into
mainfrom
feat/186-seal-of-reliability-analysis-page-official-stable
Sep 10, 2026
Merged

feat: seal of reliability analysis page official stable#193
Alessandro100 merged 21 commits into
mainfrom
feat/186-seal-of-reliability-analysis-page-official-stable

Conversation

@Alessandro100

Copy link
Copy Markdown
Contributor

Summary:

closes #186

  • Creates the banner of the seal of reliability + the official + stable criterion states
  • Wires the endpoints needed to provide data to the seal analysis page

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

"seal_dev_full_pass"
"seal_dev_ineligible_deprecated"
"seal_dev_in_grace_period"
"seal_dev_never_evaluated"
"seal_dev_on_probation"
"seal_dev_seal_lost"
"seal_dev_seasonal"
"seal_dev_stable_fail_too_new"
"seal_dev_stable_fail_unstable_url"
"seal_dev_unknown_criterion"
"seal_dev_unofficial"

The link to the seal page ex feeds/gtfs/seal_dev_stable_fail_unstable_url/seal-of-reliability

Notes

  • Once the real seal of reliability is included, the styling of the banner is subject to change depending on the logo

Technical Notes

  • All the endpoints related to the seal: /reliability available continuous_coverage are collectively cached for 6 hours (auth or guest). They will refresh early on a feed revalidation (feed change, or seal status change)
  • If the reliability endpoint fails, it will show a full page error

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with yarn test to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)
Screenshot 2026-09-09 at 09 39 22 Screenshot 2026-09-09 at 09 39 47 Screenshot 2026-09-09 at 09 40 48 Screenshot 2026-09-09 at 09 40 56 Screenshot 2026-09-09 at 09 41 05 Screenshot 2026-09-09 at 09 41 21

@Alessandro100
Alessandro100 requested a balanced review from Copilot September 9, 2026 13:42
@Alessandro100 Alessandro100 self-assigned this Sep 9, 2026
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
mobilitydatabase-web Ready Ready Preview Sep 9, 2026 4:36pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

  • fetchAuthedSealAnalysisData returns undefined when 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 with notFound() (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

  • fetchGuestSealAnalysisData returns undefined when 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.

Comment thread src/app/screens/Feed/components/SealSection.tsx Outdated
Comment thread src/app/constants/sealCriteria.ts
};
}

return { ...base, variant: 'default' };
icon={<StatusIcon aria-hidden />}
label={t(CRITERION_STATUS_LABEL_KEYS[displayStatus])}
sx={{
color,
Comment thread src/app/screens/Feed/components/SealSection.tsx Outdated
Alessandro100 and others added 4 commits September 9, 2026 09:51
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>
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/ * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 100 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/feeds * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 86 🟠 88 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🔴 49 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 94 🟠 84 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-h8zjxmjzc-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 97 🟢 94 🟢 96 🟢 100

@emmambd emmambd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Some very minor comments from me:

  1. The On Probation and Unofficial states need periods at the end of the last sentence:
Image Image
  1. 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.

@emmambd

emmambd commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

None of the paths return any components for me anymore:
Screenshot 2026-09-09 at 12 49 30 PM

@abigailmbd

Copy link
Copy Markdown

Hey! Yeah, I'm not able to see anything:
Screenshot 2026-09-09 at 13 14 48

@Alessandro100

Copy link
Copy Markdown
Contributor Author

try again on a different feed or incognito mode, I fixed a setting

@emmambd

emmambd commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

LGTM!

@abigailmbd abigailmbd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Alessandro100
Alessandro100 merged commit 28dbb3c into main Sep 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Seal Detail Page + Official and Stable criteria

5 participants