ENG-1136: Notify user when suggestive mode suggestion is adopted (Roam)#1145
ENG-1136: Notify user when suggestive mode suggestion is adopted (Roam)#1145trangdoan982 wants to merge 8 commits into
Conversation
When a user adopts a suggestion in Suggestive Mode: - Shows a toast "Added to [[Page Name]]" if the target page is already open in the main window or if sidebar navigation is disabled - Opens the target page in the right sidebar (or brings it to the top if already open) otherwise - Shows a toast confirming the created relation when a reified relation is adopted instead of a block Adds a new `notifySuggestiveModeAdoption` utility to keep notification logic separate from `SuggestionsBody`. Co-authored-by: Cursor <cursoragent@cursor.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Only add notifySuggestiveModeAdopted at the end of the success path; don't restructure the existing if/else branches. Co-authored-by: Cursor <cursoragent@cursor.com>
- Replace "adopted/adoption" naming with "added" throughout - Split single export with discriminated union into two direct functions: notifyBlockSuggestionAdded and notifyRelationSuggestionAdded - Inline one-off helpers: getSidebarWindows, findOutlineSidebarWindowId, resolveTargetPageUid - Merge bringSidebarWindowToTop + focusTopSidebarOutline into one focusSidebarOutline(windowId?, delayMs?), removing the buggy global fallback selector when a specific windowId is targeted - Share a single showSuggestionToast for both toast paths Co-authored-by: Cursor <cursoragent@cursor.com>
getCurrentPageUid() only parses the URL hash which can be stale or incorrect when a block is focused. Use the official Roam API getOpenPageOrBlockUid() (awaited properly since the caller is already async) and resolve the result to a page uid before comparing. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add comment to empty catch block to satisfy no-empty ESLint rule - Wrap suggestion-added notifications in try/catch so posthog tracking and suggestion list removal still run if sidebar/toast logic fails Co-authored-by: Cursor <cursoragent@cursor.com>
…ggested-node-is-added-to
- Use relation wording for success toast in block-adoption path when showing feedback in main window/disableSidebarOpen mode - Ensure sidebar-open path always targets outline windows and focuses the specific opened window so it is brought to the top Co-authored-by: Cursor <cursoragent@cursor.com>
| showSuggestionToast( | ||
| `Added relation between [[${sourceTitle}]] and [[${destinationTitle}]]`, | ||
| ); |
There was a problem hiding this comment.
Wrong toast message for block suggestions.
The toast says "Added relation between..." but this function handles block suggestions, not relation suggestions. According to the PR description, it should show: Added to [[Page Name]].
The message should reference the destination page, not both source and destination as a relation:
showSuggestionToast(
`Added to [[${destinationTitle}]]`,
);Currently, users adopting block suggestions see a confusing "Added relation" message even when no relation is being created.
| showSuggestionToast( | |
| `Added relation between [[${sourceTitle}]] and [[${destinationTitle}]]`, | |
| ); | |
| showSuggestionToast( | |
| `Added to [[${destinationTitle}]]`, | |
| ); | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
Summary
When a user adopts a suggestion in Suggestive Mode (Roam), they now receive clear feedback about where the content was added:
Added to [[Page Name]]disableSidebarOpensetting enabled → shows the same toast instead of opening the sidebarFor reified relation adoptions (when Stored Relations are enabled), a toast confirms the relation was created:
Added relation between [[Source]] and [[Destination]].Changes
apps/roam/src/utils/notifySuggestiveModeAdoption.ts(new) — notification logic for block and relation suggestion adoptionapps/roam/src/components/SuggestionsBody.tsx— wiresnotifyBlockSuggestionAdded/notifyRelationSuggestionAddedintohandleCreateBlockTest plan
disableSidebarOpenenabled: adopt a suggestion → toast appears regardless of sidebar state