Skip to content

CC-263 PoC for walkthrough through neuroglancer based on design #8

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

Merged
merged 51 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
fc78f24
CC-263 initial changes:add tour component
Aiga115 Mar 20, 2025
4212af8
CC-263 Add mecanism to see inside the iFrame for joyride
aranega Mar 20, 2025
1c621cb
CC-263 fix custom tooltip component unmounting
Aiga115 Mar 21, 2025
12eef80
CC-263 add more tutorial steps and make more readable
Aiga115 Mar 23, 2025
b20e77a
Merge branch 'develop' into feature/CC-263
Aiga115 Mar 23, 2025
1676a1a
CC-263 add tour component to viewer page
Aiga115 Mar 23, 2025
341bdaa
CC-263 add placement to steps and fix small ui issues
Aiga115 Mar 24, 2025
7cff35e
CC-263 fix spotlight position issue and handle tour controlled state
Aiga115 Mar 24, 2025
f0cb1c7
Merge branch 'develop' into feature/CC-263
Aiga115 Mar 26, 2025
00bb375
Merge branch 'develop' into feature/CC-263
Aiga115 Mar 31, 2025
cb20053
Merge branch 'develop' into feature/CC-263
Aiga115 Mar 31, 2025
fd96fef
Merge branch 'develop' into feature/CC-263
Aiga115 Apr 1, 2025
2a62bb8
CC-263 change placement of steps and close the help dropdown after tu…
Aiga115 Apr 1, 2025
1ddf9dd
CC-263 set tour to initial step after close action
Aiga115 Apr 1, 2025
640b4e0
CC-263 a small change
Aiga115 Apr 1, 2025
4330554
CC-263 try to render mp4 video
Aiga115 Apr 1, 2025
696b6e8
Merge branch 'develop' into feature/CC-263
Aiga115 Apr 2, 2025
835d916
Merge branch 'develop' into feature/CC-263
Aiga115 Apr 2, 2025
57a8045
CC-263 add video players
Aiga115 Apr 3, 2025
78e8e82
CC-263 add an image to the first step
Aiga115 Apr 3, 2025
3d1de74
CC-287 make tour open in another window
Aiga115 Apr 4, 2025
17a527d
CC-291 refactor tour component to use cns for styling merges
Aiga115 Apr 4, 2025
787d07d
Merge branch 'develop' into feature/CC-263
Aiga115 Apr 9, 2025
a29284c
CC-263 linting issue fix
Aiga115 Apr 9, 2025
b42ea7a
CC-263 convert mp4 videos to gifs
Aiga115 Apr 10, 2025
9b17f0d
CC-263 reduce the size of an image and gifs
Aiga115 Apr 10, 2025
d195e2a
Merge branch 'develop' into feature/CC-263
Aiga115 Apr 14, 2025
29612a4
CC-304 ad two views for demo purposes
Aiga115 Apr 14, 2025
b7c6959
Merge branch 'develop' into feature/CC-263
seankmartin Apr 18, 2025
0141081
feat: v1 of rewording step 6
seankmartin Apr 18, 2025
2c96775
Merge branch 'develop' into feature/CC-263
seankmartin Apr 18, 2025
ff0afc8
feat: control via state the side panels
seankmartin Apr 18, 2025
12a8fac
feat: show panels via neuroglancer viewer
seankmartin Apr 18, 2025
d50ce51
feat: v1 of separate step 6
seankmartin Apr 18, 2025
7bc148e
Merge branch 'develop' into feature/CC-263
seankmartin Apr 22, 2025
db96766
feat: improve some messages for steps
seankmartin Apr 22, 2025
4c1a0dd
Merge branch 'develop' into feature/CC-263
seankmartin Apr 24, 2025
ccd2749
chore: fix formatting
seankmartin Apr 24, 2025
14f5bfa
chore: update lock file
seankmartin Apr 24, 2025
1d54b1d
feat: demo button
seankmartin Apr 24, 2025
264f7de
fix: remove now uneeded demo code
seankmartin Apr 25, 2025
4f2bde1
feat: add new keybind to stesps
seankmartin Apr 29, 2025
2634753
feat: open walkthrough on the current run
aranega May 2, 2025
b49d47d
feat: enables walkthrough on the current run with original config
aranega May 2, 2025
9971363
Merge pull request #28 from MetaCell/feature/CC-319
seankmartin May 6, 2025
8e4ad5f
Merge branch 'develop' into feature/CC-263
seankmartin May 15, 2025
feb21b2
refactor: remove commented code
seankmartin May 15, 2025
cc78fae
fix: rename step target for new names
seankmartin May 15, 2025
4dba580
Merge pull request #31 from MetaCell/feature/CC-263-develop-merge
seankmartin May 15, 2025
96d411f
feat: add pointer back to ? menu at tour end
seankmartin May 15, 2025
c396d94
Merge branch 'develop' of github.com:MetaCell/cryoet-data-portal into…
aranega May 15, 2025
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
7 changes: 5 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"test": "pnpm -r test"
},
"devDependencies": {
"prettier": "^3.0.3",
"npm-run-all": "^4.1.5"
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3"
},
"pnpm": {
"overrides": {
Expand All @@ -34,5 +34,8 @@
"resolutions": {
"react": "18.2.0",
"react-dom": "18.2.0"
},
"dependencies": {
"react-joyride": "^2.9.3"
}
}
12 changes: 2 additions & 10 deletions frontend/packages/data-portal/app/components/Layout/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,5 @@ export const REPORT_LINKS: NavLink[] = [
},
]

