Repository navigation
Commit 5866877
fix(plugin-list): show list view sharing type and lock owner as read-only text, drop the dead Share button (#27013)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8G41SwYqhjjNvKBvSwT3KBm)_
Fixes #26844
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:列表视图工具栏上那个点了没反应的「Share」按钮,换成只读的共享状态文字(个人视图 / 共享视图),并在设置了
`sharing.lockedBy` 时显示锁图标和「Locked by 某人」。
- 为什么改:原按钮没有任何点击处理,`lockedBy` 也从未显示;仓内不存在可以打开的视图共享控件或接口,按分诊裁决「不接就不渲染按钮」。
- 风险与回滚:只动 plugin-list 工具栏这一处渲染和 10 个语言包各 3 个新键;不改 spec、不改接口;回滚即 revert
本 PR。
- 先看:`ui/packages/plugin-list/src/ListView.tsx` 的 Sharing
指示块;`ListView.test.tsx` 的 `sharing spec format —
additional`;`ui/packages/i18n/src/locales/en.ts` 的 `sharingLockedBy`。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/plugin-list/src/__tests__/ListView.test.tsx -t sharing`,预期 7
条全绿。
- 需要你做的:无,席位落地。
## What changes
- `ListView` no longer renders a ghost `Button` for `sharing`. It
renders a non-interactive `span` (no role, no tabindex, not inside a
button) keeping the `share-button` test id, showing the localized
sharing type (`list.sharingPersonal` "Personal view" /
`list.sharingCollaborative` "Shared view") and, when `sharing.lockedBy`
is set, a lock icon plus `list.sharingLockedBy` "Locked by USER". The
tooltip carries both, so the narrow toolbar that hides the text still
says them.
- `lockedBy`: `ViewSharingSchema` declares it as a free `z.string()`
described "User who locked the view configuration"; spec fixtures use
ids (`user_123`, `admin`) and the plugin-list test an email. No
user-lookup seam exists on this path, so it is rendered as written.
- Three new `list.*` keys in all ten `@object-ui/i18n` locale packs and
in `LIST_DEFAULT_TRANSLATIONS` (byte-identical to `en`).
- Tests: the misnamed "should display lockedBy in sharing tooltip when
set" (which asserted only `Sharing: collaborative`) is replaced by real
coverage: collaborative + `lockedBy` shows the owner; personal shows no
owner; collaborative without `lockedBy` shows no owner; the indicator is
never a button. Two existing title assertions move to the new label.
- Changeset: `@object-ui/plugin-list` patch, `@object-ui/i18n` patch.
## Why
Triage ruling on the card: "Show the lock owner, and either wire Share
to the sharing control or do not render it." / "⛔ No dead button." No
view-sharing control or endpoint was found on `main` (`ShareDialog` in
components is the record share-link dialog, a different feature; the
list-view registration publishes no `sharing` input), so the second
branch applies.
## Acceptance notes
- `ListViewBlock.inertKeys-13074.test.tsx` CONTROL "the Share button
still carries no click handler" stays green unchanged (a click on the
span changes nothing); its name now says "button" for a non-button.
Outside the claimed file surface, so left untouched.
- `packages/spec/liveness/view.json` row `sharing` cites
"ListView.test.tsx:2572 pins the lockedBy tooltip" and the test name
"should display lockedBy in sharing tooltip when set". That test is
renamed here, and the old one never pinned `lockedBy`. Not edited
(`packages/spec/**` out of scope); reported to the seat for routing.
- The `list.share` default key is no longer read by `ListView`; left in
place (still in every locale pack).
## Verification
<details><summary>Tests and ablations</summary>
- Closure: `pnpm --workspace-concurrency=2 --filter
'@object-ui/plugin-list^...' build` under the lock, VERDICT command-exit
0 (5m44s).
- `vitest run packages/plugin-list/src/__tests__/ListView.test.tsx
packages/plugin-list/src/__tests__/ListViewBlock.inertKeys-13074.test.tsx`:
Test Files 2 passed, Tests 167 passed.
- After merging `origin/main`: `vitest run packages/i18n/
packages/plugin-list/
packages/app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx`:
Test Files 255 passed, Tests 3045 passed, 13 skipped.
- `pnpm --filter @object-ui/plugin-list --filter @object-ui/i18n run
type-check`: exit 0.
- Ablation 1 (`ablation-replace.mjs`, anchor `const lockedBy =
schema.sharing.lockedBy;` replaced by an `undefined`): "shows the lock
owner from `sharing.lockedBy` beside a collaborative type" red, 1 failed
/ 6 passed; restored, blob == HEAD.
- Ablation 2 (the indicator's opening and closing `span` replaced by the
old ghost `Button`): "renders the sharing indicator as read-only text,
never a button" red, 1 failed / 6 passed; restored, blob == HEAD and
`git diff HEAD` empty.
- Tests import `ListView` by relative path, so no dist leg.
</details>
<details><summary>Gates</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at 2ccb965 (after merging `origin/main`):
34 families, each run, all exit 0, including `node
scripts/check-sdui-manifest.mjs` and `pnpm check:nul-bytes`. `--ran`
reconciliation: 34 derived, 34 run, 0 NOT-MEASURED.
- `pnpm check:new-line-citations` (ui): 0 new citations, exit 0.
- CI families: see this PR's check-runs.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbWRtAdijdY6zPkJ9Pq)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1900c02 commit 5866877
13 files changed
Lines changed: 122 additions & 23 deletions
File tree
- .changeset
- ui/packages
- i18n/src/locales
- plugin-list/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
928 | 928 | | |
929 | 929 | | |
930 | 930 | | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
931 | 934 | | |
932 | 935 | | |
933 | 936 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
826 | 829 | | |
827 | 830 | | |
828 | 831 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1085 | 1088 | | |
1086 | 1089 | | |
1087 | 1090 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
852 | 852 | | |
853 | 853 | | |
854 | 854 | | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
855 | 858 | | |
856 | 859 | | |
857 | 860 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
850 | 853 | | |
851 | 854 | | |
852 | 855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
826 | 829 | | |
827 | 830 | | |
828 | 831 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
826 | 829 | | |
827 | 830 | | |
828 | 831 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
850 | 853 | | |
851 | 854 | | |
852 | 855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
880 | 883 | | |
881 | 884 | | |
882 | 885 | | |
| |||
0 commit comments