Skip to content

test(ui): Add repository-wide guard tests and ESLint boundary rules - #27

Open
SCcagg5 wants to merge 7 commits into
stack/26-ui23from
stack/27-ui26
Open

SCcagg5 wants to merge 7 commits into
stack/26-ui23from
stack/27-ui26

Conversation

@SCcagg5

@SCcagg5 SCcagg5 commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Part of a stack of 31 pull requests that depend on each other. They must be reviewed and merged in order: each PR builds on the previous one and its diff only contains its own changes.

All PRs of the stack
# PR
1 specs: Add spec 083 and the samples store
2 ir: Add run state fields for ephemeral runs and reused outputs
3 runtime: Bound continuous steps and carry outputs of selected steps
4 api: Add step samples, events, availability and selected-step runs
5 test(ui): add YAML fixtures for the document model tests
6 ui(lib): add shared UI kit, status helpers and right-panel shell
7 ui(canvas): add canvas engine core, toolbars and editor helpers
8 ui(i18n): add workspace message catalogs, first batch
9 ui(canvas): add canvas Flow view, step run panel and workflow panel
10 ui(editor): add YAML document model, canvas model and run source logic
11 ui(editor): Add edit session, YAML format and quick fixes, run actions, tab strip
12 ui(editor): Add canvas graph model, Add step panel, issues popover, run bar
13 ui(canvas): Add layered layout, dependency edges, status styles, reference picker
14 ui(canvas): Add export, flow builder, upstream data panel, output capture
15 ui(canvas): Add node cards, launchers, inspector sections, client issues
16 ui(editor): Add visual editor, step inspector and YAML file panel
17 ui(lists): Open runs on the workflow page; add tab and schedule helpers
18 ui(workspace): Add workspace URL state, legacy redirects and run list links
19 ui(workspace): Add workspace data layer, run facts and Workflow panel
20 ui(workspace): Add run start controls, visible runs and reuse source
21 ui(workspace): Add data provider, bar identity, continuous panel and step list
22 ui(logs): Add run actions cluster, cached logs and log popout page
23 ui(workspace): Add Activity dock, step run view and workflow page
24 test(workspace): Add integration tests for the workspace shell and step view
25 ui(pages): Retire classic run pages and open runs on the workflow page
26 test(editor): Add integration tests for the editor, inspector and run overlay
27 test(ui): Add repository-wide guard tests and ESLint boundary rules
28 e2e: Add workspace helpers and fixtures, update existing specs
29 e2e: Add workspace specs, part 1 of 2
30 e2e: Add workspace specs, part 2 of 2
31 examples: Add the workspace demo workflows

Stack 27/31. Base branch: stack/26-ui23. Review and merge in order; this PR builds on the previous one.
Size: 20 files changed, 4898 insertions(+), 17 deletions(-).
Checked: Typecheck (tsc) of the whole UI and the unit tests of this PR (Vitest), on top of the previous PR.

Summary

This PR adds the guard tests that scan the source tree, and the ESLint rules that go with them. It adds the last document-model tests and starts watchPageVisibility() at app start. It is the last UI PR of the stack.

Why

The guards check rules for the whole UI: one shared clock, Monaco only in its chunk, no hard-coded text in JSX, shared status tokens, full i18n coverage and a page import boundary. They only pass once all earlier PRs (5 to 26) have landed, so they cannot be placed earlier. PR 28 onward adds e2e specs and examples.

Changes

20 files: 2 modified, 18 new.

  • ui/eslint.config.mjs: adds restricted imports and restricted syntax for workflow-workspace, visual-editor and dag-editor. It blocks the DAG barrels and classic run view imports, reload-button, StatusDot from common, formatDurationMs, fromNow, navigator.clipboard, toLocaleString, literal text in showToast and focus-visible:ring-primary. Test files are exempt.
  • ui/src/index.tsx: calls watchPageVisibility() before render.

How to review

  1. eslint.config.mjs, then eslintBoundary.test.ts, which runs ESLint on probes.
  2. The guards: sharedClock, monacoChunk, noRawCount, statusTokens, jsxLiterals.
  3. boundary.test.ts, importBoundary.test.ts, i18nCoverage.test.ts, messages/modules.test.ts.
  4. The doc/__tests__ files.

