feat: seal user feature flag only - #241
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🟡 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),isSealFilterEnabledstill defaults to false, sohasNoAccessremains true and the search renders the locked row instead of allowing the user to search by seal. This contradicts the stated behavior thatisSealEnabledgrants 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.
4d05b01 to
428b34a
Compare
|
*Lighthouse ran on https://mobilitydatabase-my8gubqmx-mobility-data.vercel.app/ * (Desktop)
*Lighthouse ran on https://mobilitydatabase-my8gubqmx-mobility-data.vercel.app/feeds * (Desktop)
*Lighthouse ran on https://mobilitydatabase-my8gubqmx-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
*Lighthouse ran on https://mobilitydatabase-my8gubqmx-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
*Lighthouse ran on https://mobilitydatabase-my8gubqmx-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
|
Summary:
closes #189
To access and view anything related to the seal of reliability you must now have the user feature flag
isSealEnabledon your emailExpected 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
Authed but
isSealEnabled=falseAuthed and `isSealEnabled=true
Testing tips:
isSealEnabled=false(default) see if the seal elements show up (they should not)isSealEnabled=truesee if the seal elements show up (they should)Important to know
Please make sure these boxes are checked before submitting your pull request - thanks!
yarn testto make sure you didn't break anything