diff --git a/src/entities/spot/sim-stream-types.ts b/src/entities/spot/sim-stream-types.ts index c53c016..ea46052 100644 --- a/src/entities/spot/sim-stream-types.ts +++ b/src/entities/spot/sim-stream-types.ts @@ -24,6 +24,11 @@ export type SimMapAnchor = { category?: string; confidence?: number; match_reason?: string; + /** Actual/public POI anchor metadata when provided by contextBuilder. */ + poi_id?: string; + poi_name?: string; + poi_category?: string; + address?: string | null; }; export type SimHotspotSignal = { diff --git a/src/features/simulation/model/use-sim-run.ts b/src/features/simulation/model/use-sim-run.ts index 0afac9c..2f00882 100644 --- a/src/features/simulation/model/use-sim-run.ts +++ b/src/features/simulation/model/use-sim-run.ts @@ -107,9 +107,16 @@ function loopPeriodTicks(manifest: SimManifest): number { } function dataWindowTicks(manifest: SimManifest): number { + const loopPeriod = loopPeriodTicks(manifest); + const declaredMaxProjected = manifest.max_projected_tick; + const tailMaxProjected = + manifest.projection_tail_ticks != null + ? loopPeriod + manifest.projection_tail_ticks - 1 + : null; return Math.max( manifest.total_ticks, - (manifest.max_projected_tick ?? manifest.total_ticks - 1) + 1, + (declaredMaxProjected ?? manifest.total_ticks - 1) + 1, + tailMaxProjected != null ? tailMaxProjected + 1 : 0, ); }