feat(dashboard): tap-to-jump time-travel removes expert mode gating
Timeline event clicks now always trigger jump-to-time replay regardless of dashboard mode, not just in expert mode. Simplified handleSeek to remove the dashboardMode state variable and expert mode check. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
79d8392095
commit
cf934ba2a2
2 changed files with 7 additions and 22 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue