diff --git a/optuna_dashboard/static/components/Note.tsx b/optuna_dashboard/static/components/Note.tsx index 24b7bf7c..0ba538b7 100644 --- a/optuna_dashboard/static/components/Note.tsx +++ b/optuna_dashboard/static/components/Note.tsx @@ -1,4 +1,12 @@ -import { Box, Button, TextField, Typography, useTheme } from "@mui/material" +import { + Box, + Button, + Card, + CardContent, + TextField, + Typography, + useTheme, +} from "@mui/material" import React, { FC, createRef, useState, useEffect } from "react" import LoadingButton from "@mui/lab/LoadingButton" import SaveIcon from "@mui/icons-material/Save" @@ -46,56 +54,63 @@ export const Note: FC<{ } return ( - <> - { - const cur = textAreaRef.current ? textAreaRef.current.value : "" - setDisable(cur === curNote.body) - }} - /> - - {notLatest && !saving && ( - <> - - The text you are editing has updated. Do you want to discard your - changes and refresh the textarea? - - - - )} - - } - variant="contained" - disabled={disable} + + + + Note + + { + const cur = textAreaRef.current ? textAreaRef.current.value : "" + setDisable(cur === curNote.body) + }} + /> + - Save - - - + {notLatest && !saving && ( + <> + + The text you are editing has updated. Do you want to discard + your changes and refresh the textarea? + + + + )} + + } + variant="contained" + disabled={disable} + > + Save + + + + ) } diff --git a/optuna_dashboard/static/components/StudyDetail.tsx b/optuna_dashboard/static/components/StudyDetail.tsx index 1373e5ed..a18e22df 100644 --- a/optuna_dashboard/static/components/StudyDetail.tsx +++ b/optuna_dashboard/static/components/StudyDetail.tsx @@ -59,9 +59,10 @@ interface Preference { graphParetoFrontChecked: boolean graphParallelCoordinateChecked: boolean graphIntermediateValuesChecked: boolean - edfChecked: boolean + graphEdfChecked: boolean graphHyperparameterImportancesChecked: boolean graphSliceChecked: boolean + noteEditorChecked: boolean reloadInterval: number } @@ -79,9 +80,10 @@ export const StudyDetail: FC<{ graphParetoFrontChecked: true, graphParallelCoordinateChecked: true, graphIntermediateValuesChecked: true, - edfChecked: true, + graphEdfChecked: true, graphHyperparameterImportancesChecked: true, graphSliceChecked: true, + noteEditorChecked: true, reloadInterval: 10, }) useEffect(() => { @@ -102,7 +104,7 @@ export const StudyDetail: FC<{ const handleClose = () => { setPrefOpen(false) } - const handleChartShownChange = ( + const handlePreferenceOnChange = ( event: React.ChangeEvent ) => { setPreferences({ @@ -160,7 +162,7 @@ export const StudyDetail: FC<{ control={ } @@ -173,7 +175,7 @@ export const StudyDetail: FC<{ control={ } @@ -183,7 +185,7 @@ export const StudyDetail: FC<{ control={ } @@ -198,7 +200,7 @@ export const StudyDetail: FC<{ control={ } @@ -207,8 +209,8 @@ export const StudyDetail: FC<{ } @@ -218,7 +220,7 @@ export const StudyDetail: FC<{ control={ } @@ -228,12 +230,23 @@ export const StudyDetail: FC<{ control={ } label="Slice" /> + Editor + + } + label="NoteEditor" + /> @@ -355,7 +368,7 @@ export const StudyDetail: FC<{ ) : null} - {preferences.edfChecked ? ( + {preferences.graphEdfChecked ? ( @@ -383,19 +396,9 @@ export const StudyDetail: FC<{ - - - - Note - - {studyDetail !== null && ( - - )} - - + {studyDetail !== null && preferences.noteEditorChecked ? ( + + ) : null}