Repository navigation
fix(app-shell): a screen-flow result screen draws Done, and closing it completes the run - #27046
Merged
Merged
Conversation
… 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>
…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>
Contributor
Author
席位核对ACCEPT · seat 席位意见:流程最后一屏若只显示记录链接(如线索转换后的客户、联系人、商机),页脚只有一个「完成」;点完成、右上角关闭、Esc、点外部都会提交空的 resume,流程照常结束并刷新页面。一次 resume 失败后,关闭恢复为普通关闭,「完成」作为重试,故障时用户不会被困在对话框里。
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Warren · project thread
Fixes #26902
Clause-②: no
Metadata-protocol: none
维护者速读
record_link、且引擎说后面没有下一屏)底部只剩一个「完成」;点「完成」、右上角 X、按 Esc、点遮罩,都会以空输入恢复运行并照 Submit 的路径收尾(成功提示、刷新数据、onComplete)。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:isDisplayOnlyScreen(screen)inScreenView.tsx, besideisRecordLinkScreenField: a flat screen that declares at least one field, every one of themtype: 'record_link'(matched exactly, as the engine's resume rule matches it).record_linkis the only member of the spec's open screen-fieldtypevocabulary 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.progress.nextScreenis'none', or the server serves noprogress), and the run is not already terminal: the footer is one primary Done (the existingcommon.donerow, no new i18n row), and Done, the dialog's X, Escape and an outside click all go throughsubmit(): 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.FlowRunner.tsxrecords the behaviour and its bounds.Unchanged on purpose:
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-formsteps and the terminal paths (refused end, terminal failure: a single Close) keep their behaviour.FlowRunnerPropsis unchanged, so neither launch host (RecordDetailView,useConsoleActionRuntime) changes.Why
On the HotCRM
lead_conversionflow, the last screen is threerecord_linkfields (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,onCompletenever 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 withvariables: {}and asserts success plus the next node's write, andflow-screen-record-link.dogfood.test.tspostsinputs: {}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 thelead_conversionshape (a last screen of threerecord_linkfields):inputs: {}and callsonCompleteonce (neveronClose), one success toast, one'*'data change over the real bus;onCompleteonce;onClosewith no second resume POST, and Done stays enabled;isDisplayOnlyScreentruth table (links only, one link, link + text, case-mismatchedRecord_Link, empty, absentfields,object-form).Acceptance notes
react-refresh/only-export-componentswarning count inScreenView.tsxrises by one with the new export, the same warning every other helper export in that file already carries; eslint exits 0.dismissbinding's result-screen arm removed, so it readsconst dismiss = onClose;(the old close behaviour), throughscripts/ablation-replace.mjs: the X/Escape test turns red (onCompletenever called, 1 failed / 9 passed), then the file is restored to the HEAD blob withgit diff HEADempty.00147cd2): the dismiss guard&& !resumeErrorremoved: the "after a failed resume the close only closes" test turns red (1 failed / 10 passed), then restored to the HEAD blob6c27e23d5741.Verification
All readings on head
00147cd2, baseorigin/maincb8988ee.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.FlowRunner*,ScreenView*andScreenPreview*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-configon the three changed files: exit 0, 0 errors.os-verify-lock: VERDICT command-exit 1,Tests 1 failed | 9 passed (10), restoreblob == 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/underui/(176 files passed), speccheck:duration-unit-keys, andcheck: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:uicheck:new-line-citations(0 new) andcheck:i18n-keys, both exit 0.Changeset: none.
@object-ui/app-shellisprivate: true, so the diff publishes nothing; labelledskip-changeset.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (changed files linted locally; repo-wide lint is CI's)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code