Skip to content

feat: seal user feature flag only - #241

Merged
Alessandro100 merged 4 commits into
mainfrom
feat/189-seal-user-feature-flag-only
Sep 16, 2026
Merged

Alessandro100 merged 4 commits into
mainfrom
feat/189-seal-user-feature-flag-only

Conversation

@Alessandro100

Copy link
Copy Markdown
Contributor

Summary:

closes #189

To access and view anything related to the seal of reliability you must now have the user feature flag isSealEnabled on your email

Expected behavior:

Gated seal UI elements: The search for seal, displaying the seal on the search table, displaying the seal chip in the feed detail page, displaying the seal section on the feed detail page, the links to the seal description page

Not Authed

  • Will not see the seal elements as described above

Authed but isSealEnabled=false

  • Will not see the seal elements as described above

Authed and `isSealEnabled=true

  • Will see all the seal elements as described above`

Testing tips:

  1. From an unauthenticated state, see if the seal elements show up (they should not)
  • Try to manually enter a seal detail page, you should get a 404
  1. From an authenticated state with isSealEnabled=false (default) see if the seal elements show up (they should not)
  • Try to manually enter a seal detail page, you should get a 404
  1. From an authenticated state with isSealEnabled=true see if the seal elements show up (they should)

Important to know

  • The description pages are not displayed in the navigation but if people know the URL they can access it directly

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)

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

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

The current gate does not enforce a true route-level 404, requires an undocumented second flag, and introduces lint and Cypress failures.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Introduces per-user gating for Seal of Reliability UI and routes using isSealEnabled.

Changes:

  • Replaces global Remote Config checks with a user feature flag.
  • Gates seal badges, links, filters, summaries, and analysis routes.
  • Blocks the unauthenticated seal-detail route.

Applied Vercel React/Next.js review guidance.

File summaries
File Description
SearchTable.tsx Gates seal badges.
AdvancedSearchTable.tsx Gates advanced-table seal badges.
FeedSummary.tsx Gates seal summary content.
ClientQualityAnalysisButton.tsx Gates the analysis link.
UserFeatureFlags.ts Defines isSealEnabled.
useSealOfReliabilityFilterAccess.ts Combines seal entitlements.
SealOfReliabilityChip.tsx Gates feed-detail seal chips.
Footer.tsx Gates the seal resource link.
FeedsScreen.tsx Passes user gating to search tables.
static/seal-of-reliability/page.tsx Returns 404 for unauthenticated users.
authed/seal-of-reliability/layout.tsx Adds a client-side entitlement gate.
Review details

Suppressed comments (1)

src/app/hooks/useSealOfReliabilityFilterAccess.ts:33

  • With only isSealEnabled=true (the state promised by the PR), isSealFilterEnabled still defaults to false, so hasNoAccess remains true and the search renders the locked row instead of allowing the user to search by seal. This contradicts the stated behavior that isSealEnabled grants all seal UI. Either make the new flag the filter entitlement too, or explicitly require/provision both flags and update the contract.
    flags: { isSealEnabled, isSealFilterEnabled },
    isResolved,
  } = useUserFeatureFlags();

  const isPending = isAuthenticated && !isResolved;
  const hasNoAccess = !isPending && (!isAuthenticated || !isSealFilterEnabled);
  • Files reviewed: 11/11 changed files
  • Comments generated: 4
  • Review effort level: Balanced

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

Comment thread src/app/interface/UserFeatureFlags.ts
@github-actions

Copy link
Copy Markdown

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

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

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

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

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

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

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

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

@Alessandro100
Alessandro100 merged commit b35a0bc into main Sep 16, 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.

Modify the seal of reliability flag gating so the "disabled" functionality does not appear

3 participants