@jskit-ai/shell-web 0.1.128 → 0.1.130

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.
@@ -1,7 +1,7 @@
1
1
  export default Object.freeze({
2
2
  packageVersion: 1,
3
3
  packageId: "@jskit-ai/shell-web",
4
- version: "0.1.128",
4
+ version: "0.1.130",
5
5
  kind: "runtime",
6
6
  description: "Web shell layout runtime with outlet-based placement contributions.",
7
7
  dependsOn: [],
@@ -311,7 +311,7 @@ export default Object.freeze({
311
311
  dependencies: {
312
312
  runtime: {
313
313
  "@mdi/js": "^7.4.47",
314
- "@jskit-ai/kernel": "0.1.127"
314
+ "@jskit-ai/kernel": "0.1.129"
315
315
  },
316
316
  dev: {
317
317
  "@playwright/test": "1.61.1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/shell-web",
3
- "version": "0.1.128",
3
+ "version": "0.1.130",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@mdi/js": "^7.4.47",
31
- "@jskit-ai/kernel": "0.1.127"
31
+ "@jskit-ai/kernel": "0.1.129"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "pinia": "^3.0.4",
@@ -490,6 +490,11 @@ function touchListIncludesActiveTouch(touchList) {
490
490
  min-width: 0;
491
491
  }
492
492
 
493
+ .shell-layout__nav-toggle {
494
+ min-height: 48px;
495
+ min-width: 48px;
496
+ }
497
+
493
498
  .shell-layout__top-right {
494
499
  max-width: min(45vw, 18rem);
495
500
  overflow: hidden;
@@ -68,6 +68,48 @@ async function isElementVisibleInViewport(page, testId) {
68
68
  });
69
69
  }
70
70
 
71
+ async function runAdaptiveShellSmokeCase({
72
+ page,
73
+ expect,
74
+ smokePath = DEFAULT_SMOKE_PATH,
75
+ viewport
76
+ } = {}) {
77
+ if (!page || !expect || !viewport) {
78
+ throw new Error("runAdaptiveShellSmokeCase requires page, expect, and viewport.");
79
+ }
80
+
81
+ await page.setViewportSize({ width: viewport.width, height: viewport.height });
82
+ await page.goto(smokePath);
83
+ await expect(page.locator("body")).toBeVisible();
84
+ await expectGeneratedScreenContract(page, expect);
85
+ await expectNoHorizontalOverflow(page, expect);
86
+
87
+ if (viewport.name === "compact") {
88
+ let bootstrapRequests = 0;
89
+ await page.route("**/api/bootstrap**", async (route) => {
90
+ bootstrapRequests += 1;
91
+ await route.continue();
92
+ });
93
+ const bootstrapRequestsBeforePull = bootstrapRequests;
94
+
95
+ await expect(page.getByTestId("jskit-shell-bottom-nav")).toBeVisible();
96
+ expect(await isElementVisibleInViewport(page, "jskit-shell-drawer")).toBe(false);
97
+
98
+ const navButtonHeights = await page.getByTestId("jskit-shell-bottom-nav").locator(".v-btn").evaluateAll((buttons) =>
99
+ buttons.map((button) => button.getBoundingClientRect().height)
100
+ );
101
+ expect(navButtonHeights.length).toBeGreaterThan(0);
102
+ for (const height of navButtonHeights) {
103
+ expect(height).toBeGreaterThanOrEqual(48);
104
+ }
105
+
106
+ await pullToRefresh(page, expect);
107
+ await expect.poll(() => bootstrapRequests).toBeGreaterThan(bootstrapRequestsBeforePull);
108
+ } else {
109
+ await expect(page.getByTestId("jskit-shell-drawer")).toBeVisible();
110
+ }
111
+ }
112
+
71
113
  function runAdaptiveShellSmoke({
72
114
  test,
73
115
  expect,
@@ -81,39 +123,10 @@ function runAdaptiveShellSmoke({
81
123
  test.describe("generated adaptive shell smoke", () => {
82
124
  for (const viewport of viewports) {
83
125
  test(`${viewport.name} layout has reachable navigation and no horizontal overflow`, async ({ page }) => {
84
- await page.setViewportSize({ width: viewport.width, height: viewport.height });
85
- await page.goto(smokePath);
86
- await expect(page.locator("body")).toBeVisible();
87
- await expectGeneratedScreenContract(page, expect);
88
- await expectNoHorizontalOverflow(page, expect);
89
-
90
- if (viewport.name === "compact") {
91
- let bootstrapRequests = 0;
92
- await page.route("**/api/bootstrap**", async (route) => {
93
- bootstrapRequests += 1;
94
- await route.continue();
95
- });
96
- const bootstrapRequestsBeforePull = bootstrapRequests;
97
-
98
- await expect(page.getByTestId("jskit-shell-bottom-nav")).toBeVisible();
99
- expect(await isElementVisibleInViewport(page, "jskit-shell-drawer")).toBe(false);
100
-
101
- const navButtonHeights = await page.getByTestId("jskit-shell-bottom-nav").locator(".v-btn").evaluateAll((buttons) =>
102
- buttons.map((button) => button.getBoundingClientRect().height)
103
- );
104
- expect(navButtonHeights.length).toBeGreaterThan(0);
105
- for (const height of navButtonHeights) {
106
- expect(height).toBeGreaterThanOrEqual(48);
107
- }
108
-
109
- await pullToRefresh(page, expect);
110
- await expect.poll(() => bootstrapRequests).toBeGreaterThan(bootstrapRequestsBeforePull);
111
- } else {
112
- await expect(page.getByTestId("jskit-shell-drawer")).toBeVisible();
113
- }
126
+ await runAdaptiveShellSmokeCase({ page, expect, smokePath, viewport });
114
127
  });
115
128
  }
116
129
  });
117
130
  }
118
131
 
119
- export { DEFAULT_VIEWPORTS, runAdaptiveShellSmoke };
132
+ export { DEFAULT_VIEWPORTS, runAdaptiveShellSmoke, runAdaptiveShellSmokeCase };
@@ -1,4 +1,10 @@
1
1
  import { expect, test } from "@playwright/test";
2
- import { runAdaptiveShellSmoke } from "@jskit-ai/shell-web/test/adaptiveShellSmoke";
2
+ import { DEFAULT_VIEWPORTS, runAdaptiveShellSmokeCase } from "@jskit-ai/shell-web/test/adaptiveShellSmoke";
3
3
 
4
- runAdaptiveShellSmoke({ test, expect });
4
+ test.describe("generated adaptive shell smoke", () => {
5
+ for (const viewport of DEFAULT_VIEWPORTS) {
6
+ test(`${viewport.name} layout has reachable navigation and no horizontal overflow`, async ({ page }) => {
7
+ await runAdaptiveShellSmokeCase({ page, expect, viewport });
8
+ });
9
+ }
10
+ });
@@ -77,6 +77,7 @@ test("shell-web shell layout registers navigation at the app layout level", asyn
77
77
  assert.match(source, /<ShellRouteTransition>[\s\S]*<slot \/>[\s\S]*<\/ShellRouteTransition>/);
78
78
  assert.match(source, /data-testid="jskit-shell-app-bar"/);
79
79
  assert.match(source, /:density="isCompactLayout \? 'compact' : 'comfortable'"/);
80
+ assert.match(source, /\.shell-layout__nav-toggle\s*\{[\s\S]*min-height:\s*48px;[\s\S]*min-width:\s*48px;/);
80
81
  assert.match(source, /shell-layout__surface-label/);
81
82
  assert.doesNotMatch(source, /shell-layout__surface-chip/);
82
83
  assert.doesNotMatch(source, /<v-chip[^>]*resolvedSurfaceLabel/);
@@ -140,7 +141,10 @@ test("shell-web installs generated adaptive shell Playwright smoke coverage", as
140
141
  profile: "responsive-smoke",
141
142
  sourceName: "adaptiveShellSmoke.js"
142
143
  });
143
- assert.match(source, /runAdaptiveShellSmoke/);
144
+ assert.match(source, /DEFAULT_VIEWPORTS, runAdaptiveShellSmokeCase/);
145
+ assert.match(source, /test\(`/);
146
+ assert.match(source, /runAdaptiveShellSmokeCase\(\{ page, expect, viewport \}\)/);
147
+ assert.doesNotMatch(source, /runAdaptiveShellSmoke\(\{/);
144
148
  assert.match(source, /@jskit-ai\/shell-web\/test\/adaptiveShellSmoke/);
145
149
  assert.match(helperSource, /generated adaptive shell smoke/);
146
150
  assert.match(helperSource, /390/);