From fd59e2067b64e72a34390f7768bf5b253f089fa4 Mon Sep 17 00:00:00 2001 From: Alexander Bentkamp Date: Wed, 21 Dec 2022 12:37:50 +0100 Subject: [PATCH 1/2] loading icon for goals --- client/src/components/Level.tsx | 2 +- client/src/components/TacticState.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/components/Level.tsx b/client/src/components/Level.tsx index f33c2ed..bc7a5a9 100644 --- a/client/src/components/Level.tsx +++ b/client/src/components/Level.tsx @@ -173,7 +173,7 @@ function Level() { - + diff --git a/client/src/components/TacticState.tsx b/client/src/components/TacticState.tsx index d7c4488..54bd39c 100644 --- a/client/src/components/TacticState.tsx +++ b/client/src/components/TacticState.tsx @@ -6,7 +6,7 @@ import '@fontsource/roboto/700.css'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; -import { Paper, Box, Typography, Alert, FormControlLabel, FormGroup, Switch, Collapse } from '@mui/material'; +import { Paper, Box, Typography, Alert, FormControlLabel, FormGroup, Switch, Collapse, CircularProgress } from '@mui/material'; import { Accordion, AccordionSummary, AccordionDetails, Divider } from '@mui/material'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; @@ -97,6 +97,7 @@ function OtherGoal({ goal }) { } function TacticState({ goals, diagnostics, completed, globalDiagnostics }) { + const isLoading = goals === null const hasGoal = goals !== null && goals.length > 0 const hasManyGoal = hasGoal && goals.length > 1 @@ -116,7 +117,8 @@ function TacticState({ goals, diagnostics, completed, globalDiagnostics }) { } - {!(hasGoal || completed) && + {isLoading && } + {!(hasGoal || completed || isLoading) && No goals (at ) From 306c76e500c4893fe658def304ba724397568c8e Mon Sep 17 00:00:00 2001 From: Alexander Bentkamp Date: Wed, 21 Dec 2022 12:42:08 +0100 Subject: [PATCH 2/2] jump to end position when loading a level --- client/src/components/Level.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/components/Level.tsx b/client/src/components/Level.tsx index bc7a5a9..37525e0 100644 --- a/client/src/components/Level.tsx +++ b/client/src/components/Level.tsx @@ -230,6 +230,7 @@ console.log() model.onDidChangeContent(() => onDidChangeContent(model.getValue())) } editor.setModel(model) + editor.setPosition(model.getFullModelRange().getEndPosition()) const taskGutter = new LeanTaskGutter(infoProvider.client, editor) const abbrevRewriter = new AbbreviationRewriter(new AbbreviationProvider(), model, editor)