dumi icon indicating copy to clipboard operation
dumi copied to clipboard

feat: add search-bar for doc mode, https://github.com/umijs/dumi/issues/373

Open suedar opened this issue 3 years ago • 8 comments

🤔 这个变动的性质是?/ What is the nature of this change?

  • [☑️] 新特性提交 / New feature

🔗 相关 Issue / Related Issue

https://github.com/umijs/dumi/issues/373

长这个样子,覆盖了原来的样式, 仅支持 pc 版本,mobile 版本保持原样 image

📝 更新日志 / Changelog

Language Changelog
🇺🇸 English add search-bar for doc mode
🇨🇳 Chinese doc mode 添加搜索框

suedar avatar May 10 '21 09:05 suedar

⚡️ Deploying PR Preview...

github-actions[bot] avatar May 10 '21 09:05 github-actions[bot]

⚡️ Deploying PR Mobile Preview...

github-actions[bot] avatar May 10 '21 09:05 github-actions[bot]

Codecov Report

Merging #678 (b3c21d7) into master (5656c82) will decrease coverage by 0.33%. The diff coverage is 33.33%.

:exclamation: Current head b3c21d7 differs from pull request most recent head 4680a8c. Consider uploading reports for the commit 4680a8c to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master     #678      +/-   ##
==========================================
- Coverage   94.17%   93.83%   -0.34%     
==========================================
  Files         112      112              
  Lines        2453     2467      +14     
  Branches      795      799       +4     
==========================================
+ Hits         2310     2315       +5     
- Misses        139      148       +9     
  Partials        4        4              
Impacted Files Coverage Δ
...ackages/theme-default/src/components/SearchBar.tsx 46.42% <31.25%> (-16.08%) :arrow_down:
packages/theme-default/src/components/SideMenu.tsx 87.50% <40.00%> (+0.65%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5656c82...4680a8c. Read the comment docs.

codecov[bot] avatar May 10 '21 09:05 codecov[bot]

感觉 UI 可以优化下,大家一起看看:

  1. 侧边栏的拥挤程度已经很高了,搜索框是不是默认收起会好一些,或者有没有更好的布局方案,哪怕大刀阔斧一些
  2. 搜索的结果替代侧边栏子项的方式会比较奇怪,是不是仍旧采用 popup 的形态会好一些

PeachScript avatar May 12 '21 03:05 PeachScript

这样的处理参考自 docz ,或者你们有更好的想法。 popup 会有点奇怪 可能有 header 的时候会比较好一点

suedar avatar May 12 '21 07:05 suedar

怎么使用搜索呢??

birdycn avatar Jul 05 '21 07:07 birdycn

cc @suedar

xrkffgg avatar Jul 05 '21 13:07 xrkffgg

有点久了这个,之前的场景是复用原搜索框,由于 mode: doc 没有搜索框,将 mode: site 右上角的搜索框放到 doc 上了。 现在可能有点变化,我有空再看看。

suedar avatar Jul 07 '21 10:07 suedar

❤️ 感谢贡献,dumi v1 不再更新,PR 将会关闭;dumi v2 已发布,欢迎继续参与 dumi 的建设,https://d.umijs.org/

PeachScript avatar Jan 28 '23 09:01 PeachScript