fix(inline-tool-link): restore unlink behavior and add dynamic tooltip with keyboard Shortcut#3008
Open
prathmeshyelne wants to merge 2 commits into
Open
fix(inline-tool-link): restore unlink behavior and add dynamic tooltip with keyboard Shortcut#3008prathmeshyelne wants to merge 2 commits into
prathmeshyelne wants to merge 2 commits 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
…rigger - Remove the call to nestedPopoverTriggerItem?.handleClick() when switching to another tool, as it caused unintended side effects (e.g., link tool modifying selection when switching away from it). - Keep only the destroyNestedPopoverIfExists() call to properly clean up the nested popover when switching tools.
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, three 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.The unlink regressions were introduced by commit
9f942ca, which added a!this.inputOpenedguard around the unlink logic. BecausecheckState()always opens the link input when an anchor is detected, the guard was never satisfied, preventingunlink()from being executed.Additionally, inline formatting tools did not consistently preserve anchor elements when modifying linked content.
Solution
!this.inputOpenedguard insurround()so that clicking the Link tool or pressingCmd/Ctrl+Kwhile inside an anchor always performs an unlink operation, restoring the behavior from v2.29.1.getTitle()method onLinkInlineTool:Changes
src/components/inline-tools/inline-tool-link.tssurround()to always unlink whenparentAnchorexists; addgetTitle(); updaterender()andcheckState()to support dynamic button titlessrc/components/modules/toolbar/inline.tsinstance.getTitle?.()aftercheckState()to update popover hint text dynamicallysrc/components/utils/popover/popover-inline.tsAcceptance Criteria
Fix Video :
Screen.Recording.2026-06-13.at.5.27.48.PM.mov
Closes #3005