Skip to content

fix(dashboard): getTimeRange returns full data extent under an active TimeWindow#284

Merged
HanSur94 merged 1 commit into
mainfrom
fix/timewindow-getrange-full-extent
Jun 28, 2026
Merged

fix(dashboard): getTimeRange returns full data extent under an active TimeWindow#284
HanSur94 merged 1 commit into
mainfrom
fix/timewindow-getrange-full-extent

Conversation

@HanSur94

Copy link
Copy Markdown
Owner

Problem

FastSenseWidget.getTimeRange() returns the cached data extent used by the navigator / preview, which is documented to be independent of the per-widget TimeWindow_. It was instead returning the window end as tMax.

TestDashboardTimeWindow/testPreviewStillFull catches this and is currently failing on main (e.g. scheduled run, getTimeRange tMax=739256 should reflect full extent end ~739261 — 739256 is exactly the window end t0+4).

Root cause

updateTimeRangeCache()'s fast path (added in 260610-ov3) trusts the already-pulled x as the full extent to avoid a second getXY(). But when a TimeWindow_ is set, callers pass the windowed pull (pullData_Tag.getXYRange), so CachedXMax became the window end. (CachedXMin is sticky, so 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(). One line + comment; no extra work in the common windowless case, one O(1) Tag.getTimeRange() when windowed.

Verification (fresh MATLAB process, restoredefaultpath)

  • Direct repro now returns the full extent (tMax = t0+9).
  • tests/test_dashboard_time_window.m: 8/8 (the previously-failing testPreviewStillFull passes).
  • Regression across FastSenseWidget / preview / dashboard-engine / serializer suites: 95/96 — the single failure is the pre-existing headless TestDashboardEngine/testTimerContinuesAfterError (unrelated; "Filtered by assumption" in CI).

Found while triaging CI on #214; kept as a separate, independent fix.

🤖 Generated with Claude Code

… TimeWindow

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>
@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@HanSur94
HanSur94 merged commit d606dd5 into main Jun 28, 2026
20 checks passed
@HanSur94
HanSur94 deleted the fix/timewindow-getrange-full-extent branch June 28, 2026 20:04
HanSur94 added a commit that referenced this pull request Jun 29, 2026
…nge/TimeWindow fix so CI picks up the Dashboard fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant