@ethlete/agent-rules 0.1.0-next.6 → 0.1.0-next.60
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/AGENTS.md +28 -0
- package/CHANGELOG.md +841 -0
- package/CLAUDE.md +1 -0
- package/README.md +244 -36
- package/THIRD-PARTY-LICENSES.md +35 -0
- package/content/defaults.json +1 -1
- package/content/hooks/away-mode.py +410 -0
- package/content/hooks/background-commands.py +177 -0
- package/content/hooks/builder-idle-check.py +529 -0
- package/content/hooks/context-warning.py +666 -134
- package/content/hooks/git-safety.py +213 -0
- package/content/hooks/human-wait-check.py +167 -0
- package/content/hooks/subagent-model-policy.py +261 -0
- package/content/mods/.claude-plugin/marketplace.json +26 -0
- package/content/mods/plugins/codex-runs/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/codex-runs/hooks/agent-runs.ts +310 -0
- package/content/mods/plugins/codex-runs/hooks/hooks.json +1 -0
- package/content/mods/plugins/codex-runs/hooks/progress.ts +130 -0
- package/content/mods/plugins/codex-runs/hooks/register.tsx +283 -0
- package/content/mods/plugins/codex-runs/tests/pane.test.ts +21 -0
- package/content/mods/plugins/codex-runs/tsconfig.json +4 -0
- package/content/mods/plugins/codex-runs/types/index.d.ts +37 -0
- package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/e2e-progress/hooks/hooks.json +1 -0
- package/content/mods/plugins/e2e-progress/hooks/progress.ts +205 -0
- package/content/mods/plugins/e2e-progress/hooks/register.tsx +498 -0
- package/content/mods/plugins/e2e-progress/tsconfig.json +3 -0
- package/content/mods/plugins/e2e-progress/types/index.d.ts +27 -0
- package/content/mods/plugins/status-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/status-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/status-line/hooks/line.ts +74 -0
- package/content/mods/plugins/status-line/hooks/register.tsx +141 -0
- package/content/mods/plugins/status-line/types/index.d.ts +5 -0
- package/content/mods/plugins/usage-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/usage-line/hooks/codex.ts +52 -0
- package/content/mods/plugins/usage-line/hooks/format.ts +24 -0
- package/content/mods/plugins/usage-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/usage-line/hooks/rate-limits.ts +23 -0
- package/content/mods/plugins/usage-line/hooks/register.tsx +83 -0
- package/content/mods/plugins/usage-line/tsconfig.json +4 -0
- package/content/mods/plugins/usage-line/types/index.d.ts +5 -0
- package/content/output-styles/ste-clarity.md +131 -0
- package/content/rules/agent-sessions-wake-up.md +11 -0
- package/content/rules/app-styling.md +66 -0
- package/content/rules/comments.md +4 -1
- package/content/rules/lint-and-format.md +7 -5
- package/content/rules/nx-layout.md +53 -0
- package/content/rules/reactive-state.md +1 -1
- package/content/rules/styling.md +19 -10
- package/content/rules/subagent-models.md +42 -0
- package/content/rules/waiting-on-the-human.md +17 -0
- package/content/skills/agent-sessions/SKILL.md +101 -0
- package/content/skills/agent-sessions/agent-sessions.mjs +1462 -0
- package/content/skills/angular-patterns/SKILL.md +31 -7
- package/content/skills/api-source/SKILL.md +156 -0
- package/content/skills/app-testing/SKILL.md +141 -0
- package/content/skills/codex-subagent/SKILL.md +102 -0
- package/content/skills/codex-subagent/codex-agent.mjs +260 -0
- package/content/skills/codex-subagent/codex-limit.mjs +106 -0
- package/content/skills/design-exploration/SKILL.md +121 -0
- package/content/skills/design-exploration/check-story.mjs +139 -0
- package/content/skills/design-exploration/reference-shots.md +15 -0
- package/content/skills/design-exploration/shoot-template.mjs +61 -0
- package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/content/skills/domain-modeling/SKILL.md +71 -0
- package/content/skills/e2e-triage/SKILL.md +80 -0
- package/content/skills/figma-export/SKILL.md +16 -18
- package/content/skills/git-commit/SKILL.md +21 -7
- package/content/skills/git-flow/SKILL.md +9 -5
- package/content/skills/grill-with-docs/SKILL.md +13 -0
- package/content/skills/grilling/SKILL.md +52 -0
- package/content/skills/handoff/SKILL.md +30 -72
- package/content/skills/handoff/save.md +189 -0
- package/content/skills/query/SKILL.md +165 -74
- package/content/skills/report/SKILL.md +26 -0
- package/content/skills/rxjs-signals/SKILL.md +33 -4
- package/content/skills/sdk-docs/SKILL.md +50 -14
- package/content/skills/sdk-local-build/SKILL.md +26 -8
- package/content/skills/sdk-local-build/sdk-local-baseline.mjs +64 -0
- package/content/skills/sdk-source/SKILL.md +37 -34
- package/content/skills/sdk-update/SKILL.md +103 -0
- package/content/skills/story-styling/SKILL.md +12 -10
- package/content/skills/styleguide/SKILL.md +13 -8
- package/content/skills/styleguide/assets.md +54 -0
- package/content/skills/styleguide/changesets.md +17 -0
- package/content/skills/styleguide/file-structure.md +73 -0
- package/content/skills/styleguide/lint-rule-lookup.md +52 -0
- package/content/skills/styleguide/storybook-structure.md +25 -0
- package/content/skills/theming/SKILL.md +76 -49
- package/content/skills/verify-in-app/SKILL.md +107 -0
- package/content/skills/verify-in-storybook/SKILL.md +1 -1
- package/content/skills/verify-on-apple-devices/SKILL.md +100 -0
- package/content/skills/verify-on-apple-devices/apple-remote.sh +421 -0
- package/content/skills/verify-on-apple-devices/sim-edge-back.m +159 -0
- package/migrations/list-state-query-form.md +20 -0
- package/migrations/nx-layout.md +29 -0
- package/migrations/sdk-components-over-hand-built-ui.md +27 -0
- package/migrations/search-query-field.md +52 -0
- package/migrations/studio-claude-plugin.md +27 -0
- package/migrations.json +47 -0
- package/package.json +8 -3
- package/src/index.js +84 -28
- package/src/index.js.map +1 -1
- package/src/lib/cli-args.d.ts +9 -0
- package/src/lib/cli-args.js +48 -0
- package/src/lib/cli-args.js.map +1 -0
- package/src/lib/commitlint.d.ts +10 -0
- package/src/lib/commitlint.js +51 -0
- package/src/lib/commitlint.js.map +1 -0
- package/src/lib/config.d.ts +53 -22
- package/src/lib/config.js +128 -12
- package/src/lib/config.js.map +1 -1
- package/src/lib/filter.d.ts +3 -0
- package/src/lib/filter.js +7 -5
- package/src/lib/filter.js.map +1 -1
- package/src/lib/frontmatter.d.ts +2 -0
- package/src/lib/frontmatter.js +33 -5
- package/src/lib/frontmatter.js.map +1 -1
- package/src/lib/git-flow/config.js +1 -1
- package/src/lib/git-flow/config.js.map +1 -1
- package/src/lib/git-flow/index.d.ts +1 -0
- package/src/lib/git-flow/index.js +20 -6
- package/src/lib/git-flow/index.js.map +1 -1
- package/src/lib/git-flow/parse.js +38 -12
- package/src/lib/git-flow/parse.js.map +1 -1
- package/src/lib/git-flow/rename.d.ts +24 -0
- package/src/lib/git-flow/rename.js +70 -0
- package/src/lib/git-flow/rename.js.map +1 -0
- package/src/lib/git-flow/start.d.ts +27 -0
- package/src/lib/git-flow/start.js +34 -1
- package/src/lib/git-flow/start.js.map +1 -1
- package/src/lib/git-flow-command.js +10 -2
- package/src/lib/git-flow-command.js.map +1 -1
- package/src/lib/git-flow-repair.d.ts +1 -1
- package/src/lib/git-flow-repair.js +30 -15
- package/src/lib/git-flow-repair.js.map +1 -1
- package/src/lib/git-flow-start.d.ts +1 -1
- package/src/lib/git-flow-start.js +25 -32
- package/src/lib/git-flow-start.js.map +1 -1
- package/src/lib/git.d.ts +37 -0
- package/src/lib/git.js +85 -3
- package/src/lib/git.js.map +1 -1
- package/src/lib/gitlab.js +24 -6
- package/src/lib/gitlab.js.map +1 -1
- package/src/lib/index.d.ts +2 -0
- package/src/lib/index.js +26 -11
- package/src/lib/index.js.map +1 -1
- package/src/lib/migrate.js +8 -2
- package/src/lib/migrate.js.map +1 -1
- package/src/lib/output-style-command.d.ts +3 -0
- package/src/lib/output-style-command.js +69 -0
- package/src/lib/output-style-command.js.map +1 -0
- package/src/lib/output-style.d.ts +38 -0
- package/src/lib/output-style.js +134 -0
- package/src/lib/output-style.js.map +1 -0
- package/src/lib/owned-paths.js +8 -2
- package/src/lib/owned-paths.js.map +1 -1
- package/src/lib/package-runner.d.ts +4 -0
- package/src/lib/package-runner.js +86 -0
- package/src/lib/package-runner.js.map +1 -0
- package/src/lib/plain-text.d.ts +9 -0
- package/src/lib/plain-text.js +22 -0
- package/src/lib/plain-text.js.map +1 -0
- package/src/lib/plan.d.ts +6 -6
- package/src/lib/plan.js +153 -40
- package/src/lib/plan.js.map +1 -1
- package/src/lib/prettier.d.ts +21 -0
- package/src/lib/prettier.js +51 -0
- package/src/lib/prettier.js.map +1 -0
- package/src/lib/prompt.js +10 -2
- package/src/lib/prompt.js.map +1 -1
- package/src/lib/render.d.ts +14 -1
- package/src/lib/render.js +23 -5
- package/src/lib/render.js.map +1 -1
- package/src/lib/report-command.d.ts +34 -0
- package/src/lib/report-command.js +322 -0
- package/src/lib/report-command.js.map +1 -0
- package/src/lib/sessions-command.d.ts +4 -0
- package/src/lib/sessions-command.js +16 -0
- package/src/lib/sessions-command.js.map +1 -0
- package/src/lib/sync.d.ts +1 -2
- package/src/lib/sync.js +37 -17
- package/src/lib/sync.js.map +1 -1
- package/src/lib/targets/agents-skills.js +1 -1
- package/src/lib/targets/agents-skills.js.map +1 -1
- package/src/lib/targets/claude-hooks.d.ts +5 -0
- package/src/lib/targets/claude-hooks.js +27 -4
- package/src/lib/targets/claude-hooks.js.map +1 -1
- package/src/lib/targets/claude-mods.d.ts +20 -0
- package/src/lib/targets/claude-mods.js +47 -0
- package/src/lib/targets/claude-mods.js.map +1 -0
- package/src/lib/targets/claude.js +2 -3
- package/src/lib/targets/claude.js.map +1 -1
- package/src/lib/targets/codex-hooks.js +4 -2
- package/src/lib/targets/codex-hooks.js.map +1 -1
- package/src/lib/targets/codex.js +4 -4
- package/src/lib/targets/codex.js.map +1 -1
- package/src/lib/targets/copilot.js +4 -4
- package/src/lib/targets/copilot.js.map +1 -1
- package/src/lib/targets/cursor.js +3 -3
- package/src/lib/targets/cursor.js.map +1 -1
- package/src/lib/targets/git-hooks.d.ts +1 -1
- package/src/lib/targets/git-hooks.js +6 -5
- package/src/lib/targets/git-hooks.js.map +1 -1
- package/src/lib/targets/hooks-shared.d.ts +34 -5
- package/src/lib/targets/hooks-shared.js +132 -36
- package/src/lib/targets/hooks-shared.js.map +1 -1
- package/src/lib/targets/mcp.d.ts +25 -0
- package/src/lib/targets/mcp.js +114 -0
- package/src/lib/targets/mcp.js.map +1 -0
- package/src/lib/targets/shared.d.ts +1 -9
- package/src/lib/targets/shared.js +4 -8
- package/src/lib/targets/shared.js.map +1 -1
- package/src/lib/timetrack.d.ts +16 -0
- package/src/lib/timetrack.js +149 -0
- package/src/lib/timetrack.js.map +1 -0
- package/content/skills/styleguide/STYLEGUIDE.md +0 -520
- package/src/lib/jira.d.ts +0 -28
- package/src/lib/jira.js +0 -83
- package/src/lib/jira.js.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# File structure
|
|
2
|
+
|
|
3
|
+
Read this file when placing routes, views, components, providers, or local utilities.
|
|
4
|
+
|
|
5
|
+
Mirror the route tree in folders and suffix routing components with `-view`:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Routes } from '@angular/router';
|
|
9
|
+
|
|
10
|
+
export const SHOP_ROUTES: Routes = [
|
|
11
|
+
{
|
|
12
|
+
path: 'items',
|
|
13
|
+
loadComponent: () =>
|
|
14
|
+
import('./items-list-view/items-list-view.component').then((module) => module.ItemsListViewComponent),
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path: 'items/:id',
|
|
18
|
+
loadComponent: () =>
|
|
19
|
+
import('./item-detail-host-view/item-detail-host-view.component').then(
|
|
20
|
+
(module) => module.ItemDetailHostViewComponent,
|
|
21
|
+
),
|
|
22
|
+
children: [
|
|
23
|
+
{
|
|
24
|
+
path: '',
|
|
25
|
+
loadComponent: () =>
|
|
26
|
+
import('./item-detail-host-view/item-detail-view/item-detail-view.component').then(
|
|
27
|
+
(module) => module.ItemDetailViewComponent,
|
|
28
|
+
),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
path: 'reviews',
|
|
32
|
+
loadComponent: () =>
|
|
33
|
+
import('./item-detail-host-view/item-reviews-view/item-reviews-view.component').then(
|
|
34
|
+
(module) => module.ItemReviewsViewComponent,
|
|
35
|
+
),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use these placement rules:
|
|
43
|
+
|
|
44
|
+
- Put reusable view-level pieces in `components/`.
|
|
45
|
+
- Put children used only by one parent in that parent's `partials/`.
|
|
46
|
+
- Put generic presentation-only pieces in `uikit/`.
|
|
47
|
+
- Put application-shell pieces in `shell/`.
|
|
48
|
+
- Keep a directive, pipe, provider, form configuration, or utility beside its narrowest
|
|
49
|
+
consumer. Move it upward only when more consumers appear.
|
|
50
|
+
- Use simple utility names such as `items-list-filter-form.ts`, not `.utils.ts`.
|
|
51
|
+
- Give exportable folders an `index.ts`, but import source files directly. Do not import
|
|
52
|
+
a parent barrel from its subdirectory.
|
|
53
|
+
- Keep application projects thin; move shared or domain logic into buildable libraries
|
|
54
|
+
with clear import paths.
|
|
55
|
+
|
|
56
|
+
```plaintext
|
|
57
|
+
shop/
|
|
58
|
+
├── items-list-view/
|
|
59
|
+
│ ├── components/
|
|
60
|
+
│ │ └── item-card/
|
|
61
|
+
│ │ ├── partials/
|
|
62
|
+
│ │ │ ├── item-image/
|
|
63
|
+
│ │ │ └── item-price/
|
|
64
|
+
│ │ ├── item-card.component.ts
|
|
65
|
+
│ │ └── item-card.component.html
|
|
66
|
+
│ ├── items-list-filter-form.ts
|
|
67
|
+
│ └── items-list-view.component.ts
|
|
68
|
+
└── item-detail-host-view/
|
|
69
|
+
├── item-detail-view/
|
|
70
|
+
├── item-reviews-view/
|
|
71
|
+
├── item-detail.provider.ts
|
|
72
|
+
└── item-detail-host-view.component.ts
|
|
73
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Lint rule lookup
|
|
2
|
+
|
|
3
|
+
Read this file only to explain a lint result or identify which rule owns a mechanical
|
|
4
|
+
convention. Run lint with `--fix`; do not hand-check this table before linting.
|
|
5
|
+
|
|
6
|
+
| Convention | Rule |
|
|
7
|
+
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
8
|
+
| No `any` / `$any()`; narrow `unknown` | `@typescript-eslint/no-explicit-any`, `@angular-eslint/template/no-any` |
|
|
9
|
+
| Static strings and booleans use attributes | `@angular-eslint/template/prefer-static-string-properties`, `ethlete/prefer-static-boolean-properties` |
|
|
10
|
+
| `type`, not `interface` (module augmentations stay interfaces) | `ethlete/consistent-type-definitions` |
|
|
11
|
+
| No `enum` or `const enum` | `ethlete/no-enum` |
|
|
12
|
+
| `const` by default; one declaration per statement | `no-var`, `prefer-const`, `one-var` |
|
|
13
|
+
| Strict equality | `eqeqeq` |
|
|
14
|
+
| Maximum two positional parameters | `max-params` |
|
|
15
|
+
| No type-only imports | `ethlete/no-type-only-import` |
|
|
16
|
+
| Descriptive `T`-prefixed generic names | `@typescript-eslint/naming-convention` |
|
|
17
|
+
| No `async` / `await` | `ethlete/no-async-await` |
|
|
18
|
+
| Arrow functions standalone; methods in classes | `no-restricted-syntax` |
|
|
19
|
+
| Blank line before a multiline guard return | `ethlete/guard-return-newline` |
|
|
20
|
+
| No trivially inferable return type | `ethlete/no-trivial-return-type` |
|
|
21
|
+
| Member and local naming conventions | `@typescript-eslint/naming-convention`, `ethlete/no-leading-underscore-class-member`, `ethlete/no-screaming-case-local` |
|
|
22
|
+
| Class constants are `readonly` and upper case | `ethlete/class-constant-property` |
|
|
23
|
+
| No `readonly` on reactive members | `ethlete/no-readonly-signal` |
|
|
24
|
+
| Injected and template-visible member accessibility | `ethlete/inject-member-accessibility`, `ethlete/template-member-accessibility` |
|
|
25
|
+
| No inject chains, pure aliases, or trivial wrappers | `ethlete/no-inject-chain`, `ethlete/no-member-alias`, `ethlete/no-trivial-wrapper-method` |
|
|
26
|
+
| No unused private or protected members | `ethlete/no-unused-class-member` |
|
|
27
|
+
| Pure module-scope provider calls | `ethlete/no-impure-top-level-provider` |
|
|
28
|
+
| No redundant `@internal` | `ethlete/no-redundant-internal` |
|
|
29
|
+
| Observable names end in `$` | `ethlete/require-dollar-suffix` |
|
|
30
|
+
| No subscribe body, subscribe in pipe, or RxJS in signal derivations | `ethlete/no-subscribe-with-body`, `ethlete/no-subscribe-in-pipe`, `ethlete/no-rxjs-in-effect` |
|
|
31
|
+
| `takeUntilDestroyed()` is the last operator in its pipe | `ethlete/take-until-destroyed-last` |
|
|
32
|
+
| Effect teardown uses `onCleanup` or `DestroyRef` | `ethlete/no-effect-cleanup-return` |
|
|
33
|
+
| Prefer `linkedSignal` for writable derived state | `ethlete/prefer-linked-signal` |
|
|
34
|
+
| `linkedSignal` source is a `computed`, not an inline function over an input | `ethlete/prefer-computed-linked-signal-source` |
|
|
35
|
+
| Global component CSS encapsulation | `ethlete/require-view-encapsulation-none` |
|
|
36
|
+
| Angular-version-correct change detection metadata | `ethlete/require-on-push-change-detection`, `ethlete/no-redundant-on-push-change-detection` |
|
|
37
|
+
| No redundant standalone flag or empty metadata arrays | `ethlete/no-standalone-flag`, `ethlete/no-empty-angular-metadata-arrays` |
|
|
38
|
+
| No legacy lifecycle hooks or decorators | `no-restricted-syntax`, `ethlete/no-legacy-angular-decorators` |
|
|
39
|
+
| No injectable services, guards, or resolvers | `no-restricted-syntax` |
|
|
40
|
+
| Output naming | `@angular-eslint/no-output-on-prefix`, `@angular-eslint/no-output-native`, `ethlete/prefer-present-tense-output` |
|
|
41
|
+
| Inputs do not collide with global HTML attributes | `ethlete/no-native-html-input-name` |
|
|
42
|
+
| No pipe logic | `ethlete/no-pipe-logic` |
|
|
43
|
+
| Class members and decorator metadata stay ordered | `ethlete/class-member-order`, `ethlete/angular-decorator-property-order` |
|
|
44
|
+
| Routing views use `-view` / `ViewComponent` | `ethlete/enforce-routing-view-naming` |
|
|
45
|
+
| No direct browser globals, DOM queries, native observers, or cookies | `no-restricted-globals`, `ethlete/no-direct-dom-manipulation`, `ethlete/no-dom-query`, `ethlete/no-native-observers`, `ethlete/no-document-cookie` |
|
|
46
|
+
| No barrel imports | `no-restricted-syntax` |
|
|
47
|
+
| Prefer the SDK wrappers for platform utilities | `ethlete/prefer-clone-equal`, `ethlete/prefer-rxjs-timer`, `ethlete/prefer-match-media`, `ethlete/prefer-viewport-size`, `ethlete/no-angular-seo-services`, `ethlete/no-locale-id`, `ethlete/no-angular-router-api` |
|
|
48
|
+
|
|
49
|
+
Judgment still belongs outside lint: name things after their behavior, use an object
|
|
50
|
+
parameter after two positional parameters, expose injected members directly instead of
|
|
51
|
+
aliasing them, and use `/** @internal */` only on technically public library API that
|
|
52
|
+
must be stripped from declarations.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Storybook structure
|
|
2
|
+
|
|
3
|
+
Read this file when placing a `*.stories.ts` file or code used only to render stories.
|
|
4
|
+
|
|
5
|
+
- Keep the `*.stories.ts` file beside the component it documents.
|
|
6
|
+
- Put private host components, dummy data, and story-only helpers in `storybook/`.
|
|
7
|
+
- Never export Storybook-only code from the component's public barrel.
|
|
8
|
+
- A private `storybook/index.ts` may simplify imports into the adjacent story, but no
|
|
9
|
+
production source may import it.
|
|
10
|
+
|
|
11
|
+
```plaintext
|
|
12
|
+
settings-form/
|
|
13
|
+
├── storybook/
|
|
14
|
+
│ ├── settings-form-storybook.component.ts
|
|
15
|
+
│ ├── settings-form-storybook.component.html
|
|
16
|
+
│ ├── settings-form-dummy-data.ts
|
|
17
|
+
│ └── index.ts
|
|
18
|
+
├── settings-form.component.ts
|
|
19
|
+
├── settings-form.component.html
|
|
20
|
+
├── settings-form.component.stories.ts
|
|
21
|
+
└── index.ts
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The story file stays at the component root; only its private support code goes into
|
|
25
|
+
`storybook/`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: theming
|
|
3
|
-
description: The
|
|
3
|
+
description: The surface and color theming systems in @ethlete/core. Read BEFORE writing or reviewing CSS involving color, background, border or interaction state, or wiring theme context across overlays/portals.
|
|
4
4
|
kind: skill
|
|
5
5
|
scope: consumer
|
|
6
6
|
requires: ['@ethlete/core']
|
|
@@ -13,11 +13,11 @@ vars: [docsBaseUrl]
|
|
|
13
13
|
Two **independent** systems in `@ethlete/core`; most components consume both:
|
|
14
14
|
|
|
15
15
|
- **Surface theming** - the neutral, elevation-aware colors of the box a component
|
|
16
|
-
sits on: background, text, muted/subtle text, borders, and a neutral
|
|
17
|
-
|
|
18
|
-
- **Color theming** - semantic accent palettes (brand
|
|
19
|
-
error): a
|
|
20
|
-
|
|
16
|
+
sits on: background, text, muted/subtle text, borders, and a neutral tint
|
|
17
|
+
for hover/pressed states. Set via `[etProvideSurface]` / `[etAutoSurface]`.
|
|
18
|
+
- **Color theming (tones)** - semantic accent palettes (brand, success,
|
|
19
|
+
warning, error): a fill, the text on that fill, and the tone as text or
|
|
20
|
+
border on the surface (`--et-tone-*`). Set via `[etProvideColor]`.
|
|
21
21
|
|
|
22
22
|
Full reference: {%docsBaseUrl%}/core/theming.
|
|
23
23
|
|
|
@@ -37,74 +37,101 @@ The generated CSS defines the raw vars on `.et-surface--<name>` / `.et-color--<n
|
|
|
37
37
|
classes (plus `:root` defaults) and derives the public tokens below on `:root` **and**
|
|
38
38
|
every scope class - so the tokens are always resolvable and components just read them.
|
|
39
39
|
|
|
40
|
-
**Theme names are yours.**
|
|
41
|
-
|
|
42
|
-
The portable handle is the theme **`type`**: `
|
|
43
|
-
the app registered with `type: 'error'`.
|
|
40
|
+
**Theme names are yours.** Never hardcode them as an SDK-defined union or reusable API
|
|
41
|
+
contract. App-specific docs may name their own themes when they label them as app values.
|
|
42
|
+
The portable handle is the theme **`type`**: `injectSemanticColorTheme('error')` finds
|
|
43
|
+
whichever theme the app registered with `type: 'error'`.
|
|
44
44
|
|
|
45
45
|
## Tokens components may consume
|
|
46
46
|
|
|
47
|
-
Use these
|
|
48
|
-
|
|
49
|
-
_after_ the token is fine).
|
|
47
|
+
Use these tokens - each is a ready color, never a channel triplet. Never use a hardcoded color as the primary value.
|
|
48
|
+
A static fallback inside `var(--token, <fallback>)` is permitted, but not required.
|
|
50
49
|
|
|
51
|
-
Surface
|
|
50
|
+
Surface:
|
|
52
51
|
|
|
53
|
-
| Token
|
|
54
|
-
|
|
|
55
|
-
| `--et-surface-background
|
|
56
|
-
| `--et-surface-
|
|
57
|
-
| `--et-surface-
|
|
58
|
-
| `--et-surface-
|
|
59
|
-
| `--et-surface-border
|
|
60
|
-
| `--et-surface-
|
|
52
|
+
| Token | Use for |
|
|
53
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
54
|
+
| `--et-surface-background` | component/panel background |
|
|
55
|
+
| `--et-surface-text` | text |
|
|
56
|
+
| `--et-surface-text-muted` | secondary text, placeholders, group labels |
|
|
57
|
+
| `--et-surface-text-subtle` | tertiary text |
|
|
58
|
+
| `--et-surface-border` | borders, separators |
|
|
59
|
+
| `--et-surface-tint` | neutral hover/pressed tint source (set by the theme's `tint`, emitted only then) - always mix it with the surface-text fallback: `color-mix(in srgb, var(--et-surface-tint, var(--et-surface-text, gray)) 12%, transparent)`; `--et-surface-control-text[-<state>]` is the text of a neutral control, never a background |
|
|
61
60
|
|
|
62
61
|
Color (from the nearest `[etProvideColor]` scope):
|
|
63
62
|
|
|
64
|
-
| Token
|
|
65
|
-
|
|
|
66
|
-
| `--et-
|
|
67
|
-
| `--et-
|
|
68
|
-
| `--et-
|
|
69
|
-
| `--et-theme-color-ink-solid` | primary-tinted text/border on transparent/tonal fills |
|
|
63
|
+
| Token | Use for |
|
|
64
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
65
|
+
| `--et-tone-fill` | filled backgrounds and accents at full strength: focus borders, selected marks, spinners. To tint per state, compose it yourself: `color-mix(in srgb, var(--et-tone-fill) calc(var(--_et-tone-fill-opacity, 1) * 100%), transparent)` |
|
|
66
|
+
| `--et-tone-on-fill` | text/icons on a filled background |
|
|
67
|
+
| `--et-tone-text` | the tone as text/border on transparent/tonal fills |
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
`[etColorInteractive]` re-resolves the color tokens per CSS state. Put it on the
|
|
70
|
+
interactive element itself, never on a wrapper. Neutral hover and pressed feedback mixes
|
|
71
|
+
`--et-surface-tint` per state at the consumer; `etSurfaceInteractive` is removed.
|
|
72
|
+
|
|
73
|
+
**Never use `hover:bg-et-surface-control-text-hover` for a hover row.** The token is a
|
|
74
|
+
full-strength text colour, so in dark mode it gives a light row with near-white text. Mix
|
|
75
|
+
the tint instead: `hover:bg-et-surface-tint/9 active:bg-et-surface-tint/15`.
|
|
76
|
+
|
|
77
|
+
`--et-surface-next-background` / `bg-et-surface-next-background` is the background of the next
|
|
78
|
+
level (the tint mixed over the background on the topmost level): use it for a "hover = next
|
|
79
|
+
level" row instead of a tint.
|
|
75
80
|
|
|
76
81
|
## Providing context
|
|
77
82
|
|
|
78
|
-
- `[etProvideSurface]="
|
|
79
|
-
elevation) set the surface scope; `[etProvideColor]="
|
|
83
|
+
- `[etProvideSurface]="surfaceThemeName"` / `[etAutoSurface]` (auto-picks the next
|
|
84
|
+
elevation) set the surface scope; `[etProvideColor]="colorThemeName"` sets the color scope.
|
|
80
85
|
A component that owns a themed region usually adds `ProvideColorDirective` /
|
|
81
86
|
`ProvideSurfaceDirective` as `hostDirectives`.
|
|
82
87
|
- **Detached overlay panes (menu, dialog, tooltip…) do not inherit DOM context.**
|
|
83
88
|
Re-apply it: inject `COLOR_PROVIDER` / `SURFACE_PROVIDER` with
|
|
84
89
|
`{ optional: true, skipSelf: true }`, then `ownProvider.syncWithProvider(ctx)` for
|
|
85
|
-
color and
|
|
90
|
+
color, and re-apply the surface one elevation above the trigger's for the surface.
|
|
86
91
|
- **Semantic colors come through DI, not CSS.** There is no global "error color"
|
|
87
92
|
variable - error/warning/success are just color themes. To render something in the
|
|
88
|
-
error color, `
|
|
89
|
-
theme) and either bind it
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
error color, `injectSemanticColorTheme('error')` (reading it throws if the app
|
|
94
|
+
registered no `type: 'error'` theme) and either bind it
|
|
95
|
+
(`[etProvideColor]="errorColorTheme()"`) or force it programmatically
|
|
96
|
+
(`provideColor.forceColor(theme)` / `clearForcedColor()`). Inside that scope,
|
|
97
|
+
`--et-tone-*` _is_ the error color.
|
|
98
|
+
- **A surface swaps a chosen accent; it never picks one.** The chosen accent is the
|
|
99
|
+
nearest `[etProvideColor]`, else the `isDefault` theme, or for
|
|
100
|
+
`injectSemanticColorTheme(type)` the theme of that `type`. The nearest surface's
|
|
101
|
+
`SurfaceTheme.colorThemeVariants` (e.g. `{ brand: 'brand-on-light', success: 'success-on-light' }`,
|
|
102
|
+
variants registered without a `type`) swaps it; an accent without an entry stays the
|
|
103
|
+
same on every surface. With no surface above, the root surface swaps, and
|
|
104
|
+
`provideColorScheme()` paints its swap of the default accent on `<html>`. A neutral that follows the surface is `color="surface"`
|
|
105
|
+
(`controlText`), not a variant. Never add per-surface logic to a color theme or new
|
|
106
|
+
CSS vars for it.
|
|
92
107
|
|
|
93
108
|
## Pitfalls
|
|
94
109
|
|
|
110
|
+
- A surface theme may have `elevation: -1` (a literal unary minus); the generator fails on a theme it cannot
|
|
111
|
+
parse. Filled form fields, table card rows and grid items resolve `parent.elevation + 1`; toasts and
|
|
112
|
+
`@ethlete/cdk` overlays with a backdrop always resolve elevation 1 (without a backdrop, `parent + 1`), and the
|
|
113
|
+
overlay scope class goes from `et-surface--inherited` to `et-surface--<theme>`. `@ethlete/cdk` CSS reads no
|
|
114
|
+
`--et-surface-*` token, so `etProvideSurface` on a cdk host does nothing.
|
|
95
115
|
- `@property` `initial-value` cannot contain `var()`, so a public `--et-*` token
|
|
96
116
|
declared via `@property` can never default to a theme token. If the default should
|
|
97
117
|
come from the theme, don't declare an `@property` - consume the theme token directly
|
|
98
118
|
(optionally behind a `--_et-*` indirection var).
|
|
99
|
-
-
|
|
119
|
+
- `@property` `initial-value` also cannot use a **font-relative or container unit**
|
|
120
|
+
(`em`, `rem`, `ex`, `ch`, `lh`, `cap`, `ic`, `cq*`). The value must be computationally
|
|
121
|
+
independent, so the browser drops the whole rule and leaves the token unregistered -
|
|
122
|
+
with no error. Percentages and viewport units (`vh`, `vw`, `dvh`) are fine. When the
|
|
123
|
+
default has to be relative, use `syntax: '*'` with no `initial-value` and put the
|
|
124
|
+
default in a fallback at each use site: `var(--et-skeleton-size, 1em)`.
|
|
125
|
+
- `--et-tone-*` always resolves to the **nearest color scope**. A
|
|
100
126
|
hardcoded semantic color in CSS can't be replaced by it unless the right theme is
|
|
101
127
|
provided on that element.
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
a hard requirement wherever it is
|
|
105
|
-
- **Cascade layers, not `:where()`,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
128
|
+
- A static fallback (`var(--et-surface-border, rgb(255 255 255 / 0.1))`) is
|
|
129
|
+
permitted for theme-less setups, but themes make it unnecessary. `injectSemanticColorTheme()`
|
|
130
|
+
is a hard requirement wherever it is read.
|
|
131
|
+
- **Cascade layers, not `:where()`, decide who wins against SDK component CSS.** SDK
|
|
132
|
+
styles live in `@layer components.sdk`, nested in `components`, so an app rule in
|
|
133
|
+
`@layer components`, a utility, or unlayered app CSS overrides them. See the
|
|
134
|
+
`app-styling` rule.
|
|
135
|
+
|
|
136
|
+
Styling a **story** file rather than a component? The colour rule is the same. Check the
|
|
137
|
+
repository's Storybook guidance before assuming a Tailwind utility exists.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verify-in-app
|
|
3
|
+
description: Verify a UI change in the running app by driving it headlessly with Playwright - screenshots, computed styles, pointer and cursor state - and prove a fix with a test that fails without it. Use whenever you change a view, a component or its styles and need to confirm what renders, not just that it compiles.
|
|
4
|
+
kind: skill
|
|
5
|
+
scope: consumer
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Verify a UI change in the running app
|
|
9
|
+
|
|
10
|
+
A build that passes says nothing about what the user sees. Serve the app, drive the real page in
|
|
11
|
+
a headless browser, and assert on the rendered DOM and computed styles.
|
|
12
|
+
|
|
13
|
+
## 1. Serve the app
|
|
14
|
+
|
|
15
|
+
It may already be running. Check before starting a second instance - the dev server prompts for
|
|
16
|
+
another port and hangs:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
curl -s -o /dev/null -w "%{http_code}" http://localhost:4200/
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- `200` → it is up.
|
|
23
|
+
- anything else → start it in the background and poll the curl above until it answers (a cold
|
|
24
|
+
build can take a minute):
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx nx serve <app>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The port and any proxy config live in the app's `project.json` `serve` target. A view behind a
|
|
31
|
+
login needs a session: log in once through the form in the script, or seed the token storage the
|
|
32
|
+
app reads before `page.goto`.
|
|
33
|
+
|
|
34
|
+
## 2. Drive it with Playwright
|
|
35
|
+
|
|
36
|
+
Use the `playwright` package from the repo's `node_modules`. Write the script in a scratch
|
|
37
|
+
directory outside the repo and run it with `node`:
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
import { createRequire } from 'node:module';
|
|
41
|
+
|
|
42
|
+
const require = createRequire(`${process.cwd()}/`);
|
|
43
|
+
const { chromium } = require('playwright');
|
|
44
|
+
|
|
45
|
+
const browser = await chromium.launch();
|
|
46
|
+
const page = await browser.newPage({ viewport: { width: 1280, height: 900 } });
|
|
47
|
+
|
|
48
|
+
await page.goto('http://localhost:4200/players?search=mul', { waitUntil: 'domcontentloaded' });
|
|
49
|
+
await page.waitForSelector('.players-table', { state: 'attached' });
|
|
50
|
+
|
|
51
|
+
const state = await page.$eval('.players-table', (el) => {
|
|
52
|
+
const cs = getComputedStyle(el);
|
|
53
|
+
return { display: cs.display, color: cs.color, rows: el.querySelectorAll('tr').length };
|
|
54
|
+
});
|
|
55
|
+
console.log(JSON.stringify(state));
|
|
56
|
+
|
|
57
|
+
await page.screenshot({ path: '/tmp/players.png', fullPage: true });
|
|
58
|
+
await browser.close();
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Then read the screenshot back and look at it.
|
|
62
|
+
|
|
63
|
+
- **`playwright` is CommonJS** - resolve it with `createRequire`; a named ESM import fails.
|
|
64
|
+
- **`waitUntil: 'domcontentloaded'`, never `networkidle`** - the dev server's live-reload socket
|
|
65
|
+
and any polling query keep the network busy forever.
|
|
66
|
+
- **`waitForSelector` waits for visible by default.** Pass `{ state: 'attached' }` for anything
|
|
67
|
+
correctly hidden (`opacity: 0`, collapsed, `inert`).
|
|
68
|
+
- **Overlays render at the end of `<body>`,** not inside the view that opened them. Query them from
|
|
69
|
+
`page`, not from the view's element.
|
|
70
|
+
- After a click that starts a transition, wait out its duration before reading final styles.
|
|
71
|
+
|
|
72
|
+
## 3. Pointer and cursor state
|
|
73
|
+
|
|
74
|
+
`getComputedStyle(el).cursor` reports what the stylesheet says, not what the pointer gets - an
|
|
75
|
+
overlay, a backdrop or `pointer-events: none` in between changes the answer. Ask the page which
|
|
76
|
+
element is under the point instead:
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
const hit = await page.evaluate(
|
|
80
|
+
([x, y]) => {
|
|
81
|
+
const el = document.elementFromPoint(x, y);
|
|
82
|
+
return el && { tag: el.tagName, class: el.className, cursor: getComputedStyle(el).cursor };
|
|
83
|
+
},
|
|
84
|
+
[640, 300],
|
|
85
|
+
);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`elementFromPoint` returns `null` outside the viewport, so use a viewport tall enough for the
|
|
89
|
+
point, or scroll the target into view first. Hover with `page.mouse.move(x, y)` before reading
|
|
90
|
+
`:hover` styles.
|
|
91
|
+
|
|
92
|
+
## 4. Prove a fix with a test that bites
|
|
93
|
+
|
|
94
|
+
A screenshot shows the fix once; a test keeps it. For a bug fix, write the spec (a unit spec for
|
|
95
|
+
logic, or a Playwright e2e spec where the app has one), then:
|
|
96
|
+
|
|
97
|
+
1. run it against the fix - it passes;
|
|
98
|
+
2. revert the fix (stash it, or comment the one line out) and run it again - it **must fail**;
|
|
99
|
+
3. restore the fix.
|
|
100
|
+
|
|
101
|
+
A test that passes both ways asserts on the wrong thing. Fix the test before you call the change
|
|
102
|
+
done.
|
|
103
|
+
|
|
104
|
+
## 5. Report
|
|
105
|
+
|
|
106
|
+
Say what you drove (URL, clicks, viewport) and what you observed, with the numbers you read. Keep
|
|
107
|
+
the script and screenshots in the scratch directory, not the repo.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verify-in-storybook
|
|
3
|
-
description:
|
|
3
|
+
description: Verify a component change by driving its Storybook story headlessly with Playwright. Use whenever you change a UI component and must confirm rendered DOM, computed styles, animations or interactions.
|
|
4
4
|
kind: skill
|
|
5
5
|
scope: consumer
|
|
6
6
|
vars: [storybookUrl, storybookStartCommand]
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verify-on-apple-devices
|
|
3
|
+
description: Drive a Mac's iOS Simulator over SSH to verify any reachable URL in Mobile Safari. Also supports WebDriver checks on a paired iPad.
|
|
4
|
+
kind: skill
|
|
5
|
+
scope: both
|
|
6
|
+
modelInvocation: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Verify a URL on Apple devices
|
|
10
|
+
|
|
11
|
+
After syncing agent-rules, invoke `/ethlete-verify-on-apple-devices` when you need to verify behavior in iOS Safari.
|
|
12
|
+
Run {%resource:apple-remote.sh%} with Bash. In the examples below, `<skill-dir>` is the directory containing this file.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
bash <skill-dir>/apple-remote.sh detect
|
|
16
|
+
bash <skill-dir>/apple-remote.sh sim-open https://example.com
|
|
17
|
+
bash <skill-dir>/apple-remote.sh sim-shot safari.png
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Setup
|
|
21
|
+
|
|
22
|
+
- Enable Remote Login on the Mac and authorize your SSH key for non-interactive login.
|
|
23
|
+
The script uses the SSH host alias `ethlete-mac` by default. Set `ETHLETE_MAC_HOST` to use another alias or hostname.
|
|
24
|
+
- Install Xcode and an iOS Simulator runtime on the Mac. The default simulator is `iPhone 16`.
|
|
25
|
+
Pass a different device name as the second argument to `sim-open` if needed.
|
|
26
|
+
- The Mac and simulator must be able to reach the page. For a local app, bind the dev server to
|
|
27
|
+
`0.0.0.0` and use the dev machine's LAN address and port, for example `http://192.168.1.20:4200/`.
|
|
28
|
+
You can also use a staging URL reachable from the Mac. `localhost` in Simulator Safari refers
|
|
29
|
+
to the Mac. The simulator commands open the supplied URL directly.
|
|
30
|
+
- For taps, coordinate swipes and typing, install idb on the Mac. Run
|
|
31
|
+
`brew trust facebook/fb && brew install idb-companion` and install the Python CLI with
|
|
32
|
+
`pip3 install --user fb-idb`. The script expects the CLI under `~/Library/Python/*/bin/idb`.
|
|
33
|
+
- For WebDriver commands, run `safaridriver --enable` on the Mac. For a real iPad, pair it with the Mac
|
|
34
|
+
over USB and enable Web Inspector and Remote Automation under Settings → Apps → Safari → Advanced.
|
|
35
|
+
|
|
36
|
+
Checks run on iOS 26 only; do not install or select an older runtime. Use Xcode 26 with an iOS 26 runtime to verify Safari 26 behavior such as toolbar tinting.
|
|
37
|
+
Pick the Xcode and the runtime per call with `SIM_DEVELOPER_DIR` (the Xcode's `Contents/Developer` path, passed
|
|
38
|
+
to every remote `xcrun`, `simctl` and `open`) and `SIM_RUNTIME` (for example `iOS-26-3`). When the runtime has no
|
|
39
|
+
device of the requested name, `sim-open` creates one. Without them the Mac's selected Xcode and the newest runtime
|
|
40
|
+
are used. Never switch the Mac's Xcode with `xcode-select -s`. Record the runtime used in the verification report.
|
|
41
|
+
[Apple's Xcode simulator requirements](https://developer.apple.com/xcode/system-requirements)
|
|
42
|
+
and [WebKit issue 301756](https://bugs.webkit.org/show_bug.cgi?id=301756) cover the version requirements and tinting behavior.
|
|
43
|
+
|
|
44
|
+
## Simulator commands
|
|
45
|
+
|
|
46
|
+
| Command | Behavior |
|
|
47
|
+
| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
48
|
+
| `detect` | Check SSH, available iPhone simulators and paired Apple devices. |
|
|
49
|
+
| `sim-open <url> [device]` | Boot the requested device if needed and open the URL in Safari. Quote URLs containing shell characters. |
|
|
50
|
+
| `sim-shot [file]` | Capture the full display, including Safari chrome and the keyboard. Defaults to `sim.png` in the working directory. Waits first until Safari stops loading (`SIM_LOAD_TIMEOUT`, default 30 s). |
|
|
51
|
+
| `sim-swipe edge-back` | Send a left-edge touch gesture in portrait. Visit two pages in the same Safari tab before testing back navigation. |
|
|
52
|
+
| `sim-swipe <x1> <y1> <x2> <y2> [duration]` | Swipe using device points. Duration is in seconds and defaults to 0.3. |
|
|
53
|
+
| `sim-tap <x> <y>` | Tap at device coordinates. Divide screenshot pixels by the display scale, typically 3 on iPhone 16. |
|
|
54
|
+
| `sim-type <text>` | Type into a focused field via idb. iOS autocorrect and capitalization apply. |
|
|
55
|
+
| `sim-keyboard on\|off [device]` | Detach or attach the hardware keyboard preference. Reopen the page afterward. |
|
|
56
|
+
| `sim-keyboard-reset [device]` | Restart Simulator.app and boot the device to restore the soft keys after `sim-type`. |
|
|
57
|
+
| `sim-stop` | Shut down the device selected by `sim-open` or `sim-probe` at the end of the session. |
|
|
58
|
+
|
|
59
|
+
A cold boot can take about a minute. If a command stalls, check the exact SSH or
|
|
60
|
+
Simulator error and whether Simulator.app is running. Simulator.app provides the UI that
|
|
61
|
+
`sim-shot` captures. Keep the device booted between verification rounds.
|
|
62
|
+
|
|
63
|
+
`sim-swipe edge-back` compiles {%resource:sim-edge-back.m%} with the selected Xcode on the Mac.
|
|
64
|
+
The helper sends an edge-tagged SimulatorKit touch directly to the selected device, so the Simulator
|
|
65
|
+
window can stay in the background. Verified with Xcode 26.3 and iOS 26.3. When running parallel sessions,
|
|
66
|
+
use a separate simulator and a separate existing `TMPDIR` on the machine running the script for each session.
|
|
67
|
+
|
|
68
|
+
## Optional Storybook commands
|
|
69
|
+
|
|
70
|
+
Run `detect --storybook [url]` to also probe Storybook from the Mac. With no URL, the default is
|
|
71
|
+
the dev machine's LAN IP on port 4400. Set `ETHLETE_STORYBOOK_URL` to use a different reachable
|
|
72
|
+
Storybook base URL and include that probe whenever you run `detect`. Plain `detect` skips the
|
|
73
|
+
probe when the variable is unset.
|
|
74
|
+
|
|
75
|
+
`sim-open <story-id>` and `ipad-open <story-id>` still open the Storybook iframe.
|
|
76
|
+
`sim-probe <story-id> [device]` opens the viewport HUD when the Storybook instance serves
|
|
77
|
+
`/assets/viewport-probe.html`. Use `sim-tap` and `sim-shot` to read live viewport metrics
|
|
78
|
+
while the keyboard is open. The HUD disables focus zoom, so open the page directly to
|
|
79
|
+
check zoom on small inputs.
|
|
80
|
+
|
|
81
|
+
## WebDriver commands
|
|
82
|
+
|
|
83
|
+
| Command | Behavior |
|
|
84
|
+
| --------------------------- | ----------------------------------------------------------------------------------------- |
|
|
85
|
+
| `ipad-start [sim]` | Start Safari WebDriver on the paired iPad or, with `sim`, on an already booted simulator. |
|
|
86
|
+
| `ipad-open <url>` | Navigate the session to a reachable URL. |
|
|
87
|
+
| `ipad-js <script>` | Run JavaScript in the page. Use `return` to read a value. |
|
|
88
|
+
| `ipad-viewport` | Read viewport units, safe-area insets, visual viewport and estimated keyboard state. |
|
|
89
|
+
| `ipad-tap <css>` | Click an element through WebDriver. |
|
|
90
|
+
| `ipad-type <css> <text>` | Call WebDriver send-keys. Safari on iOS may leave the field empty. |
|
|
91
|
+
| `ipad-shot <out.png> [css]` | Capture an element, defaulting to `html`. |
|
|
92
|
+
| `ipad-end` | End the session and close the WebDriver tunnel. |
|
|
93
|
+
|
|
94
|
+
`ipad-start` opens a blank Safari page. Follow it with `ipad-open`. Safari chrome turns
|
|
95
|
+
orange while WebDriver is active. End the session before using idb taps or swipes since
|
|
96
|
+
real input interrupts active automation. If Safari reports that it is already paired
|
|
97
|
+
with another WebDriver session, try `ipad-open` with the stored session first.
|
|
98
|
+
|
|
99
|
+
When reporting a result, include the device, iOS version, URL, interaction and observed
|
|
100
|
+
behavior. Save the screenshot alongside the report.
|