Repository navigation
Commit 5aee206
test(ui): pin the direct-URL record form save and nav CEL visibility in Live E2E UI (#28034)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg57ReKcW3wEma7daYWHXqAD)_
Fixes #27555
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:必过检查 `Live E2E UI` 多了两个场景:按 URL
直接打开整页编辑表单、改标题、保存,要看到保存提示、留在应用内的记录页、经 API 回读到新值(#27454);应用导航项的裸字符串
`visible` 按 CEL 求值,为真显示、为假隐藏且不报错(#27457)。`list-row-action-cel.spec.ts`
从夜间清单移入必过清单。
- **为什么改**:这两个缺陷都是合并后才在浏览器里发现的,单元测试没拦住;现在真实前后端栈每个 PR 都会跑它们。
- **风险与回滚**:只动测试和 `ui/package.json` 的两条脚本清单,不改产品代码。本地 `Run the live e2e
specs` 步骤从约 35 秒变成约 40 秒,远低于 #27550 的 2 分钟预算。回滚 = 把两个文件名移回
`test:e2e:live:nightly`(新文件删掉即可)。
-
**先看**:`ui/e2e/live/record-form-direct-url.spec.ts`;`ui/e2e/live/list-row-action-cel.spec.ts`
的第二个用例;`ui/package.json` 两条脚本。
- **两分钟验证**:看本 PR 的 `Live E2E UI` 检查日志,`Run the live e2e specs` 步骤应列出 15
条全部通过,其中 3 条来自这两个文件,步骤耗时在 2 分钟内。
- **需要你做的**:无,席位落地。
## What changes
- **New `ui/e2e/live/record-form-direct-url.spec.ts` (#27454).** The
test creates its own `showcase_task` through the data API (on a seeded
project, `status: backlog`), opens
`/apps/com.example.showcase/showcase_task/record/ID/edit` with
`page.goto` (a fresh page, so the only earlier history entry is
`about:blank`, the direct-URL entry the defect needs), renames the
title, clicks Save and asserts: the save request answered 2xx; the toast
`Task "NEW TITLE" updated` is visible; the URL path is exactly the
record's detail path, inside the app; the form page is gone; `GET
/api/v1/data/showcase_task/ID` returns the new title. The task is
deleted in `finally`. A new file rather than an extension of
`action-modal.spec.ts`: that file is about the modal transport, and a
full-page form by URL is a different surface.
- **`ui/e2e/live/list-row-action-cel.spec.ts` gains a navigation case
(#27457).** It authors its own package and app through the metadata API
the way Studio's menu-entry inspector writes VISIBLE WHEN (a bare
string): one entry `'org_owner' in current_user.positions`, one
`'e2e_no_such_position' in current_user.positions`, publishes the
drafts, opens the app and asserts the first entry is shown, the second
is absent, and no `predicate could not be evaluated` line reached the
browser console (hidden because false, not because it faulted closed).
`in` is CEL-only syntax, so on the legacy evaluator both entries are
hidden. The test first asserts the seeded admin's `get-session`
positions contain `org_owner`, and deletes the package in `finally`. The
existing row-action case is unchanged.
- **`ui/package.json`:** `record-form-direct-url.spec.ts` and
`list-row-action-cel.spec.ts` join `test:e2e:live:ci`;
`list-row-action-cel.spec.ts` leaves `test:e2e:live:nightly`. Both
passed the promotion rule (readings below). Both headers say they are in
the `:ci` allowlist since this card, the way `studio-editor.spec.ts`
says it.
- No changeset: the diff is tests plus two script lines in
`ui/package.json`, the private workspace root (`object-ui-monorepo`,
`"private": true`); no published package changes.
## Acceptance notes
- **Finding, for the seat to file (class a).** #27454's fix holds only
when the form is opened on the app's package-id address. Opened on the
app's NAME alias (`/apps/showcase_app/showcase_task/record/ID/edit` or
`/apps/showcase_app/showcase_task/new`, the address every other live
spec uses and the form old bookmarks carry), the console first moves the
URL to the package-id address with a `replace` navigation
(`canonicalAppPathname` effect in `AppContent.tsx`, from #26183). That
navigation gives the entry a generated `location.key`, so
`RecordFormPage`'s `hasInAppHistory = location.key !== 'default'` reads
true and `goBack` runs `navigate(-1)`, out of the document. Measured on
this branch's stack, one fresh page per row:
| Address | Mode | `history.state.key` after load | URL after Save |
Toasts |
|---|---|---|---|---|
| `showcase_app` (alias) | edit | generated | `about:blank` | 0 |
| `showcase_app` (alias) | new | generated | `about:blank` | 0 |
| `com.example.showcase` | edit | none | record detail, in app | 1 |
| `com.example.showcase` | new | none | object list, in app | 1 |
In a real tab the alias rows land on whatever page the tab showed
before, as in #27454. This spec opens the package-id address, the one
the console's own links and the address bar carry, so it pins the fix as
delivered; an alias-URL case would be red today and is not added. Dedupe
words: `RecordFormPage goBack location.key`, `canonical app pathname
replace history`, `direct URL alias save leaves app`.
- Page block `visibleWhen` (#27457's reproduction B) is not added live:
the card asks for one navigation case. The jsdom acceptance test
`SchemaRenderer.bareCelVisibleWhen-27457.test.tsx` covers it.
- `.github/workflows/ci.yml`'s `live-e2e-ui` comment still says "the
four allowlisted live specs", and
`examples/app-showcase/test/console-live-specs.live.test.ts` says "Four
of its specs are the required `Live E2E UI` job"; both counts were
already stale and are now further off (eight files). `ci.yml` is out of
bounds for this card and the test file is outside its file surface;
neither count is read by a gate (the test reads the nightly script by
name, now 13 specs).
- The project attribution link in the first two lines names this card
thread, as the harness requires of a PR the thread opens.
## Verification
All runs: this branch's workspace backend
(`ui/e2e/live/ci/start-backend.sh`, `objectstack dev --seed-admin
--fresh` on `examples/app-showcase`, port 4110) and the Console
production build (`VITE_BASE_PATH=/ vite build`) served by `vite
preview` on 5290 with `DEV_PROXY_TARGET`, the `Live E2E UI` job's stack
step for step after its turbo build filters; `--retries 0`; one
long-lived backend across all runs (the CI job boots a fresh one per
run, so this is the harder condition). Shared container, 4 cores.
| Reading | Runs | Result | Playwright total per run (wall) |
|---|---|---|---|
| Incumbent allowlist before this change (control) | 1 | 12/12 | 34.8 s
(36.0 s) |
| The two specs, 3 tests (3/3 consecutive, taken as 5 consecutive) | 5 |
5/5 green, 15/15 tests | 6.7–7.5 s (7.7–8.6 s) |
| Enlarged allowlist, `pnpm run test:e2e:live:ci` (the 5/5) | 5 | 5/5
green, 75/75 tests | 38.5–40.3 s (39.5–41.4 s) |
<details><summary>Per-test time over the 5 pair runs (min–max)</summary>
| Test | Time |
|---|---|
| row-action `visible` predicates are CEL-evaluated (unchanged) |
2.0–2.3 s |
| nav entry bare-string `visible` read as CEL (new) | 1.5–1.7 s |
| full-page edit form opened by URL saves, toasts, stays in the app
(new) | 2.3–2.9 s |
</details>
Budget: about +5 s on the step locally (incumbent 34.8 s, enlarged
38.5–40.3 s). The job comment in `ci.yml` measured the incumbent
four-spec step at 14–24 s on CI; this PR's own `Live E2E UI` run is the
first CI reading of the eight-file step, projected well inside the 120 s
budget.
<details><summary>Ablations (one per scenario, through
scripts/ablation-replace.mjs under the verify lock, Console rebuilt per
leg)</summary>
Both specs ran in each leg, so each leg also shows the other scenario's
test staying green.
- **#27454:** `RecordFormPage.tsx` anchor `const hasInAppHistory =
location.key !== 'default';` replaced with `const hasInAppHistory =
window.history.length > 1;` (the pre-fix test). Mutation landed (anchor
1 to 0, replacement 0 to 1, blob dd43d8e to 70c521b1); the rebuilt
bundle carries `history.length>1` once (0 before). Result:
`record-form-direct-url` red (`Task "…" updated` toast not found: the
page went Back to `about:blank`), the two CEL tests green.
- **#27457:** `ExpressionEvaluator.ts` anchor `if (!unwrappedEnvelope)
{` replaced with a branch that never takes the CEL route for a bare
string and carries a string marker. Mutation landed (blob 484f34d to
4ac105fe); the rebuilt bundle carries the marker once. Result: the nav
case red (`CEL Shown Entry` not visible), the row-action case and the
record-form test green.
- **Restore:** both files restored to the HEAD blob with `git diff HEAD`
empty (the tool's own verdict), the Console rebuilt from HEAD, both
markers 0 in the bundle, and every reading above was taken after that.
</details>
<details><summary>Gate lines (command :: exit code)</summary>
`node scripts/pm/dispatch-gates.mjs --commands` derived 31 families from
the three changed paths; each ran locally, plus `node
scripts/check-sdui-manifest.mjs`, `pnpm --dir ui run type-check:e2e`
(the program lists both changed spec files) and `pnpm --dir ui
check:new-line-citations`: 34 lines, every one exit 0. `--ran`
reconciliation: 31 derived, 31 run, 0 NOT-MEASURED. CI runs the rest
(the repo-wide scans, `Live E2E UI` itself).
```text
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-osv-exemptions.mjs :: exit 0
node scripts/check-osv-exemptions.mjs --self-test :: exit 0
node scripts/osv-base-relative.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:llms-txt :: exit 0
pnpm check:changeset-fixed :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:manifest-repository-directory :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:override-consistency :: exit 0
pnpm check:pnpm-flag-spellings :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:turbo-task-graph :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:vendor-export-contract-resolve :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
pnpm check:workspace-manifest-cycles :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
pnpm --dir ui run type-check:e2e :: exit 0
pnpm --dir ui check:new-line-citations :: exit 0
```
</details>
All readings on head `2b1c6d27`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CZ1fJX9wr5Lrj1S9H4)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent e1dde1a commit 5aee206
3 files changed
Lines changed: 141 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
18 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
19 | 32 | | |
20 | 33 | | |
21 | 34 | | |
| |||
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
| 114 | + | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
0 commit comments