feat(featured-stream): off-web exclusion, ad-free close, keep through lobby wait - #4698
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
ChangesFeatured stream behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
080b020 to
ce22a23
Compare
ce22a23 to
361ab0f
Compare
…ee users - Platform gate: never mount the Twitch embed on CrazyGames or the desktop (Steam) shell, and never load the Twitch SDK there. A Twitch embed carries Twitch's own ads and is third-party content, which breaks CrazyGames' SDK-ads-only policy and Steam's no-in-game-ads rules, and can't satisfy Twitch's parent-domain check in the shell. Matches how the app already suppresses its promos off the open web. - Close button: ad-free users (any shop purchase => adfree for life, so window.adsEnabled === false) get an x in the minimized bar. Their close is remembered for the current day (the day is stored in localStorage), so the panel stays gone across reloads that day and resets for the next day's stream. Ad-supported users keep minimize only; their mobile flick stays session-only. - Scope the minimized state to the current day the same way (it was persisted indefinitely before), so it also resets for the next day's stream.
361ab0f to
0a178b5
Compare
The panel used to hide the moment you joined a lobby (on join-lobby). Keep it up through the queue/lobby wait and hide only once the game actually starts: Main dispatches a game-starting event at prestart, and the panel hides on that instead of on join-lobby. It reappears on leave-lobby.
… lobby wait (#4698) Three related changes to the homepage featured-stream panel. ## 1. Exclude the embed off the open web (ToS) Never mount the Twitch embed on **CrazyGames** or the **desktop (Steam) shell**, and never load the Twitch SDK there. Matches how the app already suppresses its own promos off-web via `window.adsEnabled`: - **CrazyGames:** [only SDK-served ads are allowed](https://docs.crazygames.com/requirements/ads/) and no external cross-promotion; a Twitch embed serves Twitch's own ads and is third-party content. - **Steam:** Steam [does not support advertising models in games](https://partner.steamgames.com/doc/marketing/advertising); a live Twitch player carries Twitch ad breaks, and the desktop shell can't satisfy Twitch's `parent`-domain requirement. ## 2. Close button for ad-free users Ad-free users (any shop purchase makes a user `adfree` for life, which zeroes `window.adsEnabled`) get an `×` in the minimized bar. The close is remembered **for the current day** (the day is stored in `localStorage`), so the panel stays gone across reloads that day and resets for the next day's stream. Ad-supported users keep minimize only; their mobile flick stays session-only. The minimized state is scoped to the day the same way. ## 3. Keep the panel through the lobby wait The panel used to hide the moment you joined a lobby (`join-lobby`). Now it stays up through the **queue/lobby wait** and hides only once the game actually starts. `Main.ts` dispatches a new `game-starting` event at `prestart` (the real start moment); the panel hides on that instead of on `join-lobby`, and reappears on `leave-lobby`. > Heads-up for maintainers: (1) and (2) couple this OFM widget to OF's own ad/entitlement signals (`crazyGamesSDK.isOnCrazyGames()`, `isDesktopShell()`, `window.adsEnabled`); (3) adds a small shared `game-starting` document event in `Main.ts`. Flagging in case you'd rather gate/signal differently. ## Tests Verified locally: prettier, eslint, tsc, tests all green. Reuses the existing `common.close` i18n key (no locale-file changes). Follow-up to #4335 / #4673. Sizing (Twitch's 400×300 minimum) landed in #4696.
Three related changes to the homepage featured-stream panel.
1. Exclude the embed off the open web (ToS)
Never mount the Twitch embed on CrazyGames or the desktop (Steam) shell, and never load the Twitch SDK there. Matches how the app already suppresses its own promos off-web via
window.adsEnabled:parent-domain requirement.2. Close button for ad-free users
Ad-free users (any shop purchase makes a user
adfreefor life, which zeroeswindow.adsEnabled) get an×in the minimized bar. The close is remembered for the current day (the day is stored inlocalStorage), so the panel stays gone across reloads that day and resets for the next day's stream. Ad-supported users keep minimize only; their mobile flick stays session-only. The minimized state is scoped to the day the same way.3. Keep the panel through the lobby wait
The panel used to hide the moment you joined a lobby (
join-lobby). Now it stays up through the queue/lobby wait and hides only once the game actually starts.Main.tsdispatches a newgame-startingevent atprestart(the real start moment); the panel hides on that instead of onjoin-lobby, and reappears onleave-lobby.Tests
Verified locally: prettier, eslint, tsc, tests all green. Reuses the existing
common.closei18n key (no locale-file changes).Follow-up to #4335 / #4673. Sizing (Twitch's 400×300 minimum) landed in #4696.