Skip to content

Feat/add link handling in comments - #1675

Closed
denisugiarto wants to merge 30 commits into
masterfrom
feat/add-link-handling-in-comments
Closed

denisugiarto wants to merge 30 commits into
masterfrom
feat/add-link-handling-in-comments

Conversation

@denisugiarto

Copy link
Copy Markdown
Collaborator

EE-Solutions/geo-project-issues#114

Results:

Screenshot 2026-04-14 at 22 06 35 Screenshot 2026-04-14 at 22 06 30

denisugiarto and others added 29 commits January 17, 2026 13:20
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.
- 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.
@denisugiarto
denisugiarto requested review from b-d055 and Copilot April 14, 2026 15:07
@denisugiarto denisugiarto self-assigned this Apr 14, 2026
@vercel

vercel Bot commented Apr 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
geogenesis Ready Ready Preview Apr 18, 2026 4:31am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +360 to +362
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.

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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();

Copilot uses AI. Check for mistakes.
Comment on lines +296 to +300
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);

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread apps/web/package.json
"@upstash/ratelimit": "^2.0.8",
"@upstash/redis": "^1.37.0",
"@vercel/analytics": "^2.0.1",
"@vercel/og": "^0.9.0",

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Suggested change
"@vercel/og": "^0.9.0",

Copilot uses AI. Check for mistakes.
withSearchIcon?: boolean;
advanced?: boolean;
autoFocus?: boolean;
showUrlWarning?: boolean;

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
showUrlWarning?: boolean;

Copilot uses AI. Check for mistakes.
@ohohoreilly

Copy link
Copy Markdown
Contributor

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.

This branch was successfully deployed

1 active deployment
Preview — 1a2d0f0a Deployed Apr 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants