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
Auto-completion in HTML panel #105
Conversation
Awesome! I guess you should put yourself as the owner of these issues and reference that pull request on each of them. Florent |
Eh, I'm lazy. It doesn't reach anyone who doesn't see this PR already. Anyway, so most of this I'm reasonably confident in and doesn't need much testing. I'm looking for feedback on:
Expanding on the latter item, here's STR:
etc. (just play around with style attributes and maybe other attributes too - the interesting thing is how it feels to use, what feels weird, what's missing etc.) * motivation: if we include a single semicolon users will end up with things like "color: black;background: red" which looks weird; if we include "; " then we get trailing spaces... (cc @SebastianZ @janodvarko) |
Latest idea to handle tab in "style" attribute: add ": " or "; ", and then remove trailing spaces when editing ends. |
Sorry for the late reply on this.
To answer your questions:
"color: " is fine.
Should be completed to "color: black; " (as it's done now).
Should be completed to "color: " (with space). I didn't check the code related to the changes yet. Won't have enough time the next days either to do that. So someone else should review it. Sebastian |
This is a good point. I found the related issue 4457, and I like the suggestion to automatically jump to the right attribute value after typing an attribute name and tab (kindof like Firefox's "switch to tab" in the location bar). But yes, in the mean time we should absolutely remove already set attribute names from auto-completion.
Actually it happens even for the CSS and Style panels. But this feels like a much less often encountered problem, and it's a bit trickier to get right. Combine that with that the error behavior is much better than for attributes I'm inclined to leave this as it is.
Do we really want that? I would expect the result of typing |
Yes, I also had that issue in mind, but it can be done later.
Well, if the list of properties is long, it might happen that you define a property a second time. Anyway, this can be done later, too.
The second space is not added automatically. Again, for consistency I'd say Tab and colon/semicolon should have the same behavior (like they have inside the CSS and Style panel). Sebastian |
I added this - it probably works well enough. Do you want/have time to review this at some point? |
Works fine for me. Thanks! Found one little other thing: Pressing Tab when you've completely written the property name should still complete the ": " and stay within the "style" attribute value. Currently you're jumping to the next attribute. Sebastian |
Sure, I can fix that. But for property values we should still jump to the next attribute, right? |
Right. |
done |
Rebased, and slightly refactored. I guess I should just merge this (after adding tests). |
Thank you for the review, Sebastian! |
No problem. Sorry that I didn't do that earlier! Sebastian |
Comments addressed except for the line length thing. |
Merged in 2763f22. |
Assorted fixes for issues 3931, 3700, 6854, 4458, 6814. (Still wanted: auto-completion for "class" attribute; only including the SVG tags/attributes supported by Firefox.)
Anyone wanna try this out and see if anything feels buggy? In particular, behavior of the tab key within the "style" attribute is weird and needs some discussion. (And I guess Enter should be the same as Tab.)
Code comments are of course also welcome.