export const NEUROGLANCER_HELP_LINKS: NavLink[] = [
{
label: 'goToNeuroglancerDocumentation',
link: 'https://chanzuckerberg.github.io/cryoet-data-portal/stable/neuroglancer_quickstart.html#neuroglancer-quickstart',
},
{
label: 'neuroglancerWalkthrough',
link: '#',
},
]
export const NEUROGLANCER_DOC_LINK =
'https://chanzuckerberg.github.io/cryoet-data-portal/stable/neuroglancer_quickstart.html#neuroglancer-quickstart'
201 changes: 108 additions & 93 deletions frontend/packages/data-portal/app/components/MenuDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,107 +1,122 @@
import { Icon, Menu } from '@czi-sds/components'
import { ReactNode, useRef, useState } from 'react'
import {
ReactNode,
useRef,
useState,
useImperativeHandle,
forwardRef,
} from 'react'

import { cns } from 'app/utils/cns'

export function MenuDropdown({
children,
className,
title,
variant = 'standard',
buttonElement,
paperClassName,
}: {
children: ReactNode
variant?: 'standard' | 'outlined' | 'filled'
className?: string
title: ReactNode
buttonElement?: ReactNode
paperClassName?: string
}) {
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)
const menuRef = useRef<HTMLDivElement>(null)
export type MenuDropdownRef = {
closeMenu: () => void
}

const variantStyles = {
standard: '!p-0',
outlined: 'border border-[#A2C9FF] px-3.5 py-1.5 rounded-full',
filled: 'bg-[#2573F4] px-3.5 py-1.5 rounded-full',
export const MenuDropdown = forwardRef<
MenuDropdownRef,
{
children: ReactNode
variant?: 'standard' | 'outlined' | 'filled'
className?: string
title: ReactNode
buttonElement?: ReactNode
paperClassName?: string
}
>(
(
{ children, className, title, variant = 'standard', buttonElement, paperClassName},
ref,
) => {
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)
const menuRef = useRef<HTMLDivElement>(null)

const iconStyles = {
standard: anchorEl
? '!fill-sds-color-primitive-common-white'
: '!fill-sds-color-primitive-gray-400 group-hover:!fill-sds-color-primitive-common-white',
outlined: '!fill-[#A2C9FF]',
filled: '!fill-sds-color-primitive-common-white',
}
useImperativeHandle(ref, () => ({
closeMenu: () => setAnchorEl(null),
}))

const textStyles = {
standard: anchorEl
? 'text-sds-color-primitive-common-white'
: 'text-sds-color-primitive-gray-400 group-hover:text-sds-color-primitive-common-white',
outlined: 'text-[#A2C9FF]',
filled: '!fill-sds-color-primitive-common-white',
}
const variantStyles = {
standard: '!p-0',
outlined: 'border border-[#A2C9FF] px-3.5 py-1.5 rounded-full',
filled: 'bg-[#2573F4] px-3.5 py-1.5 rounded-full',
}

return (
<div className={className}>
{title ? (
<button
className={cns(
'flex items-center gap-2 group',
variantStyles[variant],
)}
onClick={() => setAnchorEl(menuRef.current)}
type="button"
>
<span
ref={menuRef}
const iconStyles = {
standard: anchorEl
? '!fill-sds-color-primitive-common-white'
: '!fill-sds-color-primitive-gray-400 group-hover:!fill-sds-color-primitive-common-white',
outlined: '!fill-[#A2C9FF]',
filled: '!fill-sds-color-primitive-common-white',
}

const textStyles = {
standard: anchorEl
? 'text-sds-color-primitive-common-white'
: 'text-sds-color-primitive-gray-400 group-hover:text-sds-color-primitive-common-white',
outlined: 'text-[#A2C9FF]',
filled: '!fill-sds-color-primitive-common-white',
}

return (
<div className={className}>
{title ? (
<button
className={cns(
'font-semibold',
textStyles[variant],
anchorEl
? 'text-sds-color-primitive-common-white'
: 'text-sds-color-primitive-gray-400 group-hover:text-sds-color-primitive-common-white',
'flex items-center gap-2 group',
variantStyles[variant],
)}
onClick={() => setAnchorEl(menuRef.current)}
type="button"
>
{title}
</span>
<span
ref={menuRef}
className={cns(
'font-semibold',
textStyles[variant],
anchorEl
? 'text-sds-color-primitive-common-white'
: 'text-sds-color-primitive-gray-400 group-hover:text-sds-color-primitive-common-white',
)}
>
{title}
</span>

<Icon
sdsIcon={anchorEl ? 'ChevronUp' : 'ChevronDown'}
sdsSize="xs"
sdsType="iconButton"
className={cns(
iconStyles[variant],
anchorEl
? '!w-[10px] !h-[10px] !fill-sds-color-primitive-common-white'
: '!w-[10px] !h-[10px] !fill-sds-color-primitive-gray-400 group-hover:!fill-sds-color-primitive-common-white',
)}
/>
</button>
) : (
<button
onClick={() => setAnchorEl(menuRef.current)}
type="button"
className="text-[#999] hover:text-sds-color-primitive-common-white"
>
<span ref={menuRef}>{buttonElement}</span>
</button>
)}
<Icon
sdsIcon={anchorEl ? 'ChevronUp' : 'ChevronDown'}
sdsSize="xs"
sdsType="iconButton"
className={cns(
iconStyles[variant],
anchorEl
? '!w-[10px] !h-[10px] !fill-sds-color-primitive-common-white'
: '!w-[10px] !h-[10px] !fill-sds-color-primitive-gray-400 group-hover:!fill-sds-color-primitive-common-white',
)}
/>
</button>
) : (
<button
onClick={() => setAnchorEl(menuRef.current)}
type="button"
className="text-[#999] hover:text-sds-color-primitive-common-white"
>
<span ref={menuRef}>{buttonElement}</span>
</button>
)}

<Menu
anchorEl={anchorEl}
open={!!anchorEl}
onClose={() => setAnchorEl(null)}
className="mt-2"
slotProps={{
paper: {
className: paperClassName,
},
}}
>
{children}
</Menu>
</div>
)
}
<Menu
anchorEl={anchorEl}
open={!!anchorEl}
onClose={() => setAnchorEl(null)}
className="mt-2"
slotProps={{
paper: {
className: paperClassName,
},
}}
>
{children}
</Menu>
</div>
)
},
)
Loading
Loading