Repository navigation
Feat/add link handling in comments - #1675
denisugiarto wants to merge 30 commits into
Conversation
Add complete link functionality including: - Web2 URL detection and styling with tooltips - Entity mentions via @ trigger with real-time search - Link creation via / commands with entity search modal - Floating selection toolbar for text formatting and linking - Graph link hover tooltips and navigation - Enhanced editor extensions and improved parser
… condition with proper cancellation, corrected validation control flow from return to continue in loops, and implemented 150ms debouncing to prevent performance issues during rapid typing.
… over links and enhancing web2 URL hover card stability with better mark and hover management.
…andling in markdown
- Add markdown link processing to parser for graph:// URLs - Refactor command and entity mention extensions to accept spaceId parameter - Replace Link extension with GraphLinkExtension and MarkdownLinkExtension for better link handling - Add debounced auto-save and immediate save on blur to prevent data loss - Improve graph link hover tooltip with entity name display and better UX - Fix link creation to use markdown format [name](graph://id) consistently - Prevent link navigation in edit mode to allow text selection - Enhance SelectEntity component to properly handle entity creation with space context
…e conversion Ensure web2 URL hover cards only appear in edit mode by adding an early return. Also fix URL-to-markdown conversion in edit mode by using proper position mapping and checking for existing markdown formatting. This prevents visual glitches and ensures consistent behavior between edit and view modes.
Centralize graph link insertion across editor components using the new `insertGraphLink` utility. Add data attributes (data-entity-name, data-space-id) to link marks for client-side entity caching, enabling tooltips to display entity info without fetching. Update hover interactions to use router navigation and cached attributes. Remove debug console.log statements from profile entity container.
- Add href attribute to link marks in insertGraphLink function for proper link handling - Add tiptap extension-floating-menu and extension-underline dependencies - Remove unused spaces variable from profile entity container
- Expose isLoading state from useEntity hook for entity loading status - Display spinner in graph link tooltip while entity is loading - Add data-entity-name and data-space-id attributes to link marks for hover tooltips - Refactor link attribute construction to include custom data attributes
Replace all tippy.js usage across editor extensions with @floating-ui/dom, using computePosition with strategy:'fixed' and autoUpdate to prevent popup drift during scroll/resize events. - Use virtual reference elements with live getBoundingClientRect so each autoUpdate cycle reflects the current cursor position - Save editor state synchronously on edit→read mode transition instead of debounced saves, ensuring formatting changes are persisted on mode switch - Move FloatingToolbarExtension into shared tiptapExtensions array to avoid recreation on every sync engine update - Add <u> tag passthrough in htmlToMarkdown parser for underline support - Guard against null newSpaceId before redirect in profile container - Use insertContentAt instead of insertContent for reliable link insertion in TipTap v3's position adjustment logic - Remove unused detectWeb2URLs import from SelectEntity - Upgrade @tiptap/extension-underline to v3, remove deprecated v2 deps - Add --color-grey-05 and --color-red-03 CSS custom properties
…ate persistence, and add web2 URL extension testing.
… hover tooltip stability
…adix Popover and SelectEntity
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| onOpenAutoFocus={e => { | ||
| // We want SelectEntity to focus, but we don't want Radix to do its own focus management | ||
| // because it might conflict with our timing. However, SelectEntity already auto-focuses. |
There was a problem hiding this comment.
onOpenAutoFocus is currently a no-op (and the e param is unused). In other Popover usages in this codebase, the handler calls event.preventDefault() (and often event.stopPropagation()) to prevent Radix focus management from stealing focus unexpectedly. Consider matching that pattern here to avoid focus flicker between the textarea and SelectEntity when the mention popover opens, and to avoid unused-arg linting issues.
| onOpenAutoFocus={e => { | |
| // We want SelectEntity to focus, but we don't want Radix to do its own focus management | |
| // because it might conflict with our timing. However, SelectEntity already auto-focuses. | |
| onOpenAutoFocus={event => { | |
| // We want SelectEntity to focus, but we don't want Radix to do its own focus management | |
| // because it might conflict with our timing. However, SelectEntity already auto-focuses. | |
| event.preventDefault(); | |
| event.stopPropagation(); |
| const match = after.match(/^@\S*/); | ||
| const lengthToReplace = match ? match[0].length : 1; | ||
|
|
||
| const newText = before + `[${result.name || result.id}](graph://${result.id})` + after.slice(lengthToReplace); | ||
| setText(newText); |
There was a problem hiding this comment.
The mention insertion builds markdown with the raw entity name: [${result.name}](graph://...). If result.name contains ], (, ), backslashes, or newlines, this can produce malformed markdown (or unintended formatting/links). Suggest escaping/sanitizing the link label before constructing the markdown, or using a small helper that safely formats []() sequences.
| "@upstash/ratelimit": "^2.0.8", | ||
| "@upstash/redis": "^1.37.0", | ||
| "@vercel/analytics": "^2.0.1", | ||
| "@vercel/og": "^0.9.0", |
There was a problem hiding this comment.
@vercel/og is added to dependencies, but there are no references to it under apps/web in this PR. If it’s not required for the comment/link handling work, please remove it to avoid increasing install size and dependency surface area; otherwise, add the corresponding usage/change that requires it.
| "@vercel/og": "^0.9.0", |
| withSearchIcon?: boolean; | ||
| advanced?: boolean; | ||
| autoFocus?: boolean; | ||
| showUrlWarning?: boolean; |
There was a problem hiding this comment.
showUrlWarning?: boolean was added to SelectEntityProps, but the component doesn’t destructure or use this prop anywhere, so it has no effect and may confuse callers. Either wire it through to the relevant UI/behavior (and include it in the component’s parameter destructuring) or remove the prop until it’s implemented.
| showUrlWarning?: boolean; |
|
Closing as part of a sweep of the open-PR queue. Not a judgement on the work — reopen if you still want it and I will help get it current. Opened 2026-04-14 and now conflicting with master. At this distance a rebase is usually more work than redoing the change against current code, and the surrounding code has moved a long way underneath "Feat/add link handling in comments". @denisugiarto — if the idea still stands but the branch does not, a fresh PR or a ticket is probably a better route than reviving this one. Nothing is discarded: the branch and its history remain, and reopening costs a click. Context: 74 PRs were open, 25 older than two months, the oldest from February. The point is to make the queue mean something so genuinely ready work is visible rather than buried — #2449 sat ready for three days this week partly because of the noise. Only non-draft, conflicting PRs are in scope; drafts and anything still mergeable are being left alone. |
EE-Solutions/geo-project-issues#114
Results: