-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Matthewary/v-command-palette #21534
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
Draft
MatthewAry
wants to merge
39
commits into
dev
Choose a base branch
from
matthewary/v-command-palette
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Matthewary/v-command-palette #21534
+8,691
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added a comprehensive list of command palette items with titles, subtitles, and icons. - Implemented hotkey functionality for various commands, improving user accessibility. - Enhanced the VCommandPalette component to support item click events and dynamic rendering of items. - Updated styles for better visual presentation of the command palette list. - Introduced localization for command palette instructions in English.
- Improved VHotkey component for better hotkey representation. - Updated useHotkey function to include preventDefault option for more control over event handling. - Enhanced VCommandPalette to support new slot types for header and footer, improving customization. - Added autofocus to the VCommandPaletteSearch component for better user experience. - Refactored event handling in VCommandPalette to utilize updated hotkey options.
- Introduced a comprehensive type system for command palette items, including action, link, parent, and group definitions. - Updated the VCommandPaletteList component to utilize the new item types, improving type safety and clarity. - Refactored item handling logic to accommodate the new structure, ensuring compatibility with existing functionality. - Enhanced the example usage to demonstrate the new item definitions and their properties. - Improved prop types for better integration with VList, ensuring a more robust and maintainable codebase.
- Updated VCommandPalette to improve hotkey representation by changing the format from 'ctrl+f' to 'ctrl-f'. - Simplified item rendering by removing unnecessary template slots for VListItem, enhancing code readability. - Enhanced VHotkey component with a more structured key mapping and improved display logic for key combinations. - Added localization support for the new 'then' hotkey term in English. - Refactored styles in VHotkey for better visual consistency and accessibility.
- Improved the command palette by adding structured item types, including groups and dividers, for better organization and accessibility. - Updated the handler functions to use TypeScript for type safety and clarity. - Enhanced the VHotkey component with a more comprehensive key mapping and improved display logic for key combinations. - Refactored item rendering logic in VCommandPaletteList to support new item structures, ensuring a more maintainable and readable codebase. - Added support for selectable items count to improve keyboard navigation experience. - Improved styling in VCommandPalette for better visual consistency and user experience.
User is able to selectively override items in the keymap in VHotkey
- Introduced a new `useHotkey` composable to handle keyboard shortcuts and key sequences in Vue applications. - Supports single key combinations and complex key sequences with customizable options for event type, input handling, and default behavior prevention. - Implemented platform-specific key handling for Mac users, ensuring consistent behavior across different operating systems. - Added comprehensive unit tests to validate functionality, including edge cases for key sequences and modifier keys. - Enhanced accessibility by allowing hotkeys to be ignored when focused on input elements, configurable via options.
- Introduced a custom filter function for command palette items that accommodates group and parent hierarchies, improving search accuracy. - Updated the `prepend` and `append` slot scopes to include a `search` property, enhancing accessibility and usability. - Refactored filtering logic to maintain compatibility with the existing `useFilter` composable while implementing specific group filtering behavior. - Improved code readability and maintainability by leveraging TypeScript for type definitions and ensuring proper naming conventions.
- Updated slot names from `prepend-item` and `append-item` to `prepend-list` and `append-list` for better clarity and consistency. - Enhanced the selection logic to auto-select the first item when the filter changes or when the dialog opens, improving user experience. - Adjusted SCSS styles for the list divider to include a margin-bottom for better spacing. - Ensured code readability and maintainability by adhering to TypeScript conventions and proper naming practices.
- Added transition removal for the list item overlay to improve performance and visual consistency. - Updated selection logic for arrow key navigation to clarify behavior with comments, ensuring better maintainability. - Changed scroll behavior from 'smooth' to 'instant' for immediate feedback during selection. - Deleted the unused VCommandPaletteInstructions.scss file
- Updated the VCommandPalette to include hotkeys for dark and light theme toggling, improving user experience and accessibility. - Refactored the useHotkey composable to handle edge cases in SSR environments, ensuring robust functionality across different setups. - Enhanced the VCommandPalette's item registration and navigation logic, allowing for better keyboard navigation and focus management. - Improved ARIA attributes for better screen reader support, ensuring compliance with accessibility standards. - Added comprehensive tests to validate the new features and ensure consistent behavior.
- Updated the item matching logic to include keywords, improving search accuracy for command palette items. - Modified filter keys to encompass 'title', 'subtitle', and 'keywords' for more comprehensive filtering. - Implemented state reset functionality when the parent dialog closes, ensuring a clean slate for subsequent openings. - Enhanced code readability by using TypeScript for type definitions and ensuring proper naming conventions. - Added necessary imports and adjusted existing logic for better maintainability and accessibility compliance.
- Added proper typing for the `items` prop in `VCommandPalette`, ensuring it accepts an array of `VCommandPaletteItem`. - Refactored item processing logic to directly utilize `VCommandPaletteItem` properties, enhancing clarity and maintainability. - Updated import statements for consistency and clarity, renaming `VCommandPaletteItem` to `VCommandPaletteItemComponent` for better distinction. - Enhanced the `VListDisplayTypes` type definition for improved type safety and readability. - Ensured accessibility compliance by maintaining focus restoration and hotkey registration logic.
- Introduced improved parsing logic for key sequences, specifically handling the minus key as a separator only between alphanumeric characters. - Added alternative names for the minus key, allowing for better user experience and flexibility in key mappings. - Implemented comprehensive unit tests for VHotkey, covering various key combinations, display modes, and edge cases to ensure robust functionality. - Refactored VCommandPaletteList to adjust the placement of the end divider for improved visual consistency. - Updated scroll behavior for keyboard navigation to 'auto' for a smoother user experience. - Ensured code quality and maintainability by adhering to TypeScript standards and enhancing accessibility features.
- Changed the `transformFilteredItems` and `processItems` functions from arrow functions to named functions
- Updated the `navigationMode` and `selectedIndex` properties to use `shallowRef` instead of `ref` for improved reactivity and performance. - Removed unused `ref` import from `useCommandPaletteContext` and adjusted related code for consistency.
- Updated the VHotkey component to utilize the new VKbd component. - Adjusted SCSS to apply specific styles to the VKbd component.
- Introduced new icon aliases for keyboard keys (command, ctrl, shift, alt, enter, arrow keys, backspace) in md.ts, mdi-svg.ts, and mdi.ts files. - Updated VHotkey component to utilize these new aliases.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This introduces a few things:
Markup:
Use the
packages/vuetify/playgrounds/Playground.commandpalette.vue
file to play around with it.