Skip to content

Commit d30ac2e

Browse files
authored
maint: info popup for curation (#911)
* maint: info popup for curation * fix: remove unused imports * fix: failing tests
1 parent d18defd commit d30ac2e

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

compose/neurosynth-frontend/cypress/e2e/workflows/Curation/CurationAIInterface.cy.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ describe('CurationAIInterface', () => {
2626
fixture: 'pipeline-results/ParticipantDemographicsExtraction',
2727
}).as('taskExtraction');
2828

29+
// this is necessary to hide an info popup that appears for the first time in projects for the new curation UI
30+
cy.addToLocalStorage('abc123-hide-info-popup', 'true');
31+
2932
// cy.intercept('GET', `**/api/studysets/*`, { fixture: 'studyset' }).as('studysetFixture');
3033
});
3134

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { Box, Button, Typography } from '@mui/material';
2+
import { useState } from 'react';
3+
import { useParams } from 'react-router-dom';
4+
import BaseDialog from './Dialogs/BaseDialog';
5+
6+
const InfoPopup: React.FC = () => {
7+
const { projectId } = useParams<{ projectId: string | undefined }>();
8+
const localStorageKey = `${projectId}-hide-info-popup`;
9+
const shouldHide = !!localStorage.getItem(localStorageKey);
10+
const [hide, setShouldHide] = useState(shouldHide);
11+
12+
const handleCloseDialog = () => {
13+
setShouldHide(true);
14+
window.localStorage.setItem(localStorageKey, 'true');
15+
};
16+
17+
return (
18+
<BaseDialog
19+
dialogTitle="Welcome to the new Curation interface!"
20+
isOpen={!hide}
21+
onCloseDialog={handleCloseDialog}
22+
>
23+
<Box>
24+
<Typography gutterBottom>
25+
We've made some significant changes to make the UI more useful and intuitive.
26+
</Typography>
27+
<Typography gutterBottom>
28+
We're also introducing <b>AI Assisted Curation</b>. This feature uses LLMs to extract key study
29+
information (e.g. demographics, design & task details) from the full text of papers, making it
30+
easier to screen studies for inclusion.
31+
</Typography>
32+
<Typography gutterBottom>To get started, import studies into curation.</Typography>
33+
<Typography>
34+
In the <i>simple workflow</i>, AI-extracted information will be shown in the table, as well as
35+
individual study pages.
36+
</Typography>
37+
<Typography>
38+
For <i>PRISMA</i>, this feature is available after the Identification step.
39+
</Typography>
40+
<Box sx={{ display: 'flex', justifyContent: 'space-between', marginTop: '1rem' }}>
41+
<Button fullWidth onClick={handleCloseDialog} variant="contained" color="primary" disableElevation>
42+
Continue
43+
</Button>
44+
</Box>
45+
</Box>
46+
</BaseDialog>
47+
);
48+
};
49+
50+
export default InfoPopup;

compose/neurosynth-frontend/src/pages/Curation/components/CurationBoardAi.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import useCurationBoardGroupsState from '../hooks/useCurationBoardGroupsState';
77
import CurationBoardAIInterfaceCurator from './CurationBoardAIInterfaceCurator';
88
import CurationBoardAIInterfaceExclude from './CurationBoardAIInterfaceExclude';
99
import CurationBoardAIInterfaceImportSummary from './CurationBoardAIInterfaceImportSummary';
10+
import InfoPopup from 'components/InfoPopup';
1011

1112
export enum ECurationBoardAIInterface {
1213
CURATOR = 'CURATOR', // basic curation interface with ability to toggle between spreadsheet and focused UIs.
@@ -34,6 +35,8 @@ const CurationBoardAI: React.FC = () => {
3435
height: `calc(100vh - 40px - ${NAVBAR_HEIGHT}px - 64px - 4px)`, // add 4px for a bit of padding at the bottom
3536
}}
3637
>
38+
{/* eventually remove this */}
39+
<InfoPopup />
3740
<Box sx={{ width: '20%', minWidth: '200px', height: '100%' }}>
3841
<CurationBoardAIGroupsList
3942
groups={groups}

0 commit comments

Comments
 (0)