Skip to content

Conversation

@cwillisf
Copy link
Contributor

@cwillisf cwillisf commented Nov 7, 2025

See also scratchfoundation/scratch-blocks#3412

Proposed Changes

Add a new block to the Sensing category to detect whether or not the system is online (has an active Internet connection).

Reason for Changes

Scratch users have discovered ways to check for online status, most commonly by repeatedly using the Translate extension. While I applaud the ingenuity, this approach generates excess load on the Translate infrastructure. Scratchers and the Scratch Team will all have a better time if we provide a direct way to check for online status.

I'm open to feedback, including:

  • Should the label of the monitor be something other than online?
  • I definitely think this block belongs in the Sensing category, but is this (just before username) the right place for it within the category?

Test Coverage

Tested locally:
image

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Test report for scratch-vm

    1 files  ±0    770 suites  ±0   1m 5s ⏱️ ±0s
1 686 tests ±0  1 686 ✅ ±0   0 💤 ±0  0 ❌ ±0 
4 891 runs  ±0  4 861 ✅ ±0  30 💤 ±0  0 ❌ ±0 

Results for commit 031d2b7. ± Comparison against base commit 67176de.

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Test report for scratch-gui

  2 files  ±0   62 suites  ±0   9m 27s ⏱️ -34s
398 tests ±0  390 ✅ ±0  8 💤 ±0  0 ❌ ±0 
416 runs  ±0  408 ✅ ±0  8 💤 ±0  0 ❌ ±0 

Results for commit 031d2b7. ± Comparison against base commit 67176de.

@CST1229
Copy link

CST1229 commented Nov 7, 2025

Should the label of the monitor be something other than online?

Honestly, I thought block monitors were always named directly after the block (so, is online?). But since that's not the case, online is also fine.

@ampelectrecuted
Copy link

FINALLY a new block!

@redspacecat
Copy link

This would be amazing! Mostly just because it's the first new block in a while (besides face sensing) but also it would be pretty useful.

Copy link
Contributor

@KManolov3 KManolov3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Congrats on a new block! 🎉

@ericrosenbaum
Copy link
Contributor

I recommend changing both the wording on the block and in the monitor to just online?

@cwillisf
Copy link
Contributor Author

@ericrosenbaum, I've renamed the block to online?. That was a change in scratch-blocks, so it's not obvious here.

@mrsrec
Copy link

mrsrec commented Nov 12, 2025

@ericrosenbaum, I've renamed the block to online?. That was a change in scratch-blocks, so it's not obvious here.

I still think the name is confusing. "online?" could mean whether the project has internet connectivity functionality, whether or not it's actively using them at that moment, or whether it's being run in the online editor vs. the offline editor. Something like "connected to internet?" would solve the third one, but not the first two. Maybe "internet available?", but I'm not sure.

The other thing is whether or not a block like this makes sense in the sensing category, as opposed to one of the extensions. To me it seems a bit out of place (generally anything relating to the internet is abstracted away there), but I can't think of any better place to put it, and an extension that only has one block wouldn't make sense.

@mrsrec
Copy link

mrsrec commented Nov 12, 2025

You did say in the OP you were open to feedback, but IDK if it' too late for that now.

@CST1229
Copy link

CST1229 commented Nov 12, 2025

I still think the name is confusing. "online?" could mean whether the project has internet connectivity functionality, whether or not it's actively using them at that moment, or whether it's being run in the online editor vs. the offline editor. Something like "connected to internet?" would solve the third one, but not the first two. Maybe "internet available?", but I'm not sure.

there's also another possible interpretation, "is [a user, possibly the creator of the project] currently online on the Scratch website?" (so like, a person might try to use the "is online?" block to make a project that shows if they're online on the website or not). though "online?" does probably have a lower chance of users interpreting it that way than "is online?", and the two names you suggested don't have that possibility at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants