Skip to content

Commit 2d681a2

Browse files
authored
Merge branch 'master' into test/generate-edge-coverage
2 parents 582bac8 + 5a34c5b commit 2d681a2

File tree

97 files changed

+7395
-29717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+7395
-29717
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: E2E Test
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
push:
9+
branches:
10+
- master
11+
12+
jobs:
13+
e2e:
14+
name: Run Cypress E2E Tests
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'npm'
26+
27+
- name: Run Cypress E2E Tests
28+
uses: cypress-io/github-action@v6
29+
with:
30+
install-command: npm ci
31+
start: npm start
32+
wait-on: 'http://127.0.0.1:3000'
33+
wait-on-timeout: 120
34+
browser: chrome
35+
config: video=false
36+
37+
- name: Upload Cypress Screenshots on Failure
38+
if: failure()
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: cypress-screenshots
42+
path: cypress/screenshots
43+
if-no-files-found: ignore

CONTRIBUTING.md

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## <a name="CONTRIBUTING"></a>Contributing
22

33
We welcome contributions of all kinds — whether it’s code,
4-
documentation, music, lesson plans, artwork, or ideas. Music Blocks
4+
documentation, music, lesson plans, artwork, or ideas. Music Blocks
55
is a community-driven project, and every meaningful contribution helps
66
improve the platform for learners and educators around the world.
77

@@ -11,7 +11,6 @@ open issues or discussions to find a place to contribute.
1111

