fix(V0.2): 二轮评审 6 项 —— BUILD_ID 格式 / 菜单与详情精简 / 拖动重做 / 键盘统一方案
Docker Build and Push / build-image (push) Successful in 4m5s
Docker Build and Push / build-image (push) Successful in 4m5s
1. BUILD_ID 改为 yyyyMMddHHmmss (去掉中间点), 仍 UTC+8
2. 任务 ⋯ 菜单去掉顶部任务名标题
3. 任务详情去掉底部「拷贝到其他项目」「删除任务」按钮 (⋯ 菜单已有)
4+6. 键盘遮挡统一方案 (重点设计 §7.2):
- index.html 加 interactive-widget=resizes-content
- App 级 useKeyboardInsetWatcher 写 --kb-inset (visualViewport+window 双源)
- 底部弹层统一 .kb-safe 类 (安全区+20px+键盘插入量, dvh 收缩+内部滚动)
- TaskDetail/UserPicker/CopyTaskPopup/信息块弹层全部迁移, 删除 per-component hook
- 信息块 textarea 补 focus scrollIntoView 兜底
5. 拖动方案重做 (重点设计 §7.1):
- 新 useColumnDrag: Pointer Events + setPointerCapture, 长按400ms原位抬起,
elementFromPoint 高亮目标列, 边缘 rAF 自动横滚; 移除手指跟随浮层(任务名)
- 列表行长按 500ms → 「移动到列」ActionSheet (不做自由拖动)
- 移除「拖到卡片转子任务」误触路径, 统一走详情页层级区
- 删除旧 useLongPressDrag
已验证: 99 文件语法 0 错误、导入 0 缺失
This commit is contained in:
@@ -1,16 +1,45 @@
|
||||
import { useEffect, useRef } from 'react'
|
||||
import StatusDot from './StatusDot.jsx'
|
||||
|
||||
// 列表视图的一行 (Todoist 风格, T-UI-01)
|
||||
// 长按 500ms → onLongPress (移动到列菜单); 点击其他区域 → onClick (编辑)
|
||||
const LONG_PRESS = 500
|
||||
|
||||
export default function TaskRow({
|
||||
task, onToggle, onClick, onMore, indent = false, children,
|
||||
task, onToggle, onClick, onMore, onLongPress, indent = false, children,
|
||||
}) {
|
||||
const timer = useRef(null)
|
||||
const moved = useRef(false)
|
||||
|
||||
const clear = () => { if (timer.current) { clearTimeout(timer.current); timer.current = null } }
|
||||
useEffect(() => () => clear(), [])
|
||||
|
||||
const startPress = () => {
|
||||
moved.current = false
|
||||
clear()
|
||||
if (!onLongPress) return
|
||||
timer.current = setTimeout(() => {
|
||||
if (!moved.current) {
|
||||
if (navigator.vibrate) navigator.vibrate(15)
|
||||
onLongPress(task)
|
||||
}
|
||||
}, LONG_PRESS)
|
||||
}
|
||||
const cancelPress = () => clear()
|
||||
const markMoved = () => { moved.current = true; clear() }
|
||||
|
||||
const done = task.status === 'done'
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={`${indent ? 'sub-row' : 'task-row'}${done ? ' done' : ''}`}
|
||||
data-task-id={indent ? undefined : task.id}
|
||||
onClick={onClick}
|
||||
onClick={() => { if (!moved.current) onClick?.(task) }}
|
||||
onTouchStart={startPress}
|
||||
onTouchMove={markMoved}
|
||||
onTouchEnd={cancelPress}
|
||||
onMouseDown={startPress}
|
||||
onMouseUp={cancelPress}
|
||||
>
|
||||
<div
|
||||
className="box"
|
||||
|
||||
Reference in New Issue
Block a user