Most attention: the ESLint block structure. A flat config block replaces rule options, so each block repeats the shared list.

Tests

  • Guards: lib/__tests__/sharedClock.test.ts, monacoChunk.test.ts, noRawCount.test.ts; testing/__tests__/jsxLiterals.test.ts; workflow-workspace/__tests__/boundary.test.ts, eslintBoundary.test.ts, i18nCoverage.test.ts, statusTokens.test.ts; messages/__tests__/modules.test.ts; pages/dags/dag/__tests__/importBoundary.test.ts.
  • Document model: doc/__tests__/clipboard, convert, depends, fields, golden (round-trip of 30 to 50 YAML fixtures), index, inspectorContract, issues.

Screenshots

No visible UI change in this PR. The rules it guards show in the finished workspace, for example the status colours in the Activity timeline.

This was referenced Oct 28, 2026
@yohamta0
yohamta0 force-pushed the stack/27-ui26 branch 2 times, most recently from 13f312d to 96f363d Compare October 30, 2026 06:44
@yohamta0
yohamta0 force-pushed the stack/26-ui23 branch 2 times, most recently from 5fc3766 to e67674f Compare October 30, 2026 08:07
@yohamta0
yohamta0 force-pushed the stack/27-ui26 branch 2 times, most recently from d112f22 to f4d7a13 Compare October 30, 2026 11:03
@yohamta0
yohamta0 force-pushed the stack/26-ui23 branch 2 times, most recently from 1d70972 to a5233fe Compare October 30, 2026 11:47
@yohamta0
yohamta0 force-pushed the stack/27-ui26 branch 2 times, most recently from 31f817e to e37029c Compare October 31, 2026 06:28
SCcagg5 and others added 7 commits October 31, 2026 19:46
… overlay (dagucloud#3406)

* UI: integration tests of the workspace
* Cover fixes of earlier PRs in tests
* Keep integration tests independent of order
* Test run with checks and IME keys in outputs
* Test the server steps of an unparsed YAML
* Test route edits, step labels and output cycles
* Test a step inserted on an inferred edge
* Test continue_on, step cache and inspector fixes
* Assert the step drawer closes in StepRunPanel test
An earlier PR makes duplicateStepsOp refuse a handler: a copy of a
handler lands in steps and would run on every run instead of on its
event. The clipboard test still expected the copy to be appended as a
step, so it failed. The case now expects the refusal.
Several guards let a violation through, or never ran on real code:

- Frontend CI also runs when the YAML corpora of the golden test
  change, so a Go-only or examples-only change cannot break the next
  UI change. The corpus test now needs at least one file per folder
  and drops specs/, which holds no YAML files.
- A new test lints the real files of the three guarded folders,
  because CI has no UI lint step and the rule tests lint only probes.
- The guard rules also catch navigator['clipboard'], a clipboard
  taken from navigator by destructuring, and a literal in a branch of
  a showToast or showError argument. YAMLMap.from, YAMLSeq.from and
  Iterator.from are no longer flagged as relative time.
- The i18n scanner reads string literals in JSX child expressions and
  the operands of +. The 'ERR' stream tag of the cached logs is marked
  as not a message.
- The Monaco chunk guard reads double-quoted imports and re-exports.
- The raw count guard catches a count with a fallback such as ?? 0.
- The clipboard undo test goes through applyWith as the editor does,
  and the issue tests cover CRLF text.
- The UI guide uses theme tokens instead of slate classes, which the
  status token test rejects.
Renames match number and boolean scalars in depends, rewind and route
targets, and step names and ids are trimmed as the server does. The
test file for these fields starts here.
Pasted steps keep integers beyond float precision and rename a copy
whose name or id differs only by outer spaces. The clipboard test
file starts here.
Frontend CI now runs for more corpus paths. It joins the concurrency
group that ci.yaml and conformance.yml use, so a new commit to a pull
request cancels the run of the commit it replaces.

The spec corpus of the golden test missed fenced yaml blocks in a file
with CRLF line ends, which the rest of the test already accepts.

The status token scan now covers the neutral and stone palettes and
the gradient, shadow, outline, divide, decoration, accent and caret
utilities, so those colours cannot slip past it.

The Monaco guard counted an import whose bindings are all inline type
bindings, which the bundler drops, as a static import of Monaco.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants