Skip to content

fix(console): following a result screen's record link closes the flow dialog - #36947

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36849-result-link-closes-flow-dialog
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36849-result-link-closes-flow-dialog

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #36849
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户在控制台记录页上走完多步屏幕流程(如 HotCRM 线索「转换」、商机「生成报价单」)后,点结果页里新建记录的链接,弹窗会随之关闭、流程同时完成,用户落在那条记录上,上面不再盖着停在第一步的旧弹窗。
  • 这是屏幕流程(自动化)结果页的缺陷修复,替所有使用多步屏幕流程的用户解决「点开新记录后弹窗退回第一步、再点下一步报英文错误」的问题。
  • 出错时最坏的情况是点链接后流程没完成(只弹出错误提示),用户仍可从流程运行页处理;改动只在前端控制台,可以直接撤回。
  • 无。

What changes

Cause, reproduced on origin/main (head 4f19091997f, which already carries the lost-answer recovery). The record page that launches a screen flow (RecordDetailView) holds only the run's launch state, the step the run first paused on; every later step lives inside FlowRunner. A record_link on the result screen is a router Link to another record, and the record page resets its loading flag on every object or record change (the setIsLoading(true) effect keyed on objectName and the record id), which draws its skeleton through an early return. So FlowRunner unmounted with the page and came back from the host's launch state: step one, its inputs and a live Next. Pressing Next posted step one's values to a run already on its last screen, and the engine refused them with INVALID_SCREEN_INPUT. The recovery added for a lost resume answer does not cover this path: here no resume is in flight when the dialog falls back; the dialog is simply rebuilt from stale host state.

Fix, at the link. Following a record link in the same window now ends the dialog before the route changes, through the same door as the dialog's close button:

  • ScreenView takes an optional onRecordLinkFollow callback and runs it from the record link's Link on a click the router itself navigates on (primary button, no modifier key, not already handled). A ctrl/cmd/shift/alt click opens the record elsewhere and leaves the dialog alone. The Studio preview passes nothing.
  • FlowRunner answers it with followRecordLink: the host is told to close at once (onClose), so the record page holds no run when it redraws. On a result screen (only record links, nothing after it) the run is then completed exactly as Done completes it: the empty resume, the completion toast, notifyDataChanged('*'), onComplete. On any other screen the link closes as Cancel does and resumes nothing. While a resume is in flight, or after one has failed, it only closes, as the close button does.

The completing resume's answer now arrives after the dialog is gone, so a failure there is reported by its toast alone. The run stays suspended in that case, the same outcome as closing after a failed Done today.

Files to read first (by risk):

  1. ui/packages/app-shell/src/views/FlowRunner.tsx: followRecordLink (beside dismiss), and the header section "Following a record link ends the dialog". The risky hunk is the order: onClose() first, then void submit().
  2. ui/packages/app-shell/src/views/ScreenView.tsx: navigatesInPlace and the onClick on RoutedRecordLink's Link.
  3. ui/packages/app-shell/src/views/__tests__/FlowRunner.recordLink-25872.test.tsx: the new top-level describe and its RecordPageHost, a reduced record page with the same loading flash on route change.

Tests

New top-level describe in the existing record-link harness, objectstack#36849. It mounts FlowRunner under RecordPageHost inside a MemoryRouter and drives HotCRM's quote wizard: step one declares quoteName, the result screen only the quoteLink record link.

  • lands on the record with nothing on top, never on step one again: after the link, the quote page has no dialog, no Quote name box and no Next. The resumes are [{ quoteName }, {}], onComplete fires once, one success toast and no error toast.
  • a link on a step that still takes input closes the dialog as Cancel does, resuming nothing: onClose once, no onComplete, only step one's resume.
  • a link opened in a new tab leaves the dialog where it is: a ctrl-click keeps the dialog and Done, and resumes nothing.
Red without the fix, green with it

The fix was committed first (8f7616989e4). For the red leg, FlowRunner.tsx and ScreenView.tsx were restored, tree only, from the test-only commit 42b0b768bd4. On disk FlowRunner.tsx hashed 2c374ce54e8, the 42b0b768bd4 blob (the same as origin/main), and followRecordLink occurred 0 times. Then git checkout HEAD -- on both files; afterwards FlowRunner.tsx hashed 8fa5a6ed056, the HEAD blob, and git diff HEAD had 0 lines. The test imports ../FlowRunner from source, so no build sits between the edit and the run.

red  (pre-fix source, head 8f7616989e4)
 x lands on the record with nothing on top, never on step one again
 x a link on a step that still takes input closes the dialog as Cancel does, resuming nothing
 Tests  2 failed | 7 passed (9)
 -> AssertionError: expected the dialog to be null; the DOM dump shows "Quote details", "Quote name" and Next
green (head 8f7616989e4)
 ok all three objectstack#36849 cases
 Tests  36 passed (36)   (recordLink-25872, resumeResult, resultScreen-26902)

The predicted direction was red on the two cases that follow a link in place and green on the new-tab preservation case. That is what was observed, and the red DOM dump is the card's symptom.

