Skip to content

Commit

Permalink
[ui] Bugfix: Debug tracks not auto-pinning.
Browse files Browse the repository at this point in the history
Bug: 306378462
Change-Id: I94d687ac5d69fcf54c93d51ebda1fa13ed31b671
  • Loading branch information
stevegolton committed Oct 19, 2023
1 parent d568b37 commit 39cd110
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
26 changes: 16 additions & 10 deletions ui/src/tracks/debug/counter_track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

import m from 'mithril';
import {v4 as uuidv4} from 'uuid';

import {Actions, DEBUG_COUNTER_TRACK_KIND} from '../../common/actions';
import {EngineProxy} from '../../common/engine';
Expand Down Expand Up @@ -103,14 +104,19 @@ export async function addDebugCounterTrack(
from data
order by ts;`);

globals.dispatch(Actions.addTrack({
uri: DEBUG_COUNTER_TRACK_URI,
name: trackName.trim() || `Debug Track ${debugTrackId}`,
trackSortKey: PrimaryTrackSortKey.DEBUG_TRACK,
trackGroup: SCROLLING_TRACK_GROUP,
initialState: {
sqlTableName,
columns,
},
}));
const trackInstanceId = uuidv4();
globals.dispatchMultiple([
Actions.addTrack({
id: trackInstanceId,
uri: DEBUG_COUNTER_TRACK_URI,
name: trackName.trim() || `Debug Track ${debugTrackId}`,
trackSortKey: PrimaryTrackSortKey.DEBUG_TRACK,
trackGroup: SCROLLING_TRACK_GROUP,
initialState: {
sqlTableName,
columns,
},
}),
Actions.toggleTrackPinned({trackId: trackInstanceId}),
]);
}
26 changes: 16 additions & 10 deletions ui/src/tracks/debug/slice_track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

import m from 'mithril';
import {v4 as uuidv4} from 'uuid';

import {Disposable} from '../../base/disposable';
import {Actions, DEBUG_SLICE_TRACK_KIND} from '../../common/actions';
Expand Down Expand Up @@ -145,14 +146,19 @@ export async function addDebugSliceTrack(
from prepared_data
order by ts;`);

globals.dispatch(Actions.addTrack({
uri: DEBUG_SLICE_TRACK_URI,
name: trackName.trim() || `Debug Track ${debugTrackId}`,
trackSortKey: PrimaryTrackSortKey.DEBUG_TRACK,
trackGroup: SCROLLING_TRACK_GROUP,
initialState: {
sqlTableName,
columns: sliceColumns,
},
}));
const trackInstanceId = uuidv4();
globals.dispatchMultiple([
Actions.addTrack({
id: trackInstanceId,
uri: DEBUG_SLICE_TRACK_URI,
name: trackName.trim() || `Debug Track ${debugTrackId}`,
trackSortKey: PrimaryTrackSortKey.DEBUG_TRACK,
trackGroup: SCROLLING_TRACK_GROUP,
initialState: {
sqlTableName,
columns: sliceColumns,
},
}),
Actions.toggleTrackPinned({trackId: trackInstanceId}),
]);
}

0 comments on commit 39cd110

Please sign in to comment.