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

New jbrowse-desktop start screen design #2247

Merged
merged 43 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7b915ed
Migrate electron.js to electron.ts
cmdcolin Aug 21, 2021
a1a9276
Catch for assembly manager throwing an error at start screen of app w…
cmdcolin Aug 21, 2021
f0796f3
Some fixes
cmdcolin Aug 21, 2021
17ef55b
Start screen improvements
cmdcolin Aug 21, 2021
a6d5e83
Convert debouncer in jbrowse into an autorun on rootmodel, which also…
cmdcolin Aug 21, 2021
4ef937a
Writing session independent of thumb
cmdcolin Aug 21, 2021
067305f
Rename root to rootModel
cmdcolin Aug 21, 2021
296e915
Start screen redesign
cmdcolin Aug 21, 2021
8696a27
Button panel
cmdcolin Aug 21, 2021
1c75a0c
Intermediate
cmdcolin Aug 22, 2021
bb88cfe
Start model for getting theme information elsewhere...prolly not config
cmdcolin Aug 22, 2021
9d978c5
Initial loading works
cmdcolin Aug 22, 2021
403904d
Make 'Return to splash screen' work
cmdcolin Aug 22, 2021
d6c650a
Renaming sessions works
cmdcolin Aug 22, 2021
9f2d5a1
Make session select work
cmdcolin Aug 22, 2021
07d4b7e
Disable sort/filter on some columns
cmdcolin Aug 22, 2021
c2f6cb3
Make the open sequence file dialog work
cmdcolin Aug 22, 2021
8a357db
Fix some lint
cmdcolin Aug 22, 2021
fa45aff
Allow opening an external config.json
cmdcolin Aug 22, 2021
71129b6
Only replace non-http paths
cmdcolin Aug 22, 2021
6971114
Add view launcher in the dataset
cmdcolin Aug 23, 2021
b4d0683
Fixup tests
cmdcolin Aug 23, 2021
d3401b3
[desktop beta] Create beta desktop builds
elliothershberg Aug 25, 2021
b7248c7
Manually update sessions list
cmdcolin Aug 25, 2021
67b26d1
Use toggle buttons for header items, suggestion from @carolinebridge-…
cmdcolin Aug 25, 2021
2e6c0ff
Use more functional style for electron listSessions
cmdcolin Aug 25, 2021
53e92d3
Move files around
cmdcolin Aug 27, 2021
ffd3221
Updates
cmdcolin Aug 27, 2021
70a5a62
Add a note what the user should do at the OpenSequenceDialog
cmdcolin Aug 27, 2021
24ebf64
Don't rename defaultSession on import in desktop
cmdcolin Aug 27, 2021
f7b0b61
Use custom useLocalStorage after react-use has tsc issue
cmdcolin Aug 27, 2021
787ef4b
Make sure links open in browser rather than redirecting in the electr…
cmdcolin Aug 27, 2021
b99ca34
Start PreloadedDatasetSelector
cmdcolin Aug 27, 2021
cd7981c
Add a list of preloaded session on left hand side
cmdcolin Aug 27, 2021
d21f401
[desktop beta] Multi-data selector on start screen
cmdcolin Aug 27, 2021
91f13df
[desktop beta] Make the default session name get a timestamp and make
cmdcolin Aug 30, 2021
4ea511a
[desktop beta] Rename defaultSession to have a date with OpenSequence…
cmdcolin Aug 30, 2021
ada0f5e
Add skipLibCheck to fix issue where it otherwise produces error:
cmdcolin Sep 2, 2021
b83aa50
[desktop beta] Add some suggestions from feedback
cmdcolin Sep 2, 2021
84702b9
Remove the open jbrowse web config concept
cmdcolin Sep 2, 2021
405d23a
Reorganize
cmdcolin Sep 2, 2021
f3834b3
Clarify
cmdcolin Sep 2, 2021
cba745d
Fix key
cmdcolin Sep 2, 2021
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
products/jbrowse-web/scripts/**
/config/
/products/jbrowse-web/config/
products/jbrowse-desktop/public/electron.js
2 changes: 1 addition & 1 deletion packages/core/assemblyManager/assemblyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function assemblyManagerFactory(
// hence the union with {name:string}
const {
jbrowse: { assemblies },
session: { sessionAssemblies = [] },
session: { sessionAssemblies = [] } = {},
} = getParent(self)
return [
...assemblies,
Expand Down
92 changes: 68 additions & 24 deletions packages/core/ui/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import React, { Suspense } from 'react'
import { AppBar, Fab, Toolbar, Tooltip, makeStyles } from '@material-ui/core'
import React, { useState, Suspense } from 'react'
import {
AppBar,
Button,
Fab,
MenuItem,
Paper,
Select,
Toolbar,
Tooltip,
Typography,
makeStyles,
} from '@material-ui/core'
import LaunchIcon from '@material-ui/icons/Launch'
import { observer } from 'mobx-react'
import { getEnv } from 'mobx-state-tree'
Expand Down Expand Up @@ -76,6 +87,10 @@ const useStyles = makeStyles(theme => ({
borderColor: theme.palette.secondary.main,
backgroundColor: theme.palette.primary.light,
},

selectPaper: {
padding: theme.spacing(4),
},
}))

const Logo = observer(({ session }) => {
Expand All @@ -88,9 +103,11 @@ const Logo = observer(({ session }) => {
}
})

const App = observer(({ session, HeaderButtons }) => {
const App = observer(({ session, HeaderButtons = null }) => {
const classes = useStyles()
const { pluginManager } = getEnv(session)
const viewTypes = pluginManager.getElementTypeRecord('view').all()
const [value, setValue] = useState(viewTypes[0]?.name)
const {
visibleWidget,
drawerWidth,
Expand Down Expand Up @@ -164,28 +181,55 @@ const App = observer(({ session, HeaderButtons }) => {
</AppBar>
</div>
<div className={classes.components}>
{views.map(view => {
const viewType = pluginManager.getViewType(view.type)
if (!viewType) {
throw new Error(`unknown view type ${view.type}`)
}
const { ReactComponent } = viewType
return (
<ViewContainer
key={`view-${view.id}`}
view={view}
onClose={() => session.removeView(view)}
{views.length ? (
views.map(view => {
const viewType = pluginManager.getViewType(view.type)
if (!viewType) {
throw new Error(`unknown view type ${view.type}`)
}
const { ReactComponent } = viewType
return (
<ViewContainer
key={`view-${view.id}`}
view={view}
onClose={() => session.removeView(view)}
>
<Suspense fallback={<div>Loading...</div>}>
<ReactComponent
model={view}
session={session}
getTrackType={pluginManager.getTrackType}
/>
</Suspense>
</ViewContainer>
)
})
) : (
<Paper className={classes.selectPaper}>
<Typography>Select a view to launch</Typography>
<Select
value={value}
onChange={event => setValue(event.target.value)}
>
{viewTypes.map(({ name }) => {
return (
<MenuItem key={name} value={name}>
{name}
</MenuItem>
)
})}
</Select>
<Button
onClick={() => {
session.addView(value, {})
}}
variant="contained"
color="primary"
>
<Suspense fallback={<div>Loading...</div>}>
<ReactComponent
model={view}
session={session}
getTrackType={pluginManager.getTrackType}
/>
</Suspense>
</ViewContainer>
)
})}
Launch view
</Button>
</Paper>
)}

{/* blank space at the bottom of screen allows scroll */}
<div style={{ height: 300 }} />
Expand Down
16 changes: 10 additions & 6 deletions packages/core/ui/NewSessionCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,28 @@ interface RootModel {
setSession: Function
}

export function NewEmptySession({ root }: { root: RootModel }) {
export function NewEmptySession({ rootModel }: { rootModel: RootModel }) {
return (
<NewSessionCard
name="Empty"
onClick={() => {
root.setSession(emptySessionSnapshot)
rootModel.setSession(emptySessionSnapshot)
}}
image={emptyIcon}
/>
)
}

export function NewLinearGenomeViewSession({ root }: { root: RootModel }) {
export function NewLinearGenomeViewSession({
rootModel,
}: {
rootModel: RootModel
}) {
return (
<NewSessionCard
name="Linear Genome View"
onClick={() => {
root.setSession({
rootModel.setSession({
...emptySessionSnapshot,
name: `New session ${new Date().toLocaleString()}`,
views: [{ type: 'LinearGenomeView' }],
Expand All @@ -98,12 +102,12 @@ export function NewLinearGenomeViewSession({ root }: { root: RootModel }) {
)
}

export function NewSVInspectorSession({ root }: { root: RootModel }) {
export function NewSVInspectorSession({ rootModel }: { rootModel: RootModel }) {
return (
<NewSessionCard
name="Structural Variant Inspector"
onClick={() => {
root.setSession({
rootModel.setSession({
...emptySessionSnapshot,
name: `New session ${new Date().toLocaleString()}`,
views: [{ type: 'SvInspectorView' }],
Expand Down
136 changes: 0 additions & 136 deletions packages/core/ui/RecentSessionCard.js

This file was deleted.

48 changes: 22 additions & 26 deletions plugins/data-management/src/AssemblyManager/AssemblyAddForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,31 @@ import {
MenuItem,
Paper,
TextField,
Theme,
makeStyles,
createStyles,
} from '@material-ui/core'
import AddIcon from '@material-ui/icons/Add'

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
flexGrow: 1,
overflow: 'hidden',
padding: theme.spacing(0, 3),
},
paper: {
margin: `${theme.spacing(1)}px auto`,
padding: theme.spacing(2),
},
createButton: {
marginTop: '1em',
justifyContent: 'center',
},
paperContent: {
flex: 'auto',
margin: `${theme.spacing(1)}px auto`,
padding: theme.spacing(1),
overflow: 'auto',
},
}),
)
const useStyles = makeStyles(theme => ({
root: {
flexGrow: 1,
overflow: 'hidden',
padding: theme.spacing(0, 3),
},
paper: {
margin: `${theme.spacing(1)}px auto`,
padding: theme.spacing(2),
},
createButton: {
marginTop: '1em',
justifyContent: 'center',
},
paperContent: {
flex: 'auto',
margin: `${theme.spacing(1)}px auto`,
padding: theme.spacing(1),
overflow: 'auto',
},
}))

const AdapterSelector = observer(
({
Expand All @@ -46,7 +42,7 @@ const AdapterSelector = observer(
}: {
adapterSelection: string
setAdapterSelection: Function
adapterTypes: Array<string>
adapterTypes: string[]
}) => {
return (
<TextField
Expand Down
Loading