-
-
Notifications
You must be signed in to change notification settings - Fork 415
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(edgeless): support pie menu widget #6493
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Great, this pie menu is exactly what we need! But there are some color issues that can be quickly addressed. It's best to choose colors from the theme for the hover state so that it can have better light/dark mode compatibility. In addition, it is recommended to set a feature flag for related functions so that different users can control the function switch. In fact, our product design itself also has plans to design a circular menu. I never expected the open-source community to complete it ahead of us! |
Hey! While working on it I used the hover color (--affine-hover-color) but it had some transparency, which didn't look right when hovering over it in the current setup. so for now I just used a hardcoded value. I will fix it 👍🏻 |
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.
@golok727 thanks again for the great work! I've seen previous comment regarding feature flags and some best practice, and here's the advice:
- It's really a smooth and polished feature to try, so landing this without feature flag should be fine - we may fallback if needed but no worries.
- Limiting the usage of this widget in edgeless mode should be expected.
I think @Saul-Mirone would land this after some style checks.
Thanks again for your feat. If you are interested in BlockSuite, AFFiNE and related contributions, feel free to DM me: doodlewind at toeverything dot info
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.
Thanks for your contribution!
@Saul-Mirone, just to clarify, you mentioned removing it from both the DocSpec and EdgelessSpec, correct? I've commented it out as per your instructions. Additionally, as @doodlewind pointed out, since this is an edgeless-only feature, I've removed its support in Page. PTA👀. Btw I don't know how to enable it in the playground. |
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.
@golok727 you can search for enable_synced_doc_block
to see how feature flags is being used in the codebase. Adding a enable_pie_menu
flag and test this flag on the key handler for q
should be adequate. Also in this way you can enable the flag by default in BlockSuite playground, since there are defaultFlags
that can be used to override.
Thanks! I added the flag... |
## Features - toeverything/blocksuite#6544 @golok727 - toeverything/blocksuite#6543 @golok727 - toeverything/blocksuite#6536 @donteatfriedrice - toeverything/blocksuite#6497 @doouding - toeverything/blocksuite#6514 @regischen - toeverything/blocksuite#6523 @donteatfriedrice - toeverything/blocksuite#6530 @zzj3720 - toeverything/blocksuite#6526 @fourdim - toeverything/blocksuite#6532 @donteatfriedrice - toeverything/blocksuite#6493 @golok727 - toeverything/blocksuite#6529 @zzj3720 - toeverything/blocksuite#6528 @zzj3720 - toeverything/blocksuite#6509 @zzj3720 - toeverything/blocksuite#6525 @doodlewind - toeverything/blocksuite#6502 @donteatfriedrice - toeverything/blocksuite#6489 @Flrande ## Bugfix - toeverything/blocksuite#6558 @fourdim - toeverything/blocksuite#6556 @fourdim - toeverything/blocksuite#6547 @fundon - toeverything/blocksuite#6537 @golok727 - toeverything/blocksuite#6531 @donteatfriedrice - toeverything/blocksuite#6524 @doodlewind - toeverything/blocksuite#6519 @regischen - toeverything/blocksuite#6517 @doodlewind - toeverything/blocksuite#6516 @doodlewind - toeverything/blocksuite#6510 @donteatfriedrice - toeverything/blocksuite#6511 @congzhou09 - toeverything/blocksuite#6507 @doouding - toeverything/blocksuite#6500 @fourdim - toeverything/blocksuite#6486 @congzhou09 - toeverything/blocksuite#6495 @donteatfriedrice - toeverything/blocksuite#6488 @Saul-Mirone - toeverything/blocksuite#6482 @Flrande - toeverything/blocksuite#6558 @fourdim ## Refactor - toeverything/blocksuite#6548 @doodlewind - toeverything/blocksuite#6522 @doodlewind - toeverything/blocksuite#6518 @regischen - toeverything/blocksuite#6521 @Saul-Mirone ## Misc - toeverything/blocksuite#6557 @fourdim - toeverything/blocksuite#6546 @Flrande - docs: update package desc - toeverything/blocksuite#6527 @fourdim - toeverything/blocksuite#6505 @Brooooooklyn - toeverything/blocksuite#6503 @fourdim - v0.13.0 - toeverything/blocksuite#6496 @doodlewind - toeverything/blocksuite#6562 @donteatfriedrice
A pie menu inspired by Blender's interface.
For preview I have added a tools menu for edgeless the trigger is 'q'.
Usage
Trigger Key: Each menu is associated with a trigger key to open it. To activate a menu, press and hold the trigger key.
Navigation: While holding the trigger key, move the cursor towards the desired action within the pie menu. Hovering over a wedge of the pie menu highlights that action. Release the trigger key to select the highlighted action.
Submenu: Submenus can be accessed by hovering over the submenu node (with a blue dot) within the pie menu. To close a submenu just hover over the desired center node
Keeping Menu Open: If the trigger key is released before the "SELECT_ON_RELEASE_TIMEOUT" (150ms default) threshold, the pie menu remains open and you can select with your mouse.
Shortcut Selection: The numeric keys (0-9) correspond to actions within the pie menu. Pressing a numeric key selects the pie node associated with that number directly.
I have also provided a pie builder api to build pie menus layouts easier. Looking forward for help to make the api better.
Preview
pie2.1.mp4
New!
Color Node
Color.Node.mp4