From 594e291207947173b0d1631df522450248ab4c4f Mon Sep 17 00:00:00 2001 From: Riley Jones Date: Wed, 30 Aug 2023 22:08:46 +0000 Subject: [PATCH] add missing type --- tensorboard/webapp/metrics/store/metrics_reducers.ts | 10 ++++++++++ tensorboard/webapp/metrics/store/metrics_types.ts | 9 +++++++++ tensorboard/webapp/metrics/testing.ts | 10 ++++++++++ 3 files changed, 29 insertions(+) diff --git a/tensorboard/webapp/metrics/store/metrics_reducers.ts b/tensorboard/webapp/metrics/store/metrics_reducers.ts index 07e1177d77..57b77cacb1 100644 --- a/tensorboard/webapp/metrics/store/metrics_reducers.ts +++ b/tensorboard/webapp/metrics/store/metrics_reducers.ts @@ -453,6 +453,16 @@ const {initialState, reducers: namespaceContextedReducer} = settings: METRICS_SETTINGS_DEFAULT, settingOverrides: {}, visibleCardMap: new Map(), + previousCardInteractions: { + tagFilters: [], + pins: [], + clicks: [], + }, + newCardInteractions: { + tagFilters: [], + pins: [], + clicks: [], + }, }, /** onNavigated */ diff --git a/tensorboard/webapp/metrics/store/metrics_types.ts b/tensorboard/webapp/metrics/store/metrics_types.ts index b3364cc196..c89368db7b 100644 --- a/tensorboard/webapp/metrics/store/metrics_types.ts +++ b/tensorboard/webapp/metrics/store/metrics_types.ts @@ -27,6 +27,7 @@ import { } from '../data_source'; import { CardId, + CardIdWithMetadata, CardMetadata, CardUniqueInfo, HistogramMode, @@ -166,6 +167,12 @@ export type CardStepIndexMap = Record< CardStepIndexMetaData | null >; +export type CardInteractions = { + tagFilters: string[]; + pins: CardIdWithMetadata[]; + clicks: CardIdWithMetadata[]; +}; + export type CardToPinnedCard = Map; export type PinnedCardToCard = Map; @@ -254,6 +261,8 @@ export interface MetricsNonNamespacedState { * Map from ElementId to CardId. Only contains all visible cards. */ visibleCardMap: Map; + previousCardInteractions: CardInteractions; + newCardInteractions: CardInteractions; } export type MetricsState = NamespaceContextedState< diff --git a/tensorboard/webapp/metrics/testing.ts b/tensorboard/webapp/metrics/testing.ts index fbb8a94f76..42d4d5be70 100644 --- a/tensorboard/webapp/metrics/testing.ts +++ b/tensorboard/webapp/metrics/testing.ts @@ -112,6 +112,16 @@ function buildBlankState(): MetricsState { isSettingsPaneOpen: false, isSlideoutMenuOpen: false, tableEditorSelectedTab: DataTableMode.SINGLE, + previousCardInteractions: { + tagFilters: [], + pins: [], + clicks: [], + }, + newCardInteractions: { + tagFilters: [], + pins: [], + clicks: [], + }, }; }