fix(toolbar): make blockquote toggle range-aware and atomic#140
Open
he666-ux wants to merge 1 commit into
Open
fix(toolbar): make blockquote toggle range-aware and atomic#140he666-ux wants to merge 1 commit into
he666-ux wants to merge 1 commit into
Conversation
|
heshengqi seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
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.
Summary / 摘要
Make
toggleBlockquote()range-aware and atomic so blockquote toggling behaves consistently with existing list toggles.让
toggleBlockquote()支持范围选区和原子更新,使 blockquote 的切换行为与现有列表切换保持一致。Motivation / 背景与动机
toggleBlockquote()previously only operated on the active line and updated the document/selection separately. That made its behavior inconsistent withtoggleOrderedList()andtoggleUnorderedList(), which already support multi-line ranges and atomic undo.之前的
toggleBlockquote()只处理当前行,并且分开更新文档和选区,这与已经支持多行选区和原子撤销的toggleOrderedList()/toggleUnorderedList()不一致。What Changed / 改动内容
make
toggleBlockquote()apply to every covered line in the current selectionremove
>from all selected lines when they are already quotedpreserve the existing single-line behavior for collapsed selections
support reversed selections and range boundaries consistently with other block-level toggles
switch the implementation to a single atomic range replacement so one undo restores both the document and the selection
让
toggleBlockquote()对当前选区覆盖的所有行生效当所有选中行都已带
>时,统一移除前缀保留折叠光标场景下的单行行为
让反向选区和边界行为与其他块级 toggle 保持一致
改为单次原子范围替换,保证一次 undo 同时恢复文档和选区
Tests / 测试
pnpm test packages/plugin-toolbar/test/plugin-toolbar.test.tspnpm testpnpm --filter @floatboat/nexus-plugin-toolbar buildAdded coverage for:
新增覆盖包括: