feat: add draggable mobile task composer
ci / docker (push) Successful in 3m26s

This commit is contained in:
2026-09-07 10:52:20 +08:00
parent 86fdcca773
commit d6452fb1c1
5 changed files with 133 additions and 5 deletions
+11
View File
@@ -98,6 +98,17 @@ export function nextTotalAfterLocalTaskAdd(total: number) {
return Math.max(0, Number(total) || 0) + 1
}
export function clampFabPosition(x: number, y: number, viewportWidth: number, viewportHeight: number, size = 52, margin = 14, bottomReserved = 74) {
return {
x: Math.min(Math.max(x, margin), Math.max(margin, viewportWidth - size - margin)),
y: Math.min(Math.max(y, margin), Math.max(margin, viewportHeight - size - bottomReserved)),
}
}
export function isFabDrag(deltaX: number, deltaY: number, threshold = 8) {
return Math.hypot(deltaX, deltaY) >= threshold
}
export function formatApiErrorDetail(detail: unknown): string {
if (typeof detail === 'string') return detail
if (Array.isArray(detail)) {