Repository navigation
Keep the desktop playground starfield animating on Safari before 17.4, which lacks checkVisibility - #1874
Open
dormouse-bot wants to merge 1 commit into
Open
Keep the desktop playground starfield animating on Safari before 17.4, which lacks checkVisibility#1874dormouse-bot wants to merge 1 commit into
dormouse-bot wants to merge 1 commit into
Conversation
…heckVisibility isShown called element.checkVisibility() unguarded, so on Safari before 17.4 every starfield tick threw before advancing or rendering. terminalElementShown falls back to isConnected there.
Deploying mouseterm with
|
| Latest commit: |
b20a2f6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5090fed6.mouseterm.pages.dev |
| Branch Preview URL: | https://fix-playground-starfield-che.mouseterm.pages.dev |
This branch has not been deployed
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.
On Safari before 17.4, the desktop playground's starfield freezes and the console fills with
TypeErrors.isShowninwebsite/src/pages/PlaygroundDesktop.tsxcalledelement.checkVisibility()with no guard on the method.TutRunner's background tick callsisShown()every 33 ms on every starfield screen, so on those browsers each tick threw beforeadvance()andrender(). Safari addedcheckVisibilityin 17.4. The website builds with Vite 8's default target, which still includes Safari 16.4 and doesn't polyfill DOM methods.The check moves into
terminalElementShowninwebsite/src/lib/tut-runner.ts. Where the browser hascheckVisibilityit uses it, so behavior there is unchanged. Without it, a connected element counts as shown, which still pauses a minimized pane, whose xterm element is detached.lib/src/stories/settle-terminals.tsalready guards the same call the same way. The newterminalElementShowntests intut-runner.test.tscover an element with nocheckVisibility, which the old expression threw on.tscand the file's tests pass.