Skip to content

Conversation

@0MUHAMMEDIRFAN
Copy link

This pull request introduces several updates to the frontend codebase, focusing on enhancing the Sidebar component's functionality, improving development workflows, and refining the pan-and-zoom utility. The most notable changes include adding a collapsible Sidebar feature, updating the development script to support hosting, and enabling horizontal panning with the Shift key.

Sidebar Enhancements:

Development Workflow Improvement:

  • frontend/package.json: Modified the dev script to include the --host flag, allowing the development server to be accessed from external devices.

Pan-and-Zoom Utility Enhancements:
Modified the setPanAndZoom function in frontend/src/utils/panAndZoom.ts to enable horizontal panning when the Shift key is pressed, improving navigation capabilities.

Implemented support for detecting Shift key presses during scroll events. When the Shift key is held, the scroll direction is now reversed to provide a more intuitive horizontal-to-vertical scroll behavior—especially for devices with limited axis support.

Previously, this was not an issue on laptops with touchpads, which support multi-directional scrolling. However, certain mouse devices only support horizontal (X-axis) scrolling. In those cases, holding the Shift key now triggers vertical (Y-axis) scrolling instead.

This update ensures consistent scrolling behavior across both laptops and external mouse devices.

Copy link
Member

@ruchamahabal ruchamahabal left a comment

Choose a reason for hiding this comment

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

Thanks for attempting to contributing but:

  1. I will soon be adding espresso style Sidebar to frappe-ui/Studio with more functionality and standard styles.
  2. You have also pushed package-lock.json in this. We have yarn.lock for versioning.
  3. Will be adding more standard keyboard shortcuts in a separate PR. Won't be able to accept this.

Also, try to send separate PRs for unrelated changes. Will be easier to get them reviewed and merged. So I will have to close this PR.

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.

2 participants