Repository navigation
fix(app-shell): creating an item or opening one from Pending changes asks before it drops a held Studio edit - #26927
Merged
Conversation
…asks before it drops a held Studio edit A Data, Automations or Interfaces pillar now asks the shared departure question before its New dialog opens while its autosave holds an edit, and the Data pillar asks before a Pending changes request opens another object in the same pillar. Declined, the held edit stays. Claude-Session: https://claude.ai/code/session_01JQwxbZTZSxa584VWULEuMZ Co-Authored-By: Claude <noreply@anthropic.com>
… held Studio edit now guards Per pillar: create while held asks (declined, no dialog and the held edit stays; accepted, the dialog opens and the create asks nothing more), the Data pillar's same-pillar Pending changes request asks, a cross-pillar request asks once, and with nothing held nothing asks. Claude-Session: https://claude.ai/code/session_01JQwxbZTZSxa584VWULEuMZ Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · seat 席位意见:三个支柱的「新建」在打开对话框前先走共享守卫(取消即无代价);数据支柱的「待发布更改」跳转只在要打开另一个对象时才问。跨支柱跳转仍由原有的离开守卫只问一次。
Generated by Claude Code |
This was referenced Oct 27, 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 Warren · project thread
Fixes #26845
Clause-②: no
Metadata-protocol: none
维护者速读
confirmDropUnsavedWork与原有文案,不改保存、发布和暂存判定。有问题直接 revert 本 PR。StudioDesignSurface.tsx中 DataPillar 挪到objHeld之后的 live request effect(唯一的行为改动点),然后三处新建入口(openCreate、openCreateObject、openCreateFlow),最后StudioDesignSurface.heldDataCreate-26845.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.heldDataCreate-26845.test.tsx,预期 3 个测试全绿。What changes
Base
94e29cd1. One shared guard, now read by the two departures #26705 left open:confirmDropUnsavedWorkbefore its New dialog opens, because a created object, flow or Interfaces item is opened at once (setCurrentindoCreateObject,doCreateFlowanddoCreateSurface), and that load replaces the one buffer the held edit lives in. Asking before the dialog means a decline costs nothing and the create itself never asks again.openCreate(the "+" menu's New dashboard / report / page) readsleafHeld.openCreateObject, declared belowobjHeld, wrapsopenCreateDialogfor the rail's New and the empty state's New (the empty state can hold nothing; it goes through the same door so every create asks the same way).openCreateFlowreadsflowHeld.useRequestedSurface), and the sheet's security block is the only producer, so a same-pillar request is always an object request applied by the Data pillar. Its apply effect moves belowobjHeldand asks, like the rail, only when the requested object is not the open one. Declined, the request id is spent (as before, at most once) and the held edit stays. A request for the open object asks nothing.requestSurfacealready asks throughconfirmLeavePillar(which readsheldEditsince fix(app-shell): an edit a Studio pillar holds unsent guards departure like a dirty pillar #26839) and vetoes on a decline; the Data pillar it lands on holds nothing, so its apply asks nothing more. Pinned below, not changed.engine.edit.unsavedLeaveConfirm, no new i18n key). The Access pillar is not touched.Why
Triage first grade on the card, verbatim: "p2, the remainder of #26705 (PR #26839): two more departures still drop a held pillar edit without asking: creating a new object, flow or Interfaces item, and opening another item from Pending changes. Route both through the same departure guard."
Tests
Three new files, one per pillar, each through the real
StudioDesignSurfaceon the real route shape, with the held edit produced as #26839's files produce it (a Picklist with no option, a Notify step with no Title, a Metric widget with no dataset). The Data and Automations files replace the mocked Pending changes sheet with a stand-in that asks the host for an object throughuseSurfaceNavigator, as the sheet's security block does.StudioDesignSurface.heldDataCreate-26845.test.tsx(3): New object asks, Cancel opens no dialog and keeps the held field, OK opens the dialog and the create (Ticket, stored asacme_ticket) asks nothing more; a Pending changes request for another object asks, Cancel keeps the held field, a request for the open object asks nothing, OK opens the other object; CONTROL with nothing held, New object and a request never ask.StudioDesignSurface.heldFlowCreate-26845.test.tsx(3): New flow asks, Cancel opens no dialog and keeps the held step, OK opens the dialog; a cross-pillar request (an object, from Automations while a step is held) asks exactly once, Cancel stays on Automations with the held step, OK opens the Data pillar on that object with no second ask; CONTROL with nothing held.StudioDesignSurface.heldWidgetCreate-26845.test.tsx(2): New dashboard asks, Cancel opens no dialog and keeps the held widget, OK opens the dialog; CONTROL with nothing held.Runs (head 3a6924e)
ui/packagesthat importsStudioDesignSurface,DataPillar,AutomationsPillarorInterfacesPillar(161 files,DataPillar.surfaceRequest.test.tsxand the three fix(app-shell): an edit a Studio pillar holds unsent guards departure like a dirty pillar #26839 files among them): 161/161 files, 1179/1179 tests passed, lock VERDICT command-exit 0.pnpm --filter @object-ui/app-shell run type-check(both projects, tests included): exit 0.StudioDesignSurface.tsxcarries 16 warnings, as on the base (the moved effect'sset-state-in-effectwarning moves with it; the count is unchanged), the three tests none.Ablation (one-shot, through scripts/ablation-replace.mjs --delete; each leg restored to the HEAD blob with an empty git diff HEAD)
leafHeld):heldWidgetCreate1 of 2 red, the create case only.openCreateObject):heldDataCreate1 of 3 red, the New object case only.heldDataCreate1 of 3 red, the Pending changes case only.flowHeld):heldFlowCreate1 of 3 red, the New flow case only. Its cross-pillar case pins the existing surface guard and stays green, as intended.Acceptance notes
origin/maingained57820085(fix(metadata-protocol): a draft's _diagnostics reports what its publish will refuse #26856, metadata-protocol only) after the base; it touches none of these files or the derived gate inputs, so it was not merged in.@object-ui/app-shellisprivate: true, so no changeset.Verification
Gates derived by
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat3a6924e3: 24 families, all exit 0, reconciled with--ran(24 run, 0 NOT-MEASURED, 0 UNRUN).pnpm --dir ui exec vitest run scripts/first queued out of the lock (exit 99, not run) while the 161-file run held it, then ran in full under the same slot: 178 files passed, 2 skipped, exit 0.pnpm check:new-line-citations(ui): 0 new citations.Human Minimum
packages/specholds no runtime logic. (Not touched.)pnpm lintpasses. (eslint on the four files: 0 errors.)main, one pull request.@object-ui/app-shellis private.)packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code