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

feat(protocol-designer): make timeline responsive #17109

Merged
merged 28 commits into from
Dec 20, 2024
Merged

Conversation

koji
Copy link
Contributor

@koji koji commented Dec 13, 2024

Overview

make timeline responsive

close AUTH-877

Test Plan and Hands on Testing

Changelog

  • add DraggableSidebar component to make the sidebar draggable/resizable
  • update AddStepButton to align with the design (remove + text and add + icon)

Review requests

Risk assessment

low

} from '@opentrons/components'
import { TimelineToolbox } from './Timeline/TimelineToolbox'

const INITIAL_SIDEBAR_WIDTH = 350
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll get the right value from Mel next week

@@ -56,6 +59,7 @@ export function ProtocolSteps(): JSX.Element {
const [deckView, setDeckView] = useState<
typeof leftString | typeof rightString
>(leftString)
const [targetWidth, setTargetWidth] = useState<number>(350)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the initial value will be updated.

@koji
Copy link
Contributor Author

koji commented Dec 13, 2024

  • fix check-js and lint-js errors
  • fix test errors
  • add test for DraggableSidebar

@koji koji requested review from ncdiehl11 and jerader December 13, 2024 22:44
@koji koji marked this pull request as ready for review December 14, 2024 04:56
@koji koji requested a review from a team as a code owner December 14, 2024 04:56
@koji koji removed the request for review from a team December 14, 2024 04:56
@ncdiehl11
Copy link
Collaborator

Whoa, looks really slick. I do see some highlighting when dragging the timeline toolbox (see "Ending deck"). Not sure if this is blocking, though.

Screen.Recording.2024-12-17.at.10.18.12.AM.mov

@ncdiehl11
Copy link
Collaborator

I think the add step menu is being contained by the timeline toolbox container
Screenshot 2024-12-17 at 10 21 02 AM

Copy link
Collaborator

@ncdiehl11 ncdiehl11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments but generally looking good

const addStep = (stepType: StepType): ReturnType<any> =>
dispatch(stepsActions.addAndSelectStep({ stepType }))

const items = getSupportedSteps()
.filter(stepType => isStepTypeEnabled[stepType])
const items = getSupportedSteps(enableComment)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe

Suggested change
const items = getSupportedSteps(enableComment)
getSupportedSteps(enableComment).
reduce<JSX.Element[]>((acc, stepType) => {
return getIsStepTypeEnabled(enableComment, modules)[stepType]
? [...acc, <AddOverflowButton ... />]
: acc
}, [])

white-space: ${NO_WRAP};
bottom: 4.2rem;
border-radius: ${BORDERS.borderRadius8};
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a constant for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean box-shadow or the entire style?
i think we don't have the constant for this part.

@koji
Copy link
Contributor Author

koji commented Dec 18, 2024

I think the add step menu is being contained by the timeline toolbox container Screenshot 2024-12-17 at 10 21 02 AM

@ncdiehl11 thank you for catching this.
finally, I could figure out what the issue is.

@koji koji requested review from ncdiehl11 and jerader December 19, 2024 04:32
@ncdiehl11
Copy link
Collaborator

Screenshot 2024-12-20 at 2 56 49 PM Do we want to break "Timeline"?

Copy link
Collaborator

@ncdiehl11 ncdiehl11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left one comment but looks good 💪

@koji
Copy link
Contributor Author

koji commented Dec 20, 2024

Screenshot 2024-12-20 at 2 56 49 PM Do we want to break "Timeline"?

yeah, that is Mel's current design.
https://www.figma.com/design/WbkiUyU8VhtKz0JSuIFA45/Feature%3A-Protocol-Designer-Phase-1?node-id=10928-294030&m=dev

@koji koji merged commit 35422b6 into edge Dec 20, 2024
14 checks passed
@koji koji deleted the feat_add-resizeable-sidebar branch December 20, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants