@@ -5,6 +5,7 @@ import { coldStore } from "../lib/ColdStore";
55import type { ReplayFrame , ReplayPlotLayout } from "../types/replay" ;
66import { parseReplayFile , REPLAY_FRAME_HARD_CAP } from "../utils/replayParser" ;
77import { serializePecanV2 } from "../utils/pecanSerializer" ;
8+ import { getActiveDbcText , usingCachedDBC } from "../utils/canProcessor" ;
89import ReplayImportClipModal from "./ReplayImportClipModal" ;
910
1011interface TimelineBarProps {
@@ -142,6 +143,7 @@ function TimelineBar({ plotLayouts = [] }: TimelineBarProps) {
142143 fileName : string ;
143144 timelineMeta ?: Parameters < typeof loadReplayFrames > [ 2 ] ;
144145 plotsMeta ?: Parameters < typeof loadReplayFrames > [ 3 ] ;
146+ decodeMeta ?: Parameters < typeof loadReplayFrames > [ 4 ] ;
145147 } | null > ( null ) ;
146148 const replayFileInputRef = useRef < HTMLInputElement | null > ( null ) ;
147149 const showColdStoreSupportHint = source === "live" && ! dataStore . isColdStoreSupported ( ) ;
@@ -334,9 +336,15 @@ function TimelineBar({ plotLayouts = [] }: TimelineBarProps) {
334336 ) ;
335337 }
336338
339+ const dbcText = getActiveDbcText ( ) ;
340+ const selectedFile = localStorage . getItem ( 'dbc-selected-file' ) ?? undefined ;
337341 const blob = new Blob ( [ serializePecanV2 ( {
338342 frames,
339343 epochBaseMs,
344+ decode : usingCachedDBC ( ) ? {
345+ dbcName : selectedFile ,
346+ dbcEmbedded : { format : "dbc" , encoding : "utf-8" , content : dbcText } ,
347+ } : undefined ,
340348 timeline : {
341349 windowMs,
342350 lastCursorMs : Math . max ( 0 , sliderValue - rangeStart ) ,
@@ -383,13 +391,15 @@ function TimelineBar({ plotLayouts = [] }: TimelineBarProps) {
383391 fileName : file . name ,
384392 timelineMeta : parseResult . sessionMeta ?. timeline ,
385393 plotsMeta : parseResult . sessionMeta ?. plots ,
394+ decodeMeta : parseResult . sessionMeta ?. decode ,
386395 } ) ;
387396 } else {
388397 await loadReplayFrames (
389398 parseResult . frames ,
390399 file . name ,
391400 parseResult . sessionMeta ?. timeline ,
392- parseResult . sessionMeta ?. plots
401+ parseResult . sessionMeta ?. plots ,
402+ parseResult . sessionMeta ?. decode
393403 ) ;
394404 }
395405
@@ -480,7 +490,8 @@ function TimelineBar({ plotLayouts = [] }: TimelineBarProps) {
480490 framesToLoad ,
481491 pendingClipImport . fileName ,
482492 pendingClipImport . timelineMeta ,
483- pendingClipImport . plotsMeta
493+ pendingClipImport . plotsMeta ,
494+ pendingClipImport . decodeMeta
484495 ) ;
485496 setPendingClipImport ( null ) ;
486497 } }
0 commit comments