Skip to content

feat: seal of reliability how it is calculated - #179

Open
Alessandro100 wants to merge 6 commits into
mainfrom
feat/210-seal-of-reliability-how
Open

feat: seal of reliability how it is calculated#179
Alessandro100 wants to merge 6 commits into
mainfrom
feat/210-seal-of-reliability-how

Conversation

@Alessandro100

Copy link
Copy Markdown
Contributor

Summary:

closes https://github.com/MobilityData/product-tasks/issues/210

Adds the seal of reliability "How it is calculated" page

Expected behavior:

When going on seal-of-reliability/how-it-is-calculated you should see the page and it should look good in mobile, tablet, light mode dark mode

You should be able to navigate from the seal-of-reliability page

Testing tips:

Go on seal-of-reliability/how-it-is-calculated and proof read the text, check styling on different resolutions and light mode dark mode

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-08-18 at 09 50 46 Screenshot 2026-08-18 at 09 50 51 Screenshot 2026-08-18 at 09 50 57 Screenshot 2026-08-18 at 09 51 05

@Alessandro100
Alessandro100 requested a lite review from Copilot August 18, 2026 13:51
@Alessandro100 Alessandro100 self-assigned this Aug 18, 2026
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
mobilitydatabase-web Ready Ready Preview Aug 18, 2026 4:08pm

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a localized “How it is calculated” page for the Seal of Reliability, including timeline-based visual explanations and richer rendering of translated copy.

Changes:

  • Introduces RichText + InlineCode and an inline backtick tokenizer to safely render code-ish identifiers in translations.
  • Adds a new “how it is calculated” route with multiple UI components, timeline math helpers, and unit tests.
  • Updates Seal of Reliability description page CTAs and extends EN/FR message catalogs with the new page content.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/app/utils/inline-code.ts Adds tokenizer to split translated strings into plain/code runs based on backticks.
src/app/utils/inline-code.spec.ts Unit tests for inline-code tokenization behavior.
src/app/components/RichText.tsx Renders tokenized text with inline code formatting.
src/app/components/InlineCode.tsx Provides styled inline code rendering via MUI Box.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/page.tsx Registers the new localized Next.js route + metadata/static params.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/lib/timeline.ts Adds UTC-stable timeline geometry helpers for diagrams.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/lib/timeline.spec.ts Unit tests for timeline math helpers.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/lib/content.tsx Defines scenario/example data and message keys powering the page.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/components/TimelineTrack.tsx Renders track segments/markers for timeline diagrams.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/components/ScenarioCard.tsx Renders scenario diagrams and captions using timeline helpers + translations.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/components/RollingCoverageCard.tsx Renders rolling coverage examples with markers and pass/fail chip.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/components/ResultChip.tsx Adds a pass/fail chip with icons.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/components/HowItIsCalculatedPage.tsx Implements the main page layout and sections.
src/app/[locale]/seal-of-reliability/how-it-is-calculated/components/AxisTicks.tsx Adds positioned axis tick labels for diagrams.
src/app/[locale]/seal-of-reliability/components/SealOfReliabilityDescriptionPage.tsx Adds CTAs linking to the new “how it is calculated” page.
src/app/Theme.ts Removes 'use client' and tweaks a typography spacing value.
messages/fr.json Adds EN/FR copy for the new page + new CTA labels.
messages/en.json Adds EN/FR copy for the new page + new CTA labels.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +9 to +14
export interface DateRange {
/** Inclusive ISO date (YYYY-MM-DD). */
start: string;
/** Inclusive ISO date (YYYY-MM-DD). */
end: string;
}
Comment on lines +29 to +31
export function daysBetween(startIso: string, endIso: string): number {
return (parseIsoDate(endIso) - parseIsoDate(startIso)) / MS_PER_DAY;
}
Comment on lines +84 to +94
export function placeRangeOnAxis(
range: DateRange,
axis: DateRange,
): TrackPlacement {
const leftPercent = placeDateOnAxis(range.start, axis);
const rightPercent = placeDateOnAxis(range.end, axis);
return {
leftPercent,
widthPercent: roundPercent(Math.max(rightPercent - leftPercent, 0)),
};
}
Comment on lines +240 to +246
{t('freshContinuous.scenarios.title')}
</Typography>
<Box sx={twoColumnGrid}>
{rollingCoverageExamples.map((example) => (
<RollingCoverageCard key={example.id} example={example} />
))}
</Box>
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

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

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

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

Performance Accessibility Best Practices SEO
🟠 81 🟠 87 🟢 96 🟢 100

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

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

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

*Lighthouse ran on https://mobilitydatabase-k1a83vcx1-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
🟢 98 🟢 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! I have two main thoughts:

  1. I think adding icons in the methodology section might help to make it more visual
  2. I think the timeline for "How the Seal is earned over time" in the prototype did a better job of visually explaining this process than the 3 steps. It's really important that we convey clearly that the Seal probation starts being earned once the feed meets the criteria and I think that needs a better visual to accompany it to get the point across.

@emmambd

emmambd commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Another thought - the "Aug 27th" in the "Fresh: Rolling 7 Days of Coverage" maybe is just noise that isn't contributing to the visual - it could be omitted

@emmambd

emmambd commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

LGTM! @abigailmbd's off sick today but we can wait for her feedback tomorrow before merging

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.

3 participants