Skip to content

Commit 07c171b

Browse files
committed
push debug
1 parent 5a3dcd8 commit 07c171b

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

web/src/components/timeline/MotionSegment.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,15 @@ export function MotionSegment({
213213
<div className="flex flex-row justify-center w-[20px] md:w-[40px] mb-[1px]">
214214
<div className="w-[10px] md:w-[20px] flex justify-end">
215215
<div
216+
data-segment-time={
217+
new Date(segmentTime * 1000 + (segmentDuration * 1000) / 2)
218+
}
219+
data-motion-value={getMotionSegmentValue(
220+
segmentTime + segmentDuration / 2,
221+
)}
222+
data-audio-value={getAudioSegmentValue(
223+
segmentTime + segmentDuration / 2,
224+
)}
216225
key={`${segmentKey}_motion_data_1`}
217226
className={`h-[2px] rounded-full bg-motion_review`}
218227
onClick={segmentClick}
@@ -242,6 +251,9 @@ export function MotionSegment({
242251
<div className="flex flex-row justify-center w-[20px] md:w-[40px]">
243252
<div className="w-[10px] md:w-[20px] flex justify-end">
244253
<div
254+
data-segment-time={new Date(segmentTime * 1000)}
255+
data-motion-value={getMotionSegmentValue(segmentTime)}
256+
data-audio-value={getAudioSegmentValue(segmentTime)}
245257
key={`${segmentKey}_motion_data_2`}
246258
className={`h-[2px] rounded-full bg-motion_review`}
247259
onClick={segmentClick}

web/src/pages/UIPlayground.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export type MockMotionData = {
6363
function generateRandomMotionAudioData(): MockMotionData[] {
6464
const now = new Date();
6565
const endTime = now.getTime() / 1000;
66-
const startTime = endTime - 24 * 60 * 60; // 24 hours ago
66+
const startTime = endTime - 0.25 * 60 * 60; // 24 hours ago
6767
const interval = 30; // 30 seconds
6868

6969
const data = [];
@@ -75,14 +75,17 @@ function generateRandomMotionAudioData(): MockMotionData[] {
7575
const endTimestamp = startTimestamp + interval;
7676
const motionValue = Math.floor(Math.random() * 101); // Random number between 0 and 100
7777
const audioValue = Math.random() * -100; // Random negative value between -100 and 0
78+
const foo = new Date(startTimestamp * 1000);
7879
data.push({
7980
start_time: startTimestamp,
8081
end_time: endTimestamp,
8182
motionValue,
8283
audioValue,
84+
foo,
8385
});
8486
}
8587

88+
console.log(data);
8689
return data;
8790
}
8891

@@ -295,7 +298,7 @@ function UIPlayground() {
295298
handlebarTime={handlebarTime} // set the time of the handlebar
296299
setHandlebarTime={setHandlebarTime} // expose handler to set the handlebar time
297300
onHandlebarDraggingChange={handleDraggingChange} // function for state of handlebar dragging
298-
showMinimap // show / hide the minimap
301+
// show / hide the minimap
299302
minimapStartTime={minimapStartTime} // start time of the minimap - the earlier time (eg 1:00pm)
300303
minimapEndTime={minimapEndTime} // end of the minimap - the later time (eg 3:00pm)
301304
events={mockEvents} // events, including new has_been_reviewed and severity properties
@@ -314,7 +317,7 @@ function UIPlayground() {
314317
handlebarTime={handlebarTime} // set the time of the handlebar
315318
setHandlebarTime={setHandlebarTime} // expose handler to set the handlebar time
316319
onHandlebarDraggingChange={handleDraggingChange} // function for state of handlebar dragging
317-
showMinimap // show / hide the minimap
320+
// show / hide the minimap
318321
minimapStartTime={minimapStartTime} // start time of the minimap - the earlier time (eg 1:00pm)
319322
minimapEndTime={minimapEndTime} // end of the minimap - the later time (eg 3:00pm)
320323
events={mockEvents} // events, including new has_been_reviewed and severity properties

0 commit comments

Comments
 (0)