Devlog 46: UI Fine-tuning & Timing Logic Optimization
Lap Calculations
-Replaced laps.forEach with for (let j = 0; j <= i; j++) to ensure cumulative total times (totalMS) strictly correspond to the current lap index.
Layout
- Enhanced
formatTime()rendering logic by applying inline styleswidth,transform: scaleX(0.8),text-align: centerto dynamicspanelements, preventing font-width shifting during rapid ticker updates.
Dynamic Rendering
- Integrated
updateListedStopwatch()into the global interval loop, enabling sidebar preview labels to tick synchronously with active main cards. - Optimized state updates to target individual time elements instead of triggering full list re-renders on every ticker frame.
- Added optional chaining
laps?.[0]?.startTimeacross rendering pipelines to prevent runtime exceptions when initializing empty stopwatches.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.