feat(P1.5): Console — Comments & Collaboration#718
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Add MentionNotification, CommentSearchResult types to @object-ui/types - Extend CommentEntry with pinned, mentions, objectName, recordId fields - Create useMentionNotifications hook in @object-ui/collaboration - Create useCommentSearch hook in @object-ui/collaboration - Add onMentionNotify callback to CommentThread - Add comment pinning/starring and search to RecordComments - Add activity type filtering to ActivityTimeline Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ing, and activity filtering - 40 new tests across 5 test files - All 291 tests in affected packages pass - ROADMAP.md updated to mark P1.5 items as complete Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR implements the P1.5 Comments & Collaboration roadmap items, adding mention notifications, comment search, pinning, and activity filtering to the ObjectUI collaboration suite. The implementation follows ObjectUI's SDUI architecture by extending type definitions, adding React hooks for state management, and enhancing UI components with new interactive features.
Changes:
- Extended
CommentEntry, addedMentionNotificationandCommentSearchResulttypes in@object-ui/types - Added
useMentionNotificationsanduseCommentSearchhooks in@object-ui/collaborationfor notification and search state management - Enhanced
RecordCommentswith search input and pinning controls,ActivityTimelinewith type filters, andCommentThreadwith mention notification callbacks - Added 40 new tests across 5 test files covering all new features
- Marked all P1.5 roadmap items as complete
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/types/src/views.ts | Extended CommentEntry with pinned/mentions/objectName/recordId fields; added MentionNotification and CommentSearchResult interfaces |
| packages/types/src/index.ts | Exported new MentionNotification and CommentSearchResult types |
| packages/plugin-detail/src/index.tsx | Exported ActivityFilterType for activity filtering |
| packages/plugin-detail/src/RecordComments.tsx | Added searchable prop with search input UI and onTogglePin callback for comment pinning |
| packages/plugin-detail/src/ActivityTimeline.tsx | Added filterable prop with filter pills UI and defaultFilter for initial state |
| packages/collaboration/src/CommentThread.tsx | Added onMentionNotify callback that fires when @mentions are detected on submit |
| packages/collaboration/src/useMentionNotifications.ts | New hook for managing mention notifications with delivery, read/unread state, and dismissal |
| packages/collaboration/src/useCommentSearch.ts | New hook for searching comments across records with highlighted snippets |
| packages/collaboration/src/index.ts | Exported new hooks and types |
| packages/plugin-detail/src/tests/RecordCommentsPinSearch.test.tsx | Tests for comment pinning and search functionality |
| packages/plugin-detail/src/tests/ActivityTimelineFiltering.test.tsx | Tests for activity timeline filtering |
| packages/collaboration/src/tests/useMentionNotifications.test.ts | Tests for mention notification hook |
| packages/collaboration/src/tests/useCommentSearch.test.ts | Tests for comment search hook |
| packages/collaboration/src/tests/CommentThreadMentionNotify.test.tsx | Tests for CommentThread mention callback |
| ROADMAP.md | Marked all P1.5 items as complete |
Comments suppressed due to low confidence (1)
packages/collaboration/src/useCommentSearch.ts:43
- The JSDoc comment at line 32 states "Returns the match wrapped in tags for display" but the function does not actually wrap the match in any HTML tags. It only returns a plain text snippet with ellipsis. Either update the documentation to accurately reflect what the function does, or implement actual highlighting by wrapping the matched portion in tags or similar markup.
/**
* Build a highlighted snippet around the first match of `query` in `text`.
* Returns the match wrapped in <mark> tags for display.
*/
function buildHighlight(text: string, query: string): string {
if (!query) return text;
const idx = text.toLowerCase().indexOf(query.toLowerCase());
if (idx === -1) return text;
const start = Math.max(0, idx - 30);
const end = Math.min(text.length, idx + query.length + 30);
const before = start > 0 ? '…' : '';
const after = end < text.length ? '…' : '';
return `${before}${text.slice(start, end)}${after}`;
}
| export { | ||
| useMentionNotifications, | ||
| type MentionNotificationsConfig, | ||
| type MentionNotificationsResult, | ||
| } from './useMentionNotifications'; | ||
|
|
||
| export { | ||
| useCommentSearch, | ||
| type CommentSearchConfig, | ||
| type CommentSearchReturn, | ||
| } from './useCommentSearch'; | ||
|
|
There was a problem hiding this comment.
According to the Documentation Driven Development guideline (Rule #2), every feature implemented or refactored must update the corresponding documentation, including the package README.md. The new hooks useMentionNotifications and useCommentSearch should be documented in packages/collaboration/README.md with usage examples similar to the existing hooks. Additionally, the new props for RecordComments and ActivityTimeline should be documented. The task is not complete until documentation reflects the new code/architecture.
| export type { RelatedListProps } from './RelatedList'; | ||
| export type { RecordCommentsProps } from './RecordComments'; | ||
| export type { ActivityTimelineProps } from './ActivityTimeline'; | ||
| export type { ActivityTimelineProps, ActivityFilterType } from './ActivityTimeline'; |
There was a problem hiding this comment.
According to the Documentation Driven Development guideline (Rule #2), the new props added to RecordComments (searchable, onTogglePin) and ActivityTimeline (filterable, defaultFilter), as well as the new exported type ActivityFilterType, should be documented in packages/plugin-detail/README.md with usage examples. The task is not complete until documentation reflects the new features.
Implements the four P1.5 roadmap items: @mention notification delivery, cross-record comment search, comment pinning, and activity feed filtering.
Types (
@object-ui/types)CommentEntrywithpinned,mentions,objectName,recordIdMentionNotificationtype (recipient, channels, read state)CommentSearchResulttype (comment + highlight snippet)Hooks (
@object-ui/collaboration)useMentionNotifications— notification state management withonDelivercallback for email/push dispatch, mark-as-read, dismissuseCommentSearch— case-insensitive text/author search across a flat comment list, returnsCommentSearchResult[]with highlighted snippetsUI Changes
CommentThread— newonMentionNotify(userIds, content)callback, fires on submit when @mentions are detectedRecordComments—searchableprop adds search input with clear;onTogglePinenables pin/unpin per comment; pinned comments sort first with visual indicatorActivityTimeline—filterableprop renders filter pills (All / Comments / Field Changes / Creates / Deletes / Status Changes);defaultFiltersets initial stateTests
40 new tests across 5 files. All 291 existing tests in affected packages pass.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.