fix(inline-tool-link): restore unlink behavior and add dynamic tooltip with keyboard Shortcut#3008
Open
prathmeshyelne wants to merge 1 commit into
Open
fix(inline-tool-link): restore unlink behavior and add dynamic tooltip with keyboard Shortcut#3008prathmeshyelne wants to merge 1 commit into
prathmeshyelne wants to merge 1 commit into
Conversation
- Remove the !this.inputOpened guard that prevented unlinking when the link input was already open (which it always is when an anchor is detected via checkState). - Add getTitle() to LinkInlineTool for dynamic tooltip: shows 'Unlink' when selection is inside a link, 'Link' otherwise. - Update inline toolbar to read dynamic title from tool instances. Closes codex-team#3005
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In v2.31.6, two regressions appeared in the Link Inline Tool:
⌘+K(Mac) orCtrl+K(Win/Linux) while the selection is inside an existing link also fails to unlink.Both were introduced by commit
9f942cawhich added a!this.inputOpenedguard around the unlink logic. Because checkState() always opens the link input when an anchor is detected, the guard was never satisfied, so unlink() was never called.Solution
!this.inputOpenedguard in surround() so that clicking the Link tool or pressingCmd/Ctrl+Kwhile inside an anchor always unlinks, restoring the v2.29.1 behavior.Changes
parentAnchorexists; add getTitle(); update render() and checkState() to set dynamic button.titleinstance.getTitle?.()after checkState() to populate the popover hint titleAcceptance criteria
Fix Video :
Screen.Recording.2026-06-09.at.10.30.24.PM.mov
Closes #3005