diff --git a/client/src/components/infoview/info.tsx b/client/src/components/infoview/info.tsx index ead03f5..d77ae8a 100644 --- a/client/src/components/infoview/info.tsx +++ b/client/src/components/infoview/info.tsx @@ -17,6 +17,7 @@ import { goalsToString, Goal, MainAssumptions, OtherGoals } from './goals' import { InteractiveTermGoal, InteractiveGoalsWithHints, InteractiveGoals, ProofState } from './rpc_api' import { MonacoEditorContext, ProofStateProps, InfoStatus, ProofContext } from '../../state/context' import { useTranslation } from 'react-i18next' +import { GoalsTabs } from './main' // TODO: All about pinning could probably be removed type InfoKind = 'cursor' | 'pin' @@ -123,37 +124,39 @@ const InfoDisplayContent = React.memo((props: InfoDisplayContentProps) => { Error updating:{' '}{error}. { e.preventDefault(); void triggerUpdate() }}>{' '}Try again. } + {/* TODO: Move error messages to Chat instead */}
+ { goals && goals.goals.length > 0 && <> - - + ({goal: goal, hints: []}))} last={false} onClick={() => {}} onGoalChange={() => {}}/> + {/* + */} }
-
+ {/*
{ goals && (goals.goals.length > 0 ? :
{t("No Goals")}
)} -
+
*/}
- {userWidgets.map(widget => + {/* {userWidgets.map(widget =>
{widget.name}
- )} - {nothingToShow && ( + )} */} + {/* {nothingToShow && ( isPaused ? - /* Adding {' '} to manage string literals properly: https://reactjs.org/docs/jsx-in-depth.html#string-literals-1 */ + /* Adding {' '} to manage string literals properly: https://reactjs.org/docs/jsx-in-depth.html#string-literals-1 * / Updating is paused.{' '} { e.preventDefault(); void triggerUpdate() }}>Refresh {' '}or { e.preventDefault(); setPaused(false) }}>resume updating {' '}to see information. : - <>
{t("Loading goal…")}
)} - + <>
{t("Loading goal…")}
)} */} {/* {goals && goals.goals.length > 1 &&
Weitere Goals
diff --git a/client/src/components/infoview/main.tsx b/client/src/components/infoview/main.tsx index c8a9363..9a21fab 100644 --- a/client/src/components/infoview/main.tsx +++ b/client/src/components/infoview/main.tsx @@ -29,7 +29,7 @@ import { ChatContext, PageContext, PreferencesContext, MonacoEditorContext, Proo import { Typewriter, getInteractiveDiagsAt, hasErrors, hasInteractiveErrors } from './typewriter'; import { InteractiveDiagnostic } from '@leanprover/infoview/*'; import { CircularProgress } from '@mui/material'; -import { GameHint, InteractiveGoalsWithHints, ProofState } from './rpc_api'; +import { GameHint, InteractiveGoalWithHints, InteractiveGoalsWithHints, ProofState } from './rpc_api'; import { store } from '../../state/store'; import { DocumentPosition } from '../../../../node_modules/lean4-infoview/src/infoview/util'; import { DiagnosticSeverity } from 'vscode-languageclient'; @@ -340,17 +340,17 @@ function Command({ proof, i, deleteProof }: { proof: ProofState, i: number, dele // }, fastIsEqual) /** The tabs of goals that lean has after the command of this step has been processed */ -function GoalsTabs({ proofStep, last, onClick, onGoalChange=(n)=>{}}: { proofStep: InteractiveGoalsWithHints, last : boolean, onClick? : any, onGoalChange?: (n?: number) => void }) { +export function GoalsTabs({ goals, last, onClick, onGoalChange=(n)=>{}}: { goals: InteractiveGoalWithHints[], last : boolean, onClick? : any, onGoalChange?: (n?: number) => void }) { let { t } = useTranslation() const [selectedGoal, setSelectedGoal] = React.useState(0) - if (proofStep.goals.length == 0) { + if (goals.length == 0) { return <> } return
- {proofStep.goals.map((goal, i) => ( + {goals.map((goal, i) => ( // TODO: Should not use index as key.
{ onGoalChange(i); setSelectedGoal(i); ev.stopPropagation() }}> {i ? t("Goal") + ` ${i + 1}` : t("Active Goal")} @@ -358,7 +358,7 @@ function GoalsTabs({ proofStep, last, onClick, onGoalChange=(n)=>{}}: { proofSte ))}
- +
} @@ -570,7 +570,7 @@ export function TypewriterInterface({props}) { } {/* setDisableInput(n > 0) : (n) => {}}/> */} {!(isLastStepWithErrors(proof, i)) && - setDisableInput(n > 0) : (n) => {}}/> + setDisableInput(n > 0) : (n) => {}}/> } {mobile && i == proof?.steps.length - 1 && diff --git a/client/src/css/infoview.css b/client/src/css/infoview.css index 62811c0..dc1a5ec 100644 --- a/client/src/css/infoview.css +++ b/client/src/css/infoview.css @@ -91,8 +91,8 @@ flex-direction: row; } -.goals-section div { - flex-grow: 1; +.goal-tabs { + width: 100%; } #current-proof, #main-assumptions {