Skip to content

Conversation

@mashazyu
Copy link
Contributor

@mashazyu mashazyu commented Oct 15, 2025

Changes

  • added separate endpoint to use within app
  • tried to minimize changes to existing code
  • left only a couple of buttons in workspace toolbox for the first version.

Open questions

  • Blockly toolbox
    • wdyt about location?
    • Felix suggested trying out instead of wrapping categories to allow horizontal scroll. And then maybe keep vertical sub-category flyout?
  • Wdyt about path naming?
  • What buttons in the workspace toolbox would you like to see?
  • Felix also suggested to save button click and on successful compilation automatically navigate user to transfer screen and maybe even start upload. If you think it's a good idea, i'd like to do that in the follow up PR.

STATISTICS,
PLATFORM,
COMPILER,
EMBEDDED_MODE,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

suggestion: I don't want to create a separate copy of existing code for embedded use, rather make (minimal) changes to the existing code, if needed. This variable is to track, if user is on /embedded path.


// Only apply mobile layout options when in embedded mode
if (isEmbedded) {
blocklyOptions.horizontalLayout = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

suggestion: This are settings to move toolbox to the bottom.


// Set default locale before any components load
// This prevents undefined Blockly.Msg properties when blocks are registered
Blockly.setLocale(De);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

suggestion: This change is to fix the error I was getting, when I navigated to /embedded directly.

@@ -0,0 +1,85 @@
import React, { useEffect, useRef } from "react";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

suggestion: I ended up creating a separate toolbox for embedded route to avoid styling mess.

Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense to keep it seperated 👍

<ErrorBoundary>
<Content />
<Switch>
<EmbeddedRoute path="/embedded" exact>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

suggestion: This is a route name I thought reflects the best it's purpose. But I am open for suggestions.

@sensebox sensebox deleted a comment from github-actions bot Oct 21, 2025
@sensebox sensebox deleted a comment from github-actions bot Oct 21, 2025
@sensebox sensebox deleted a comment from github-actions bot Oct 21, 2025
@sensebox sensebox deleted a comment from github-actions bot Oct 21, 2025
@sensebox sensebox deleted a comment from github-actions bot Oct 21, 2025
@sensebox sensebox deleted a comment from github-actions bot Oct 21, 2025
@sensebox sensebox deleted a comment from github-actions bot Oct 21, 2025
@sensebox sensebox deleted a comment from github-actions bot Oct 21, 2025
@sensebox sensebox deleted a comment from github-actions bot Oct 21, 2025
Copy link
Contributor

@Thiemann96 Thiemann96 left a comment

Choose a reason for hiding this comment

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

I tested it with the preview link on my smartphone. If there is an app version let me know.

I am not sure how I like the toolbox on the bottom or top to be honest.
When scrolling through the selected category sometimes you "click" the block. I think this is because the blocks fill out almost the entire flyout and the user has no space to scroll. Moreover I (personally) dislike sideway scrolling. It feels weird to me and leads to errors like the one mentioned above.

I think for example OzoBlockly has some interesting idead about mobile navigation of blockly , i.e. forcing portrait mode and having the flyout be almost as big as the screen so scrolling is not always neccessary. Additional examples which use Blockly and have a mobile section : Microsoft MakeCode, or OpenRobertalLab.

We can also decrease the size of blocks to further prevent scrolling if possible. And I think you mentioned it before but the sub categories are kinda buggy. I think finding a solution for this on mobile will be hard without cluttering the screen and I think we can firstly "ignore" sub categories and just put them in one.

Overall though this is a very good proposal and definetly a step in the right direction.
Let me know what you think, I am definetly open for discussion and interested to hear what you think / thought during testing.

// Inject Blockly once on mount
useEffect(() => {
const ws = Blockly.inject(blocklyDivRef.current, {
const blocklyOptions = {
Copy link
Contributor

Choose a reason for hiding this comment

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

i could not find exactly where but I think the renderer for blockly got changed. Im guessing that this was not intentional. thats why the blocks look different. i think putting the renderer "Thrasos" in the blockly options makes the blocks look "normal" again.

@@ -0,0 +1,85 @@
import React, { useEffect, useRef } from "react";
Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense to keep it seperated 👍

@sensebox sensebox deleted a comment from github-actions bot Oct 27, 2025
@mashazyu
Copy link
Contributor Author

I tested it with the preview link on my smartphone. If there is an app version let me know.

Here it is https://github.com/sensebox/sensebox-connect/pull/17/. PR turned to draft i guess because it couldn't be merged in main after you merged previous PR.

@github-actions
Copy link

Tests

Test Name Status Flaky Duration
Blockly Editor Page Tests [Blockly] visits the editor page 1.1s
Blockly Editor Page Tests [Blockly] visits the tutorial page 203ms
Blockly Editor Page Tests [Blockly] visits the gallery page 148ms
Blockly Editor Page Tests [Blockly] visits the faq page 136ms
Blockly Editor Page Tests [Blockly] visits the settings page 141ms
Blockly Editor Page Tests [Blockly] visits the login page 140ms
Blockly Editor Page Tests [Blockly] navigates to tutorial and back 7.6s
Blockly Editor Page Tests [Blockly] selects senseBox ESP 1.3s
Blockly Editor Page Tests [Blockly] selects senseBox MCU 5.0s
Blockly Editor Page Tests [Blockly] selects senseBox Mini 878ms
Blockly Editor Page Tests [Blockly] changes the language in settings and verifies via headline 1.1s
Blockly Editor Page Tests [Blockly] compiles code 6.1s
Code Editor Page Tests [CodeEditor] visits the code editor page 1.5s
Code Editor Page Tests [CodeEditor] selects senseBox ESP 539ms
Code Editor Page Tests [CodeEditor] compiles code 663ms
Code Editor Page Tests [CodeEditor] opens reset dialog 814ms
Code Editor Page Tests [CodeEditor] fetches libraries 1.4s
Embedded Blockly Page Tests [Embedded] visits the embedded page 1.2s
Embedded Blockly Page Tests [Embedded] displays Blockly workspace 378ms
Embedded Blockly Page Tests [Embedded] displays iPad toolbar 528ms
Embedded Blockly Page Tests [Embedded] displays workspace name component 318ms
Embedded Blockly Page Tests [Embedded] displays device selection 311ms
Embedded Blockly Page Tests [Embedded] compiles code 4.8s
Embedded Blockly Page Tests [Embedded] opens reset dialog 714ms
Embedded Blockly Page Tests [Embedded] displays toolbox with search 296ms
Embedded Blockly Page Tests [Embedded] marks toolbox xml as embedded mode 299ms
Embedded Blockly Page Tests [Embedded] uses tablet mode for compilation with embedded-specific text 5.0s

Github Test Reporter by CTRF 💚

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.

3 participants