Skip to content

fix(studio): the read-only header offers an overlay only for a type that takes one - #27927

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-9nt6x7
Oct 30, 2026
Merged

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

维护者速读

  • 改了什么:Studio 里只读软件包(代码包或已安装包)的条目页头,只有当前条目的类型在服务端类型注册表里声明了 allowEnvironmentOverlay 时,才显示「Read-only · Customize with an overlay」,并直接打开该条目在 Setup 的页面;其他类型(对象、流程、页面、权限集等)只显示带锁的「Read-only」,不再是链接。
  • 为什么改:HotCRM 浏览器走查(Setup and Studio: suggestions from a full HotCRM browser pass on 18.2.0: user onboarding, packaged automation state, run-now for scheduled flows, admin lists, and Studio entry, field table, flow inspector wording and one designer per item #27356 第 13 行)发现,对象、流程这些根本不能做 overlay 的条目也挂着「用 overlay 定制」,点进去是整个包的元数据目录,找不到能做的事。
  • 风险与回滚:只改页头这一个标记,不改只读判定和任何写入;回滚就是 revert 本 PR。
  • 先看:StudioDesignSurface.tsx 里的 StudioReadOnlyLink(读 useMetadataTypes 判定 overlay),以及四个 pillar 的调用点传入的 item。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioReadOnlyLink.overlay-27356.test.tsx,应见 5 passed。
  • 需要你做的:无,席位落地。

Part of #27356 (row 13, hotcrm#2320 Studio S2: the read-only header offers an overlay only where one exists)
Clause-②: no
Metadata-protocol: none

What changes

  • The overlay link appears only for a type that takes an overlay. StudioReadOnlyLink, the mark at the right of an open item's header in a read-only package, used to read "Read-only · Customize with an overlay" on every pillar and link to the package's metadata directory (overlayPath). It now takes the open item ({ type, name }, or null) and reads the served type registry (useMetadataTypes, /meta/types). When that item's type declares allowEnvironmentOverlay: true (ADR-0005), the mark keeps its text and Layers icon and links to the item's own Setup page, /apps/setup/metadata/TYPE/NAME, where the overlay is edited. Otherwise, and also with no item open or the registry not yet read, it is a plain <span> with a Lock icon reading "Read-only" (the existing engine.studio.pkg.readonly key). It keeps the same data-testid, tooltip (the pillar's read-only sentence) and fold-to-glyph behaviour (objectui#12707).
  • Call sites. Interfaces, Data and Automations pass their open current item. Access passes { type: 'permission', name } for an open permission set and null on the OWD overview.
  • i18n. No key added, renamed or removed, and no value changed.
  • overlayPath itself is unchanged and still used by the Studio home's read-only package card.

Tests

  • New StudioReadOnlyLink.overlay-27356.test.tsx (5 tests, registry mocked at useMetadataTypes): an overlay-able type links to its Setup page with the overlay text; a non-overlay type, a type missing from the registry, no open item, and an empty (not yet read) registry each render a plain "Read-only" span with no href.
  • Updated pins that asserted the old always-a-link behaviour on non-overlay items:
    • StudioDesignSurface.readOnlyPosture-12453.test.tsx: the mark on a read-only object is a span reading "Read-only" with no href.
    • StudioDesignSurface.readOnlyChipFold-12707.test.tsx: the folded mark carries the read-only text, with no href; it reads text content rather than the link's accessible name.
    • DataPillar.headerActions-12511.test.tsx: the header's only control is the rail toggle; the mark reads "Read-only".
Readings (head 281d785, branch rebuilt from origin/main d770b15 after #27882 merged)
  • The six read-only mark files (the new one, the three updated, plus readOnlyWording-11781 and StudioItemHeader.statusPlace-12524 unchanged): 6 files, 31 passed.
  • Every ui test file naming StudioDesignSurface or StudioReadOnlyLink (190 files): 190 passed, 1430 passed.
  • pnpm --filter @object-ui/app-shell run type-check: exit 0 (lock VERDICT command-exit 0).
  • Ablation through scripts/ablation-replace.mjs: const overlayable = item !== null && entries.some(...) to const overlayable = item !== null; (every open item offered the overlay): 3 failed / 2 passed (the three non-overlay cases red); restored blob = HEAD blob b97b32176c04, git diff HEAD empty. vitest resolves @object-ui/* to source, so no rebuild leg.
  • pnpm --dir ui run check:i18n-drift: no en value changed in this range (packs and designer table).

Acceptance notes

  • Types that now show a plain "Read-only". The served registry marks only view, dashboard, report, translation and email_template as overlay-able. Items of type object, flow, page, permission, app and dataset (among others) no longer offer an overlay; in practice most Data and Automations items, Interfaces pages and every Access permission set show the plain mark. That is the intent of row 13: offer the overlay only where the server accepts one.
  • The decision reads the server's registry, not a Studio list, so a type the server later makes overlay-able gets the link with no Studio change.
  • The link goes to the item's own Setup page. Whether that page's overlay editor covers every overlay-able type was not measured here.

Verification

On head 281d7857: dispatch-gates --commands derived 34 families for this diff; all 34 were run locally, each exit 0, and --ran reconciled 34 run, 0 NOT-MEASURED, 0 UNRUN. check:new-line-citations: 0 new. CI check-runs were in progress when this was opened.


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 Oct 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe

席位核对

ACCEPT · head 281d7857acc5881d845171331a511f3075c4b0d2 · 2026-10-30T04:25Z

  • Shape: draft → main, Part of #27356 (row 13 only; the order lands one PR per row, so the card stays open), no closing keyword. Clause-②: no and Metadata-protocol: none match the claim; Studio-side only (@object-ui/app-shell, private: true), and no i18n key or value changed. No contract review owed.
  • Premise, measured: StudioReadOnlyLink sent every read-only item, in every pillar, to the package's whole metadata directory with "Customize with an overlay". The spec registry allows an overlay only for view, dashboard, report, translation and email_template. The mark now reads the served type registry (useMetadataTypes, allowEnvironmentOverlay), with no local list. Where the open item's type can be overlaid, it links to that item's own Setup page. Everywhere else it is a plain lock "Read-only": a type that can't be overlaid, no item open, or the registry not read yet. The testid, tooltip and fold behaviour are kept. Access passes {type: 'permission'}, and the OWD overview passes null.
  • Gates (check-runs on the head): 44 success, 11 skipped, 0 failure; mergeable_state clean. check-governed-merges --pr 27927: NOT governed (0 of 6 paths), 219 changed lines.
  • Accepted deviations: none beyond the rebuild from origin/main d770b150 after row 18 landed, as the order sequenced it. The seat agreed beforehand that the row needs no ruling: it adds no new way out (such as "clone to edit" for flows).
  • Out of scope: object, flow, page, permission, app and dataset now show only "Read-only"; the Acceptance notes list them. Any new way out for them is a product question, not this row.
  • Landing: non-governed, all checks green, mergeable_state clean ⇒ the seat lands it (pr_ready + automerge_enable). Row 22 follows from the new main.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 30, 2026 04:27
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 30, 2026 04:27
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 80e1d87 Oct 30, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-9nt6x7 branch October 30, 2026 05:23
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