From 7510b83591b3468fa7bad976d4831c356f291c84 Mon Sep 17 00:00:00 2001 From: Alexander Bentkamp Date: Tue, 7 Feb 2023 16:03:04 +0100 Subject: [PATCH] hide command line in "other goals" Fixes #30 --- client/src/components/infoview/goals.tsx | 7 ++++--- client/src/components/infoview/info.tsx | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/components/infoview/goals.tsx b/client/src/components/infoview/goals.tsx index 0ee317f..6393c0c 100644 --- a/client/src/components/infoview/goals.tsx +++ b/client/src/components/infoview/goals.tsx @@ -118,13 +118,14 @@ interface GoalProps { goal: InteractiveGoal filter: GoalFilterState showHints?: boolean + commandLine: boolean } /** * Displays the hypotheses, target type and optional case label of a goal according to the * provided `filter`. */ export const Goal = React.memo((props: GoalProps) => { - const { goal, filter, showHints } = props + const { goal, filter, showHints, commandLine } = props const filteredList = getFilteredHypotheses(goal.hyps, filter); const hyps = filter.reverse ? filteredList.slice().reverse() : filteredList; @@ -159,7 +160,7 @@ export const Goal = React.memo((props: GoalProps) => { { assumptionHyps.length > 0 &&
Assumptions:
{assumptionHyps.map((h, i) => )}
} - {commandLineMode && } + {commandLine && commandLineMode && } {!filter.reverse && goalLi} {showHints && hints} @@ -175,7 +176,7 @@ export function Goals({ goals, filter }: GoalsProps) { return <>No goals } else { return <> - {goals.goals.map((g, i) => )} + {goals.goals.map((g, i) => )} } } diff --git a/client/src/components/infoview/info.tsx b/client/src/components/infoview/info.tsx index dfe66a9..3958b5f 100644 --- a/client/src/components/infoview/info.tsx +++ b/client/src/components/infoview/info.tsx @@ -16,6 +16,7 @@ import { PanelWidgetDisplay } from '../../../../node_modules/lean4-infoview/src/ import { RpcContext, useRpcSessionAtPos } from '../../../../node_modules/lean4-infoview/src/infoview/rpcSessions'; import { GoalsLocation, Locations, LocationsContext } from '../../../../node_modules/lean4-infoview/src/infoview/goalLocation'; import { InteractiveCode } from '../../../../node_modules/lean4-infoview/src/infoview/interactiveCode' +import { Troubleshoot } from '@mui/icons-material'; type InfoStatus = 'updating' | 'error' | 'ready'; type InfoKind = 'cursor' | 'pin'; @@ -123,7 +124,7 @@ const InfoDisplayContent = React.memo((props: InfoDisplayContentProps) => {
{ goals && goals.goals.length > 0 ? <>
Main Goal
- + :
No Goals
}
@@ -149,7 +150,7 @@ const InfoDisplayContent = React.memo((props: InfoDisplayContentProps) => {
Other Goals
{goals.goals.slice(1).map((goal, i) => -
)} +
)} }