Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [Feature]: CodeReview组件增加多行选择功能 #1876

Open
redshade opened this issue Jun 3, 2024 · 7 comments
Open

✨ [Feature]: CodeReview组件增加多行选择功能 #1876

redshade opened this issue Jun 3, 2024 · 7 comments
Labels
feature New feature

Comments

@redshade
Copy link
Collaborator

redshade commented Jun 3, 2024

What problem does this feature solve

  • 业务中需要实现类似github的多行代码建议功能

What does the proposed API look like

  • 支持多行选择效果
  • 可获取到多行选择的代码内容
    image
@aolinpk
Copy link
Contributor

aolinpk commented Jun 4, 2024

现调研了一下github的这块功能。

@aolinpk
Copy link
Contributor

aolinpk commented Jun 4, 2024

结合现有CodeReview现有功能,预计增加以下功能:
1、点击选中行(只能选连续的行,预计做成按住shift点击左键)。
2、点击评论的回调函数中增加一到两个参数,优先增加返回参数行号数组[1,2,3,4,5,6],如果可以的话返回对应选中行的代码块字符串。

@aolinpk
Copy link
Contributor

aolinpk commented Jun 5, 2024

补充:参照github如果已经选中多行 此时如果点击的是最后一个选中的行触发事件则为多选。 如果选中的不是已选中多选的最后一行,或者点击是未选中行则走原来的单选。
image

@aolinpk
Copy link
Contributor

aolinpk commented Jun 5, 2024

选中方法参照github,改成只能从小到大选择。 因为如果能自由选择的话会有一个问题。 例如选中了200-205,再选202的时候到底是要200-202还是202-205就会有分歧。

@aolinpk
Copy link
Contributor

aolinpk commented Jun 13, 2024

image

@aolinpk
Copy link
Contributor

aolinpk commented Jun 13, 2024

image

@aolinpk
Copy link
Contributor

aolinpk commented Jun 13, 2024

image
image

GreatZPP pushed a commit that referenced this issue Jun 17, 2024
#1885)

* 组件易用性优化,category-search组件唤出textInput时,input框自动聚焦 (#1842)

* feat: 代码比较CodeReview组件增加行/多行选中功能。使用allow-checked参数控制。增加详细使用示例和文档说明。 #1876
@fu050409 fu050409 added the feature New feature label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

3 participants