From 5b2b84851ee2744c14c8198cb5a9533468c761d9 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Wed, 6 Aug 2025 23:04:58 +0000 Subject: [PATCH 1/5] feat: Deploy GH pages w/ screen reader experiment. --- .github/workflows/pages.yml | 57 ++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index c86ebec2..f241ebbf 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -2,14 +2,16 @@ name: Deploy static content to Pages on: - # Runs on pushes targeting the default branch + # Runs on pushes targeting the default and experimentation branches. push: - branches: ['main'] + branches: + - main + - add-screen-reader-support-experimental - # Allows you to run this workflow manually from the Actions tab + # Allows the workflow to be manually run from the Actions tab. workflow_dispatch: -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages. permissions: contents: read pages: write @@ -26,24 +28,36 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout blockly + - name: Checkout tip-of-tree core Blockly uses: actions/checkout@v4 with: path: blockly repository: google/blockly ref: develop - - name: Checkout blockly-keyboard-experimentation + - name: Checkout add-screen-reader-support-experimental core Blockly + uses: actions/checkout@v4 + with: + path: blockly-add-screen-reader-support-experimental + repository: google/blockly + ref: add-screen-reader-support-experimental + + - name: Checkout tip-of-tree blockly-keyboard-experimentation uses: actions/checkout@v4 with: path: blockly-keyboard-experimentation + - name: Checkout add-screen-reader-support-experimental blockly-keyboard-experimentation + uses: actions/checkout@v4 + with: + path: blockly-keyboard-experimentation-add-screen-reader-support-experimental + - name: Setup Node uses: actions/setup-node@v4 with: node-version: 20.x - - name: Build blockly + - name: Build tip-of-tree core Blockly run: | cd blockly npm ci @@ -52,19 +66,42 @@ jobs: npm link cd ../.. - - name: Build blockly-keyboard-experimentation + - name: Build tip-of-tree blockly-keyboard-experimentation run: | cd blockly-keyboard-experimentation npm ci npm link blockly npm run ghpages + mkdir ../ghpages + cp -r build/* ../ghpages/ + cd .. + + - name: Build add-screen-reader-support-experimental core Blockly + run: | + cd blockly/dist + npm unlink -g + cd ../../blockly-add-screen-reader-support-experimental + npm ci + npm run package + cd dist + npm link + cd ../.. + + - name: Build add-screen-reader-support-experimental blockly-keyboard-experimentation + run: | + cd blockly-keyboard-experimentation-add-screen-reader-support-experimental + npm ci + npm link blockly + npm run ghpages + mkdir ../ghpages/screenreader + cp -r build/* ../ghpages/screenreader/ cd .. - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - # Upload build folder - path: './blockly-keyboard-experimentation/build' + # Upload configured GH pages site files. + path: './ghpages' deploy: environment: From 7ad81148718ce941f7592ae8d258aaadfdd8185d Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Wed, 6 Aug 2025 23:10:32 +0000 Subject: [PATCH 2/5] fix: Use correct branch for plugin. --- .github/workflows/pages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index f241ebbf..e5feb2c4 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -51,6 +51,7 @@ jobs: uses: actions/checkout@v4 with: path: blockly-keyboard-experimentation-add-screen-reader-support-experimental + ref: add-screen-reader-support-experimental - name: Setup Node uses: actions/setup-node@v4 From 458e4f8ef2a6e20e56ab80f3c0141ed0183233c1 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Mon, 11 Aug 2025 13:29:31 -0700 Subject: [PATCH 3/5] feat: Introduce initial screen reader support (experimental) (#684) Fixes part of https://github.com/google/blockly/issues/3370 Fixes part of https://github.com/google/blockly/issues/9283 This PR introduces the plugin corresponding changes needed by https://github.com/google/blockly/pull/9280. In particular, this: - Introduces CI workflow updates so that "tip-of-tree" is redefined as the corresponding experimental branch in core for screen reader support (to ensure CI passes here for changes that happen there). - Removes some access error overrides since the corresponding field was made public in the core PR (which is the root of the CI failures here). - Introduces some general instructions in the navigation plugin playground for folks testing Blockly with a screen reader (and points to https://github.com/google/blockly-keyboard-experimentation/discussions/673 for discussion). **Important**: Note that this PR's changes will NOT be merged into the `main` branch as-is. They will be reconsidered entirely (and likely largely reimplemented) separately from this experimental branch and submitted as a separate, future review for `main`. See https://github.com/google/blockly/pull/9280 and Fixes part of https://github.com/google/blockly/issues/9283 for more specifics on why the separate branch thing is being set up this way. --- .github/workflows/build.yml | 28 ++++--------------------- .github/workflows/test.yml | 39 ++++++----------------------------- src/actions/mover.ts | 2 -- src/keyboard_drag_strategy.ts | 4 ---- test/index.html | 28 +++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 63 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41f96b40..8391cf1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,14 +6,14 @@ on: pull_request: push: branches: - - main + - add-screen-reader-support-experimental permissions: contents: read jobs: build_tip_of_tree_v12: - name: Build test (against tip-of-tree core develop) + name: Build test (against add-screen-reader-support-experimental core develop) runs-on: ubuntu-latest steps: - name: Checkout experimentation plugin @@ -25,7 +25,7 @@ jobs: uses: actions/checkout@v4 with: repository: 'google/blockly' - ref: 'develop' + ref: 'add-screen-reader-support-experimental' path: core-blockly - name: Use Node.js 20.x @@ -42,7 +42,7 @@ jobs: npm install cd .. - - name: Link latest Blockly develop + - name: Link latest Blockly add-screen-reader-support-experimental run: | cd core-blockly npm run package @@ -57,26 +57,6 @@ jobs: cd main npm run build - build: - name: Build test (against pinned v12) - # Don't run pinned version checks for PRs. - if: ${{ !github.base_ref }} - runs-on: ubuntu-latest - steps: - - name: Checkout experimentation plugin - uses: actions/checkout@v4 - - - name: Use Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: 20.x - - - name: NPM install - run: npm install - - - name: Verify build - run: npm run build - lint: name: Eslint check timeout-minutes: 5 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6419b501..f52a5bff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,14 +7,14 @@ on: pull_request: push: branches: - - main + - add-screen-reader-support-experimental permissions: contents: read jobs: - webdriverio_tests_tip_of_tree_v12: - name: WebdriverIO tests (against tip-of-tree core develop) + webdriverio_tests: + name: WebdriverIO tests (against add-screen-reader-support-experimental core develop) timeout-minutes: 10 runs-on: ${{ matrix.os }} @@ -29,11 +29,11 @@ jobs: with: path: main - - name: Checkout core Blockly + - name: Checkout experimentation Blockly uses: actions/checkout@v4 with: repository: 'google/blockly' - ref: 'develop' + ref: 'add-screen-reader-support-experimental' path: core-blockly - name: Use Node.js 20.x @@ -50,7 +50,7 @@ jobs: npm install cd .. - - name: Link latest Blockly develop + - name: Link latest Blockly add-screen-reader-support-experimental run: | cd core-blockly npm run package @@ -64,30 +64,3 @@ jobs: run: | cd main npm run test - - webdriverio_tests: - name: WebdriverIO tests (against pinned v12) - # Don't run pinned version checks for PRs. - if: ${{ !github.base_ref }} - timeout-minutes: 10 - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - - steps: - - name: Checkout experimentation plugin - uses: actions/checkout@v4 - - - name: Use Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: 20.x - - - name: NPM install - run: npm install - - - name: Run tests - run: npm run test diff --git a/src/actions/mover.ts b/src/actions/mover.ts index ebc9b1e4..fc20113e 100644 --- a/src/actions/mover.ts +++ b/src/actions/mover.ts @@ -244,11 +244,9 @@ export class Mover { this.patchDragger(info.dragger as dragging.Dragger, dragStrategy.moveType); // Save the position so we can put the cursor in a reasonable spot. - // @ts-expect-error Access to private property connectionCandidate. const target = dragStrategy.connectionCandidate?.neighbour; // Prevent the strategy connecting the block so we just delete one block. - // @ts-expect-error Access to private property connectionCandidate. dragStrategy.connectionCandidate = null; info.dragger.onDragEnd( diff --git a/src/keyboard_drag_strategy.ts b/src/keyboard_drag_strategy.ts index 09b3bcc2..45b67d11 100644 --- a/src/keyboard_drag_strategy.ts +++ b/src/keyboard_drag_strategy.ts @@ -50,7 +50,6 @@ export class KeyboardDragStrategy extends dragging.BlockDragStrategy { // to the top left of the workspace. // @ts-expect-error block and startLoc are private. this.block.moveDuringDrag(this.startLoc); - // @ts-expect-error connectionCandidate is private. this.connectionCandidate = this.createInitialCandidate(); this.forceShowPreview(); this.block.addIcon(new MoveIcon(this.block)); @@ -62,9 +61,7 @@ export class KeyboardDragStrategy extends dragging.BlockDragStrategy { super.drag(newLoc); // Handle the case when an unconstrained drag found a connection candidate. - // @ts-expect-error connectionCandidate is private. if (this.connectionCandidate) { - // @ts-expect-error connectionCandidate is private. const neighbour = (this.connectionCandidate as ConnectionCandidate) .neighbour; // The next constrained move will resume the search from the current @@ -253,7 +250,6 @@ export class KeyboardDragStrategy extends dragging.BlockDragStrategy { private forceShowPreview() { // @ts-expect-error connectionPreviewer is private const previewer = this.connectionPreviewer; - // @ts-expect-error connectionCandidate is private const candidate = this.connectionCandidate as ConnectionCandidate; if (!candidate || !previewer) return; const block = this.block; diff --git a/test/index.html b/test/index.html index 212d0354..d4cb4378 100644 --- a/test/index.html +++ b/test/index.html @@ -134,6 +134,34 @@ +
+
+ Instructions for screen reader support: +
    +
  • + Enable a screen reader while on the page, and tab navigate/use + arrow keys as normal. +
  • +
  • + It's recommended to enable text output (sometimes a developer + feature) so that you can see what the screen reader will read + out (which allows it to be muted, or even just helps to follow + along). +
  • +
  • + It's recommended to use a keyboard shortcut for quickly + enabling/disabling the screen reader to avoid needing to + navigate back through menus to disable it. +
  • +
+ For the primary discussion around screen reader support, please read + and comment on: discussion + #673. +
From c8cd7cad0f705bd129c7ed18dd12345ca5fdd3fb Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Mon, 11 Aug 2025 21:44:17 +0000 Subject: [PATCH 4/5] Revert "feat: Introduce initial screen reader support (experimental) (#684)" This reverts commit 458e4f8ef2a6e20e56ab80f3c0141ed0183233c1. --- .github/workflows/build.yml | 28 +++++++++++++++++++++---- .github/workflows/test.yml | 39 +++++++++++++++++++++++++++++------ src/actions/mover.ts | 2 ++ src/keyboard_drag_strategy.ts | 4 ++++ test/index.html | 28 ------------------------- 5 files changed, 63 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8391cf1a..41f96b40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,14 +6,14 @@ on: pull_request: push: branches: - - add-screen-reader-support-experimental + - main permissions: contents: read jobs: build_tip_of_tree_v12: - name: Build test (against add-screen-reader-support-experimental core develop) + name: Build test (against tip-of-tree core develop) runs-on: ubuntu-latest steps: - name: Checkout experimentation plugin @@ -25,7 +25,7 @@ jobs: uses: actions/checkout@v4 with: repository: 'google/blockly' - ref: 'add-screen-reader-support-experimental' + ref: 'develop' path: core-blockly - name: Use Node.js 20.x @@ -42,7 +42,7 @@ jobs: npm install cd .. - - name: Link latest Blockly add-screen-reader-support-experimental + - name: Link latest Blockly develop run: | cd core-blockly npm run package @@ -57,6 +57,26 @@ jobs: cd main npm run build + build: + name: Build test (against pinned v12) + # Don't run pinned version checks for PRs. + if: ${{ !github.base_ref }} + runs-on: ubuntu-latest + steps: + - name: Checkout experimentation plugin + uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: NPM install + run: npm install + + - name: Verify build + run: npm run build + lint: name: Eslint check timeout-minutes: 5 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f52a5bff..6419b501 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,14 +7,14 @@ on: pull_request: push: branches: - - add-screen-reader-support-experimental + - main permissions: contents: read jobs: - webdriverio_tests: - name: WebdriverIO tests (against add-screen-reader-support-experimental core develop) + webdriverio_tests_tip_of_tree_v12: + name: WebdriverIO tests (against tip-of-tree core develop) timeout-minutes: 10 runs-on: ${{ matrix.os }} @@ -29,11 +29,11 @@ jobs: with: path: main - - name: Checkout experimentation Blockly + - name: Checkout core Blockly uses: actions/checkout@v4 with: repository: 'google/blockly' - ref: 'add-screen-reader-support-experimental' + ref: 'develop' path: core-blockly - name: Use Node.js 20.x @@ -50,7 +50,7 @@ jobs: npm install cd .. - - name: Link latest Blockly add-screen-reader-support-experimental + - name: Link latest Blockly develop run: | cd core-blockly npm run package @@ -64,3 +64,30 @@ jobs: run: | cd main npm run test + + webdriverio_tests: + name: WebdriverIO tests (against pinned v12) + # Don't run pinned version checks for PRs. + if: ${{ !github.base_ref }} + timeout-minutes: 10 + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + + steps: + - name: Checkout experimentation plugin + uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: NPM install + run: npm install + + - name: Run tests + run: npm run test diff --git a/src/actions/mover.ts b/src/actions/mover.ts index fc20113e..ebc9b1e4 100644 --- a/src/actions/mover.ts +++ b/src/actions/mover.ts @@ -244,9 +244,11 @@ export class Mover { this.patchDragger(info.dragger as dragging.Dragger, dragStrategy.moveType); // Save the position so we can put the cursor in a reasonable spot. + // @ts-expect-error Access to private property connectionCandidate. const target = dragStrategy.connectionCandidate?.neighbour; // Prevent the strategy connecting the block so we just delete one block. + // @ts-expect-error Access to private property connectionCandidate. dragStrategy.connectionCandidate = null; info.dragger.onDragEnd( diff --git a/src/keyboard_drag_strategy.ts b/src/keyboard_drag_strategy.ts index 45b67d11..09b3bcc2 100644 --- a/src/keyboard_drag_strategy.ts +++ b/src/keyboard_drag_strategy.ts @@ -50,6 +50,7 @@ export class KeyboardDragStrategy extends dragging.BlockDragStrategy { // to the top left of the workspace. // @ts-expect-error block and startLoc are private. this.block.moveDuringDrag(this.startLoc); + // @ts-expect-error connectionCandidate is private. this.connectionCandidate = this.createInitialCandidate(); this.forceShowPreview(); this.block.addIcon(new MoveIcon(this.block)); @@ -61,7 +62,9 @@ export class KeyboardDragStrategy extends dragging.BlockDragStrategy { super.drag(newLoc); // Handle the case when an unconstrained drag found a connection candidate. + // @ts-expect-error connectionCandidate is private. if (this.connectionCandidate) { + // @ts-expect-error connectionCandidate is private. const neighbour = (this.connectionCandidate as ConnectionCandidate) .neighbour; // The next constrained move will resume the search from the current @@ -250,6 +253,7 @@ export class KeyboardDragStrategy extends dragging.BlockDragStrategy { private forceShowPreview() { // @ts-expect-error connectionPreviewer is private const previewer = this.connectionPreviewer; + // @ts-expect-error connectionCandidate is private const candidate = this.connectionCandidate as ConnectionCandidate; if (!candidate || !previewer) return; const block = this.block; diff --git a/test/index.html b/test/index.html index d4cb4378..212d0354 100644 --- a/test/index.html +++ b/test/index.html @@ -134,34 +134,6 @@ -
-
- Instructions for screen reader support: -
    -
  • - Enable a screen reader while on the page, and tab navigate/use - arrow keys as normal. -
  • -
  • - It's recommended to enable text output (sometimes a developer - feature) so that you can see what the screen reader will read - out (which allows it to be muted, or even just helps to follow - along). -
  • -
  • - It's recommended to use a keyboard shortcut for quickly - enabling/disabling the screen reader to avoid needing to - navigate back through menus to disable it. -
  • -
- For the primary discussion around screen reader support, please read - and comment on: discussion - #673. -
From 47b585c3bc17913b055c327f49c1819dbc4bfb93 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Mon, 11 Aug 2025 21:48:58 +0000 Subject: [PATCH 5/5] chore: Remove unnecessary change dirs. --- .github/workflows/pages.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index e5feb2c4..3b70b9a0 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -65,7 +65,6 @@ jobs: npm run package cd dist npm link - cd ../.. - name: Build tip-of-tree blockly-keyboard-experimentation run: | @@ -75,7 +74,6 @@ jobs: npm run ghpages mkdir ../ghpages cp -r build/* ../ghpages/ - cd .. - name: Build add-screen-reader-support-experimental core Blockly run: | @@ -86,7 +84,6 @@ jobs: npm run package cd dist npm link - cd ../.. - name: Build add-screen-reader-support-experimental blockly-keyboard-experimentation run: | @@ -96,7 +93,6 @@ jobs: npm run ghpages mkdir ../ghpages/screenreader cp -r build/* ../ghpages/screenreader/ - cd .. - name: Upload artifact uses: actions/upload-pages-artifact@v3