-
Notifications
You must be signed in to change notification settings - Fork 887
feat: Add "Outdated" tooltip and "Update version" button in the Workspaces page #2322
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
Conversation
const helpTooltipContext = useContext(HelpTooltipContext) | ||
|
||
if (!helpTooltipContext) { | ||
throw new Error("This hook should be used in side of the HelpTooltipContext.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
@@ -76,6 +84,78 @@ const WorkspaceHelpTooltip: React.FC = () => { | |||
) | |||
} | |||
|
|||
const OutdatedHelpTooltip: React.FC<{ onUpdateVersion: () => void }> = ({ onUpdateVersion }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file is getting really big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is but, for now, I think it is ok. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can leave it for now. I want to talk about directory structure at the next FE Variety - maybe we can look at pulling stuff apart then.
|
||
export const workspacesMachine = createMachine( | ||
{ | ||
tsTypes: {} as import("./workspacesXService.typegen").Typegen0, | ||
tsTypes: {} as import("./workspacesXService.typegen").Typegen1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this Typegen1
vs Typegen0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is auto-generated by XState types: https://xstate.js.org/docs/guides/typescript.html#typegen
export const HelpTooltip: React.FC<HelpTooltipProps> = ({ children, open, size = "medium" }) => { | ||
const styles = useStyles({ size }) | ||
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null) | ||
open = open ?? Boolean(anchorEl) | ||
const id = open ? "help-popover" : undefined | ||
|
||
const onClose = () => { | ||
setAnchorEl(null) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like when I click to escape the tooltip, regardless of where I click, I am automatically routed to the workspace page. Sometimes I just want to close the tooltip without leaving the list. Could we suppress navigation on close?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is because you are clicking on a workspace row when you click outside of the tooltip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does it even if I click somewhere else on the page. I think it is using the initial click into the tooltip to navigate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulled this down and it looks and works great!
Co-authored-by: Kira Pilot <kira@coder.com>
Chromatic deploys are failing, I reviewed the storybooks and they look good. I send a support message to support@chromatic.com. |
Demo:
https://user-images.githubusercontent.com/3165839/173636455-33c83eb3-2525-46cd-a198-6d9ec785eb81.mov
Important things:
updateWorkspaceRefs
Closes #2001