Repository navigation
fix: 弹幕搜索历史支持长按/右键删除记录 - #2704
Open
LOVE-START wants to merge 1 commit into
Open
LOVE-START wants to merge 1 commit into
LOVE-START wants to merge 1 commit into
Conversation
- 最近搜索关键词由只读 Chip 改为可删除:长按(触屏或鼠标左键)或鼠标右键单击弹出「删除该记录」菜单 - 修复按住鼠标右键超过长按时长时,长按识别器会把 Listener 刚打开的菜单再次关闭(表现为菜单一闪即消失) - 复用 KazumiMenuButton,弹出菜单的尺寸与内边距与全局其它菜单保持一致 - 删除后同步持久化到本地存储,落盘失败时记录日志并提示用户,避免界面已删除但重开又出现的不一致
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by claude-opus-5.5 · Input: 260 · Output: 3.5K · Cached: 303.5K |
4 of 11 tasks
Owner
|
此PR有大量没有必要的防御性代码,需要重构 我们根本没有必要假设 hive 居然向我们抛出错误,即使 hive 抛出错误,我们的程序将完全无法正确运行,这里的防御没有意义 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
「弹幕源」面板里的“最近搜索”关键词此前只能点击检索,无法从历史中移除。本次为其加上删除能力。
KazumiMenuButton,弹出菜单的尺寸、内边距与主题与全局其它菜单保持一致顺带修掉的一个边界缺陷
右键与长按是两条独立路径,都会翻转同一个菜单的开关:
Listener.onPointerDown立即打开菜单LongPressGestureRecognizer的allowedButtonsFilter默认接受任意鼠标按键,所以按住右键超过 500ms 时它也会触发,此时菜单已打开,于是又把菜单关掉 —— 表现为菜单一闪即消失处理:给长按识别器加
allowedButtonsFilter: (buttons) => buttons == kPrimaryButton,右键完全交给Listener,两条路径不再互相干扰。验证方式
已在本机 Windows 桌面端构建运行(
flutter run -d windows --no-enable-impeller)人工验证:短按仍能搜索、长按弹出菜单并能成功删除、按住右键菜单不再一闪即消失、删除后关闭再重开面板该记录确实不再出现(持久化生效)。flutter analyze对改动文件无告警。影响范围
仅
lib/pages/player/danmaku_source_sheet.dart一个文件,+116 / -12。