Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/34795-studio-permissions-wording.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@object-ui/app-shell': patch
'@object-ui/i18n': patch
'@object-ui/console': patch
---

feat(studio): the permissions page speaks business wording; the bulk buttons show on every row

Clause-②: no
Metadata-protocol: none

Studio's permissions page now reads in the words an app builder uses, in zh-CN and in English. It changes wording and presentation only; the permission model, the suggestion and confirmation mechanism (ADR-0090 D5/D9) and every request are the same.

- **The default-grant banner is one sentence.** When an app's member permission set is accepted for everyone, the banner reads "所有成员默认拥有这个权限集,新加入的人也会自动拥有。" ("Every member has this permission set by default, and new members get it automatically."). Its button reads "取消默认授予" ("Stop granting by default") instead of "撤销" ("Revoke"), and it makes the same call. The pending, not-in-force, dismissed and guest lines say the same thing in the same tone. None of them names the Everyone or Guest position.
- **The open set's title is "app · set label".** The set's machine name moves to the title's tooltip, and the provenance, default and lock labels move to the line under the title. The rail row shows the set's label, with the machine name as its tooltip.
- **Plain terms.** "记录共享模型(OWD)" ("Record sharing (OWD)") is now "谁能看到哪些记录" ("Who can see which records"). The values read "只有负责人能看 / 所有人能看 / 所有人都能看和改" ("Only the owner can see / Everyone can see / Everyone can see and edit"), and "受父级控制 → {master}" reads "跟随所属的{master}" ("Follows its {master}"). The stored `sharingModel` values do not change. The tabs read "对象权限 / 系统功能 / 数据范围规则 / 菜单可见" ("Object permissions / System features / Record scope rules / Menu visibility").
- **The bulk buttons show on every row**, not only on the row under the pointer, as "全选 · 只读 · 清空" ("All · Read only · None"), then the CRUD set as a fourth button ("增删改查", "Read & write"). Each button writes what All / R / None / CRUD wrote before. The footnote that explained the hidden buttons is gone.
- **An object row shows the object's label**, in the matrix and in the package's "who can see which records" overview. Its machine name is the tooltip. The record-visibility chip stays on one line now that its labels are longer.

The Draft Changes publish refusal now points to "Settings → Who can see which records" (all 11 language packs), since the old "Settings → Record sharing" label no longer exists.

