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: Add shortcuts component #877

Merged
merged 5 commits into from
Jan 31, 2024
Merged

feat: Add shortcuts component #877

merged 5 commits into from
Jan 31, 2024

Conversation

cyaiox
Copy link
Contributor

@cyaiox cyaiox commented Jan 26, 2024

This PR adds a toolbar in the render to show hotkeys help.

Also add the following new hotkeys:

  • M to activate the positioning gizmo
  • R to activate the rotating gizmo
  • X to activate the scaling gizmo
  • ctrl + D to duplicate entities
Screen.Recording.2024-01-26.at.20.58.16.mov

Closes: decentraland/sdk#1072
Fixes: decentraland/sdk#1076

Copy link

cloudflare-workers-and-pages bot commented Jan 27, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d39df29
Status: ✅  Deploy successful!
Preview URL: https://781c9b84.js-sdk-toolchain.pages.dev
Branch Preview URL: https://feat-add-shortcuts-icons.js-sdk-toolchain.pages.dev

View logs

@cyaiox cyaiox requested a review from cazala January 27, 2024 00:02
Copy link
Contributor

github-actions bot commented Jan 27, 2024

Test this pull request

  • The @dcl/sdk package can be tested in scenes by running

    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/feat/add-shortcuts-icons/dcl-sdk-7.3.41-7727519562.commit-835a108.tgz"
  • To test with npx init

    export SDK_COMMANDS="https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/feat/add-shortcuts-icons/dcl-sdk-commands-7.3.41-7727519562.commit-835a108.tgz"
    npx $SDK_COMMANDS init
  • The @dcl/inspector package can be tested by visiting this url

    • Or by installing it via NPM
    npm install "https://sdk-team-cdn.decentraland.org/@dcl/js-sdk-toolchain/branch/feat/add-shortcuts-icons/@dcl/inspector/dcl-inspector-7.3.41-7727519562.commit-835a108.tgz"
  • The /changerealm command to test test in-world

    /changerealm https://sdk-team-cdn.decentraland.org/ipfs/feat/add-shortcuts-icons-e2e
    
  • You can preview this build entering:
    https://playground.decentraland.org/?sdk-branch=feat/add-shortcuts-icons

Copy link

codecov bot commented Jan 27, 2024

Codecov Report

Attention: 46 lines in your changes are missing coverage. Please review.

Comparison is base (ece036d) 67.29% compared to head (d39df29) 67.17%.
Report is 1 commits behind head on main.

Files Patch % Lines
...ages/@dcl/inspector/src/lib/babylon/setup/input.ts 8.69% 21 Missing ⚠️
...ctor/src/lib/babylon/decentraland/gizmo-manager.ts 64.86% 13 Missing ⚠️
...spector/src/components/Renderer/Shortcuts/types.ts 0.00% 5 Missing and 1 partial ⚠️
...spector/src/components/Renderer/Shortcuts/index.ts 0.00% 1 Missing and 1 partial ⚠️
packages/@dcl/inspector/src/hooks/useHotkey.ts 0.00% 2 Missing ⚠️
...ckages/@dcl/inspector/src/hooks/useOutsideClick.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #877      +/-   ##
==========================================
- Coverage   67.29%   67.17%   -0.13%     
==========================================
  Files         517      519       +2     
  Lines       15874    15941      +67     
  Branches     2036     2040       +4     
==========================================
+ Hits        10683    10708      +25     
- Misses       4864     4904      +40     
- Partials      327      329       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cyaiox cyaiox force-pushed the feat/add-shortcuts-icons branch from f9e298e to 4277b9e Compare January 30, 2024 12:49
@cazala
Copy link
Member

cazala commented Jan 30, 2024

i noticed one issue when i ctrl + D to duplicate it also moves the camera (because WASD moves the camera). Maybe we could check on the camera bindings if the ctrl key is also pressed and prevent the movement, or stop the propagation of the event from the duplicate handler to avoid reaching the camera handler, i dunno

@cyaiox cyaiox force-pushed the feat/add-shortcuts-icons branch from 32eb40f to 4d53180 Compare January 31, 2024 12:50
@cyaiox
Copy link
Contributor Author

cyaiox commented Jan 31, 2024

i noticed one issue when i ctrl + D to duplicate it also moves the camera (because WASD moves the camera). Maybe we could check on the camera bindings if the ctrl key is also pressed and prevent the movement, or stop the propagation of the event from the duplicate handler to avoid reaching the camera handler, i dunno

Hey @cazala -- thanks for the review! issue fixed 🙌

@cyaiox cyaiox force-pushed the feat/add-shortcuts-icons branch from 4d53180 to d39df29 Compare January 31, 2024 14:23
@cyaiox cyaiox merged commit 6dfc702 into main Jan 31, 2024
9 of 10 checks passed
@cyaiox cyaiox deleted the feat/add-shortcuts-icons branch January 31, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Duplicate items hotkey moves the camera Add a Shortcuts/User Guide
2 participants