1212
- [How to set up a local server](README.md#how-to-set-up-a-local-server)
1313

14-
1514
### Special Notes
1615

1716
Music Blocks is being built from the ground-up, to address several
@@ -53,7 +52,6 @@ following resources:
5352
Programmers, please follow these general [guidelines for
5453
contributions](https://github.com/sugarlabs/sugar-docs/blob/master/src/contributing.md).
5554

56-
5755
### Before You Push
5856

5957
Run these commands locally before submitting a PR:
@@ -64,8 +62,20 @@ npx prettier --check . # Formatting
6462
npm test # Jest
6563
```
6664

65+
NOTE: Only run ```prettier``` on the files you have modified.
66+
6767
If formatting fails, run `npx prettier --write .` to fix it.
6868

69+
### After your PR is merged
70+
71+
Please note that production deployments of Music Blocks are **manual**.
72+
73+
This means that even after your pull request is merged, your changes may not immediately appear. Your update will become visible after the next official release is deployed.
74+
75+
If your changes are not visible right away, it does **not** indicate a problem with your PR or implementation.
76+
77+
This note is included to prevent contributors from spending time debugging caching or deployment issues unnecessarily.
78+
6979
### License Header
7080

7181
Music Blocks is licensed under the [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html).
@@ -129,60 +139,60 @@ Feel free. But, please don't spam :p.
129139
### Keep in Mind
130140

131141
1. Your contributions need not necessarily have to address any
132-
discovered issue. If you encounter any, feel free to add a fix through
133-
a PR, or create a new issue ticket.
142+
discovered issue. If you encounter any, feel free to add a fix through
143+
a PR, or create a new issue ticket.
134144

135145
2. Use [labels](https://github.com/sugarlabs/musicblocks/labels) on
136-
your issues and PRs.
146+
your issues and PRs.
137147

138148
3. Please do not spam with many PRs consisting of little changes.
139149

140150
4. If you are addressing a bulk change, divide your commits across
141-
multiple PRs, and send them one at a time. The fewer the number of
142-
files addressed per PR, the better.
151+
multiple PRs, and send them one at a time. The fewer the number of
152+
files addressed per PR, the better.
143153

144154
5. Communicate effectively. Go straight to the point. You don't need
145-
to address anyone using '_sir_'. Don't write unnecessary comments;
146-
don't be over-apologetic. There is no superiority hierarchy. Every
147-
single contribution is welcome, as long as it doesn't spam or distract
148-
the flow.
155+
to address anyone using '_sir_'. Don't write unnecessary comments;
156+
don't be over-apologetic. There is no superiority hierarchy. Every
157+
single contribution is welcome, as long as it doesn't spam or distract
158+
the flow.
149159

150160
6. Write useful, brief commit messages. Add commit descriptions if
151-
necessary. PR name should speak about what it is addressing and not
152-
the issue. In case a PR fixes an issue, use `fixes #ticketno` or
153-
`closes #ticketno` in the PR's comment. Briefly explain what your PR
154-
is doing.
161+
necessary. PR name should speak about what it is addressing and not
162+
the issue. In case a PR fixes an issue, use `fixes #ticketno` or
163+
`closes #ticketno` in the PR's comment. Briefly explain what your PR
164+
is doing.
155165

156166
7. Always test your changes extensively before creating a PR. There's
157-
no sense in merging broken code. If a PR is a _work in progress
158-
(WIP)_, convert it to draft. It'll let the maintainers know it isn't
159-
ready for merging.
167+
no sense in merging broken code. If a PR is a _work in progress
168+
(WIP)_, convert it to draft. It'll let the maintainers know it isn't
169+
ready for merging.
160170

161171
8. Read and revise the concepts about programming constructs you're
162-
dealing with. You must be clear about the behavior of the language or
163-
compiler/transpiler. See [JavaScript
164-
docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript).
172+
dealing with. You must be clear about the behavior of the language or
173+
compiler/transpiler. See [JavaScript
174+
docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript).
165175

166176
9. If you have a question, do a _web search_ first. If you don't find
167-
any satisfactory answer, then ask it in a comment. If it is a general
168-
question about Music Blocks, please use the new
169-
[discussions](https://github.com/sugarlabs/musicblocks/discussions)
170-
tab on top the the repository, or the _Sugar-dev Devel
171-
<[sugar-devel@lists.sugarlabs.org](mailto:sugar-devel@lists.sugarlabs.org)>_
172-
mailing list. Don't ask silly questions (unless you don't know it is
173-
silly ;p) before searching it on the web.
177+
any satisfactory answer, then ask it in a comment. If it is a general
178+
question about Music Blocks, please use the new
179+
[discussions](https://github.com/sugarlabs/musicblocks/discussions)
180+
tab on top the the repository, or the _Sugar-dev Devel
181+
<[sugar-devel@lists.sugarlabs.org](mailto:sugar-devel@lists.sugarlabs.org)>_
182+
mailing list. Don't ask silly questions (unless you don't know it is
183+
silly ;p) before searching it on the web.
174184

175185
10. Work on things that matter. Follow three milestones: `Port Ready`,
176-
`Migration`, and `Future`. Those tagged `Port Ready` are
177-
priority. Those tagged with `Migration` will be taken care of during
178-
or after the foundation rebuild. Feel free to participate in the
179-
conversation, adding valuable comments. Those tagged with `Future`
180-
need not be addressed presently.
186+
`Migration`, and `Future`. Those tagged `Port Ready` are
187+
priority. Those tagged with `Migration` will be taken care of during
188+
or after the foundation rebuild. Feel free to participate in the
189+
conversation, adding valuable comments. Those tagged with `Future`
190+
need not be addressed presently.
181191

182192
_Please note there is no need to ask permission to work on an
183193
issue. You should check for pull requests linked to an issue you are
184194
addressing; if there are none, then assume nobody has done
185195
anything. Begin to fix the problem, test, make your commits, push your
186196
commits, then make a pull request. Mention an issue number in the pull
187197
request, but not the commit message. These practices allow the
188-
competition of ideas (Sugar Labs is a meritocracy)._
198+
competition of ideas (Sugar Labs is a meritocracy)._

cypress/e2e/main.cy.js

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ describe("MusicBlocks Application", () => {
1414
describe("Loading and Initial Render", () => {
1515
it("should display the loading animation and then the main content", () => {
1616
cy.get("#loading-image-container").should("be.visible");
17-
cy.contains("#loadingText", "Loading Complete!", { timeout: 20000 }).should("be.visible");
17+
cy.contains("#loadingText", "Loading Complete!", { timeout: 20000 }).should(
18+
"be.visible"
19+
);
1820
cy.wait(10000);
1921
cy.get("#canvas", { timeout: 10000 }).should("be.visible");
2022
});
@@ -27,7 +29,7 @@ describe("MusicBlocks Application", () => {
2729
describe("Audio Controls", () => {
2830
it("should have a functional play button", () => {
2931
cy.get("#play").should("be.visible").click();
30-
cy.window().then((win) => {
32+
cy.window().then(win => {
3133
const audioContext = win.Tone.context;
3234
cy.wrap(audioContext.state).should("eq", "running");
3335
});
@@ -46,12 +48,9 @@ describe("MusicBlocks Application", () => {
4648
});
4749

4850
it("should toggle full-screen mode", () => {
49-
cy.get("#FullScreen").click();
51+
cy.get("#FullScreen").should("be.visible").click();
5052
cy.wait(500);
51-
cy.document().its("fullscreenElement").should("not.be.null");
52-
cy.get("#FullScreen").click();
53-
cy.wait(500);
54-
cy.document().its("fullscreenElement").should("be.null");
53+
cy.get("#FullScreen").should("be.visible").click();
5554
});
5655

5756
it("should toggle the toolbar menu", () => {
@@ -81,9 +80,7 @@ describe("MusicBlocks Application", () => {
8180
});
8281

8382
it('should click the New File button and verify "New Project" appears', () => {
84-
cy.get("#newFile > .material-icons")
85-
.should("exist")
86-
.and("be.visible");
83+
cy.get("#newFile > .material-icons").should("exist").and("be.visible");
8784
cy.get("#newFile > .material-icons").click();
8885
cy.wait(500);
8986
cy.contains("New project").should("be.visible");
@@ -99,7 +96,7 @@ describe("MusicBlocks Application", () => {
9996
"#Decrease\\ block\\ size > img",
10097
"#Increase\\ block\\ size > img"
10198
];
102-
99+
103100
bottomBarElements.forEach(selector => {
104101
cy.get(selector).should("exist").and("be.visible");
105102
});
@@ -111,21 +108,14 @@ describe("MusicBlocks Application", () => {
111108
"tr > :nth-child(2) > img",
112109
"tr > :nth-child(3) > img"
113110
];
114-
111+
115112
sidebarElements.forEach(selector => {
116-
cy.get(selector)
117-
.should("exist")
118-
.and("be.visible")
119-
.click();
113+
cy.get(selector).should("exist").and("be.visible").click();
120114
});
121115
});
122116

123117
it("should verify that Grid, Clear, and Collapse elements exist and are visible", () => {
124-
const elements = [
125-
"#Grid > img",
126-
"#Clear",
127-
"#Collapse > img"
128-
];
118+
const elements = ["#Grid > img", "#Clear", "#Collapse > img"];
129119
elements.forEach(selector => {
130120
cy.get(selector).should("exist").and("be.visible");
131121
});
@@ -149,12 +139,12 @@ describe("MusicBlocks Application", () => {
149139
.and("have.attr", "src")
150140
.and("not.be.empty");
151141

152-
cy.get("#planet-iframe").then(($iframe) => {
142+
cy.get("#planet-iframe").then($iframe => {
153143
const iframeSrc = $iframe.attr("src");
154144
cy.log("Iframe source:", iframeSrc);
155145
});
156146

157-
cy.window().then((win) => {
147+
cy.window().then(win => {
158148
win.document.getElementById("planet-iframe").style.display = "block";
159149
});
160150
});

dist/css/style.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,30 @@ input[type="range"]:focus::-ms-fill-upper {
104104
position: absolute;
105105
cursor: pointer;
106106
}
107+
108+
/* Keyboard navigation focus state for toolbar buttons */
109+
.toolbar-btn-focused {
110+
background-color: rgba(0, 0, 0, 0.25) !important;
111+
border-radius: 4px;
112+
transition: background-color 0.15s ease;
113+
}
114+
115+
/* Dark mode focus - brighten the background */
116+
body.dark .toolbar-btn-focused,
117+
.dark-theme .toolbar-btn-focused {
118+
background-color: rgba(255, 255, 255, 0.3) !important;
119+
}
120+
121+
/* Keyboard navigation focus state for dropdown menu items */
122+
.dropdown-item-focused {
123+
background-color: rgba(0, 150, 136, 0.2) !important;
124+
}
125+
126+
/* Keyboard navigation focus state for modal dialog buttons */
127+
.modal-btn-focused {
128+
outline: 3px solid #009688 !important;
129+
outline-offset: 2px;
130+
box-shadow: 0 0 8px rgba(0, 150, 136, 0.5) !important;
131+
}
132+
107133
html, body { overscroll-behavior-x: none; }

examples/test-suite.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)