Repository navigation
Commit 3eeb81d
refactor(collaboration, types)!: retire the zero-consumer useMentionNotifications hook and MentionNotification (#29732)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb8SWuZMeMAGh31P7H2NJ3R7)_
Part of #25921. The umbrella stays open; this is one batch of it.
Clause-②: no (narrowing)
Metadata-protocol: none
## 维护者速读
- 改了什么:删除 `@object-ui/collaboration` 里没有任何使用者的 `useMentionNotifications`
钩子(连同两个配置/结果类型),以及 `@object-ui/types` 里只被它读取的 `MentionNotification` 接口。
- 为什么改:控制台的 @提及 铃铛读的是服务端通知(`sys_notification`,经
`useInboxBell`),这个前端内存版钩子从未被接上;留着它会让人(和 AI)误以为提及通知走的是它。
- 风险与回滚:对外是 breaking 收窄,只影响直接 import 这几个名字的外部宿主;仓内与 hotcrm 零引用。回滚即
revert 本 PR。
-
先看:`.changeset/25921-collab-mention-notifications.md`(迁移说明)、`ui/packages/types/src/views.ts`(删除的接口)、`ui/packages/collaboration/src/index.ts`(barrel
行)。
- 两分钟验证:`git grep -w -e useMentionNotifications -e MentionNotification
-- ui packages apps examples content` 应只剩 changeset 与 QA 清单里的历史文字,无代码命中。
- 需要你做的:无,席位落地。
## What changes
- Delete `ui/packages/collaboration/src/useMentionNotifications.ts` (97
lines) and its barrel lines (`useMentionNotifications`,
`MentionNotificationsConfig`, `MentionNotificationsResult`).
- Delete the `MentionNotification` interface from
`ui/packages/types/src/views.ts` and its barrel line in
`ui/packages/types/src/index.ts`.
-
`ui/packages/types/src/__tests__/record-id-string-survivors-10078.test.ts`:
doc comment only. It named `MentionNotification.recordId` while
recounting which ids an earlier ruling covered; it now describes that
interface as retired. The test pins `RecordSubscription.recordId` and
`DataSourceMutationEvent.id` only, so no assertion moves.
- One new changeset, `.changeset/25921-collab-mention-notifications.md`:
patch for both packages, BREAKING paragraph, one FROM/TO line per
retired name, ADR-0087 marker `not-required (runtime-export-retired
...)` naming all four operands.
## Tests
Premise census on `origin/main` 1c1a5d4 (`git grep -l -w -F NAME`,
excluding `**/CHANGELOG.md`, lockfiles and `.changeset/**`):
| Name | Files repo-wide | Outside `ui/packages/collaboration` |
|:---|---:|:---|
| `useMentionNotifications` | 3 |
`docs/qa/platform-checklist/areas/records-forms.json` only (prose) |
| `MentionNotificationsConfig` | 2 | none |
| `MentionNotificationsResult` | 2 | none |
| `MentionNotification` | 4 | `ui/packages/types` definition, barrel and
the 10078 test comment only |
| `useRealtimeSubscription` (positive control) | 72 | 71 |
hotcrm and docs.objectos.ai: 0 hits for `MentionNotification`
(case-insensitive substring). No string or dynamic `import()` of the
module path, and neither package README names the hook or the type.
After the change (head 4d64f54). Two later merges of main brought no
file of `collaboration` or `types`: d6bab30 none under `ui/`, 9be84e1
only `ui/packages/fields` (lookup cell). Readings:
- `turbo run type-check` for `@object-ui/types`,
`@object-ui/collaboration`, `@object-ui/app-shell`, `@object-ui/console`
with their `^build` closure: 74 of 74 tasks successful (lock VERDICT
command-exit 0, 12m23s).
- `vitest run packages/collaboration/ packages/types/ --maxWorkers=2`
from `ui/`: Test Files 394 passed (394), Tests 10545 passed (10545).
- Reverse check on the rebuilt `.d.ts`: a temporary probe in app-shell
importing the retired names answered `TS2305 Module '"@object-ui/types"'
has no exported member 'MentionNotification'` and `TS2305 ...
'"@object-ui/collaboration"' has no exported member
'useMentionNotifications'`, while `CommentEntry` from the same entry
still resolved. Probe deleted.
- `pnpm --dir ui run check:readme-exports`: census line `0 fabricated, 0
stale omission(s)`; exit 1 only on the known prerequisite
(`packages/cli` dist unbuilt: `@object-ui/cli` imports `serve` /
`init`).
- On 9be84e1 the census reads `MentionNotificationsConfig` 0,
`MentionNotificationsResult` 0, `MentionNotification` 0,
`useMentionNotifications` 1 (the QA checklist prose), control
`useRealtimeSubscription` 72.
## Acceptance notes
- `docs/qa/platform-checklist/areas/records-forms.json` L3265 (a
`source[]` line saying the hook "is exported but the console does not
consume it") is now stale: the hook is no longer exported. Left
untouched per the claim's file surface; L3299 is a history row and stays
as written.
- The pending precedent changeset
`.changeset/25921-types-comment-search-result.md` says
`MentionNotification` "stay[s] exported unchanged". This PR makes that
sentence untrue for the release that consumes both. Not edited here
(editing a pending `25921-*` changeset reds Check Changeset); the seat
may want to amend it in a docs-only follow-up before the release.
- A director contract review is owed (narrowing batch); the seat routes
it.
## Verification
<details><summary>Derived gates (dispatch-gates --commands, head
4d64f54): 35 commands</summary>
33 of 33 run in a loop exited 0, among them `check-adr-0087-registration
--base origin/main`, `check-changeset-no-major --base origin/main`,
`check-sdui-manifest` (and `--self-test`), `check-comment-mask-corpus`,
`check-empty-changeset`, `check:published-files`,
`check:type-check-coverage`, `check:undeclared-dep-imports`,
`check:test-source-alias`, `check:cross-package-test-inputs`,
`check:nul-bytes`. The other two ran under the verify lock: `pnpm --dir
ui exec vitest run scripts/` (Test Files 170 passed, 2 skipped; Tests
4977 passed, 2 skipped; VERDICT command-exit 0) and `pnpm
check:type-check-debt` (VERDICT command-exit 0).
Against this PR body: `check-changeset-no-major` exit 0,
`check-adr-0087-registration` exit 0 (all four `runtime-export-retired`
operands verified as retired from their entries),
`check-closing-keyword-parity` exit 0, `check-partof-closing-keyword`
exit 0. `check-platform-checklist --changed-from origin/main`: 0
anchored files in the change set.
</details>
<details><summary>Dogfood battery (head d6bab30)</summary>
Closure build plus `pnpm --filter @objectstack/dogfood test` under the
verify lock: Test Files 401 passed, 3 skipped (404); Tests 3310 passed,
28 skipped (3338); VERDICT command-exit 0. The final head 9be84e1 adds
only the main merge described under Tests.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jSoUd7Uhw6ei5FFLD1)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 11c4eb5 commit 3eeb81d
6 files changed
Lines changed: 20 additions & 133 deletions
File tree
- .changeset
- ui/packages
- collaboration/src
- types/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 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 65 | | |
72 | 66 | | |
73 | 67 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
1073 | | - | |
1074 | 1073 | | |
1075 | 1074 | | |
1076 | 1075 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | 482 | | |
511 | 483 | | |
512 | 484 | | |
| |||
0 commit comments