Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 4 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
58 changes: 48 additions & 10 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,24 +28,37 @@ 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
ref: 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
Expand All @@ -52,19 +67,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:
Expand Down
39 changes: 6 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 0 additions & 2 deletions src/actions/mover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 0 additions & 4 deletions src/keyboard_drag_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
28 changes: 28 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,34 @@
</select>
</div>
</form>
<div>
<br />
Instructions for screen reader support:
<ul>
<li>
Enable a screen reader while on the page, and tab navigate/use
arrow keys as normal.
</li>
<li>
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).
</li>
<li>
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.
</li>
</ul>
For the primary discussion around screen reader support, please read
and comment on: discussion
<a
href="https://github.com/google/blockly-keyboard-experimentation/discussions/673"
target="_blank"
>#673</a
>.
</div>
</div>
</div>
<div id="blocklyDiv"></div>
Expand Down
Loading