Giter VIP home page Giter VIP logo

cmd-dialog's Introduction

cmd-dialog's People

Contributors

ozzyczech avatar philetaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

philetaylor

cmd-dialog's Issues

Close button

Im not convinced the close button (and the closing of the dialog by pressing esc or clicking outside) is working as expected.

I was expecting that on closing the dialog the new code at

this._results = this.actions;
would be resetting all the actions to be shown again, that is not happening,

To replicate type github, click X, open the cmd+k, and see that only Github is showing, no other actions are visible, I think your intention here was that all should be visible because of this._results = this.actions; which doesnt seem to be working

Screen.Recording.2024-01-03.at.13.04.55.mov

hotkeys (again) not overriding browser default keys

set a hotkey for and item for cmd+n

attempt to use cmd+n

It opens a new browser window, when it should trigger the action/url from the item

The hotkeys docs https://github.com/jaywcjlove/hotkeys#defining-shortcuts state you should be able to return false to override browser default behaviour, I tried that in your source code and it did not work either, you are already having event.preventDefault() in your code.. Im no JS expert sorry, Im mainly PHP :)

// Returning false stops the event and prevents default browser events
// Mac OS system defines `command + r` as a refresh shortcut
hotkeys('ctrl+r, command+r', function() {
  alert('stopped reload!');
  return false;
});

Hotkeys integration bug,

Assign the letter A to a menu item (Like "Your Account")

invoke cmd+k

note that Your Account has a [A] correctly - note you can arrow down and select it and it runs...

BUT note that if you type a in the search box the hotkey is invoked INCORRECTLY and navigates you away to the url of the action.

This is wrong, this should not happen.

I should be able to have hotkeys, but they should not invoke if I am in a search box, text box etc... (They dont invoke, correctly, when Im in a normal input box on my page - they do invoke when the dialog search box has focus - this is incorrect and needs a fix)

Without this fixed, it makes hotkeys unusable if they are single letters like a

chars typed before hitting Cmd+k are shown in dialog

Loving this so far...

A quick bug report

  1. invoke cmd+k
  2. close the popup dialog
  3. smash the keyboard sdfkguys
  4. invoke cmd+K
  5. Note that the smashed keys are in the search box, but not searched for, and overlaid the placeholder

ScreenShot-2023-03-18-22 18 33

Feature requests?

are you taking feature requests?

  1. Ability to color the text (for example using a css class to show a red text for dangerous commands
  2. The ability to use FontAwesome (or other) icon classes as image instead of having to provide the svg source.
  3. Ability to group items. Like a Group of items replicating the main menu called "Main Menu" and a Group of items called "User Account" which contains things like password reset, 2fa and logout etc, and when filtered, for those bread crumb categories to be shown somehow like "User Account -> Set Up 2fa" see my crappy current implementation (my own js/css etc in screenshot)

ScreenShot-2023-03-19-18 40 01

Dark mode not init

So I have been trying to track this down, if I set my whole Mac to use dark mode, and window.matchMedia("(prefers-color-scheme: dark)").matches evaluates to true in the JS Console, the dialog is still not correctly setting the dark theme

Replicated on https://cmd-dialog.vercel.app

ScreenShot-2023-05-19-10 28 48

When lots of items, you search, and the selected item can be randomly in the middle of the list

When lots of items, you search, and the selected item can be randomly in the middle of the list

Hard to explain but after every search, the expectation is that a new list of actions is shown, with the first in the list being highlighted as that is the "most matching" the fuzzy search.

Using your demo as an example, when I search for a the item highlighted is the last but one search result, and the overflow-y-hidden is near the bottom

ScreenShot-2023-12-31-20 28 10

When you have lots (Im up to 40+ in mine) items this becomes more of an issue especially if you type one search, then backspace to clear it and then type another, the "relavant" search result is normally at the top of the list, but now I need to scroll up (or arrow up many times) to get to it

I tried to fix this in cmd-dialog.ts but I just broke it, and was not able then to arrow down to other items :-(

your code:

// Select first result
		if (this._results.length > 0 && this._selectedIndex === -1) {
			this._selected = this._results[0];
		}

		// Nothing was found
		if (this._results.length === 0) {
			this._selected = undefined;
		}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.