Skip to content

[iPad] Keep toolbox categories re-openable on consecutive taps in Blocks editor#11318

Draft
Copilot wants to merge 5 commits into
masterfrom
copilot/fix-toolbox-category-selection
Draft

[iPad] Keep toolbox categories re-openable on consecutive taps in Blocks editor#11318
Copilot wants to merge 5 commits into
masterfrom
copilot/fix-toolbox-category-selection

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

On iPad/touch devices, tapping the same toolbox category twice in a row could leave the category unusable until another category was selected. This updates toolbox selection behavior so repeated taps on the same category continue to work as expected on touch, while preserving expected toggle-close behavior.

  • Behavior change: category reselection and toggle behavior

    • Updated Toolbox.setSelection(...) in webapp/src/toolbox.tsx to:
      • keep desktop/non-touch toggle-close behavior
      • on touch, only toggle-close when the selected category’s flyout is currently visible
    • Result:
      • If flyout is open, tapping the same category closes it (expected behavior).
      • If flyout is already closed on touch, tapping the same category reopens it (fixes the iPad regression).
  • Editor support for flyout visibility checks

    • Added isFlyoutVisible() to ToolboxEditor and implemented it in:
      • webapp/src/blocks.tsx
      • webapp/src/monaco.tsx
  • Code hygiene in touched logic

    • Uses strict equality for selected-category comparison.
if (this.state.selectedItem === id && !force && !onlyTriggerOnClick
    && (!pxt.BrowserUtils.isTouchEnabled() || parent.isFlyoutVisible())) {
    this.clearSelection();
    this.closeFlyout();
}

> [!WARNING]
>
>

Copilot AI and others added 2 commits May 16, 2026 00:36
Copilot AI changed the title [WIP] Fix toolbox category not opening twice in a row [iPad] Keep toolbox categories re-openable on consecutive taps in Blocks editor May 16, 2026
Copilot AI requested a review from srietkerk May 16, 2026 00:38
@srietkerk
Copy link
Copy Markdown
Contributor

@copilot This change is close to what we need, but this change also makes it so that tapping the category again, if the flyout is open, does not close the blockly flyout. This is expected behavior. Can you fix that?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 20, 2026

@copilot This change is close to what we need, but this change also makes it so that tapping the category again, if the flyout is open, does not close the blockly flyout. This is expected behavior. Ca...

Updated in b3b2ecd. Same-category taps now close the flyout only when it is currently open, and reopen it when it’s already closed (the iPad regression case). Screenshot: /tmp/pxt-toolbox-retap-followup.png

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --string-annotations --crashpad-handler-pid=6382 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-eY1uyi --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,180727351056816646,3224229640756436361,262144 --enable-features=PdfOopif --disable-features=AcceptCHFrame,IsolateSandboxedIframes,MediaRouter,OptimizationHints,PaintHolding,ProcessPerSiteUpToMainFrameThreshold,Translate --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome --allow-pre-commit-input --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-crash-reporter --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-hang-monitor --disable-infobars --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-search-engine-choice-screen --disable-sync (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --string-annotations --crashpad-handler-pid=6382 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-eY1uyi --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,180727351056816646,3224229640756436361,262144 --enable-features=PdfOopif --disable-features=AcceptCHFrame,IsolateSandboxedIframes,MediaRouter,OptimizationHints,PaintHolding,ProcessPerSiteUpToMainFrameThreshold,Translate --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome --allow-pre-commit-input --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-crash-reporter --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-hang-monitor --disable-infobars --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-search-engine-choice-screen --disable-sync (dns block)
  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/pxt/pxt/node_modules/less/bin/lessc theme/style.less built/web/semantic.css --include-path=node_modules/semantic-ui-less:node_modules/pxt-core/theme:theme/foo/bar:theme:node_modules/pxt-core/react-common/styles:react-common/styles:node_modules/@fortawesome:node_modules/pxt-core/node_modules/@fortawesome " lude ules/.bin/sh 15.0/src (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --string-annotations --crashpad-handler-pid=6382 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-eY1uyi --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,180727351056816646,3224229640756436361,262144 --enable-features=PdfOopif --disable-features=AcceptCHFrame,IsolateSandboxedIframes,MediaRouter,OptimizationHints,PaintHolding,ProcessPerSiteUpToMainFrameThreshold,Translate --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome --allow-pre-commit-input --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-crash-reporter --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-hang-monitor --disable-infobars --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-search-engine-choice-screen --disable-sync (dns block)
  • www.makecode.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node built/pxt.js buildtarget rc/woff2/table_tags.o.d rev-�� s/ (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@srietkerk
Copy link
Copy Markdown
Contributor

@copilot you got rid of the original fix. Can you add the "isTouchEnabled" check back into the condition?

Agent-Logs-Url: https://github.com/microsoft/pxt/sessions/ccd44e42-ea24-44be-9d68-39880725dac7

Co-authored-by: srietkerk <49178322+srietkerk@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 20, 2026

@copilot you got rid of the original fix. Can you add the "isTouchEnabled" check back into the condition?

Updated in 5e368d3. I added isTouchEnabled back into the condition while keeping the flyout-visible check, so touch behavior remains reopenable when closed and still closes when open. Screenshot: /tmp/pxt-toolbox-retap-touchcheck.png

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --string-annotations --crashpad-handler-pid=6422 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-BxiZY3 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,384557947890232798,2001880284963259786,262144 --enable-features=PdfOopif --disable-features=AcceptCHFrame,IsolateSandboxedIframes,MediaRouter,OptimizationHints,PaintHolding,ProcessPerSiteUpToMainFrameThreshold,Translate --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome --allow-pre-commit-input --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-crash-reporter --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-hang-monitor --disable-infobars --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-search-engine-choice-screen --disable-sync (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --string-annotations --crashpad-handler-pid=6422 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-BxiZY3 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,384557947890232798,2001880284963259786,262144 --enable-features=PdfOopif --disable-features=AcceptCHFrame,IsolateSandboxedIframes,MediaRouter,OptimizationHints,PaintHolding,ProcessPerSiteUpToMainFrameThreshold,Translate --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome --allow-pre-commit-input --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-crash-reporter --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-hang-monitor --disable-infobars --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-search-engine-choice-screen --disable-sync (dns block)
  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/pxt/pxt/node_modules/less/bin/lessc theme/style.less built/web/semantic.css --include-path=node_modules/semantic-ui-less:node_modules/pxt-core/theme:theme/foo/bar:theme:node_modules/pxt-core/react-common/styles:react-common/styles:node_modules/@fortawesome:node_modules/pxt-core/node_modules/@fortawesome --verify lude modules/@npmcli/run-script/lib/node-gyp-bin/sh 15.0/src (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --string-annotations --crashpad-handler-pid=6422 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/puppeteer_dev_chrome_profile-BxiZY3 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,384557947890232798,2001880284963259786,262144 --enable-features=PdfOopif --disable-features=AcceptCHFrame,IsolateSandboxedIframes,MediaRouter,OptimizationHints,PaintHolding,ProcessPerSiteUpToMainFrameThreshold,Translate --variations-seed-version (dns block)
    • Triggering command: /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome /home/REDACTED/.cache/puppeteer/chrome/linux-131.0.6778.204/chrome-linux64/chrome --allow-pre-commit-input --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-crash-reporter --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-hang-monitor --disable-infobars --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-search-engine-choice-screen --disable-sync (dns block)
  • www.makecode.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node built/pxt.js buildtarget git l/op�� --local lude nfig/composer/vendor/bin/as /enc/metablock.csh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

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.

[iPad] Beta - Cannot use any toolbox category twice in a row

2 participants