excalidraw
excalidraw copied to clipboard
Redesign Context menu 🔥
The context menu is becoming bigger and overloaded with more and more options so we need to revamp it.
Let's discuss the ideas here on how we can improve it
Hi, @ad1992
An idea:
Or the "copy/paste as..." actions could be all grouped together, as Figma does:
@adarkforce yes, this is what we'll want to do. Probably best to use https://www.radix-ui.com/docs/primitives/components/context-menu for this.
But, before we do that, this should land first: https://github.com/excalidraw/excalidraw/issues/5926 (in progress)
Should be implemented using @radix-ui/react-context-menu, or possibly reuse @radix-ui/react-dropdown-menu (we'll soon be using for main menu) if it turns out that the contextmenu adds too much size on top of their dropdownmenu.
Hi, looks like #5926 has been merged. Can I work on this one?
Hi @jamiecjm, sure thing!
I'll send you the design spec tomorrow.
Implementation-wise, let's use the @radix-ui/react-dropdown-menu
package we're using in https://github.com/excalidraw/excalidraw/pull/6483 (you don't need to wait for the PR to be merged and just install it directly).
Thanks! What's the reason of not using @radix-ui/react-context-menu? Seems to be more straightforward implementation wise and the size is around 26.55 kB
@jamiecjm the size seems too large for context menu, implementation wise I am hoping it should be similar using the menu as well.
However if you want you can check how much bundle size is getting increased with context-menu
by running yarn size
in src/packages/excalidraw
depending on our usage and based on that we can decide.
Tested this using #6483
With react-dropdown-menu
:
With react-context-menu
:
I can use react-dropdown-menu
, I'm just curious.
so almost ~17kB increased, lets go ahead dropdown then @jamiecjm :)
Effort wise I am hoping it would be similar ?
Yeah it should be similar
@jamiecjm here's the context menu design spec:
https://www.figma.com/file/EvavjRtXUmHjrcNIBTAMxI/Public-components?type=design&node-id=9%3A649&mode=design&t=nawGicyIY1jpomIp-1
How does it look in dark mode? Does using the variables/design token adjust to dark/light mode automatically?
How does it look in dark mode? Does using the variables/design token adjust to dark/light mode automatically?
@jamiecjm yes the css variables will take care of dark mode, there are equivalent values in dark mode https://github.com/excalidraw/excalidraw/blob/master/src/css/theme.scss#L138
@jamiecjm I've added the dark mode.
And by mistake the figma design I posted above was using a color scheme we will deploy later and does not reflect the current one in production. I've updated the file: https://www.figma.com/file/EvavjRtXUmHjrcNIBTAMxI/Public-components?type=design&node-id=32%3A4746&mode=design&t=yqNXPLjBOd49aMhh-1
What should the hover state of Delete look like? The current behaviour has a red background on hover
What should the hover state of Delete look like? The current behaviour has a red background on hover
lets keep it same as prod, we can tweak in PR is needed
Hi should I use the chevron right icon from radix-ui? Or is there one in the package already?
@ad1992 is someone still working on this? Can I pick this up?