Suites and type-check (head 8f76169)
pnpm --dir ui exec vitest run packages/app-shell/src/views/__tests__/FlowRunner packages/app-shell/src/views/ScreenView packages/app-shell/src/views/metadata-admin/previews apps/console/src/pages/developer/FlowRunsPage.test.tsx packages/app-shell/src/views/ActionParamDialog.dialogReach-12080.test.tsx
 Test Files  188 passed (188)
      Tests  2007 passed (2007)
pnpm --filter @object-ui/app-shell run type-check     VERDICT command-exit 0 (both tsconfig.json and tsconfig.test.json)
pnpm --dir ui exec vitest run scripts/
 Test Files  172 passed | 2 skipped (174)
      Tests  5126 passed | 2 skipped (5128)

Acceptance notes

  • The fix holds the link's path only. The record page still unmounts FlowRunner on any route change and rebuilds it from the launch state, so a route change that does not go through the dialog (the browser's Back or Forward while a wizard sits on step two over a record page) would show step one again. That path was read from the code, not reproduced; it needs the host to keep the run's current step, which is a change to the hosts and outside this claim's file surface.
  • No string was added, so no locale pack changed. No server change.
  • On a result screen both onClose and then onComplete reach the host. Every current host clears its run state on either; FlowRunsPage refreshes once for each.

Verification

Two-minute check: from the repository root, pnpm --dir ui exec vitest run packages/app-shell/src/views/__tests__/FlowRunner.recordLink-25872.test.tsx. Expect 9 passed, including the three objectstack#36849 cases.

Local gate subset (head 8f76169)

node scripts/pm/dispatch-gates.mjs --commands derived 38 families from this diff; all 38 ran and each exited 0. --ran reconciliation: "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3)". Also run: ui check:new-line-citations (0 new citations). Repo-wide scans, lint and the type-check lanes are left to CI.

node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
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-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: 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:nul-bytes :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: 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:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0

Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 24, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 8f7616989e4af1aebcb508ed7a6ef9400829badf · 2026-11-24T10:52Z

  • Shape. l1-face --pr 36947 CLEAN (13 items). Draft, base main, Fixes #36849, Clause-②: no · Metadata-protocol: none; changeset @object-ui/app-shell patch. Not governed, 269 changed lines, 4 files, all inside claim 7127838358's surface (no locale string added).
  • Premise. Held on origin/main 4f19091997 (which contains fix(console): a screen-flow step the run already left is never submitted again #36864): the dev's red test reproduces the card on main (dialog back on step one with a live Next after the link click). fix(console): a screen-flow step the run already left is never submitted again #36864 recovers a lost resume answer — a different path.
  • Delivery vs card. One place: the record link. ScreenView gains optional onRecordLinkFollow, threaded to RoutedRecordLink, fired only on a click the router navigates in place (navigatesInPlace: primary button, no modifier, not default-prevented) — a new-tab click leaves the dialog. FlowRunner.followRecordLink: onClose() first, then on a result screen (no resume error, not submitting) the same submit() Done runs (empty resume, toast, notifyDataChanged, onComplete); on any other screen it closes as Cancel and resumes nothing. fix(console): a screen-flow step the run already left is never submitted again #36864's recovery path untouched; single-screen result screens still close and complete. The Studio preview passes no callback. The header and props docs state the order (close before complete) and that a late failure is told by its toast.
  • Gates. Check-runs at 8f7616989e: 38 success, 13 expected skip, 0 failed, 0 pending; mergeable_state clean. Local: 38 derived families run, all exit 0 (--ran: derived zero).
  • Tests evidence. Three new cases in FlowRunner.recordLink-25872.test.tsx with a record-page host that flashes loading on route change: red with FlowRunner.tsx/ScreenView.tsx at the test-only commit (2 failed — dialog still showing 'Quote details' / Next), green at head (36/36 in the three FlowRunner files; 188 files / 2007 tests in the wider app-shell run). Type-check exit 0.
  • Accepted deviation. Main not merged before opening (5 commits, none on the touched files); K now 8, below the hold.
  • Out of scope. Filed console: a screen flow dialog over a record page falls back to its first screen on any route change (browser Back/Forward), because the host keeps only the run's launch state #36951 (the host still remounts from the launch state on any other route change — browser Back/Forward shows step one again; read from code).
  • Landing condition. Met: not governed, K = 8 (manual; UI-only PR), os-regen drift 0. Land now.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Landing · 2026-11-24T10:53Z · head 8f7616989e4af1aebcb508ed7a6ef9400829badf

Probe Reading
check-governed-merges.mjs --pr 36947 NOT governed — 269 changed lines
landing-k UI-only PR, no Test Core PRBASE; manual: 8 first-parent commits on main since the merge base (< 15), no shared book under this PR
pr-state.mjs --pr 36947 38 success · 13 expected skip · 0 failed · 0 pending · mergeable_state clean
os-regen drift 0

State: L1 ACCEPT at this head (above). pr_ready + auto-merge now; the seat follows it to MERGED and closes out #36849 there.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 24, 2026 10:53
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 91bb024 Nov 24, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36849-result-link-closes-flow-dialog branch November 24, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants