Repository navigation
fix(app-shell): a full-page record form opened by direct URL returns inside the app after save or cancel - #27558
Merged
objectstack-fleet[bot] merged 2 commits intoOct 29, 2026
Conversation
…inside the app after save or cancel goBack decided 'has in-app history' from window.history.length, which counts the tab's entries from before the console loaded, so a direct-URL entry went Back out of the app and lost the save toast. Decide it from react-router's location key instead, as FormPage's cancel does. Claude-Session: https://claude.ai/code/session_01L6bhgXU26UBEjd1KKHgNEx Co-authored-by: Claude <noreply@anthropic.com>
… budget Claude-Session: https://claude.ai/code/session_01L6bhgXU26UBEjd1KKHgNEx Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#1 · os-sales · session_01L6bhgXU26UBEjd1KKHgNEx 席位核对 · ACCEPT · 2026-10-29T13:10ZHead-sha:
|
objectstack-fleet
Bot
deleted the
claude/issue-27454-direct-url-form-return
branch
October 29, 2026 20:13
This was referenced Oct 29, 2026
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 Sales · project thread
维护者速读
RecordFormPage的返回判定一处;应用内进入的行为不变。回滚即还原该文件一个提交。ui/packages/app-shell/src/views/RecordFormPage.tsx的goBack(hasInAppHistory),然后看新测试RecordFormPage.directUrlReturn-27454.test.tsx。/_console/apps/com.example.showcase/showcase_task/new,填写并点 Create,应看到Task "TITLE" created提示并停留在任务列表(应用内)。Fixes #27454
Clause-②: no
Metadata-protocol: none
What changes
RecordFormPage'sgoBackdecided "came from inside the app" fromwindow.history.length > 1. That counts the tab's entries from before the console document loaded, so a form opened by pasted URL, new tab or deep link went Back out of the app, and the save toast fired just before the document unloaded.'default', every entry it navigated to gets a generated key. Back only when the key is not'default'; otherwise the existing parent route (record detail in edit mode, object list in create mode) withreplace. This is the same ruleFormPage's cancel already uses in the console, and the same route in-app entry takes when nothing is behind it, not a second fallback.goBack, so both follow the rule; edit mode (/record/ID/edit) is covered by the same change.Tests
New
RecordFormPage.directUrlReturn-27454.test.tsx, withwindow.history.lengthstubbed to 3 on every cell:Task "Quarterly review" updatedand lands on the record detail;Task "Quarterly review" createdand lands on the object list;Ablation (one-shot, through
scripts/ablation-replace.mjs, restored to the HEAD blob): putting thewindow.history.length > 1test back turns the three direct-URL cells red and leaves the two in-app cells green, as predicted.Acceptance notes
ui/packages/layout/src/PageHeader.tsx(its back button) uses the samewindow.history.length > 1pattern. That is the back-button control, a different bug class from the after-save route; left unchanged here.Verification
All readings on head
6912ecba.Local runs
pnpm --dir ui exec vitest run packages/app-shell/src/views/RecordFormPage(lock VERDICT command-exit 0): Test Files 10 passed, Tests 61 passed.git diff HEADempty.pnpm --filter @object-ui/app-shell run type-check(both the source and the test tsconfig): exit 0.pnpm --dir ui check:new-line-citations: 0 new citations, exit 0.dispatch-gates --commandsderived 34 families; all 34 run with exit 0 recorded,--ranreconciliation: 34 run, 0 NOT-MEASURED, 0 UNRUN. That includespnpm --dir ui exec vitest run scripts/(169 files passed, 2 skipped).Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgXU26UBEjd1KKHgNEx