@jskit-ai/shell-web 0.2.26 → 0.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- The "Test copy" banner has no accessible label any more: it is a note read by its visible "Test copy", with "Test copy: emails, messages and payments are simulated, not sent." as its `aria-description`. The label made it a labelled element, so an application's browser test looking up its Email field with Playwright's inexact `page.getByLabel("Email")` found the banner too and failed strict mode.
|
|
5
6
|
- A page whose server simulates side effects (`SIDE_EFFECTS` is not `live`) shows a small amber "Test copy" tab at the top centre, with no application code: the shell adds it at boot from the page's `jskit-side-effects` meta tag and removes it at shutdown. It never takes a click or a tap, reads the same in light and dark themes, and its accessible label says emails, messages and payments are simulated. A live page, or a page that names no setting (a mobile bundle), has none.
|
|
6
7
|
- Menu and tab links, and the navigation bar's swipe destinations, take the current surface's params from the URL when the route declares none, as on the not-found route that catches any path: on `/w/acme/no-such-page` a link to the workspace surface goes to `/w/acme/...`. They threw "Missing required surface route params" on every render instead, so a workspace surface's not-found page showed that error in an alert, drew its drawer without destinations and logged the error again each time the shell redrew. The route's own params still win, and a link to a surface whose params neither the route nor the URL holds still throws.
|
|
7
8
|
- `shell.bootstrap.refresh()` runs one bootstrap request at a time and keeps at most one more waiting: everyone who asks while one waits shares it, and it reads the route and the handlers' request only when it starts. Each call used to queue its own request, so a burst of N realtime events or auth state reads fetched and applied the whole bootstrap N times in a row; it now does so at most twice.
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
</head>
|
|
8
8
|
<body>
|
|
9
9
|
<button id="under-banner" type="button">Pressed 0 times</button>
|
|
10
|
+
<!-- An application's Email field, which an inexact getByLabel("Email") must find alone. -->
|
|
11
|
+
<label for="email">Email</label>
|
|
12
|
+
<input id="email" type="email">
|
|
10
13
|
<script type="module" src="/src/main.js"></script>
|
|
11
14
|
</body>
|
|
12
15
|
</html>
|
package/package.json
CHANGED
|
@@ -48,8 +48,10 @@ function installTestCopyBanner({ documentObject = pageDocument(), mode = pageSid
|
|
|
48
48
|
const banner = documentObject.createElement("div");
|
|
49
49
|
banner.id = TEST_COPY_BANNER_ID;
|
|
50
50
|
banner.setAttribute("data-testid", TEST_COPY_BANNER_ID);
|
|
51
|
+
// A note read by its visible text, with the full sentence as its description. A label would make it a labelled
|
|
52
|
+
// element, which a browser test's field lookup such as `getByLabel("Email")` would also find.
|
|
51
53
|
banner.setAttribute("role", "note");
|
|
52
|
-
banner.setAttribute("aria-
|
|
54
|
+
banner.setAttribute("aria-description", t("jskit.shell.sideEffects.testCopyDescription"));
|
|
53
55
|
banner.textContent = t("jskit.shell.sideEffects.testCopy");
|
|
54
56
|
// Through the style object, not a style attribute, so a strict content policy without inline styles allows it.
|
|
55
57
|
Object.assign(banner.style, TEST_COPY_BANNER_STYLE);
|
|
@@ -57,7 +57,11 @@ test("a simulating page shows the Test copy banner at every width, in light and
|
|
|
57
57
|
const label = `${colorScheme} ${viewport.name}`;
|
|
58
58
|
const banner = page.getByTestId("jskit-test-copy-banner");
|
|
59
59
|
assert.equal(await banner.textContent(), "Test copy", label);
|
|
60
|
-
assert.equal(await
|
|
60
|
+
assert.equal(await page.getByRole("note").textContent(), "Test copy", `${label}: a note`);
|
|
61
|
+
assert.equal(await banner.getAttribute("aria-description"), "Test copy: emails, messages and payments are simulated, not sent.", label);
|
|
62
|
+
// An application's inexact field lookup finds only its Email field, never the banner whose sentence says emails.
|
|
63
|
+
assert.equal(await page.getByLabel("Email").count(), 1, `${label}: one Email match`);
|
|
64
|
+
assert.equal(await page.getByLabel("Email").getAttribute("id"), "email", `${label}: the Email field`);
|
|
61
65
|
const box = await banner.boundingBox();
|
|
62
66
|
assert.equal(box.y, 0, `${label}: hangs from the top edge`);
|
|
63
67
|
assert.ok(Math.abs(box.x + box.width / 2 - viewport.width / 2) <= 1, `${label}: centred`);
|
|
@@ -29,7 +29,11 @@ test("a simulating page gets one Test copy banner that takes no clicks", () => {
|
|
|
29
29
|
assert.equal(documentObject.appended.length, 1);
|
|
30
30
|
const [banner] = documentObject.appended;
|
|
31
31
|
assert.equal(banner.textContent, "Test copy");
|
|
32
|
-
assert.equal(banner.attributes
|
|
32
|
+
assert.equal(banner.attributes.role, "note");
|
|
33
|
+
assert.equal(banner.attributes["aria-description"], "Test copy: emails, messages and payments are simulated, not sent.");
|
|
34
|
+
// No label, so a field lookup by label (Playwright's getByLabel reads aria-label and aria-labelledby) never finds it.
|
|
35
|
+
assert.equal("aria-label" in banner.attributes, false);
|
|
36
|
+
assert.equal("aria-labelledby" in banner.attributes, false);
|
|
33
37
|
assert.equal(banner.attributes["data-testid"], "jskit-test-copy-banner");
|
|
34
38
|
assert.equal(banner.style.pointerEvents, "none");
|
|
35
39
|
assert.equal(banner.style.position, "fixed");
|