Skip to content

Improve search highlighting #13343

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

Closed
88250 opened this issue Dec 3, 2024 · 18 comments
Closed

Improve search highlighting #13343

88250 opened this issue Dec 3, 2024 · 18 comments
Assignees
Milestone

Comments

@88250
Copy link
Member

88250 commented Dec 3, 2024

继续完善 #13178 并支持代码块中的关键字高亮 #11350

@88250 88250 added this to the 3.1.15 milestone Dec 3, 2024
88250 added a commit that referenced this issue Dec 5, 2024
@Vanessa219
Copy link
Member

  • 历史
  • 反链
  • 搜索

Vanessa219 added a commit that referenced this issue Dec 7, 2024
Vanessa219 added a commit that referenced this issue Dec 7, 2024
Vanessa219 added a commit that referenced this issue Dec 7, 2024
88250 added a commit that referenced this issue Dec 7, 2024
Vanessa219 added a commit that referenced this issue Dec 7, 2024
Vanessa219 added a commit that referenced this issue Dec 7, 2024
Vanessa219 added a commit that referenced this issue Dec 7, 2024
88250 added a commit that referenced this issue Dec 8, 2024
Vanessa219 added a commit that referenced this issue Dec 8, 2024
88250 added a commit that referenced this issue Dec 8, 2024
Vanessa219 added a commit that referenced this issue Dec 8, 2024
88250 added a commit that referenced this issue Dec 8, 2024
Vanessa219 added a commit that referenced this issue Dec 8, 2024
@Achuan-2
Copy link
Member

Achuan-2 commented Dec 9, 2024

我建议能不能搞个新的css变量--b3-protyle-search-mark-background,用var(--b3-protyle-inline-mark-background); 会和行内高亮样式区别不开,这样方便主题修改
PixPin_2024-12-09_09-46-48

@Achuan-2
Copy link
Member

Achuan-2 commented Dec 9, 2024

现在在搜索中点击块,可以看下个高亮项,但是这个交互有问题,太隐藏了,而且还不能点快,一旦点快,就打开块了

可以参考下高亮搜索插件:https://github.com/TCOTC/siyuan-plugin-hsr-mdzz2048-fork
添加前一个和后一个按钮
PixPin_2024-12-09_10-07-23

@Achuan-2
Copy link
Member

Achuan-2 commented Dec 9, 2024

搜索定位有问题,如果搜索的内容已经是命中了文档块,搜索面板里点击文档块里的子块,是不会跳转或者跳转不正确的

PixPin_2024-12-09_10-05-08

PixPin_2024-12-09_10-05-41

Vanessa219 added a commit that referenced this issue Dec 9, 2024
@Vanessa219
Copy link
Member

搜索面板放不下按钮了,放在编辑器上的话有点不恰当。目前先这样
image

其余两点已修改。

@Achuan-2
Copy link
Member

Achuan-2 commented Dec 9, 2024

可以在右上角放的,参考高亮搜索插件,其实占据不了多大空间的

或者在面包屑下方放,这样不会挡住块

@Vanessa219
Copy link
Member

这个是全局搜索,放在编辑器内不有一点突兀。

@Achuan-2
Copy link
Member

Achuan-2 commented Dec 9, 2024

这个是全局搜索,放在编辑器内不有一点突兀。

不觉得突兀,全局搜索是搜索全部块,这个是在块里看每个命中,对于看文档块中的多个命中是很好用的,如果全局搜索有这个,就可以更方便看多个文档的命中情况。虽然思源搜索结果虽然会罗列所有命中的块,但是左侧的展现并不能展示多少文字,也不能展示所有命中,还是得到右侧的编辑区看具体的命中情况。其实这点可以参考vscode的搜索体验,dock栏全局搜索可以搜索到相关的文件,打开文件后又可以进一步搜索

这个提案只是把跳转到下一个命中的功能凸显出来,更易用而已,不然当初为什么要做跳转到下一个命中的功能呢

@Vanessa219
Copy link
Member

没太理解,是要在编辑器内部再加一个搜索按钮么?看了下 IDE 中并没有
image

@Achuan-2
Copy link
Member

Achuan-2 commented Dec 9, 2024

没太理解,是要在编辑器内部再加一个搜索按钮么?看了下 IDE 中并没有 image

VScode的界面是这样的
PixPin_2024-12-09_22-34-06

我只是解释全局搜索和单页面搜索并不冲突,是可以一起互补的

思源可以在现在的基础上,先做前一个按钮和后一个按钮

@Vanessa219
Copy link
Member

编辑器内搜索目前好像有插件了。全局搜索中的下一个放置位置还需要在考虑一下。如果放到编辑器内,不仅突兀,操作也不方便,间隔的太远了。
image

@Achuan-2
Copy link
Member

Achuan-2 commented Dec 10, 2024

嗯,暂时没必要做编辑器内搜索,先把跳转做好
上一个,下一个我觉得就应该放在编辑器内,左边是全局搜索,右边是进一步看每一个块的搜索,放在编辑器才合适,就可以一直看着右边,而不是看着右边,点着左边,这才不方便的。全局搜索和块内的高亮跳转就应该分开的,一个全局,一个局部,操作做到分离

至于位置,我觉得面包屑左下方或者右下方都合适

@Vanessa219
Copy link
Member

Vanessa219 commented Dec 10, 2024

太远了,没有直接点击行方便。鼠标需要滑动来滑动去的。

@Achuan-2
Copy link
Member

Achuan-2 commented Dec 10, 2024

太远了,没有直接点击行方便。鼠标需要滑动来滑动去的。

问题是直接点击的交互是有问题的,误触了就跳转,用户误以为定位失败,真正去用这个功能也容易变为双击打开

左侧本来连内容都放不下,也塞不下按钮

也只能放在编辑器区了

我觉得一般用跳转的场景是,现在全局搜索找到可能的几个块,然后再右侧看有几个高亮跳转,只有几个高亮的用不到高亮跳转功能,有很多高亮的,目前一个个点击块来跳转太累,速度还不能快,不如右侧添加专门按钮来得实际

鼠标需要滑动来滑动去的问题对我而言并没有什么,反而能引导我专注在当前块里,并且视野本来就要移动到编辑器区,如果按钮在全局搜索的块那边,反而隔的远,不方便

或者等用户反馈再看看要不要改吧,暂时就这样

@TCOTC
Copy link
Contributor

TCOTC commented Dec 10, 2024

同一个块内的关键词应该不会太多,点几下就够了

@Achuan-2
Copy link
Member

同一个块内的关键词应该不会太多,点几下就够了

一个块的就不需要高亮跳转了,只有文档块才需要

@Vanessa219
Copy link
Member

要不按住 ctrl 点击,就可以阻止打开了?

@TCOTC
Copy link
Contributor

TCOTC commented Dec 10, 2024

太怪了

mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
mouyase pushed a commit to mouyase/siyuan that referenced this issue Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants