Skip to content

fix(app-shell): a screen-flow result screen draws Done, and closing it completes the run - #27046

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-2xzlyg
Oct 28, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-2xzlyg

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread
Fixes #26902

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:屏幕流的「结果屏」(所有字段都是只读 record_link、且引擎说后面没有下一屏)底部只剩一个「完成」;点「完成」、右上角 X、按 Esc、点遮罩,都会以空输入恢复运行并照 Submit 的路径收尾(成功提示、刷新数据、onComplete)。
  • 为什么改:以前这一屏还画「取消 + 提交」,取消和关闭只关掉对话框,运行一直挂起、宿主页不刷新,刚转化的线索仍显示 Qualified,「取消」还像能撤销已写入的记录。
  • 风险与回滚:只动控制台 FlowRunner 的底部按钮与关闭处理,以及一个新判定 isDisplayOnlyScreen;有输入的屏、无字段的纯消息屏、引擎说还有下一屏的只读步骤、object-form 步骤、失败/拒绝的终态都保持原样。回滚 = revert 本 PR。
  • 先看:ui/packages/app-shell/src/views/FlowRunner.tsx 的 resultScreen / dismiss 两行与底部分支;ScreenView.tsx 的 isDisplayOnlyScreen;新测试 FlowRunner.resultScreen-26902.test.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/__tests__/FlowRunner.resultScreen-26902.test.tsx,预期 11 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

FlowRunner (the console's screen-flow dialog) now treats a result screen as something the user acknowledges, not cancels:

  • New predicate isDisplayOnlyScreen(screen) in ScreenView.tsx, beside isRecordLinkScreenField: a flat screen that declares at least one field, every one of them type: 'record_link' (matched exactly, as the engine's resume rule matches it). record_link is the only member of the spec's open screen-field type vocabulary that takes no input, so this is the whole of "a screen with no input fields". Read over the DECLARED fields, like the dialog width, so the answer never changes while the screen is open.
  • On such a screen, when it is the end of the line (progress.nextScreen is 'none', or the server serves no progress), and the run is not already terminal: the footer is one primary Done (the existing common.done row, no new i18n row), and Done, the dialog's X, Escape and an outside click all go through submit(): resume with no inputs, then take the answer exactly as Submit does (completion toast, notifyDataChanged({ objectName: '*' }), onComplete; the next screen if the run pauses again; the banner if the resume fails). A close while that resume is in flight is ignored, as on Submit. Once a resume has failed, closing is a plain close again (onClose) and Done is the retry, so an outage never traps the user in the dialog.
  • A new header section in FlowRunner.tsx records the behaviour and its bounds.

Unchanged on purpose:

  • A screen with any input field keeps Cancel + Submit, and its Cancel and X still only close.
  • A screen with no fields at all is not display-only: a message-only step can be the go-ahead for what follows it ("Delete these records?"), so its Cancel must stay a way out.
  • A display-only step the engine says another screen follows (nextScreen 'certain' / 'possible') keeps Cancel + Next: there Cancel abandons a wizard, and an X that resumed would open the next step instead of closing.
  • object-form steps and the terminal paths (refused end, terminal failure: a single Close) keep their behaviour.
  • FlowRunnerProps is unchanged, so neither launch host (RecordDetailView, useConsoleActionRuntime) changes.

Why

On the HotCRM lead_conversion flow, the last screen is three record_link fields (the created account, contact and opportunity). The dialog drew Cancel + Submit; Cancel or the close dismissed the dialog without resuming, so the run stayed suspended, onComplete never fired, and the record page kept showing the converted lead as Qualified until a reload. "Cancel" also read as if it could undo the conversion.

The server side completes on the empty resume, so the client is not faking completion: screen-record-link-resume.test.ts (service-automation) resumes a record-link result screen with variables: {} and asserts success plus the next node's write, and flow-screen-record-link.dogfood.test.ts posts inputs: {} to the real resume door and asserts the run completes.

Tests

New file ui/packages/app-shell/src/views/__tests__/FlowRunner.resultScreen-26902.test.tsx (11 tests), on the lead_conversion shape (a last screen of three record_link fields):

  • the footer shows Done and no Cancel or Submit;
  • Done POSTs the resume with inputs: {} and calls onComplete once (never onClose), one success toast, one '*' data change over the real bus;
  • the X and Escape each POST the resume and call onComplete once;
  • a close while the resume is in flight posts nothing more;
  • a resume that pauses again draws the next screen (back to Cancel + Submit);
  • a retryable failed resume keeps the banner and Done;
  • after a retryable failed resume, the X and Escape call onClose with no second resume POST, and Done stays enabled;
  • controls: a screen with any input keeps Cancel + Submit and its Cancel/X only close; a message-only screen keeps its Cancel; a display-only step with another screen after it keeps Cancel + Next;
  • isDisplayOnlyScreen truth table (links only, one link, link + text, case-mismatched Record_Link, empty, absent fields, object-form).

Acceptance notes

  • The react-refresh/only-export-components warning count in ScreenView.tsx rises by one with the new export, the same warning every other helper export in that file already carries; eslint exits 0.
  • Ablation (one-shot, not kept): the dismiss binding's result-screen arm removed, so it reads const dismiss = onClose; (the old close behaviour), through scripts/ablation-replace.mjs: the X/Escape test turns red (onComplete never called, 1 failed / 9 passed), then the file is restored to the HEAD blob with git diff HEAD empty.
  • Second ablation (on 00147cd2): the dismiss guard && !resumeError removed: the "after a failed resume the close only closes" test turns red (1 failed / 10 passed), then restored to the HEAD blob 6c27e23d5741.

Verification

All readings on head 00147cd2, base origin/main cb8988ee.

Local test and type-check runs
  • pnpm --dir ui exec vitest run packages/app-shell/src/views/__tests__/FlowRunner.resultScreen-26902.test.tsx: Test Files 1 passed, Tests 11 passed.
  • 38 affected files (every FlowRunner*, ScreenView* and ScreenPreview* test, the flow simulator parity, flowResponse, flow-envelope.ratchet, spec-symbol-parity, the flow and refused-launch tests of both hosts, FlowRunsPage): Test Files 38 passed, Tests 372 passed.
  • pnpm --filter @object-ui/app-shell run type-check: exit 0.
  • eslint --no-inline-config on the three changed files: exit 0, 0 errors.
  • Ablation: os-verify-lock: VERDICT command-exit 1, Tests 1 failed | 9 passed (10), restore blob == HEAD (318486cd2eb5).
Derived gates (dispatch-gates --commands, reconciled with --ran)

24 derived, 24 run, 0 NOT-MEASURED, 0 UNRUN; every one exit 0: check-closing-keyword-parity (+ --self-test), check-comment-mask-corpus (18647 files, 0 disagree), check-sdui-manifest (+ --self-test), vitest run scripts/ under ui/ (176 files passed), spec check:duration-unit-keys, and check:cross-package-test-inputs, dispatcher-error-vocabulary, driver-memory-census, engine-double-contract, gitlink-declared, nul-bytes, published-files, query-options-erasure, refd-timer-probe, skill-identifier-liveness, test-source-alias, tier-file-adoption, type-check-coverage, type-check-debt, undeclared-dep-imports, watch-hint-literal, where-matcher. Also run outside the derivation: ui check:new-line-citations (0 new) and check:i18n-keys, both exit 0.

Changeset: none. @object-ui/app-shell is private: true, so the diff publishes nothing; labelled skip-changeset.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (changed files linted locally; repo-wide lint is CI's)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing)
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

… completes the run

A flat screen whose every field is a record_link takes no input. When it is
the last screen, its footer is now one Done, and Done, the dialog's X, Escape
and an outside click all resume the run with no inputs and take the answer as
Submit does (completion toast, notifyDataChanged, onComplete). Before, Cancel
and the close only dismissed the dialog, leaving the run suspended and the
host page stale.

A screen with any input, a message-only screen, and a display-only step the
engine says another screen follows keep Cancel + Submit/Next.

Claude-Session: https://claude.ai/code/session_01JQwxbWYBBF9CLagvsKZNkN
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 28, 2026
…loses

Done stays the retry, but the X, Escape and an outside click fall back to
onClose once a resume has failed, so an outage never leaves the user in a
dialog whose every way out retries the same request.

Claude-Session: https://claude.ai/code/session_01JQwxbWYBBF9CLagvsKZNkN
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

ACCEPT · seat domain:ui#5 · session_01JQwxbXGpVJHZTXXerMoY4C · head 00147cd2 · 2026-10-28T03:36Z

席位意见:流程最后一屏若只显示记录链接(如线索转换后的客户、联系人、商机),页脚只有一个「完成」;点完成、右上角关闭、Esc、点外部都会提交空的 resume,流程照常结束并刷新页面。一次 resume 失败后,关闭恢复为普通关闭,「完成」作为重试,故障时用户不会被困在对话框里。

  1. Shape: Fixes #26902; 3 files, +302/−1: FlowRunner.tsx (header section, resultScreen / dismiss, the Done footer), ScreenView.tsx +19 (isDisplayOnlyScreen beside isRecordLinkScreenField), one new test file. FlowRunnerProps unchanged, so both launch hosts are untouched. Done is the existing common.done row. skip-changeset: @object-ui/app-shell is private: true.
  2. Premise measured: the seat read the source diff. isDisplayOnlyScreen is a flat, non-object-form screen with ≥1 field, every one record_link, read over the declared fields. resultScreen also needs a non-terminal run and no next screen (progress.nextScreen 'none' or absent); Done and every close path go through submit(), so completion is Submit's own (toast, notifyDataChanged('*'), onComplete; a re-pause draws the next screen). Dev measured that the engine completes on an empty resume (engine and dogfood tests). The seat asked for one change on review: after a failed resume the closes fall back to onClose (resultScreen && !resumeError), pinned by a new test and a second ablation.
  3. Gates / check-runs: PR check-runs on 00147cd2: 43 success, 14 skipped, 0 failure; Lint & Repo Gates, TypeScript Type Check and Type Check UI success (Check Changeset skipped by label). Dev's local run: 24 derived, 24 run, 0 NOT-MEASURED; new file 11/11, 38 affected files / 372 tests, app-shell type-check exit 0. Earlier reds on 6245ea3c were lanes cancelled by the push.
  4. Accepted deviations: two narrowings, both reasoned in the PR: a display-only step with another screen after it keeps Cancel + Next (Cancel still abandons a wizard), and a zero-field message screen keeps Cancel (it can be the go-ahead for what follows); the PR body amended by the seat through the relay for the review fix (os-dev writes its body once).
  5. Out of scope: none. Skills-docs: none — runtime dialog footer only.
  6. Landing: not Tier H (no governed path, +303 lines); ready for landing (ready + auto-merge).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 28, 2026 03:37
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 28, 2026 03:37
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 2713377 Oct 28, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-2xzlyg branch October 28, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants