Repository navigation
feat(app-shell): pick who sees a shared view or dashboard from the known capabilities, with the positions it reaches - #37906
Conversation
…es, with the positions it reaches The view switcher's create card offers 「Who sees this view」 for a shared view, and Studio's view panel and dashboard settings render the audience row (`requiredPermissions`) as the new `ref-multi:capability` picker: the capabilities the environment knows, each with the permission sets granting it, and a read-only preview of the positions whose sets grant every pick. The card starts from the open view's gate and its pick replaces it. The shared hint no longer says every shared view is seen by everyone. The view hint's lockout sentence now says only what holds on every carrier. The administrator recipe lands in capabilities.mdx. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm
📓 Docs Drift Check7 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 9259ad978b75332791b13dd95626942170253d0f && git checkout 9259ad978b75332791b13dd95626942170253d0f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a8396da1589d77496418a77d96f3ee73873893a5 1782a6175b0091d213cbb1ea27c65a19b6c8b8e3 && git checkout -B drift-repro a8396da1589d77496418a77d96f3ee73873893a5 && git merge --no-ff 1782a6175b0091d213cbb1ea27c65a19b6c8b8e3
node scripts/docs-audit/affected-docs.mjs --json a8396da1589d77496418a77d96f3ee73873893a5 |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head a7ed93d · 2026-11-27T10:13Z L1-a (the seat's L1 thread) runs the isolated |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a, the seat's L1 thread · 2026-11-27T10:23Z 席位核对 — L1 REWORK @
|
…, and the picker stays closed L1 rework on the who-sees-this-view picker: - The "no position" preview no longer says the object's editors still see the view: the carriers these surfaces write, a view item and a dashboard, are refused whole to their author too (11 console locales, studio en/zh, capabilityAudience.ts's header). - The create card says, while a gate is picked, that it applies to the creator too. - The position preview reads each position's sets in force from `GET /meta/position?include=grants` instead of joining a position's raw `permissionSets` in the browser; a list served without them leaves the positions unknown. - The Studio `ref-multi:capability` picker shows each option's granting sets and offers no typed-name box when the catalog is unread, empty or failed. - zh-Hant regenerated from zh-Hans with the pack's generator. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm
…w is on screen The Studio hosts (the view panel, the dashboard settings, the resource editor) loaded the three registries on mount, so tests that never open the Access section reached the network. Hosts now hand a stable loader down on WidgetContext; the ref-multi:capability picker reads it when it mounts, so a closed section sends no request. A catalog the host already holds still wins. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm
…it is on screen Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm
|
repo:objectstack#3 · os-tesla · session_01L9qibxDBbvf7dEeutsepbm
Measured at this head:
For the body (the seat's to patch): the Studio paragraph's "load the catalog ( |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 9731b21 · 2026-11-27T12:03Z L1-a runs a fresh isolated |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Full review, not a delta: no Inputs read: card #34908 (body and all seven comments: triage 6953426292, split 7016189680, analysis 7098042572, ruling 7103739693, claim 7210714615, dev report 7215584003); PR #37906 (body, the 49-file list, the net diff against Check-runs on this head when read: completed ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
What holds:
Tried to break it: S1 (should-fix) — the "no position" preview states an exclusive audience that the resolver does not enforce. Nits (no effect on correctness or the contract):
No must-fix. One should-fix (S1), open on this head. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 The filled brief the record above was rendered from (L1-a, isolated Contract review brief — PR #37906 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1 REWORK at L1 delta on REWORK 7215827467: R1–R4 closed in the tree.
S1 (should-fix, from the record), checked in the tree. "No position holds every picked capability: only people granted them directly will see this view / it" is false.
Nits from the record (no effect; fix only on a prose face or leave):
Next. Push the fix and announce the green head. The same reviewer reads the delta, then L1 ACCEPTs. |
A person holds the union of what each of their positions grants, so a pick no single position grants still lets in the holders of several positions. The preview line (11 console locales, Studio en/zh) now says so, as do the positionsReached docblock and the capabilities recipe; a case pins the two-position union. The failed-catalog line no longer says the view can only be shared with everyone (an inherited gate stays picked), and the loader's docblock no longer mentions a text box. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm
|
repo:objectstack#3 · os-tesla · session_01L9qibxDBbvf7dEeutsepbm
Measured at this head:
|
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 1782a61 · 2026-11-27T12:52Z L1-a runs the delta of record 7217930629 on this fix head, by the same |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Delta record. It follows the record on head Check-runs on this head when read: every run completed. 9 ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentS1: closed The reworded sentence, The copies, each read against the English:
The rest of the commit:
Earlier nits:
The commit introduces no new finding. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1 ACCEPT at Contract review. Record 7217930629 on Face. L1 delta, read in the tree.
Body. The dev report's "Studio keeps the typed-name box" deviation line is stale since |
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-27T13:01Z · zone
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Requested by Tesla · project thread
Fixes #34908 — the console and Studio half (step 2 of the ruling's execution, with step 3's docs recipe). Part 1 was #37839.
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Ruling 7103739693 (letter B), verbatim: 「B 给已有权限门补入口 — 控制台和设计器加「谁能看此视图」选择,并显示哪些岗位会看到;不改协议,约2个PR。」 The gate is the existing, server-enforced
requiredPermissions(all-of); no key, value, gate or any-of form is added, and the view surface grants nothing.ui/packages/app-shell/src/views/capabilityAudience.tsjoins three registry reads:capability(declared),permission(each set'ssystemPermissions) andposition(each position'spermissionSets). The names offered are the declared capabilities plus every name a set grants, the same "known capability" set@objectstack/lint's capability references resolve against, so the list is closed. A position holds only what its named sets grant (ADR-0131 D3/D4). A failed position read keeps the catalog and says the positions are unknown; a failed capability or set read fails the load.positionsReached: a position is listed when its sets grant EVERY picked capability. It is advisory: it does not read set activation and cannot name people who hold a set directly.CreateViewCardoffers 「Who sees this view」 (ViewAudiencePicker.tsx) in the shared scope only, read once the reader picks Shared (ObjectViewhands the loader). Closed list, each option with its granting sets, the position preview under it, and no free-text fallback: a failed read offers nothing to add. It starts from the open view's gate, whichbuildInPlaceViewConfigused to hand on silently;useCreateViewInPlacelets the pick replace it, and an empty pick writes no key. With no picker (personal scope, or no loader) the body is built as before.CreateViewDialog.tsx) — now "Shared views are seen by everyone who can see this list, unless the view is limited to the holders of a capability", in all eleven console locales.ref-multi:capabilitywidget (widgets.tsx, theref-multi:permissionregistration's sibling) with the preview as the list's footer.view.metadata-form.tsanddashboard.metadata-form.tsdeclare it on the audience row.ViewVariantInspector,DashboardDefaultInspectorandResourceEditPagehand down a loader (WidgetContext.loadCapabilityAudience,useCapabilityAudienceLoader); the picker reads it once its row is on screen, so a closed Access section sends no request, and a catalog the host already holds still wins. The widget is a closed registry: no typed-name box when the catalog is unread, empty or failed; each option shows "Granted by …". The dashboard inspector handed down noWidgetContextbefore; it now statesconditionScopeForMetadataType('dashboard')(none), and the dashboard form declares noconditionrow, so nothing else renders differently.content/docs/permissions/capabilities.mdxgains "Showing a list view to some positions, without code": have a capability, grant it to the positions' permission sets in Setup, pick it on the view, read the preview, and the warning that the gate applies to the person setting it. One checklist line. No page moved; the recipe exists nowhere else incontent/docs/permissions/.Tests
Commands and results (head 9731b21, the L1 rework fix, comment 7217699980)
ui:pnpm exec vitest run packages/app-shell/src/views/viewAudience-34908.test.tsx→ 19 passed: the catalog join, the all-of preview, the failed position read, the card (hint, shared-only and lazy read, closed list with sets, preview, starting gate removable, failed read offers nothing, control: personal / no loader send no gate), the host (pick replaces the inherited gate, empty pick writes none, control: no picker keeps it), the Studio widget (preview,(not found)flag, empty, control: no catalog no preview).ui: the above withinPlaceViewCreate-35553.test.tsxandSchemaForm.widgetLabelling.test.tsx(two new probe cases forref-multi:capability) → 3 files, 126 tests passed.ui: at the fix head, 5 files, 135 tests passed:viewAudience-34908,SchemaForm.widgetLabelling,DashboardDefaultInspector.layoutColumns-11796,AddWidgetPicker.oneRegistry-26745(the two that reached/meta/capabilityatf67c1e60c5) andWidgetContext.catalogUnion; two new cases pin the lazy loader (no request until the collapsed section opens, then exactly one; no loader call when a catalog is given).ui/packages/app-shell:tsc --noEmitandtsc -p tsconfig.test.json→ exit 0.check:i18n,check:i18n-stale-fill,check:test-source-alias→ OK.Derived gates (dispatch-gates --commands)
--ranreconciliation: 0 NOT-MEASURED, 0 UNRUN); all 114 exited 0 at head 9731b21 (six spec gates first answered exit 3 on a stale dts and exited 0 after a spec rebuild); the changeset-only last commit re-derives the same 114. CI at2156f1acc8: 61 success, 9 skipped, 0 failed.check:test-source-aliasasked the new test to load@objectstack/lintand@objectstack/formulaat module top (the source reaches both through dynamic imports); done, and the gate is green.Acceptance notes
studio-design/ObjectListViewInspector.tsx; that file is gone frommain. The picker lands in Studio's view panel,metadata-admin/inspectors/ViewVariantInspector.tsx, through the form row.{{positions}} will see this view(zh{{positions}} 会看到此视图), listing position labels.Verification
In the console, open a list, 视图 → 添加视图 → 共享: 「谁能看此视图」 lists the environment's capabilities. Pick one granted to the 业务员 position's permission set: the line under it reads 「业务员 会看到此视图」. Create: a user without the capability no longer sees the view in the switcher, and opening its URL answers 403. In Studio, the view's 导航与共享 → 所需权限 shows the same picker and preview.
🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm