Skip to content

[finding] ObjectSettingsPanel re-declares OWD_WIDTH inline instead of calling owd-sharing.ts's isExternalWider — the module that exists to be the single home for exactly that comparison #5477

Description

@os-support-ai

Observed while working #5418. Not fixed there — untouched by that card's change, and folding it in would have widened a security-surface diff for a cleanup.

packages/app-shell/src/views/studio-design/owd-sharing.ts states its own purpose:

> The per-object Settings tab (ObjectSettingsPanel) and the package-level OWD overview (PackageOwdOverviewPanel) both edit the SAME record-sharing baseline (…). This module is the single home for the pieces they must agree on: the canonical value set, the D11 "external ≤ internal" width comparison, and the master-object derivation (…)

ObjectSettingsPanel.tsx then computes that comparison inline instead of importing it:

constOWD_WIDTH: Record<string,number>={private: 0,public_read: 1,public_read_write: 2};constexternalWider=externalSharingModelinOWD_WIDTH&&sharingModelinOWD_WIDTH&&OWD_WIDTH[externalSharingModel]>OWD_WIDTH[sharingModel];

owd-sharing.ts exports isExternalWider(internal, external) doing the same thing, and its docstring acknowledges the split — "mirrors the comparison ObjectSettingsPanel implemented inline" — so this is a known state rather than an accidental one.

Why it is still worth closing. The two are equivalent today, and the inline copy's guards happen to line up with the exported one's. They are not pinned to each other by anything: no test compares them, and the shared module is where the ADR-0090 D11 semantics are documented. A future D11 refinement lands in owd-sharing.ts and the Settings tab — the surface an author actually uses to set the dial — keeps the old rule, silently.

Scope. Replace the inline block with the import, and consider whether PackageOwdOverviewPanel (which does use the shared module) grows a test that both surfaces agree.

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:dispatched

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions