Skip to content

feat(app-shell): fold the .custom pair's landing card under its base and name the base on the pending-changes sheet - #29723

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-pkn482
Nov 3, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-pkn482

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Part of #29691

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:Studio 首页「我的软件包」不再给 BASE.custom 定制包单独一张卡,它折叠在基座卡下(与软件包切换器同一规则);基座卡保留「已定制 n 项」及其链接。待发布变更面板在审阅定制包草稿时,标题下多一句「保存到 基座名 的定制」。
  • 为什么改:定制一个只读软件包后,首页冒出一张用户从没建过的「可写」包卡,而面板只说「本软件包」,用户不知道改动存到了哪里(ADR-0146 D3)。
  • 风险与回滚:仅 UI 与一条新文案键;定制包的导出与删除仍在 Studio「概览 → 软件包」页(已实测)。回滚即还原本 PR,无数据或协议变化。
  • 先看:BuilderLanding.tsx 的折叠(foldCustomizationPairs);DraftChangesPanel.tsx 的 customizationOf 一行;StudioDesignSurface.tsx 只在 pairId 存在时传入基座名。
  • 两分钟验证:在 showcase 定制任意一项后打开 /_console/studio,「我的软件包」里不再有 com.example.showcase.custom 卡,只读区的 Showcase 卡写着「已定制 1 项」;点 Publish 打开面板,标题下是「保存到 ObjectStack Showcase 的定制」。
  • 需要你做的:无,席位落地。

What changes

  • Landing (ADR-0146 D3). BuilderLanding folds each BASE.custom pair under its base with the switcher's own foldCustomizationPairs before it splits writable from read-only. A pair whose base is listed draws no card in either section. The base's card keeps its "n customized" line, and that line's link into the pair. A pair whose base is not listed keeps its card, the switcher's rule too.
  • Pending-changes sheet. DraftChangesPanel takes an optional customizationOf (the base's label) and, when set, says under its title "Saved to BASE's customizations" (zh 保存到 BASE 的定制). The sentence is one exported helper, savedToCustomizationText, so the item header can say the same words in the follow-up PR. StudioDesignSurface passes the base label only while it reviews a pair's drafts (pairId set), and nothing for a writable package or a base with no pair.
  • i18n. One new key, preview.changes.savedToCustomization, in all ten @object-ui/i18n locale packs. Nothing is removed or renamed.
  • Not changed: the publish toast (the card's direction names only the item header and the sheet), and the item header, which waits for Studio: an item header keeps the item name readable; chips and tools collapse first #29693 and lands in a second PR.

Contract review

  • What widens: the published @object-ui/i18n locale packs gain one leaf, preview.changes.savedToCustomization, in each of the ten packs, and @object-ui/app-shell gains an optional DraftChangesPanel prop (customizationOf) and one exported helper (savedToCustomizationText).
  • What narrows: nothing. No key, prop, export or accepted value is removed or tightened. Metadata authors see no change (Metadata-protocol: none).

Tests

  • BuilderLanding.customizationCounts-28566.test.tsx: a new describe over the real landing. A read-only base and its writable pair draw one card, the base's, with its customized count and the pair link, and the pair's name and id appear on no card. A read-only pair folds under its listed base too. CONTROL: a writable package that is no pair keeps its card, and a pair whose base is not listed keeps its card. The existing "no line for a pair" case now finds the orphan pair's card and no card for the folded one.
  • DraftChangesPanel.test.tsx: a new describe that renders the real sheet through the real i18next hook and the shipped packs. With customizationOf="HotCRM" it reads 保存到 HotCRM 的定制 in zh and "Saved to HotCRM’s customizations" in en. CONTROL: without it, no sentence.
  • StudioDesignSurface.customizePublish-28562.test.tsx (the real surface): reviewing a listed pair, and after the first edit makes the pair, the sheet is handed the base label HotCRM. CONTROL: a base with no pair hands it nothing.

Acceptance notes

  • Where the pair's export and delete live. They were never on the landing card, which offered only Open and Duplicate. They are on Studio, Overview → Packages (nav_packages → /apps/studio/component/developer/packages, the developer:packages page). That page lists every served package with no pair fold. The pair's row opens a detail sheet with Export (every row, GET /api/v1/packages/:id/export) and Delete package (writable rows, DELETE /api/v1/packages/:id). Measured live on a fresh showcase (pnpm dev -- --fresh, branch head d47495aa): POST /api/v1/packages/com.example.showcase/ensure-customization answered 201 and created com.example.showcase.custom. GET /api/v1/packages then served it as its own row (writable: true, source: authored), the row the Packages page draws. GET /api/v1/packages/com.example.showcase.custom/export answered 200 with the pair's manifest, and DELETE /api/v1/packages/com.example.showcase.custom answered 200, after which the list held only com.example.showcase. Those are the doors the sheet's Export and Delete package buttons call (PackagesPage: Export on every row, Delete package on writable rows); the buttons themselves were read from code, not clicked.
  • The review's claim that the pair card's link returns to the base holds. The pair card opened /studio/PAIR/data, and the StudioDesignSurface wrapper sends every pillar URL of a pair to the base's surface. StudioDesignSurface.oneSurface-28572 already pins that. The base card's customized link takes the same path, unchanged.

Verification

Tests and gates (final head 62ad4a4; sweep on d47495a, and the merge of main brought no file under ui/)
  • Red on main, green here. The three touched test files with origin/main 1c1a5d40's BuilderLanding.tsx, DraftChangesPanel.tsx and StudioDesignSurface.tsx (each blob-identical to main, restored to HEAD after, git diff HEAD empty): 7 failed, 24 passed. The 7 are the new pins; the CONTROL cases stay green on main. On the branch: Test Files 3 passed, Tests 31 passed, on d47495aa and again on 62ad4a49.
  • Sweep (--maxWorkers=2, locked): every ui test file naming BuilderLanding or DraftChangesPanel plus every test reading the locale packs or preview.changes, 254 files in six batches, all green (346 + 425 + 554 + 289 + 519 + 677 tests), and packages/i18n/ whole: 95 files, 1443 passed, 13 skipped.
  • Type check: turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n: 66 of 66 tasks green.
  • eslint on the touched source and test files: 0 errors, 8 warnings. One is react-refresh's only-export-components warning on the new savedToCustomizationText export, the warning the file's three other exported helpers already carry. The other 7 are on lines this PR does not touch.
  • Derived gates (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack): 35 commands, each exit 0, including check-sdui-manifest, check-changeset-no-major, check-adr-0087-registration, check-closing-keyword-parity (run against this body) and pnpm --dir ui exec vitest run scripts/ (170 files passed, 2 skipped).
  • Not run locally: the full Test UI shards, which CI's Test UI runs.

Generated by Claude Code

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

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu

席位核对 · ACCEPT · 2026-11-03T03:07Z

Head-sha: 62ad4a49c883d19f42618b181b4aa7aaed0e3852

  • Shape:
    • The PR is a draft against main. The first card line is Part of #29691 (PR 1 of 2), under claim 6593455602.
    • 17 files, +186 / −13: BuilderLanding.tsx (+10 / −2), preview/DraftChangesPanel.tsx (+26), StudioDesignSurface.tsx (+3, one prop at the DraftChangesPanel call), the three claimed tests, one key in each of the ten packs under ui/packages/i18n/src/locales/, and a changeset. That is the claimed surface. The claim spelled the sheet as views/studio-design/preview/DraftChangesPanel.tsx; the file is ui/packages/app-shell/src/preview/DraftChangesPanel.tsx, and only that file changed. check-governed-merges --pr 29723: not governed, 199 changed lines, under the human-merge threshold.
    • Clause-②: yes (widening) and Metadata-protocol: none start their lines in the body and the changeset, as claimed. The changeset is patch for app-shell and i18n.
  • Read in the diff:
    • The landing now builds its cards from foldCustomizationPairs(pkgs).rows, the same fold the package switcher uses. A pair whose base is listed draws no card; the base's card keeps its customized line and its pair link. An orphan pair keeps its card. Writable and read-only sections split the folded rows as before.
    • DraftChangesPanel takes an optional customizationOf and draws one line under the sheet description through savedToCustomizationText, an exported helper the item header can reuse in PR 2. The surface passes baseLabel only while pairId is set, so a sheet outside a pair is unchanged.
    • The new key preview.changes.savedToCustomization is in all ten packs (en "Saved to PACKAGE’s customizations", zh 保存到 PACKAGE 的定制, with the label interpolated; ja and the others translated), so locale parity holds.
  • Contract review (seat self-review, Clause-② yes):
    • What widens: @object-ui/i18n gains one leaf in each of the ten packs; @object-ui/app-shell gains an optional DraftChangesPanel prop and the exported savedToCustomizationText.
    • What narrows: nothing. No key, prop, export or accepted value is removed or tightened, and the new prop is optional with no default behaviour change. Metadata authors see nothing (Metadata-protocol: none).
    • Verdict: PASS. Widening only; a minor-safe patch.
  • Pins changed: BuilderLanding.customizationCounts-28566.test.tsx's "no line for a pair" case now finds the orphan pair's card and no card for the folded one. That follows the card's direction, not a weakening. customizePublish-28562's stub now draws the new prop.
  • Gates (check-runs on this head): 44 success, 11 skipped, 0 failed or pending. mergeable_state is clean.
  • Tests (dev):
    • Seven new pins go red with main's three source files; the CONTROLs (a writable non-pair package, an orphan pair, a sheet with no pair) stay green. All 31 pass on the branch.
    • 254 ui files plus all 95 packages/i18n files green; app-shell and i18n type-check 66 of 66; derived gates 35 of 35, including the changeset and closing-keyword gates against the body.
    • Live on a fresh showcase: ensure-customization 201; the pair lists as its own writable row in GET /packages; its export answers 200 and its DELETE 200, after which only the base is listed. So the pair's export and delete stay reachable from the Packages page after its landing card goes, as ADR-0146 D3 requires.
  • NOT MEASURED: the seat ran no live session. The landing and the sheet were rendered in jsdom, not in a browser.
  • Findings: not filed. A pair's publish toast still reads 已发布本软件包的 N 项; the card names the header and the sheet only, and the toast is noted in the body.
  • Serial: PR 2 (the item-header sentence, reusing savedToCustomizationText) waits for seat 4's Studio: an item header keeps the item name readable; chips and tools collapse first #29693 and is cleared with seat 4 before code.
  • Landing: ordinary queue landing, pr_ready then automerge_enable. Part of #29691 leaves the card open for PR 2.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu

Post-landing review on the landing head (contract-review.md: a PR that lands still owing its record is reviewed on its landing head). The seat's ACCEPT 6594418645 carried this judgment as a bullet, not in the record shape; this is the record.

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 62ad4a49c883d19f42618b181b4aa7aaed0e3852
Local-runs: none

① Derived judgments

  • @object-ui/i18n: one new leaf, preview.changes.savedToCustomization, in each of the ten packs under ui/packages/i18n/src/locales/. Only an addition, with no key renamed or removed. It interpolates one package value, and the en defaultValue in savedToCustomizationText matches the en pack. Correct.
  • @object-ui/app-shell: DraftChangesPanelProps gains an optional customizationOf?: string. Absent, the sheet renders exactly as before (the line is behind customizationOf ?). An addition to the accepted props, and correct.
  • @object-ui/app-shell: a new export, savedToCustomizationText(t, baseLabel). It is additive and pure, with no existing export changed.
  • BuilderLanding folding the pair card is behaviour, not a contract face: no prop, export or key moves.
  • Nothing narrows: no key, prop, export or accepted value is removed or tightened. Metadata-protocol: none holds, because no metadata author can write anything new.

② Semver level

The changeset declares '@object-ui/app-shell': patch and '@object-ui/i18n': patch with Clause-②: yes (widening) and Metadata-protocol: none. AGENTS.md Post-Task step 3 says a non-protocol change, widening or breaking, ships patch, and none takes patch. The level matches the declaration.

③ Boundary flags

The dev raised no open_questions. The PR author is objectstack-fleet[bot] (relay pr_create). The noted out-of-scope item, a pair's publish toast still reading 已发布本软件包的 N 项, is outside the card's two named surfaces and moves no contract.

Implemented-by: claude/project-thread-pkn482
Reviewed-by: session_01QsR2jUJ19MstFvFhjgiYTu

VERDICT: PASS

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/m 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.

1 participant