feat(discover-weekly): put the feature behind the discover_weekly flag - #14581
Merged
Conversation
Discover Weekly is merged to main but has never shipped, and web/desktop deploys are gated on a manual approval that batches everything sitting on main. Unrelated fixes are waiting on that approval, so the mix needs an off switch rather than a revert. Adds `discover_weekly`, defaulted off in production and on in development. Gated at three points, which is every way in: - The web banner (Explore desktop, Explore mobile-web, desktop feed) - The native banner (Explore, feed) - The web page, which is reachable by URL and so redirects to Explore rather than 404ing on a link that predates the rollout The banners already returned null on an empty or failed mix, so the surfaces around them are built to tolerate a missing banner -- the flag check rides that same return. The native screen is reachable only through the native banner, so it needs no separate gate. `enabled` is threaded into `useDiscoverWeekly` at each site so a disabled flag costs no request. `DISCOVER_WEEKLY_PAGE` stays in `staticRoutes`: dropping it would make `/explore/discover-weekly` parse as a user handle while the flag is off. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Discover Weekly is fully merged to
mainbut has never shipped. Web/desktop don't auto-deploy — they're gated on a manualProductionenvironment approval that ships everything sitting on main as one batch. There are unrelated fixes waiting on that approval, and approving it today would take Discover Weekly to prod along with them.A flag is the cheap way out: ship the batch, leave the mix dark, turn it on deliberately.
What
Adds
FeatureFlags.DISCOVER_WEEKLY(discover_weekly) — off in production defaults, on indevelopmentso local/dev keeps working unchanged.Gated at three points, which covers every entry:
DiscoverWeeklyBanner(web)DiscoverWeekly(native)DiscoverWeeklyPage(web)/explore/discover-weeklyURLBoth banners already returned
nullon an empty or failed mix, so every surface that renders them is built to tolerate a missing banner — the flag check rides that same early return, and no layout changes were needed. Verified the containers: the desktop Explore section list wraps each entry in aFragment(no DOM node, so no stray flex gap), mobile Explore is agapcolumn, and the native feed passes it as aheader.The web page redirects to Explore instead of 404ing, since the URL is public and shareable. It waits on
isLoadedfirst so an enabled user isn't bounced on the first frame.enabledis threaded intouseDiscoverWeeklyat each call site, so a disabled flag costs no API request.Notes
DiscoverWeeklyScreenis reachable only through the native banner (no deep link maps to it), so it needs no separate gate.DISCOVER_WEEKLY_PAGEdeliberately stays instaticRoutes— dropping it would make/explore/discover-weeklyparse as a user handle while the flag is off.Testing
tsc --noEmitclean incommon,web, andmobileeslintclean on all four changed files (run from each package root)responsiveCoverage.test.tspasses (3/3) — it asserts againstDiscoverWeeklyPage.tsx🤖 Generated with Claude Code