Conversation
… activities (fixes TheNetsky#603) - Parse Explore on Bing activities dynamically from React Server Component (RSC) flight chunks via Fluent UI design tokens (findTextByClass), completely language-agnostic across all locales - Strip zero-width Unicode characters (\u200B-\u200D, \uFEFF) from titles and descriptions - Introduce offerAdapter to unify ParsedOffer to BasePromotion transformation with safe defaults - Add fallback in DailySet and MorePromotions for RSC-only offers not returned by the legacy dashboard API - Align UrlReward context with /earn (matching bootstrap and router state tree) - Simplify quest completion regex to use universal slash-based task counts without language-specific keywords
phanex
force-pushed
the
fix/earn-tab-and-explore-on-bing
branch
from
September 23, 2026 18:25
c51bb01 to
28ebf5c
Compare
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.
Summary of Changes
Microsoft Rewards has been transitioning cards and activities to the new
/earntab rendered via Next.js React Server Components (RSC), as well as converting app-exclusive activities into a new weekly punch card format. This PR introduces native support for these changes:Dynamic RSC Component Parsing (
ReactFunc.ts):findTextByClass()— a recursive tree-walker that extracts title, description, and points from RSC flight chunks using Fluent UI design tokens (text-globalBody2Strong,text-fgCtrlNeutralSecondaryRest,text-statusInformativeTintFg).\u200B-\u200D,\uFEFF) embedded by Microsoft's server-rendered text.exploreonbingcards when shared badge elements are deduplicated into external flight chunk references ($Lxx).Universal Quest Completion Regex (
ReactFunc.ts):(\d+)\s*\/\s*(\d+), relying solely on the universal fractional slash format (1/1,1/5) present across all localized interfaces (instead of matching English"tasks").Centralized Promotion Adapter (
offerAdapter.ts):ParsedOffertoBasePromotionconversion into a single reusable adapter with safe defaults (exclusiveLockedFeatureStatus,priority,activityType) to maintain DRY and prevent downstream type issues.RSC Fallbacks in Activity Runners:
DailySet.tsandMorePromotions.ts, added fallback toreactSnapshot.offers/reactSnapshot.reportablewhen the legacy dashboard API returns an empty list.PromotionActivityRunner.ts, check bothnameandofferIdforexploreonbing.Aligned Server Action Context (
UrlReward.ts):url,referer, androuterStateTreefrom legacydashboardtoearnto match the bootstrap context and defaultBrowserFuncbehavior.RewardsApp Weekly Punch Card Support (
PunchCards.ts):isClaimChild()to avoid mistakenly matchingrewardwithinurlrewardoffer IDs (e.g.WW_pcchild{N}_urlreward_{Day}_RewardsApp_weekly_Exclusive_*).UrlRewardactivities instead of falsely attempting to POST to the claim endpoint.Testing
de-DE).npm run build) and ESLint (npm run lint) pass with 0 errors.Fixes #603