Skip to content

Comments

Feat: Add Link Functionality.#174

Open
ayushnirwal wants to merge 8 commits intofeat/text-editor-migratefrom
feat/text-editor-migrate-link
Open

Feat: Add Link Functionality.#174
ayushnirwal wants to merge 8 commits intofeat/text-editor-migratefrom
feat/text-editor-migrate-link

Conversation

@ayushnirwal
Copy link
Collaborator

@ayushnirwal ayushnirwal commented Jan 27, 2026

Description

Add link editing functionality

Screenshot/Screencast

Screen.Recording.2026-01-27.at.1.45.57.PM.mov

Checklist

  • I have thoroughly tested this code to the best of my abilities.
  • I have reviewed the code myself before requesting a review.
  • This code is covered by unit tests to verify that it works as intended.
  • The QA of this PR is done by a member of the QA team (to be checked by QA).

Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
@ayushnirwal ayushnirwal force-pushed the feat/text-editor-migrate-link branch from 19e9409 to 326c5d0 Compare February 5, 2026 12:43
@ayushnirwal ayushnirwal marked this pull request as ready for review February 5, 2026 12:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds link editing functionality to the text editor component, including a bubble menu for editing link URLs and a toolbar button for creating links.

Changes:

  • Added LinkBubbleMenu component to display a popup editor when links are selected
  • Added "link" command to the text editor toolbar
  • Updated TypeScript configuration to use bundler module resolution

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/frappe-ui-react/tsconfig.json Added bundler module resolution for improved module handling
packages/frappe-ui-react/src/components/textEditor/textEditor.tsx Integrated LinkBubbleMenu component into the editor
packages/frappe-ui-react/src/components/textEditor/menu/menu.tsx Added link command to the default toolbar commands
packages/frappe-ui-react/src/components/textEditor/menu/linkBubbleMenu.tsx New component implementing link editing bubble menu with URL input and remove functionality
packages/frappe-ui-react/src/components/textEditor/menu/commands/types.ts Added "link" to the command keys type definition
packages/frappe-ui-react/src/components/textEditor/menu/commands/index.ts Implemented link command with Link2 icon and setLink action
packages/frappe-ui-react/package.json Reordered dependencies (unintentional formatting change)
Comments suppressed due to low confidence (1)

packages/frappe-ui-react/package.json:58

  • The '@tiptap/extension-link' package is missing from dependencies. This package needs to be added to make the link functionality work. Add "@tiptap/extension-link": "^3.17.1" to the dependencies section.
    "@headlessui/react": "^2.2.9",
    "@popperjs/core": "^2.11.8",
    "@tailwindcss/typography": "^0.5.19",
    "@tiptap/extension-blockquote": "^3.17.1",
    "@tiptap/extension-code-block-lowlight": "^3.17.1",
    "@tiptap/extension-highlight": "^3.17.1",
    "@tiptap/extension-horizontal-rule": "^3.17.1",
    "@tiptap/extension-list": "^3.17.1",
    "@tiptap/extension-placeholder": "^3.17.1",
    "@tiptap/extension-strike": "^3.17.1",
    "@tiptap/extension-table": "^3.17.1",
    "@tiptap/extension-task-list": "^3.17.1",
    "@tiptap/extension-text-align": "^3.17.1",
    "@tiptap/extension-text-style": "^3.17.1",
    "@tiptap/pm": "^3.17.1",
    "@tiptap/react": "^3.17.1",
    "@tiptap/starter-kit": "^3.17.1",

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
@ayushnirwal ayushnirwal changed the title Feat: text editor migrate - Add Link Functionality. Feat: Add Link Functionality. Feb 6, 2026

return (
<EditorContext.Provider value={{ editor }}>
<LinkBubbleMenu />
Copy link
Collaborator

Choose a reason for hiding this comment

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

When clicking on the link, it opens directly. This behavior is different from frappe-ui, where a popup appears with options to click or edit the link. I think that approach is better, as accidentally clicking the link while editing opens a new tab. Overall, I don’t think the current UX is good.

Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
Signed-off-by: ayushnirwal <53055971+ayushnirwal@users.noreply.github.com>
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.

2 participants