Skip to content

feat: seal available compliant - #196

Open
Alessandro100 wants to merge 14 commits into
mainfrom
feat/187-seal-available-compliant
Open

feat: seal available compliant#196
Alessandro100 wants to merge 14 commits into
mainfrom
feat/187-seal-available-compliant

Conversation

@Alessandro100

Copy link
Copy Markdown
Contributor

Summary:

closes #187

Includes the seal of reliability criteria: available and compliant

Expected behavior:

It should display the correct visualizations for the criteria available and compliant based on their reliability status

Testing tips:

Using the following feed ids assure that the correct UI elements and expected state are displayed

"seal_dev_available_fail"
"seal_dev_available_fail_first_check"
"seal_dev_available_probation"
"seal_dev_available_grace_period"
"seal_dev_compliant_fail"
"seal_dev_compliant_grace_period"
"seal_dev_compliant_probation"
"seal_dev_full_pass"
"seal_dev_in_grace_period"
"seal_dev_multi_probation"

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-10 at 13 10 40 Screenshot 2026-09-10 at 13 10 58 Screenshot 2026-09-10 at 13 11 11 Screenshot 2026-09-10 at 13 11 29 Screenshot 2026-09-10 at 13 11 50 Screenshot 2026-09-10 at 13 12 00 Screenshot 2026-09-10 at 13 12 09 Screenshot 2026-09-10 at 13 12 33 Screenshot 2026-09-10 at 13 14 03

@Alessandro100
Alessandro100 requested a balanced review from Copilot September 10, 2026 17:15
@Alessandro100 Alessandro100 self-assigned this Sep 10, 2026
@vercel

vercel Bot commented Sep 10, 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 10, 2026 6:48pm 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

Data-failure states are missing, and several date, pagination, localization, and accessibility paths can render inaccurate or inaccessible results.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds detailed Available and Compliant Seal of Reliability visualizations to feed pages.

Changes:

  • Adds availability heatmaps, uptime metrics, compliance summaries, and report links.
  • Adds grace-period and probation progress displays.
  • Extends data loading, localization, skeletons, and tests.

Applied Vercel React/Next.js performance guidance.

File summaries
File Description
src/app/utils/date.ts Adds month formatting.
src/app/screens/Feed/lib/compliance-report.ts Builds compliance summaries.
src/app/screens/Feed/lib/compliance-report.spec.ts Tests compliance summaries.
src/app/screens/Feed/lib/availability-history.ts Builds availability calendars and summaries.
src/app/screens/Feed/lib/availability-history.spec.ts Tests availability logic.
src/app/screens/Feed/components/FeedReliabilityView.tsx Adds Available and Compliant cards.
src/app/screens/Feed/components/CriterionSection.tsx Supports custom bodies and deadline indicators.
src/app/screens/Feed/components/CriterionSection.spec.tsx Tests new criterion behavior.
src/app/screens/Feed/components/CriterionProbationProgress.tsx Displays probation progress.
src/app/screens/Feed/components/CriterionGraceCountdown.tsx Displays grace-period warnings.
src/app/screens/Feed/components/ComplianceCriterionBody.tsx Renders compliance details.
src/app/screens/Feed/components/AvailabilityUptimeChip.tsx Displays uptime percentage.
src/app/screens/Feed/components/AvailabilityHeatmap.tsx Renders daily availability history.
src/app/screens/Feed/components/AvailabilityCriterionBody.tsx Composes availability details.
src/app/constants/sealCriteria.ts Adds criterion probation-window logic.
src/app/constants/sealCriteria.spec.ts Tests probation aggregation.
src/app/[locale]/feeds/[feedDataType]/[feedId]/static/seal-of-reliability/page.tsx Supplies guest dataset reports.
src/app/[locale]/feeds/[feedDataType]/[feedId]/lib/seal-analysis-data.ts Fetches paginated availability history.
src/app/[locale]/feeds/[feedDataType]/[feedId]/lib/seal-analysis-data.spec.ts Tests history fetching.
src/app/[locale]/feeds/[feedDataType]/[feedId]/components/SealReliabilitySkeleton.tsx Expands the loading skeleton.
src/app/[locale]/feeds/[feedDataType]/[feedId]/authed/seal-of-reliability/page.tsx Supplies authenticated dataset reports.
messages/fr.json Adds French criterion copy.
messages/en.json Adds English criterion copy.
Review details

Suppressed comments (2)

src/app/screens/Feed/components/FeedReliabilityView.tsx:228

  • This conflates a dataset-endpoint failure with a legitimate latest dataset that has no validation report: fetchDatasets catches failures and returns [], which the guest wrapper can cache for 14 days, so both become undefined here and render “No validation report available.” Issue #187 requires a distinct data-failed state. Carry a dataset fetch-error signal into this page and avoid caching that failure as valid data.
                    report={latestDataset?.validation_report}

src/app/[locale]/feeds/[feedDataType]/[feedId]/lib/seal-analysis-data.ts:75

  • This month subtraction also overflows at month ends: on August 31, requesting February 31 normalizes the API from value to March 3, so valid February checks are never fetched. Share a UTC-safe, end-of-month-clamping calculation with buildAvailabilityCalendar so the fetched and rendered windows both cover the intended six months.
    Date.UTC(
      now.getUTCFullYear(),
      now.getUTCMonth() - AVAILABILITY_HISTORY_MONTHS,
      now.getUTCDate(),
    ),
  • Files reviewed: 23/23 changed files
  • Comments generated: 9
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

* with room to spare. The cap keeps a feed checked more than once a day from
* turning one render into an unbounded page walk.
*/
const AVAILABILITY_MAX_PAGES = 2;
Comment thread src/app/screens/Feed/components/FeedReliabilityView.tsx
Comment thread src/app/screens/Feed/components/AvailabilityHeatmap.tsx
Comment thread src/app/screens/Feed/components/CriterionSection.tsx Outdated
Comment thread src/app/screens/Feed/lib/availability-history.ts
Comment thread src/app/screens/Feed/lib/availability-history.ts Outdated
Comment thread src/app/screens/Feed/lib/availability-history.ts Outdated
Comment thread src/app/screens/Feed/lib/compliance-report.ts
Comment thread src/app/utils/date.ts
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

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

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

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

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

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

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

*Lighthouse ran on https://mobilitydatabase-cm8cqy2y9-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
🟢 98 🟠 84 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-cm8cqy2y9-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
🟠 80 🟢 94 🟢 96 🟢 100

@emmambd
emmambd requested a review from abigailmbd September 10, 2026 17:57

@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.

Great work! Some design/content feedback:

  1. Available component: I think 3 different chips in the right hand corner might be too noisy. Could we move the "x days left" information to the On probation bar and grace period text sections?
Screenshot 2026-09-10 at 2 33 30 PM Screenshot 2026-09-10 at 2 36 45 PM
  1. For when the validation report fails, revise text to "The latest validation report has 22 errors. Resolve these validation errors to pass this criterion."

We should include a link to the validation report HTML report so the user can troubleshoot further.

As a note, @abigailmbd the path for testing is /feeds/gtfs/{path-in-github-issue}/seal-of-reliability

@Alessandro100

Copy link
Copy Markdown
Contributor Author

Fixes done, and the validation report button does exist on normal feeds, this is something omitted from the fake data
ex:
image

@emmambd

emmambd commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Ah great! LGTM!

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.

Feed Page: Display Available and Compliant

3 participants