Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f56c9728c | ||
|
|
0f51366fd5 |
@@ -1,3 +1,10 @@
|
||||
## [4.62.1](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.62.0...v4.62.1) (2025-10-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **flashcards:** improve shadow speed logging with separate throttling ([0f51366](https://github.com/antialias/soroban-abacus-flashcards/commit/0f51366fd56540e691df4931b6350c03043484f1))
|
||||
|
||||
## [4.62.0](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.61.3...v4.62.0) (2025-10-21)
|
||||
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ function DraggableCard({ card }: DraggableCardProps) {
|
||||
const dragStartRef = useRef<{ x: number; y: number; cardX: number; cardY: number } | null>(null)
|
||||
const lastMoveTimeRef = useRef<number>(0)
|
||||
const lastMovePositionRef = useRef<{ x: number; y: number }>({ x: 0, y: 0 })
|
||||
const lastLogTimeRef = useRef<number>(0) // Separate throttling for logging
|
||||
|
||||
const handlePointerDown = (e: React.PointerEvent) => {
|
||||
setIsDragging(true)
|
||||
@@ -121,8 +122,10 @@ function DraggableCard({ card }: DraggableCardProps) {
|
||||
}
|
||||
|
||||
// Initialize velocity tracking
|
||||
lastMoveTimeRef.current = Date.now()
|
||||
const now = Date.now()
|
||||
lastMoveTimeRef.current = now
|
||||
lastMovePositionRef.current = { x: e.clientX, y: e.clientY }
|
||||
lastLogTimeRef.current = now
|
||||
|
||||
console.log('[Shadow] Drag started, speed reset to 0')
|
||||
}
|
||||
@@ -150,11 +153,13 @@ function DraggableCard({ card }: DraggableCardProps) {
|
||||
|
||||
setDragSpeed(scaledSpeed)
|
||||
|
||||
// Log occasionally (every ~100ms) to avoid console spam
|
||||
if (timeDelta > 100) {
|
||||
// Log occasionally (every ~200ms) to avoid console spam
|
||||
const timeSinceLastLog = now - lastLogTimeRef.current
|
||||
if (timeSinceLastLog > 200) {
|
||||
console.log(
|
||||
`[Shadow] Speed: ${scaledSpeed.toFixed(1)}, distance: ${distance.toFixed(0)}px, time: ${timeDelta}ms`
|
||||
`[Shadow] Speed: ${scaledSpeed.toFixed(1)}, distance: ${distance.toFixed(0)}px, timeDelta: ${timeDelta}ms`
|
||||
)
|
||||
lastLogTimeRef.current = now
|
||||
}
|
||||
|
||||
lastMoveTimeRef.current = now
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "soroban-monorepo",
|
||||
"version": "4.62.0",
|
||||
"version": "4.62.1",
|
||||
"private": true,
|
||||
"description": "Beautiful Soroban Flashcard Generator - Monorepo",
|
||||
"workspaces": [
|
||||
|
||||
Reference in New Issue
Block a user