Skip to content

fix(studio): every retired pillar address lands on its new page in one redirect; the pillar-era code with no reader goes - #37383

Draft
objectstack-fleet[bot] wants to merge 5 commits into
mainfrom
claude/issue-36909-studio-pillar-dead-code
Draft

objectstack-fleet[bot] wants to merge 5 commits into
mainfrom
claude/issue-36909-studio-pillar-dead-code

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #36909

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:Studio 的旧地址(以前的「数据 / 自动化 / 权限 / 界面」分区链接、收藏夹、AI 给过的链接、服务器发的草稿审阅链接)都还能打开原来要看的页面,而且一次就跳到位;清理本身用户无感。
  • 为什么做:Studio 重构专题的收尾——分区已经被左侧菜单和全屏设计器取代,这一单删掉分区留下的、已经没人读的代码。
  • 出错会怎样:如果哪条旧地址漏了,打开它会落到「页面不存在」或错误的列表页;这是纯前端改动,撤回这个 PR 即可恢复。
  • 要你做什么:无。

What changes

No Studio pillar draws a page any more. This PR makes the route, not the builder, answer every retired pillar address, and deletes what the redesign left with no reader.

1. One redirect table, mounted on the route (studioPillarRedirectModel.ts, StudioPillarRedirect.tsx, StudioRoute.tsx).
/studio/PACKAGE and /studio/PACKAGE/:tab now render StudioPillarRedirect. A retired pillar address redirects once; any other segment renders the builder (the sharing overview owd, or the not-found state).

old address lands on
/studio/PACKAGE, /studio/PACKAGE/data /studio/PACKAGE/metadata/object?package=PACKAGE
/data?surface=object:NAME (all three spellings, ?action= kept) /studio/PACKAGE/metadata/object/NAME?package=PACKAGE
/data?changes=review (the server's studioChangesReviewLink) /studio/PACKAGE/metadata/object?changes=review&package=PACKAGE
/automations[?surface=flow:NAME] the flow list, or /metadata/flow/NAME?package=PACKAGE
/access[?surface=permission:NAME / owd:overview] the permission set list, the set's matrix (its holder read, as before), or /owd
/interfaces[?…] the object list, with the "interface editing moved" notice
/studio/~org and every /studio/~org/… /studio/~org/metadata/flow[/NAME]?source=runtime

A base's .custom pair keeps each pillar's old rule (Data and Automations in the pair's area; Access and Interfaces on the base).

2. One hop (carry item from 7157423170). Every target in the area is put where the area would put it (settledAreaAddress, built on a new studioAddressParts parser in studioAddress.ts), so the area never redirects a second time. Before: /data took two redirects, bare /studio/PACKAGE three, /studio/~org two. The publish toast's "Open Access" and the Changes sheet's link to a permission set now open the set's own page instead of the old Access address.

3. Removed, with every reader gone (all in @object-ui/app-shell, private: true, last published 18.2.0 — nothing published narrows):

  • AREA_PILLAR_FOR_TYPE, areaItemPillarPath, studioPillarItemPath (metadataArea.ts); StudioMetadataArea's pillar redirect branch.
  • STUDIO_ITEM_PILLAR (empty since Studio 重构(3-1):流程设计器在元数据地址上右侧全屏打开,去掉流程左侧列表,流程类型切到新地址 #36903), studioItemPillar, studioPillarItemAddress, studioSurfaceQuery, StudioItemOptions.spelling (studioAddress.ts). studioItemPath now always returns the metadata address.
  • STUDIO_ORG_SCOPE_PILLAR (studioAddress.ts, its studioScope.ts re-export and the package entry). Kept only as data where a redirect needs it: the literal 'automations' inside the redirect table.
  • STUDIO_HOME_PILLAR from the package entry (the console no longer reads it). It stays inside app-shell: studioHomePath / studioChangesReviewPath mirror the server's /data?changes=review link, which this card may not change.
  • The ?surface= mirror half and the capture half with it (useSurfaceDeepLink, useSurfaceDeepLinkCapture, useSurfaceDeepLinkMirror, parseSurfaceTarget, resolveSurfaceDeepLink) and their test file. useSurfaceActionDeepLink and the qualifier keys stay (the object designer and the redirects read them).
  • The channel's subscriber half: useRequestedSurface, SurfaceRequest and the requested state (carry item: no reader since feat(studio): the object designer opens full-screen on its metadata address, tabs in #36513's order #37168). useSurfaceNavigator + SurfaceDeepLinkProvider stay: the Changes sheet's security block uses them.
  • In StudioDesignSurface: the in-surface Data / Automations / Interfaces redirects, PILLARS, the Access landing branch, PILLAR_FOR_SURFACE_TYPE, and the pillar re-entry counter whose value nothing read.
  • studioMenuModel.ts needed only the sharing overview's section, not a pillar map: PILLAR_TYPE went; the menu marks nothing current on a retired address (it never draws one).

4. studio.app.ts: no change needed. All 15 metadata:resource / metadata:directory entries were walked through the console's real path (/apps/studio/metadata/TYPE?package=PACKAGE → setupMetadataStudioPath): each lands on /studio/PACKAGE/metadata/TYPE?package=PACKAGE (or ~all with no package), a settled area address, none on a pillar. Reading in Verification.

5. Card item 3 (engine.studio.pillar.*) was already gone on main (the claim's Premise). This diff removes no translation call site; ui/scripts/check-i18n-dead-keys.mjs exits 0.

Tests

Pins (each ablated, below):

  • Table — studioPillarRedirectModel.test.ts walks 22 old addresses (every package pillar, bare package, a .custom pair, every ~org address, the three ?surface= spellings) to their literal targets, plus the Access mapping; studioAddress.test.ts holds every STUDIO_ITEM_TYPES row's redirectsTo equal to what the table returns for each spelling. Route-level: StudioRoute.metadataArea-28561.test.tsx walks 14 old addresses through the real studioRoutes and the real redirect.
  • /data single hop — the old /data address reaches the object list in one redirect (the area's areaLocationRedirect answers null for the target); route-level, the location probe records exactly [old, new].
  • CONTROL — /owd, /owd?object=…, area addresses and an unknown segment are not redirected (pure and route-level: the probe records [url] only).

Updated: 37 app-shell surface tests now mount the console's route shape (StudioPillarRedirect around the builder on :tab); the console route tests expect the new landings; the publish toast test expects the permission set list.

Acceptance notes

Not filed (dead code / drift, no defect class); carrier: none.

  • Client producers still write old addresses that now cost one redirect: studioHomePath callers (command palette, app no-access state, AI chat page, appRoute, PackagesPage, PackageCustomizationsPanel) and setupMetadataRedirect's packagedAutomationStudioPath / packagedActionsStudioPath (two hops for those legacy Setup bookmarks). Left alone: two of those files belong to an in-flight branch, and the address they write still works.
  • The copilot's surface context (StudioAiCopilot) still reads :tab and ?surface= as its pillar context (cloud#1610 contract); on current pages it reads the area path instead.
  • The surface keeps its ~org non-area fallback and its pair→base redirect for owd/unknown segments; the route no longer reaches the first.

Finding for the seat (class a, user-visible misleading text), not fixed here: the not-found state at /studio/PACKAGE/bogus_pillar says "pick Data, Automations, Interfaces, Access or All metadata above" (engine.studio.notFound.pillar, en and zh) — none of those exist any more.

First read (by risk)

  1. ui/packages/app-shell/src/views/studio-design/studioPillarRedirectModel.ts — the table; the .custom pair rules and the ~org catch-all.
  2. ui/apps/console/src/components/StudioRoute.tsx — the two routes that now render the redirect, and the lazy boundary it rides.
  3. ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx — the removed in-surface redirects and the requestSurface permission branch.

Verification

Two-minute check: open /studio/com.example.showcase/data?changes=review in the Console (OS_PORT=3000 pnpm dev, Console on :5180). Expected: the address bar shows /studio/com.example.showcase/metadata/object?changes=review&package=com.example.showcase, the Objects list is open, and the Changes drawer is open over it.

All readings below are on tree 26ec30e1 (the rebased head), byte-identical to the pushed head 2322b402 (git diff --quiet between them exits 0; see Process notes).

Type-check
  • pnpm --filter @object-ui/app-shell type-check (both programs, tsconfig.json and tsconfig.test.json): VERDICT command-exit 0, 0 error TS.
  • pnpm --filter @object-ui/console type-check: VERDICT command-exit 0, 0 error TS (run on the pre-rebase head 3a7bc226; the rebase brought no console change).
Tests
  • Full app-shell suite, pre-rebase head 3a7bc226 + the guard fix: Test Files 1 failed | 2429 passed | 1 skipped (2431), Tests 1 failed | 23308 passed. The one failure was studioAddress.guard.test.ts (my parse prefix spelled the Studio root outside studioAddress.ts); fixed by studioAddressParts, then that guard passes.
  • Rebased head 26ec30e1: vitest run packages/app-shell/src/views/studio-design packages/app-shell/src/views/metadata-admin packages/app-shell/src/console apps/console/src/components → Test Files 1442 passed (1442), Tests 14059 passed | 1 skipped.
  • Pins: studioPillarRedirectModel.test.ts + StudioRoute.metadataArea-28561.test.tsx → 64 tests pass.
Ablations (one per pin; each via `scripts/ablation-replace.mjs`, anchor hit x1, mutation landed on disk, restored to HEAD blob `85ed9932ab4b`, `git diff HEAD` empty after)
  • Table — the Automations case maps through dataPillarRedirect instead: red, exactly the Automations rows — 4 in studioPillarRedirectModel.test.ts and 2 route-level ones.
  • /data single hop — settledAreaAddress(...) dropped from the Data case: Tests 14 failed | 50 passed (64), the one-hop pin the old /data address reaches the object list in one redirect among them, and every route-level /data and bare-package row (the probe saw a second hop).
  • CONTROL — the default: arm redirects to the object list instead of null: Tests 8 failed | 56 passed (64): all pure and route-level CONTROL cases, plus the /access?surface=owd:overview row (its /owd target then redirects again).
  • Restored leg: both files plus a scratch walk of studio.app.ts → Test Files 3 passed, Tests 66 passed.
`studio.app.ts` walk (scratch test, not committed)

Each metadata:resource / metadata:directory entry through /apps/studio/metadata/TYPE?package=PACKAGE → setupMetadataStudioPath, then areaLocationRedirect on the result: 15 of 15 land on /studio/PACKAGE/metadata/TYPE?package=PACKAGE (directory: /studio/PACKAGE/metadata?package=PACKAGE), section metadata, settled (no second redirect). With no package: 15 of 15 on /studio/~all/metadata/TYPE, settled. Types: object, app, view, page, dashboard, report, dataset, action, hook, flow, agent, tool, skill, email_template.

Gates

Process notes

  • One push (3a7bc226) went out before I re-ran the three pre-push gates; I ran them on that head right after (all exit 0).
  • The final rebase could not be pushed: the permission classifier refused the --force-with-lease. I did not retry it. Instead the branch keeps its pushed history, merges origin/main (1691563a) and replays the two later commits; the resulting tree is byte-identical to the rebased, tested tree.

Generated by Claude Code

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

This branch has not been deployed

No deployments
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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio 重构(4-1):删掉分区路由和残留(:packageId/:tab 路由、AREA_PILLAR_FOR_TYPE、pillar 文案、旧 Studio 应用的菜单项)

2 participants