Skip to content

Commit d606dd5

Browse files
HanSur94claude
andauthored
fix(dashboard): getTimeRange returns full data extent under an active TimeWindow (#284)
FastSenseWidget.getTimeRange() reports the cached data extent for the navigator/preview, which must be independent of the per-widget TimeWindow_. But updateTimeRangeCache()'s fast path trusted the already-pulled x as the full extent — and when a TimeWindow_ is set, callers pass the WINDOWED pull (pullData_ -> Tag.getXYRange). That set CachedXMax to the window end, so getTimeRange() returned [fullStart, windowEnd] (CachedXMin is sticky, which is why only the max was wrong). Fix: only take the passed-x fast path when TimeWindow_ is empty; with a window active, fall through to the Tag's own (full) getTimeRange()/getXY(). No extra work in the common windowless case; one O(1) Tag.getTimeRange() when windowed. Regression guard: existing tests/test_dashboard_time_window.m testPreviewStillFull (was failing on main). Verified fresh-process: repro fixed (tMax full extent), test_dashboard_time_window 8/8, and 95/96 across FastSenseWidget/preview/dashboard suites (the 1 is the pre-existing headless TestDashboardEngine/testTimerContinuesAfterError, unrelated). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9fdc13d commit d606dd5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

libs/Dashboard/FastSenseWidget.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1775,8 +1775,14 @@ function updateTimeRangeCache(obj, x)
17751775
% no second arg and get the existing pull behavior unchanged.
17761776
if ~isempty(obj.Tag)
17771777
try
1778-
if nargin >= 2 && ~isempty(x)
1778+
if nargin >= 2 && ~isempty(x) && isempty(obj.TimeWindow_)
17791779
% Use the already-pulled x — avoids a redundant getXY().
1780+
% Only trust it as the full extent when no TimeWindow_
1781+
% is active: with a window set, callers pass the WINDOWED
1782+
% pull (pullData_ -> getXYRange), which must not poison
1783+
% the full-extent cache that getTimeRange() reports for
1784+
% the navigator/preview. When windowed, fall through to
1785+
% the Tag's own (full) range below.
17801786
n = numel(x);
17811787
tMin = x(1);
17821788
tMax = x(n);

0 commit comments

Comments
 (0)