grssam / User-Style-Manager

Source Code for the addon User Style Manager
https://addons.mozilla.org/en-US/firefox/addon/user-style-manager/
28 stars 4 forks source link

Smart Editor's prediction (suggestion) function #25

Closed Drugoy closed 12 years ago

Drugoy commented 12 years ago

When the user starts typing a property's name you added a feature to show a drop-down list with suggestions.

  1. The problem is that at the moment you can't navigate in this list using Up/Down arrow keys. You can't select a property with a mouse either.
  2. There is also always a blank line at the bottom of that list - it should be removed.
  3. You've set "Enter" key used to finalize the word, I'd suggest you to use "Tab" instead.
  4. I think list of suggestions shouldn't show up before "{", because everything you type before "{" is related to selectors, not properties and you can't build any predictions for the selectors yet (though it would be super awesome if you coded a feature of invoking some kind of "CSS selectors picker" tool). By the way, could you give a comment about the possible existence of such a tool in the future? Maybe it's possible to use some Firefox's internal tools, like "Menu>Tools>Web Developer>Inspect"?

p.s.: I suggest keeping this issue open, since there will show up more things related to the predi later.

grssam commented 12 years ago

Except for the fact that you could not press enter after selecting any entry in the list, I am not seeing any of the first 2 points.

  1. I can navigate using up down keys, i can select a property also (but selecting does not input it )
  2. There is not blank line at my side. Can you post a screen shot ?
  3. I was thinking the same.
  4. True. I should fix it.
Drugoy commented 12 years ago
  1. Oh, Up/Down arrow keys navigation actually works, I just didn't realize that I had to click the popup list first to be able to navigate in it. Could you change that? This requires to move hands from keyboard to mouse and back to keyboard. Maybe set "Tab" to transfer focus to that list and second "Tab" to paste the selected item?
  2. It is not seen when that list has scroll. Try typing "cl" so there will be just 2 suggested items ("clear" and "clip") but 3 lines. 3rd line is just blank, are you sure you need a screen shot of a blank line? :)
  3. & 4. Awesome.
grssam commented 12 years ago
  1. No, you need not to shift b/w mouse and keyboard. Just start typing anything, like "bac", press down key to go to next result,( or and then ) press Enter for that result to be pushed to the editor. The only thing that does not work is if you click on any of the entry in the list, and then afterwards (while focusing on the list only) press enter, then nothing happens. Which I am working on.
  2. That is just some extra margin, and not an altogether list entry, you cannot select it. That is just because of a minimum width (so that the popup does not looks bad in aspect ratio.) . Does not happens with "background-a"
Drugoy commented 12 years ago
  1. That doesn't work for me. I'm on latest Nightly (well, 1 day old, didn't update to the newest one yet), Win7SP1x64.
  2. Happens even with "backgorund-a" for me too. Anyways, I think it should be removed. minimum-width shouldn't give such an effect, though I do not know what is aspect ratio
grssam commented 12 years ago

That's why I needed you to send me an screenshot. I am on windows 7 x64

Drugoy commented 12 years ago

<img src="http://storage6.static.itmages.ru/i/12/0317/h_1331998835_1099613_c25889c9e3.png>

grssam commented 12 years ago

Okay, apparently, on XP, the panel is not opened with the first result selected by default :| I will fix it. Aspect ration is the ratio of width to height. like 4:3 16:9 . I will still rethink of something. As the bug suggested, That was only the initial implementation, that I did in 4-5 hours :P

Drugoy commented 12 years ago

XP? you said you are on Win7x64, just as me. Anyways, I advice you to set very low priority for that small issue for now. It's not that important now as some other things like "undo" chain of actions getting into the loop.

grssam commented 12 years ago

Oh, sorry I misread your machine. but then why is the styling of the panel completely different for you ? and why is not the first result getting auto selected. Is there any error in error console window ? Can you check ?

Drugoy commented 12 years ago

Sorry for bothering you, it was my local problem. I had GlassMyFox restartless add-on installed and it was the reason of up/down arrow keys not working until I click the list. Switching it off solves the issue.

grssam commented 12 years ago

Can you test with the latest commited code ?

Drugoy commented 12 years ago

yeah, now it works, even with mouse clicks. one thing though: add ":" after pasting the chosen property.

grssam commented 12 years ago

isn't there any other thing that can be added? like "," or if user wants, " " Also, did you test with that glassmy... extension enabled ? Please do.

Drugoy commented 12 years ago

uhm, actually no. Can you give an example? I think you are talking about the cases when some properties are used as values for other properties, like so

smth { -moz-transition: max-height }

where "max-height" is actually a value for '-moz-transition" property, but there is also a property with such a name.

But I think when you redo showing the list of properties for cases before "{" or after ":" then the issue will completely be gone and there are no other cases where you can put something different then ":" after the property's name.

As for GlassMyFox - I tried and the bug is still there. It's the problem of that extension: it is based on incorrect user style (I think it changes -moz-appearance, which affects that bug). Just never mind it.

grssam commented 12 years ago

what about when the user wants to style things around and thus wants to put a space ? I personally do that.

Drugoy commented 12 years ago

Sorry, I don't understand what do you mean. What does "style things around" mean? Around what? Could you give some examples when you type anything other than ":" after the property's name? Except spaces - they can be put almost everywhere and in any quantities, so let's not count them.

grssam commented 12 years ago

style things around : as in : properly give spaces and tabs to indent things. Like

#something {
  background : red;
  margin     : 2px;
}
Drugoy commented 12 years ago

Anyways you type those spaces manually, so it won't be a problem for you to hit left arrow key once before typing those spaces. Not many people do such kind of styling, so if you'd do as I suggested - you will make happier way more people :) You can add a setting to remove auto typing ":" after pasting a property, if you want :P

grssam commented 12 years ago

Carried onto bug #34