Repository navigation
feat(player): 增加进度条悬停和拖动时间提示 - #2722
Conversation
| child: LayoutBuilder( | ||
| builder: (context, constraints) { | ||
| if (_constraints != null && _constraints != constraints) { | ||
| _cancelPointer(); |
There was a problem hiding this comment.
WARNING: Any constraint change aborts an in-progress drag, including changes caused by the drag itself
In compact mode, PlayerTransportBar lays out Row[playPause, Expanded(progress), timeLabel, fullscreen]. The timeLabel text is durationToString(currentPosition) / .... During a drag, onDragUpdate → updateInteractiveSeek writes the drag target into playback.currentPosition. On a video longer than an hour, dragging across the 1:00:00 mark switches the label from MM:SS to HH:MM:SS. That makes the label wider, so the Expanded progress bar gets new constraints. This builder then calls _cancelPointer(), which sets _cancelledPointer, fires onDragCancel (resetting the position to where the drag started), and drops every later update and the final seek. The user's drag silently snaps back.
Window resizes are already handled by didChangeMetrics, so this check could be limited to hiding the hover preview, or skip the cancel while _dragging (recomputing the drag preview geometry on the next update instead).
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Since Both earlier findings are resolved:
What I checked:
I left out some rare edge cases as too unlikely to flag. These need multi-touch with a cancelled pointer, the bar and the video swipe gesture used at the same moment, or a position label longer than the total while the duration is still Files Reviewed (5 files)
Previous Review Summaries (4 snapshots, latest commit c5da97d)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit c5da97d)Status: 1 Issue Found | Recommendation: Address before merge Overview
The changes since
Issue Details (click to expand)WARNING
Fix these issues in Kilo Cloud Files Reviewed (7 files)
Previous review (commit cc30f88)Status: No Issues Found | Recommendation: Merge The incremental changes since
Behavior I checked is unchanged:
The earlier WARNING on line 330 (a constraint change aborting a drag) stays fixed. Files Reviewed (2 files)
Previous review (commit e6b92ce)Status: No Issues Found | Recommendation: Merge The previous WARNING on Files Reviewed (2 files)
Previous review (commit 6884e4e)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Reviewed by claude-opus-5.5 · Input: 276 · Output: 15K · Cached: 887.1K |
|
考虑移除 audio_progress_bar 依赖并收敛代码边界 |
|
我们已经几乎重复实现了 audio_progress_bar ,重复引入此依赖看上去不再合适 |
| bufferedFraction: _fractionOf(widget.buffered), | ||
| dragging: _dragValue != null, | ||
| leftLabel: widget.sideLabels | ||
| ? durationToString(widget.progress) |
There was a problem hiding this comment.
WARNING: The side labels use a different time format from the one PlayerProgressTrackGeometry measures
The painter draws durationToString(...), which zero-pads minutes and hours (05:30, 01:02:03). PlayerProgressTrackGeometry.labelWidth (player_progress_hover.dart:35-41) still measures the format of the replaced package (5:30, 1:02:03). When the progress is under 10 minutes or at least an hour, or the total is under 10 minutes, the painted label is one digit wider than the space reserved for it. That digit is roughly 7px at 12pt, while sideLabelPadding minus the thumb overhang leaves only about 7.5px. The thumb at the track ends and the right label then nearly touch or overlap. This also changes the visible label format from the package's 5:30 style.
Build both the painted labels and labelWidth from one shared formatter, so the geometry and the painter cannot drift apart.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
|
已按建议移除
请再看一下这版是否满足“收敛代码边界”的要求。 |
Upstream replaced the local `_desktop` getter with the shared `isDesktop()` helper and added pause-on-danmaku-edit, while this branch replaced `ProgressBar` with the in-tree `PlayerProgressBar`. Only the import block conflicted: keep `utils/device.dart` for `isDesktop()` and drop the now-unused `audio_video_progress_bar`.
描述
为播放器进度条增加鼠标悬停时间提示,方便定位要跳转的时间点。按住拖动时持续显示目标时间,移出轨道后仍保留提示,松开或取消拖动后隐藏。
关联的 Issues
暂无
PR 类型
AI 辅助开发
AI 辅助模型:
OpenAI GPT-6.1 Sol(推理强度:ultra)
提交前检查
附注
已完成人工核验。针对性测试 12/12、全量测试 225/225 通过;静态分析通过,仅有 17 条原有 info,无错误或警告。