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

report(flow): add help dialog to explain flows #13159

Merged
merged 10 commits into from Oct 7, 2021
Merged

Conversation

patrickhulce
Copy link
Collaborator

Summary
Implements the help dialog from the mocks. Waiting on #13109 to resolve the topbar button layout before updating the button here, but the contents should be unaffected.

image

Related Issues/PRs
ref #11313

Copy link
Member

@adamraine adamraine left a comment

Choose a reason for hiding this comment

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

Looks great, thanks Patrick!

const strings = useUIStrings();

return (
<div className={classNames('HelpDialog', {'HelpDialog--hidden': !visible})}>
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding a --hidden style, WDYT about removing the node entirely? This way you don't need the visible param and it won't be rendered in the DOM for most use cases.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure we can go with conditional rendering here. my thoughts on this topic in general are to default to display: none if the content is not exceedingly expensive to keep around in the DOM because you get DOM-based state preservation for free, and it avoids really thorny bugs in many SSR hydration implementations. in this case though, we're definitely not SSR'ing and there's no state to keep, so I'm relatively indifferent.

Copy link
Member

@adamraine adamraine left a comment

Choose a reason for hiding this comment

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

Looks good overall, I think you still need to merge in the TopbarButton styles.

flow-report/src/i18n/ui-strings.js Show resolved Hide resolved
flow-report/src/help-dialog.tsx Outdated Show resolved Hide resolved
flow-report/assets/styles.css Outdated Show resolved Hide resolved
flow-report/assets/styles.css Show resolved Hide resolved
flow-report/assets/styles.css Show resolved Hide resolved
flow-report/src/topbar.tsx Outdated Show resolved Hide resolved
flow-report/src/topbar.tsx Show resolved Hide resolved
@@ -92,6 +96,16 @@ export const Topbar: FunctionComponent<{onMenuClick: JSX.MouseEventHandler<HTMLB
onClick={() => saveHtml(flowResult, dom)}
label="Button that saves the report as HTML"
>{strings.save}</TopbarButton>
<div style={{flexGrow: 1}} />
<TopbarButton
Copy link
Member

Choose a reason for hiding this comment

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

Mocks show this button with blue text, up to you if you want to change it or keep it consistent with the other topbar buttons.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I figured we'd keep it consistent, but happy to discuss tomorrow with jiwoong if he feels strongly about it

Copy link
Member

Choose a reason for hiding this comment

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

Feel free to merge without the blue text since this is blocking your next PR. We can circle back to this after the UX sync.

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.

None yet

4 participants