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: improved command selector with scroll and scroll into view #118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

32teeth
Copy link
Member

@32teeth 32teeth commented Oct 3, 2024

Problem

  • When resizing the window, the command popup was not adjusting its size or anchoring correctly.
  • Scrolling through the command popup using up/down arrows did not bring the focused element into view, causing confusion for the user.
  • Text and fonts in the command popup appeared blurry due to transform resolution issues.
  • The static import open from 'open'; was still broken, leading to local execution issues.
  • The web watch in dev mode required hard refreshes to reflect changes.

Solution

  • Window Resize Handling: Added an event listener for window resize to ensure the command popup adjusts its size dynamically.
  • Sticky Group Titles: Implemented sticky group titles in the command popup using position: sticky, enhancing navigation and focus visibility.
  • Intersection Observer: Added an IntersectionObserver to decorate group titles when they become stuck, providing better visual cues to users.
  • Optimized Memory Usage: Refactored command element into a selectedElement property to reduce memory overhead and improve performance.
  • Internal Class Property Enhancements: Introduced internal class properties for better memory management and UI state tracking.
  • CSS Improvements: Fixed CSS to ensure all transition properties are applied correctly, improving the responsiveness of the UI.
  • Scroll Snap: Integrated the CSS scroll-snap feature for smoother scrolling and better focus management within the command popup.
  • Dynamic Import Fix: Replaced the static import with dynamic import() for loading the open module, fixing the local execution issue.
  • Live Server & Hot Reloading: Added a new serve:example script using live-server to enable live reload functionality, removing the need for hard refreshes during development.

improvedCommandWindowUi

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@32teeth 32teeth requested a review from a team as a code owner October 3, 2024 17:37
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.

1 participant