Repository navigation
feat(studio): customize a read-only base's flow into its pair, with one ledger switch and Restore package original - #28824
Merged
Conversation
…tudio On a read-only base, the Automations pillar offers Customize on a flow. The first saved edit asks the ensure door and writes the flow's draft into the pair under the same name, declaring the override. The ledger switch stays on the flow's name, no definition switch is drawn for the override, the header carries the override badge, and the flow menu offers Restore package original, decided from the served declaration. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRWZNXu1HAHuMowQXS
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRWZNXu1HAHuMowQXS
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRWZNXu1HAHuMowQXS
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRWZNXu1HAHuMowQXS
…ation doubles Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRWZNXu1HAHuMowQXS
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-01T22:06ZHead-sha:
|
This was referenced Nov 2, 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 Steedos · project thread
Fixes #28570
Clause-②: no
Metadata-protocol: none
维护者速读
BASE.custom,把这个流程以同名草稿写进去,并声明overrides: { package, basedOn }。覆盖流程的头部显示「覆盖 HotCRM」徽标,仍然只用启用台账的那一个开关,不画定义开关。流程的 ⋯ 菜单多了「恢复软件包原版」,确认后删除配对包里的草稿和行,基础流程重新运行。app-shell的 studio-design 目录和 studio 文案(en/zh 各加一条),不改协议、服务端或 spec。是否已覆盖,读的是声明覆盖那一行本身(配对包草稿,否则 layered 读取的overlay),不读信封里随基础包封印走的deletable(服务端席位 1 的发现)。可写包的流程照旧有删除和定义开关(对照测试)。回滚即还原本 PR。StudioDesignSurface.tsx里AutomationsPillar的doSave(写进配对包并声明覆盖)、restoreFlow(两次删除)和flowSwitchEl(覆盖流程不画定义开关);然后FlowItemMoreMenu.tsx的restore。cd ui && pnpm exec vitest run packages/app-shell/src/views/studio-design/AutomationsPillar.customizeFlow-28570.test.tsx,预期 10 条全过。What changes
On a read-only base, the Automations pillar now customizes a flow the way the Interfaces pillar customizes a view, a dashboard or a report (the card's Wanted 1 to 6).
StudioCustomizeButton, N-17's control, with the same block reasons:walledfrom the surface'scustomizeDoorWalled,noVersionwhen the listed manifest states no version. Pressing it only unlocks the flow's editors (canvasonPatch, the node inspector, the autosave). Nothing is written until an edit is saved.doSaveasks the surface's ensure door once per flow (StudioBaseCustomization.ensure, the same pathInterfacesPillartakes) and writes the flow's draft into the package that answer names, under the flow's own name. The body isoverrideDraftBody(draft, base, basedOn): the served flow without its_keys, declaringoverrides: { package, basedOn }. The first save into the pair is pinned to "no draft there" (ifNoneMatch), the later ones to the version they were answered. The flow's load reads its draft at the pair once one is listed, so the designer then edits that draft. The rest of the package stays read-only: Delete flow, New similar's target, the item tools and the definition switch keep their read-only gates.FlowLedgerSwitchon the flow's name (_statusrow, unchanged). When no ledger row is served, a customized flow draws no switch at all, where the base's own flow keeps its locked definition switch.toggleEnabledstays refused on a read-only package's flow, so Studio never writes the override'sstatusto mean on or off.StudioOverrideChipfromuseServedOverride: the pair's draft through the draft door, else the layered read'soverlay, which N-11 serves as the pair's row.FlowItemMoreMenugains arestoreprop that draws N-17'sStudioRestoreOriginalItem. The pillar passes it when the served declaration exists. Per server seat 1's finding on the card, Restore is decided from the declared override's own row, never from the served envelope'sdeletable, which follows the base's seal. The confirmation (StudioRestoreOriginalDialog, newkind: 'flow') says the base's flow runs again under the same switch, and names the draft that goes first. Confirming deletes the pair's draft, then the pair's row, both at the pair (client.reset), reloads the flow, re-reads the declaration and the engine's rows, and the base's flow reads back.publishRefusal,engine.studio.refusal.publishPlain).engine.studio.customize.restoreFlowBody, in the studio namespace'senandzh.Tests
AutomationsPillar.customizeFlow-28570.test.tsx, 10 cases, through the mounted pillar, its real autosave, the real header controls and the realensureCustomizationPackageover a fetch stub that also serves the/automationdoors:_key; the base is untouched; no/togglerequest is sent; the badge appears; one switch, the ledger's; the second edit asks the door no more and is pinned tov1.deletable: false, no Delete flow, and an edit saves into the pair keeping the declaration.status.Acceptance notes
FlowItemMoreMenulives in its own file,studio-design/FlowItemMoreMenu.tsx, not insideStudioDesignSurface.tsx, so the edit to it is that file. The claim namesFlowItemMoreMenuin the file surface.setup/packagedFlowLedger.tswas not touched: the ledger row is keyed by the flow's name, and N-11 keepspackagedFlowOwner(name)answering the base, so the existing hook already binds the override.Verification
All local runs at head
146e0b60unless stated.Touched-package tests
Test Files 1 passed (1),Tests 10 passed (10).AutomationsPillar,FlowItemMoreMenu,StudioCustomizeControls, the automations route, or importing the studio namespace, in four batches at47ed4fb8: 40/40 files 336 tests, 40/40 files 851 tests, 40/40 files 283 tests, 35/35 files 587 tests, all passed.packages/i18n/: 94 files, 1438 passed, 13 skipped. The commits after47ed4fb8are a one-line render change to Restore'sdisabled(it no longer reads a ref while rendering), the new no-ledger-row case and two renamed test parameters. At146e0b60the new file and five neighbouring files (AutomationsPillar.ledgerSwitch-28148,.deleteFlow-27356,.newSimilar-28567,StudioDesignSurface.oneSurface-28572,InterfacesPillar.customize-28562) ran again:Test Files 6 passed (6),Tests 52 passed (52).git grepof the touched components and strings, blind to tests that reach them indirectly).Ablations (each one-shot through `scripts/ablation-replace.mjs`, restored to the HEAD blob, `git diff HEAD` empty)
Type-check, lint, derived gates
pnpm exec turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n --concurrency=2at146e0b60:Tasks: 66 successful, 66 total(the first run, at92ba27eb, was red on two unused parameters in the new test's doubles, TS6133; fixed in146e0b60).StudioDesignSurface.tsxthe React Compiler's "memoization could not be preserved" warnings move from 27 to 29, forrestoreFlow(the same shapedeleteOpenFlowalready warns on); no other warning class is added.node scripts/pm/dispatch-gates.mjs --commands: 34 derived families, each run once at92ba27eband exit 0, includingnode scripts/check-sdui-manifest.mjsandpnpm --dir ui exec vitest run scripts/.--ranreconciliation:34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN. The only commit after it renames two test parameters.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jRWZNXu1HAHuMowQXS