Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goal position #695

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/goal-view-ui/src/components/atoms/Separator.module.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.Separator {
width: 90%;
width: 100%;
height: 1px;
margin-top: 6px;
margin-bottom: 3px;
border-color: var(--vscode-coq-hypothesesSeparator);
border-top-color: var(--vscode-coq-hypothesesSeparator);
border-top: 1px solid;
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import React, {FunctionComponent} from 'react';
import {VSCodeButton} from '@vscode/webview-ui-toolkit/react';
import {VscChevronDown} from 'react-icons/vsc';

import GoalBlock from './GoalBlock';
import Accordion from '../atoms/Accordion';

import classes from './GoalBlock.module.css';
import { CollapsibleGoal } from '../../types';

type CollapsibleGoalBlockProps = {
goal: CollapsibleGoal
collapseHandler: (id: string) => void,
goalIndex: number
goalIndicator: string
};

const collapsibleGoalBlock: FunctionComponent<CollapsibleGoalBlockProps> = (props) => {

const {goal, goalIndex, collapseHandler} = props;
const {goal, goalIndex, goalIndicator, collapseHandler} = props;

return (
<Accordion title={"Goal " + goalIndex} collapsed={!goal.isOpen} collapseHandler={() => collapseHandler(goal.id)}>
<GoalBlock goal={goal} />
<GoalBlock goal={goal} goalIndicator={goalIndicator} />
</Accordion>
);

Expand Down
13 changes: 13 additions & 0 deletions client/goal-view-ui/src/components/molecules/GoalBlock.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
width: 100%;
}

.SeparatorZone {
width: 100%;
display: flex;
flex-direction: row;
}

.GoalIndex {
color: var(--vscode-coq-goalId);
margin-right: 6px;
text-wrap: nowrap;
font-size: x-small;
}

.Header {
display: flex;
flex-direction: row;
Expand Down
5 changes: 4 additions & 1 deletion client/goal-view-ui/src/components/molecules/GoalBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ import { Goal } from '../../types';

type GoalBlockProps = {
goal: Goal
goalIndicator?: string
};

const goalBlock: FunctionComponent<GoalBlockProps> = (props) => {

const {goal} = props;
const {goal, goalIndicator} = props;
const indicator = goalIndicator ? <span className={classes.GoalIndex} >({goalIndicator})</span> : null;

return (
<div className={classes.Block}>
<HypothesesBlock hypotheses={goal.hypotheses}/>
<div className={classes.SeparatorZone}> {indicator} <Separator /> </div>
<GoalComponent goal={goal.goal}/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.Block {
border-bottom: 2pt solid;
/* border-bottom: 2pt solid; */
padding: 0pt;
padding-bottom: 1em;
margin: 0;
border-bottom-color: var(--vscode-coq-hypothesesSeparator);
/* border-bottom-color: var(--vscode-coq-hypothesesSeparator); */
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const goalSection: FunctionComponent<GoalSectionProps> = (props) => {
const scrollToBottomOfFirstGoal = () => {
if(firstGoalRef.current) {
firstGoalRef.current.scrollIntoView({
behavior: "smooth",
// behavior: "smooth",
block: "end",
inline: "nearest"
});
Expand All @@ -34,14 +34,14 @@ const goalSection: FunctionComponent<GoalSectionProps> = (props) => {
if(index === 0) {
return (
<>
<CollapsibleGoalBlock goal={goal} goalIndex={index + 1} collapseHandler={collapseGoalHandler}/>
<CollapsibleGoalBlock goal={goal} goalIndex={index + 1} goalIndicator={index + 1 + " / " + goals.length} collapseHandler={collapseGoalHandler}/>
<div ref={firstGoalRef}/>
</>
);
}

return (
<CollapsibleGoalBlock goal={goal} goalIndex={index + 1} collapseHandler={collapseGoalHandler}/>
<CollapsibleGoalBlock goal={goal} goalIndex={index + 1} goalIndicator={index + 1 + " / " + goals.length} collapseHandler={collapseGoalHandler}/>
);
});

Expand Down
Loading