Repository navigation
fix(studio): 「新建自己的应用」 ends with an app; a new object joins its menu; an empty menu is not blamed on access - #36764
Conversation
… names a package with no app Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXT7Mhxfq3Zqk9Vbt2
…app menu is not blamed on access Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXT7Mhxfq3Zqk9Vbt2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXT7Mhxfq3Zqk9Vbt2
…f family The dialog's newApp step writes app metadata through the metadata client, not a record through a data source; its member is named create like one. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXT7Mhxfq3Zqk9Vbt2
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: FAIL |
…list is answered, not thrown An administrator who cannot author is served the pruned app by /layers, so an empty read there is the access case, and Studio would refuse them. A failed read of the package's apps after a new object goes live warns instead of drawing the create's refusal over the live object. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXT7Mhxfq3Zqk9Vbt2
…nu fixes' wording Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXT7Mhxfq3Zqk9Vbt2
… whole Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXT7Mhxfq3Zqk9Vbt2
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: ① Derived judgments
No must-fix, no should-fix. ② Semver levelUnchanged: ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读Studio 里「新建自己的应用」现在真的建出一个应用,并马上可用。之后在 Studio 新建的对象会自动加进这个应用的菜单。应用菜单为空时,能编辑应用的管理员会看到「菜单还是空的」和「在 Studio 中打开」,不会再被引导去 Setup 授权。没有编辑权限的组织管理员看到的仍是原来的提示。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
Requested by Warren · project thread
Fixes #36748
Clause-②: yes (widening) — new keys in the published
@object-ui/i18npacks:engine.studio.newApp.*,engine.studio.data.appMenu.*in the studio namespace;empty.appMenuEmpty,empty.appMenuEmptyDescription,empty.openInStudioin all 11 app-shell locale packs. Additive only.Metadata-protocol: none
维护者速读
What changes
The landing door.
BuilderLanding's 「新建自己的应用」 card (studio-landing-new-app, and the/studio?new=packagedeep link that opens the same dialog) now handsPackageFormDialoganewAppstep (studio-design/newAppDoor.ts). With it, create mode:NAMESPACE_app, read with the samefindTakenIdentifierevery Studio create reads. Both taken ⇒ the confirm is refused in the dialog's banner (Advanced opens, where the namespace is), and nothing is written;POST, writes the app as the top bar's Create app does (buildAppSkeleton, draft under the first-write pin) and publishes that one item (publishSavedItem, Studio 里人工修改改成「保存」「取消」,保存后这一项立刻生效;不再自动存草稿,不用整包发布 #36511), so the app is live when the dialog closes. A refused publish takes back its draft (existing behaviour ofpublishSavedItem); the package then exists without an app, the toast says so and points at the top bar's Create app, and the author still lands in the package's Studio.The dialog elsewhere (Packages page, no
newApp) is unchanged, and so is the top bar's own Create app button.The header.
StudioBackToApptakespackageLabel. When there is no app to name (no remembered app page and no published app), the name slot shows the open package's label, markeddata-names="package"("app"when it names an app). Where the back link goes is unchanged.StudioDesignSurfacepassespkgEntry.namefor the open package.A new object joins its app's menu (folded in by the maintainer's 「这张卡里一起做」). The door creates the app before any object exists, so its menu starts empty, and nothing added a later object.
studio-design/newObjectJoinsAppMenu.tsaddNewObjectToAppMenuruns indoCreateObjectonce the object is live (its toast shown), for the rail's own writable package:saveAppMenu, 设计模式(二)菜单编辑:添加已有的菜单项,上移下移、移到分组、移除、改名和图标 #36363): the stored menu read from/layers, one object entry with nolabelappended at the top level (the shapebuildAppSkeletonseeds), a draft under the first-write pin, then that app's publish. A draft somebody left pending on the app is refused, never overwritten; a refused publish discards the draft the save wrote;toast.warning「“X” was created, but it could not be added to the menu of “App”: REASON You can add it in the app’s design mode.」 A failed read of the package's apps is answered the same way (failed,app: null, the sentenceappMenu.failedNoApp), never thrown into the create's refusal strip over the live object.An empty menu is said as such.
console/AppNoAccessEmptyState.tsx: for the no-navigation reason and a caller who can grant access (setupPathset) AND author (useCanAuthorMetadata,manage_metadata), the screen reads the app's stored menu (GET /api/v1/meta/app/NAME/layers?package=PKG, plain fetch to keep the console's eager closure unchanged). Empty there too (navigation and every area) ⇒data-reason="empty-menu": 「{app} 的菜单还是空的」, a line saying objects created in Studio join it, and 「在 Studio 中打开」 →/studio/PKG/data. A stored menu with entries this caller is not shown, a failed read, a caller who cannot grant, or an administrator who cannot author keep the access answer. The last is the hostedorganization_adminposture (objectstack#8270):/layersserves such a caller the app PRUNED to what they may see, so an empty read there is the access case, and the Studio link would refuse them; they are never read for.i18n:
engine.studio.newApp.*andengine.studio.data.appMenu.*(incl.failedNoApp) rows in the studio namespace (en,zh);empty.appMenuEmpty,empty.appMenuEmptyDescription,empty.openInStudioin all 11 app-shell locale packs. Changeset:@object-ui/app-shell,@object-ui/i18npatch, Clause-② yes (widening). No new route or spec change.Tests
New
studio-design/BuilderLanding.newAppDoor-36748.test.tsx(realBuilderLanding,PackageFormDialog, metadata client andStudioDesignSurfaceover a stateful fetch stub):POST /api/v1/packages,PUT /api/v1/meta/app/NAMESPACE(mode=draft,package=ID, label = the name),POST /api/v1/meta/app/NAMESPACE/publish(package=ID); the author lands in the package's Studio, the header readsBack to app·Visits·Studiowithdata-names="app", no Create app is offered, and 「‹ Back to app」 opens/apps/ID;StudioDesignSurface.backToApp-36501.test.tsx: the two no-app cases (no app; a draft-only app) now expect the package's label in the name slot (Back to app·Sales·Studio,data-names="package"); where the link goes is asserted unchanged.New
studio-design/newObjectJoinsAppMenu-36748.test.ts(6): the stored menu plus one entry, draft (ifNoneMatch: '*') then publish; an empty menu gets its first entry; no app / several apps / an entry already opening the object (inside a group) write nothing; a 409 on the app's save is answered asfailedand nothing is published; a rejected app list is answered asfailedwithapp: nulland nothing is written; the entry id is one no entry holds.New
studio-design/DataPillar.newObjectJoinsAppMenu-36748.test.tsx(4, the realDataPillar):save object draft, publish object, save app draft, publish appand the saved navigation is the object's entry; a package with no app writes only the object; a refused menu save keeps the object, opens it on the rail, and warns with the pending-draft reason; a rejected app list keeps the object, warns with the no-app sentence, and draws nostudio-refusal/role=alert.New
console/__tests__/AppNoAccessEmptyState.emptyMenu-36748.test.tsx(6): empty stored menu ⇒empty-menu, no 「grant access」, Studio link/studio/PKG/data, the/layersURL; entries filtered away, a 403, a caller who cannot grant (never fetched), or an administrator who cannot author (never fetched; the Setup link shown, no Studio link) keepno-navigation;storedMenuIsEmptyover navigation and areas.AppContent.emptyNavigationLanding-12079.test.tsx: the admin Setup-link case now stubs a stored menu with entries (it is the access case).plugin-form/src/affordanceGrantMap-12082.test.tsx(the console write census): the dialog'snewApp.create(…)call is a member namedcreate, so the census reads it as a write site; it is entered asoutOfFamily(app metadata through the metadata client, not a record through a data source). CI's Test UI caught it at 82e04d4.Ablation, fix committed, each mutation through
node scripts/ablation-replace.mjsand restored withgit diff HEADempty:const name = target.appLabel ?? fallbackLabel→target.appLabel: both no-app header cases fail (2 of 12); restored 12/12.await newApp.create(…)→void 0: the one-confirm case fails (1 of 3); restored 3/3.if ('taken' in reserved)→if (false): the taken-name case fails (1 of 3); restored 3/3.addNewObjectToAppMenucall indoCreateObjectdisabled: all 3 DataPillar cases fail; restored 3/3.AppNoAccessEmptyStatedisabled: 1 of 5 fails; restored 5/5.&& canAuthordropped from the stored-menu ask: the non-author administrator case fails (1 of 6); restored.catchansweringfailed→throw error: the unit and the DataPillar cases fail (2 of 10); restored.Local runs (82e04d4, then the fold-in at ffa8751 / a572abe)
The full
@object-ui/app-shellsuite is left to CI.Verification
Live, showcase stack (
objectstack dev --seed-admin --fresh) plus the console dev server, zh-CN, 1440×900. Screenshots are in the project thread (not committed, perui/AGENTS.md):/apps/com.default.kehu-hui-fang, the app switcher shows 客户回访.data-reason="empty-menu")./apps/com.default.kehu-hui-fang/kehu_hui_fang_hui_fang_jilu);GET /api/v1/meta/appanswersnavigation: [{ id: "nav_kehu_hui_fang_hui_fang_jilu", type: "object", objectName: "kehu_hui_fang_hui_fang_jilu" }].Two-minute check: open
/studio, click 「新建自己的应用」, type a name, click 「创建应用」; expect the header to name the new app. Open the app: it says its menu is empty. Back in Studio, 新建对象; open the app again: the object is in its menu.Acceptance notes
Generated by Claude Code