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
18 changes: 18 additions & 0 deletions .changeset/25921-collab-mention-notifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@object-ui/collaboration': patch
'@object-ui/types': patch
---

refactor(collaboration, types)!: retire the zero-consumer `useMentionNotifications` hook and the `MentionNotification` interface

Clause-②: no (narrowing)
Metadata-protocol: none

<!-- adr-0087: not-required (runtime-export-retired @object-ui/collaboration#useMentionNotifications, @object-ui/collaboration#MentionNotificationsConfig, @object-ui/collaboration#MentionNotificationsResult, @object-ui/types#MentionNotification) the retired operands are a React hook that kept an in-memory list of mention notifications, its two TypeScript config and result interfaces, and the `MentionNotification` interface of `@object-ui/types` that only the hook read; nothing in the workspace or in hotcrm imports any of them (the console bell reads the server inbox through `useInboxBell`), and no packages/spec schema, registered node type, conversion surface or stored shape names them, so there is nothing for `objectstack migrate meta` to rewrite -->

**BREAKING** for a host that imports `useMentionNotifications`, `MentionNotificationsConfig` or `MentionNotificationsResult` from `@object-ui/collaboration`, or the type `MentionNotification` from `@object-ui/types`. The hook held a client-side list of mention notifications with read flags; no console surface used it, because mention notifications are server records (`sys_notification`, topic `collab.mention`) that the console bell reads from the inbox feed. `CommentEntry` and `ActivityEntry` stay exported unchanged. The `CommentSearchResult` entry of this release said `MentionNotification` stays exported; it leaves here.

- FROM `useMentionNotifications` TO a local hook in your own code, or read the server inbox (`GET /api/v1/notifications`) as the console bell does.
- FROM `MentionNotificationsConfig` TO a local interface in your own code: `{ currentUserId: string; initialNotifications?: MentionNotification[]; onDeliver?: (notification: MentionNotification) => void | Promise<void> }`.
- FROM `MentionNotificationsResult` TO a local interface in your own code, typed by what your own hook returns.
- FROM `MentionNotification` TO a local interface in your own code: `{ id: string; type: 'mention'; recipientId: string; commentId: string | number; mentionedBy: string; commentText: string; objectName?: string; recordId?: string; createdAt: string; read?: boolean; channels?: Array<'in_app' | 'email' | 'push'> }`.
6 changes: 0 additions & 6 deletions ui/packages/collaboration/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ export {
type CollaborationTranslate,
} from './useCollaborationTranslation.js';

export {
useMentionNotifications,
type MentionNotificationsConfig,
type MentionNotificationsResult,
} from './useMentionNotifications.js';

export {
PresenceAvatars,
type PresenceAvatarsProps,
Expand Down
97 changes: 0 additions & 97 deletions ui/packages/collaboration/src/useMentionNotifications.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
*
* Director batch #195 item 1, letter A (objectui#9511) made a record id a
* `string` wherever METADATA names one, and extended it as "the same
* principle" to `CommentEntry.recordId` / `MentionNotification.recordId`. The
* principle" to `CommentEntry.recordId` and to the `recordId` of a mention
* notification interface that has since been retired with its only reader. The
* two below are runtime / API shapes that ruling did not name; carrying the
* rule to them is the `domain:spec` seat's inheritance decision in the claim on
* objectui#10078. Each carried the same id with the old `string | number`
Expand Down
1 change: 0 additions & 1 deletion ui/packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,6 @@ export type {
DetailSectionNodeSchema,
ViewComponentSchema,
CommentEntry,
MentionNotification,
ActivityEntry,
// Feed / Chatter Protocol Types
FeedItemType,
Expand Down
28 changes: 0 additions & 28 deletions ui/packages/types/src/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,34 +479,6 @@ export interface CommentEntry {
recordId?: string;
}

/**
* Mention notification - delivered when a user is @mentioned in a comment
*/
export interface MentionNotification {
/** Unique notification ID */
id: string;
/** Type of notification */
type: 'mention';
/** ID of the user being notified */
recipientId: string;
/** The comment that contains the mention */
commentId: string | number;
/** Author who mentioned the recipient */
mentionedBy: string;
/** The comment text (or excerpt) */
commentText: string;
/** Object name the comment belongs to */
objectName?: string;
/** Record ID the comment belongs to. A string, per the one record-id rule (objectui#9511). */
recordId?: string;
/** When the mention was created */
createdAt: string;
/** Whether the notification has been read */
read?: boolean;
/** Delivery channels */
channels?: Array<'in_app' | 'email' | 'push'>;
}

/**
* Activity Entry - represents a single activity/field change on a record
*/
Expand Down
Loading