diff --git a/optuna_dashboard/ts/components/PreferenceHistory.tsx b/optuna_dashboard/ts/components/PreferenceHistory.tsx index 9e19bf07..db4df078 100644 --- a/optuna_dashboard/ts/components/PreferenceHistory.tsx +++ b/optuna_dashboard/ts/components/PreferenceHistory.tsx @@ -142,7 +142,7 @@ const ChoiceTrials: FC<{ trials: Trial[] study_id: number }> = ({ choice, trials, study_id }) => { - const [isRemoved, setRemoved] = useState(choice.isRemoved) + const [isRemoved, setRemoved] = useState(choice.is_removed) const theme = useTheme() const worst_trials = new Set([choice.clicked]) const action = actionCreator() @@ -170,7 +170,7 @@ const ChoiceTrials: FC<{ > {formatDate(choice.timestamp)} - {choice.isRemoved ? ( + {choice.is_removed ? ( { @@ -203,7 +203,7 @@ const ChoiceTrials: FC<{ display: "flex", flexDirection: "row", flexWrap: "wrap", - filter: choice.isRemoved ? "brightness(0.4)" : undefined, + filter: choice.is_removed ? "brightness(0.4)" : undefined, backgroundColor: theme.palette.background.paper, }} > diff --git a/optuna_dashboard/ts/components/PreferentialTrials.tsx b/optuna_dashboard/ts/components/PreferentialTrials.tsx index 7fcb634f..26cc4976 100644 --- a/optuna_dashboard/ts/components/PreferentialTrials.tsx +++ b/optuna_dashboard/ts/components/PreferentialTrials.tsx @@ -196,7 +196,8 @@ export const PreferentialTrials: FC<{ studyDetail: StudyDetail | null }> = ({ const hiddenTrials = new Set( studyDetail.preference_history - ?.map((p) => p.clicked) + ?.filter((h) => !h.is_removed) + .map((p) => p.clicked) .concat(studyDetail.skipped_trials) ?? [] ) const activeTrials = studyDetail.trials.filter( @@ -256,7 +257,7 @@ export const PreferentialTrials: FC<{ studyDetail: StudyDetail | null }> = ({ }) } const latestHistoryId = - studyDetail?.preference_history?.filter((h) => !h.isRemoved).pop()?.id ?? + studyDetail?.preference_history?.filter((h) => !h.is_removed).pop()?.id ?? null if (undoHistoryId !== null && undoHistoryId !== latestHistoryId) { setUndoHistoryId(null)