diff --git a/dashboard/js/sidebar-timeline.js b/dashboard/js/sidebar-timeline.js index 60862b0..73fdea9 100644 --- a/dashboard/js/sidebar-timeline.js +++ b/dashboard/js/sidebar-timeline.js @@ -150,7 +150,6 @@ total: 0, loading: false, panelVisible: false, - dashboardMode: 'expert', selectedEventId: null, // ID of the currently selected (jumped-to) event // Virtualization state virtualization: { @@ -227,14 +226,6 @@ // ============================================ function onRouterModeChange(newMode, oldMode) { - // Expert modes support time-travel replay - var expertModes = ['live', 'timeline', 'replay', 'simulate']; - if (expertModes.indexOf(newMode) === -1) { - state.dashboardMode = 'simple'; - } else { - state.dashboardMode = 'expert'; - } - // Reload events if panel is visible if (state.panelVisible) { loadInitialEvents(); @@ -278,7 +269,6 @@ function loadInitialEvents() { const params = new URLSearchParams(); params.set('limit', CONFIG.initialLoadLimit); - params.set('mode', state.dashboardMode); fetch('/api/events?' + params.toString()) .then(function(res) { @@ -703,8 +693,8 @@ eventEl.classList.add('selected'); } - // In expert mode, use jump-to-time replay - if (state.dashboardMode === 'expert' && window.SpaxelReplay) { + // Jump-to-time replay + if (window.SpaxelReplay) { SpaxelReplay.jumpToTime(timestamp).then(function() { updateNowReplayingChip(true, timestamp); @@ -719,7 +709,6 @@ } }); } else if (window.SpaxelRouter) { - // In simple mode, navigate to timeline view instead of replay SpaxelRouter.navigate('timeline'); } } diff --git a/dashboard/js/sidebar-timeline.test.js b/dashboard/js/sidebar-timeline.test.js index 282aeff..3b98f08 100644 --- a/dashboard/js/sidebar-timeline.test.js +++ b/dashboard/js/sidebar-timeline.test.js @@ -1176,25 +1176,21 @@ describe('SidebarTimeline', function() { }); }); - test('non-replay mode navigates to timeline view instead of replay', function() { + test('without SpaxelReplay navigates to timeline view', function() { + // Remove SpaxelReplay to simulate it not being available + delete window.SpaxelReplay; + // Show panel and load events SidebarTimeline.show(); SidebarTimeline.refresh(); return new Promise(function(resolve) { setTimeout(function() { - // Trigger ambient mode via the router callback that sidebar-timeline registered during init - var routerCalls = global.SpaxelRouter.onModeChange.mock.calls; - expect(routerCalls.length).toBeGreaterThan(0); - var routerCallback = routerCalls[0][0]; - expect(typeof routerCallback).toBe('function'); - routerCallback('ambient'); - var eventEl = mockElements.eventsContainer.querySelector('[data-id="100"]'); expect(eventEl).toBeTruthy(); eventEl.click(); - // In ambient mode, should navigate via router, not call jumpToTime + // Without SpaxelReplay, should navigate via router expect(global.SpaxelRouter.navigate).toHaveBeenCalledWith('timeline'); resolve(); }, 150);