-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
💄 style: 移动端菜单按钮常显 & 长按直接显示菜单 #2330
base: main
Are you sure you want to change the base?
Conversation
@sxjeru is attempting to deploy a commit to the LobeHub Team on Vercel. A member of the Team first needs to authorize it. |
👍 @sxjeru Thank you for raising your pull request and contributing to our Community |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2330 +/- ##
==========================================
- Coverage 92.08% 92.04% -0.04%
==========================================
Files 460 460
Lines 31551 31573 +22
Branches 2152 2151 -1
==========================================
+ Hits 29053 29062 +9
- Misses 2498 2511 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
position: 'absolute', | ||
}}/> | ||
</Dropdown> | ||
</Item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
考虑把触发区域放在 SessionList Item 子元素,发现两个问题需要协助:
- 触发区域 div 渲染在最后,导致先渲染的其他 item 子元素被覆盖。zIndex 不太合适。
一种解决方案是能否让 div 先渲染,然后再是 item 内置的其他子元素。 - Dropdown 的 menu 不在此文件,如何从原 Actions 里复制或暴露相同内容。
如果能给一个类似的例子,想必这边能照猫画虎解决。
均已解决。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你看下这个分支: https://github.com/lobehub/lobe-chat/tree/feat/group-backup 这是最早尝试的支持右键的方案,其实在方案完整性上已经差不多了,就是 iOS 的支持有问题。看下这个有没有参考价值
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另外其实我更倾向于 在 mobile 上不直接使用 desktop 的 session item,而是使用 mobile 特有的交互,比如这种: https://mobile.ant.design/zh/components/swipe-action 。这样体验会更好
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类似于左滑显示菜单按钮吗?不知 antd mobile 组件能否直接用于 antd 的 List,还是要新建对象。
这边写不了复杂代码,估计会在原本目标实现后再看看,很可能不会实现。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类似于左滑显示菜单按钮吗?
对
不知 antd mobile 组件能否直接用于 antd 的 List,还是要新建对象。
如果要用 antd mobile,整个 list 是需要使用 mobile 这一套重新实现的。所以我现在也没这么去做
本次提交有较大改动,涉及简单重构,烦请耐心审阅。 922abf2 |
This submission has major changes and involves simple refactoring. Please review it patiently. 922abf2 |
我看涉及到了 chat 路由相关的变动,然后我们最近在做 chat layout 的重构 #2339 ,可能 review 要等这个PR合并完毕之后才会开始 |
I see that changes related to chat routing are involved, and we are currently refactoring the chat layout #2339. Maybe the review will not start until this PR is merged. |
不急,主线为重。届时等相关pr合并后再修。 |
Don't be in a hurry, focus on the main line. It will be revised after the relevant PRs are merged. |
这个问题后面改成右键菜单 context menu 就可以解了吧?右键菜单到移动端自然就变成长按唤起了 |
This problem can be solved later by changing it to the right-click menu context menu, right? The right-click menu on the mobile terminal will naturally become a long press to call it up. |
通过略微延迟菜单按钮的消失,使菜单关闭动画能完整显示,希望可以接受。 8b4d9ac |
By slightly delaying the disappearance of the menu button, the menu closing animation can be fully displayed, which I hope is acceptable. 8b4d9ac |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Perhaps this PR can be dismantled and the "mobile menu button always displayed" can be implemented first, otherwise the mobile terminal cannot currently expand the assistant menu. |
@sxjeru 这个 PR 重新 rebase 下,时间线理一下 |
@sxjeru Rebase this PR and sort out the timeline |
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
From #2329
助手、话题列表项长按(桌面端为右键)直接显示出菜单。#1920
拿不到正确的触发区域,部分移动端浏览器无法触发)经测试移动端 chrome、雨见浏览器支持,而 Via 不支持触发。
zIndex 可解决,或者更改元素排列顺序,并设置排列方向从右到左。
可能无法实现)考虑移动端直接不显示菜单按钮,这样也不会遮盖时间了)已知 IOS Safari 不支持长按触发 oncontextmenu 事件,待议。
📝 补充信息 | Additional Information
close #2329
close #1749
replace #1863
相关 #1920 (该 issue 希望所有菜单都能右键,个人反觉不妥,可以只支持上面两处。)