Setup's permission-set page reads some of the same strings, so it changes too: the bulk buttons' labels, the sharing values, and the record-scope-rules, menu-visibility and system-features headings. Its layout does not change.
10 changes: 8 additions & 2 deletions docs/qa/platform-checklist/areas/studio-authoring.json
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@
"title": "Permission-matrix editor UX: field-filter + bulk apply to EXACTLY the visible fields, and the Bulk column never clips at narrow widths",
"since": "v16",
"status": "active",
"revision": 11,
"revision": 12,
"priority": "P2",
"surface": "mixed",
"personas": ["admin"],
Expand Down Expand Up @@ -1016,7 +1016,7 @@
{
"clause": "the read-only gate holds: a read-only set hides Save, offers no field bulk at all and no operating object-row bulk, and disables every checkbox; the read-only badge names WHICH gate holds",
"oracle": "screenshot",
"verify": "on the read-only set Save is absent, every checkbox is disabled, the field bulk buttons (Read-only all / Write all / Clear) are absent — not merely disabled (PermissionMatrixEditor.tsx FieldsSubTable renders them only while writable; QA run #26715 read them absent in read-only Studio) — and the object row's bulk, which appears only on hover or keyboard focus (engine.studio.access.bulkHint), is disabled when it appears; an operating bulk control is the FAIL. The badge names the gate that holds; the console distinguishes FOUR (objectui PermissionMatrixEditor.tsx at the pin): the package gate (engine.studio.pkg.readonly — Studio on a read-only package), the artifact gate (perm.readOnly.artifact, 'Read-only (this set is provided by a code package)' — a set a code package ships, in the metadata admin), the wall (perm.readOnly.walled — the security catalog under isolated/group tenancy) and the type gate (perm.readOnly — a type with no runtime write channel). On a stock boot only the package and artifact gates are reachable — the wall needs a walled tenancy posture and the type gate a permission type with no write channel, which stock does not have — so score those two on the packaged showcase_contributor set (Studio Access and the metadata admin) and record the other two as not reachable on stock. A badge that blames the wrong gate is the FAIL",
"verify": "on the read-only set Save is absent, every checkbox is disabled, the field bulk buttons (Read-only all / Write all / Clear) are absent — not merely disabled (PermissionMatrixEditor.tsx FieldsSubTable renders them only while writable; QA run #26715 read them absent in read-only Studio) — and every object row draws its bulk strip, every button of which is disabled in read-only Studio; an operating bulk control is the FAIL. The badge names the gate that holds; the console distinguishes FOUR (objectui PermissionMatrixEditor.tsx at the pin): the package gate (engine.studio.pkg.readonly — Studio on a read-only package), the artifact gate (perm.readOnly.artifact, 'Read-only (this set is provided by a code package)' — a set a code package ships, in the metadata admin), the wall (perm.readOnly.walled — the security catalog under isolated/group tenancy) and the type gate (perm.readOnly — a type with no runtime write channel). On a stock boot only the package and artifact gates are reachable — the wall needs a walled tenancy posture and the type gate a permission type with no write channel, which stock does not have — so score those two on the packaged showcase_contributor set (Studio Access and the metadata admin) and record the other two as not reachable on stock. A badge that blames the wrong gate is the FAIL",
"evidence": "the read-only screenshot"
},
{
Expand Down Expand Up @@ -1096,6 +1096,12 @@
"date": "2026-11-04",
"change": "steps[3] and acceptance[3].clause corrected from QA run #29893 (W5-STUDIO, at 589049b0): after Clear a field falls back to the object's grant (data-field-rule=\"inherited\"), not to a read-only default; the verify (keys absent from the saved map) is unchanged. Read at base f68b47ca",
"ref": "#29906"
},
{
"revision": 12,
"date": "2026-11-17",
"change": "acceptance[5].verify re-read for #34795 (PR #34914): every object row now draws its bulk strip, so the verify no longer says the strip appears only on hover or keyboard focus or cites engine.studio.access.bulkHint (that key is removed). It says every row draws the strip and every button in it is disabled in read-only Studio. The FAIL condition, an operating bulk control, is unchanged. Wording only; no clause weakened",
"ref": "#34795"
}
]
},
Expand Down
6 changes: 5 additions & 1 deletion ui/e2e/permission-field-panel-scroll.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ async function mount(page: Page, c: Case): Promise<void> {
}, c);
await page.addScriptTag({ content: bundle, type: 'module' });
const compiled = new Set<string>();
const expand = page.getByRole('button', { name: new RegExp(`^Project\\W*${OBJECT}\\W*$`) });
// The Studio row names the object by its label alone, the machine name being
// the button's tooltip (objectstack#34795); the environment table still
// prints the name beside the label.
const name = c.host === 'studio' ? /^Project$/ : new RegExp(`^Project\\W*${OBJECT}\\W*$`);
const expand = page.getByRole('button', { name });
await expand.waitFor({ state: 'attached', timeout: 30_000 });
await styleUntilStable(page, compiled);
await expand.click();
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/app-shell/src/preview/DraftChangesPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ export function DraftChangesPanel({
</ul>
<p className="mt-1.5 text-[11px] text-amber-800/80 dark:text-amber-300/80">
{t('preview.changes.securityBlockWhere', {
defaultValue: 'Fix it on the object under Settings → Record sharing, then publish again.',
defaultValue: 'Fix it on the object under Settings → Who can see which records, then publish again.',
})}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ describe('DraftChangesPanel — reaching the object the publish door refuses (ob
// And what #5418 shipped is intact: the item is still named, and the
// sentence still says where to fix it.
expect(block.textContent).toContain('object/crmext_visit');
expect(block.textContent).toMatch(/Settings → Record sharing/);
expect(block.textContent).toMatch(/Settings → Who can see which records/);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('DraftChangesPanel — pre-publish security posture (objectui#5418)', (
// language (`SECURITY_RULE_TEXT`), not the ADR paragraph.
expect(block.textContent).toMatch(/sharingModel/);
// And where to go, which the toast never said.
expect(block.textContent).toMatch(/Settings → Record sharing/);
expect(block.textContent).toMatch(/Settings → Who can see which records/);
});

it('reports without blocking — the server door stays the authority', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,14 @@ describe('Access: sharing settings in zh carry no English doublet or bare OWD (o
});

it('the matrix column and the explain rule name the sharing model in Chinese', () => {
expect(ZH['engine.studio.access.colOwd']).toBe('记录共享模型');
expect(ZH['engine.studio.access.colOwd']).toBe('谁能看到哪些记录');
expect(ZH['engine.studio.access.explain.ruleKind.owd_baseline']).toMatch(/^\p{Script=Han}/u);
// The prose that names the Private option names it the way the picker does.
expect(ZH['engine.studio.settings.sharingDescUnset']).not.toMatch(/Private/u);
expect(ZH['engine.studio.data.owdHint']).not.toMatch(/Private/u);
// en is untouched.
expect(EN['perm.owd.private']).toBe('Private');
expect(EN['engine.studio.access.colOwd']).toBe('OWD');
// en names them in plain words too (objectstack#34795).
expect(EN['perm.owd.private']).toBe('Only the owner can see');
expect(EN['engine.studio.access.colOwd']).toBe('Who can see which records');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
*/

import '@testing-library/jest-dom/vitest';
// The source under test reaches these through dynamic imports: their first load is paid at collection.
import '@objectstack/formula';
import '@objectstack/lint';
import '@objectstack/spec/identity';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { cleanup, render, screen, within } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
Expand Down Expand Up @@ -185,7 +189,7 @@ describe('PermissionMatrixEditPage — the ARTIFACT tier locks an env-scope over
expect(screen.getByLabelText('a_account Read')).toBeDisabled();
for (const box of screen.getAllByRole('checkbox')) expect(box).toBeDisabled();
const row = screen.getByText('Account').closest('tr')!;
for (const n of ['R', 'CRUD', 'All', 'None']) {
for (const n of ['Read only', 'Read & write', 'All', 'None']) {
expect(within(row).getByRole('button', { name: n })).toBeDisabled();
}
});
Expand Down Expand Up @@ -276,7 +280,7 @@ describe('PermissionMatrixEditPage — MUST NOT CHANGE: what the artifact tier m
expect(screen.queryByRole('button', { name: /^Save$/ })).toBeNull();
expect(screen.getByLabelText('a_account Read')).toBeEnabled();
const row = screen.getByText('Account').closest('tr')!;
for (const n of ['R', 'CRUD', 'All', 'None']) {
for (const n of ['Read only', 'Read & write', 'All', 'None']) {
expect(within(row).getByRole('button', { name: n })).toBeEnabled();
}
expect(lockBadge()).toBeNull();
Expand Down Expand Up @@ -399,7 +403,7 @@ describe('PermissionMatrixEditPage — the artifact verdict asks ADR-0010 proven
expect(screen.getByRole('button', { name: /^Save$/ })).toBeEnabled();
expect(screen.getByLabelText('a_account Read')).toBeEnabled();
const row = screen.getByText('Account').closest('tr')!;
for (const n of ['R', 'CRUD', 'All', 'None']) {
for (const n of ['Read only', 'Read & write', 'All', 'None']) {
expect(within(row).getByRole('button', { name: n })).toBeEnabled();
}
expect(lockBadge()).toBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
*/

import { describe, it, expect, vi, afterEach } from 'vitest';
// The source under test reaches these through dynamic imports: their first load is paid at collection.
import '@objectstack/formula';
import '@objectstack/lint';
import '@objectstack/spec/identity';
import { render, screen, cleanup, fireEvent, waitFor, within } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';

Expand Down Expand Up @@ -193,7 +197,7 @@ describe('PermissionMatrixEditor · bulk buttons vs unmodelled keys (objectui#66
},
});

fireEvent.click(bulkButton('a_account', 'CRUD'));
fireEvent.click(bulkButton('a_account', 'Read & write'));
const payload = await save(server);

const row = payload.objects.a_account;
Expand Down Expand Up @@ -221,7 +225,7 @@ describe('PermissionMatrixEditor · bulk buttons vs unmodelled keys (objectui#66
},
});

fireEvent.click(bulkButton('a_account', 'R'));
fireEvent.click(bulkButton('a_account', 'Read only'));
const payload = await save(server);

const row = payload.objects.a_account;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
*/

import '@testing-library/jest-dom/vitest';
// The source under test reaches these through dynamic imports: their first load is paid at collection.
import '@objectstack/formula';
import '@objectstack/lint';
import '@objectstack/spec/identity';
import * as React from 'react';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { cleanup, render, screen, within } from '@testing-library/react';
Expand Down Expand Up @@ -138,12 +142,12 @@ describe("Setup's sharing-model chip reads through the catalogue (objectstack#29
it('zh names the sharing model in Chinese, with no bare OWD', async () => {
mount('zh', 'setup');
const chip = await screen.findByText(/^记录共享模型:/u, undefined, { timeout: 8000 });
expect(chip.textContent).toBe('记录共享模型:私有(默认)');
expect(chip.textContent).toBe('记录共享模型:只有负责人能看(默认)');
expect(chip.textContent).not.toMatch(/OWD/u);
});

it('CONTROL — en keeps "OWD {value}"', async () => {
mount('en', 'setup');
expect(await screen.findByText('OWD Private (default)')).toBeInTheDocument();
expect(await screen.findByText('OWD Only the owner can see (default)')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
*/

import { describe, it, expect, vi, afterEach } from 'vitest';
// The source under test reaches these through dynamic imports: their first load is paid at collection.
import '@objectstack/formula';
import '@objectstack/lint';
import '@objectstack/spec/identity';
import { render, screen, cleanup, fireEvent, waitFor, within } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';

Expand Down Expand Up @@ -161,7 +165,7 @@ describe('the bulk buttons leave Export as it is (objectstack#26885)', () => {
});
});

for (const label of ['R', 'CRUD', 'All']) {
for (const label of ['Read only', 'Read & write', 'All']) {
it(`"${label}" keeps a granted Export ticked`, async () => {
const server = await renderSet({ crm_case: { allowRead: true, allowExport: true } });
fireEvent.click(bulk(label));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
*/

import '@testing-library/jest-dom/vitest';
// The source under test reaches these through dynamic imports: their first load is paid at collection.
import '@objectstack/formula';
import '@objectstack/lint';
import '@objectstack/spec/identity';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { act, cleanup, fireEvent, render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
Expand Down Expand Up @@ -88,8 +92,11 @@ async function renderPage(studio = false) {
await screen.findByRole('button', { name: objectButton('a_project') }, { timeout: 5000 });
}

/** An object row's expand button: its label, then its API name. */
const objectButton = (name: string) => new RegExp(`^${name === 'a_project' ? 'Project' : 'Task'}\\W*${name}\\W*$`);
/**
* An object row's expand button: its label, then its API name — on the Studio
* Objects tab the label alone, the API name its tooltip (objectstack#34795).
*/
const objectButton = (name: string) => new RegExp(`^${name === 'a_project' ? 'Project' : 'Task'}(\\W*${name}\\W*)?$`);

async function expand() {
fireEvent.click(screen.getByRole('button', { name: objectButton('a_project') }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
*/

import '@testing-library/jest-dom/vitest';
// The source under test reaches these through dynamic imports: their first load is paid at collection.
import '@objectstack/formula';
import '@objectstack/lint';
import '@objectstack/spec/identity';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
Expand Down Expand Up @@ -257,7 +261,7 @@ describe('every object-row control writes only what the admin sees change (objec
it('the R shortcut on an inherited row merges from the `*` entry; None writes an empty entry of its own', async () => {
const server = await renderSet({ '*': { ...CRUD, allowExport: true } });
const projectRow = rowOf('a_project');
fireEvent.click(within(projectRow).getByRole('button', { name: 'R' }));
fireEvent.click(within(projectRow).getByRole('button', { name: 'Read only' }));
const taskRow = rowOf('a_task');
fireEvent.click(within(taskRow).getByRole('button', { name: 'None' }));
// On screen: a_task now draws its own empty entry, nothing checked.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
*/

import '@testing-library/jest-dom/vitest';
// The source under test reaches these through dynamic imports: their first load is paid at collection.
import '@objectstack/formula';
import '@objectstack/lint';
import '@objectstack/spec/identity';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
Expand Down Expand Up @@ -135,7 +139,7 @@ function openFacet(title: string) {
* through the real facet editors — the card's reproduction, minus the browser.
*/
async function authorEveryFacet() {
openFacet('Row-Level Security');
openFacet('Record Scope Rules');
fireEvent.click(await screen.findByRole('button', { name: /Add policy/ }));
fireEvent.change(await screen.findByPlaceholderText('Policy name'), {
target: { value: 'qa_st2_rls' },
Expand All @@ -145,7 +149,7 @@ async function authorEveryFacet() {
});
fireEvent.change(screen.getByPlaceholderText(USING_PLACEHOLDER), { target: { value: USING } });

openFacet('Tab Visibility');
openFacet('Menu Visibility');
// The visibility picker is the shared Select (objectui#11865): open it and pick, as a user does.
fireEvent.keyDown(await screen.findByTestId('tab-visibility-a_account'), { key: 'ArrowDown' });
fireEvent.click(within(await screen.findByRole('listbox')).getByRole('option', { name: 'Hidden' }));
Expand Down
Loading
Loading