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

feat: 优化搜索交互 #76

Merged
merged 5 commits into from
Mar 18, 2024
Merged

feat: 优化搜索交互 #76

merged 5 commits into from
Mar 18, 2024

Conversation

crazyair
Copy link
Member

@crazyair crazyair commented Mar 17, 2024

iShot_2024-03-17_17.35.29.mp4

Copy link

vercel bot commented Mar 17, 2024

@crazyair is attempting to deploy a commit to the cnpmweb Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Mar 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cnpmweb ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2024 8:31am

suffixIcon={null}
onSearch={setSearch}
autoFocus
onChange={(search) => router.push(`/package/${search}`)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加下 shallow 配置? 点击搜索结果后现在跳转有点慢 😭

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不清楚为什么会卡,可能开发环境问题,我本地测试也是一会快一会慢

iShot_2024-03-18_08.56.18.mp4

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这次改动是想把进入搜索页限制下,代码恢复之前的写法了,增加了只有点击按钮才进搜索页面,保证箭头选中搜索结果项回车能直接进入包页面,而不是搜索页面。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯 没开 shallow 的话,会优先尝试 fetch 一下资源,感觉上就会有点卡顿

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是试过加了一次,感觉没区别呀?要不我加下?

@fengmk2 fengmk2 added the enhancement New feature or request label Mar 18, 2024
closeIcon={closeIcon}
onClose={() => onClose?.(tag.label)}
>
<Link href={tag.href}>{tag.label}</Link>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个会有 a 嵌套 a 的警告,可以先不管

package.json Show resolved Hide resolved
@elrrrrrrr
Copy link
Member

+1 👍🏻 感谢贡献 搜索体验好了很多

@elrrrrrrr elrrrrrrr enabled auto-merge (squash) March 18, 2024 08:45
@elrrrrrrr elrrrrrrr merged commit 909a82c into cnpm:main Mar 18, 2024
4 checks passed
@crazyair
Copy link
Member Author

crazyair commented Mar 18, 2024

进入结果页面 https://npmmirror.com/packages?q=antd 刷新页面会异常

iShot_2024-03-18_16.51.00.mp4

这个问题还没有解决,不知道怎么解决

@fengmk2
Copy link
Member

fengmk2 commented Mar 18, 2024

@crazyair @elrrrrrrr 改完出 bug 了?搜索 url 直接访问会跳转到 pkg 页面 https://npmmirror.com/packages?q=antd

@crazyair
Copy link
Member Author

@crazyair @elrrrrrrr 改完出 bug 了?搜索 url 直接访问会跳转到 pkg 页面 https://npmmirror.com/packages?q=antd

之前就有

@crazyair
Copy link
Member Author

/packages?q=antd

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants