KTextEditor : syntax definition priority UI usability
ClosedPublic

Authored by rjvbb on Oct 22 2018, 11:45 AM.

Details

Summary

This implements 2 ideas I evoked in a blog post comment, concerning the usability of the syntax definition priority GUI:

  • provide contextual help in a tooltip. I had never discovered the "what's this" property is set on the priority spinbox because that is something not made evident by the UI. Some usage feedback is useful here IMHO because the effect of a higher priority value isn't necessarily apparent directly.
  • allow negative priority values. This requires no other changes (in the syntax-highhlighting FW) and makes it possible to "filter out" individual definitions (file types) that aren't (won't ever be) relevant and that can conflict with multiple other types. Think of a file type that uses a very common extension used by a number of other types that are more relevant. Decreasing the priority of a single type is less cumbersome than increasing the priority of a possibly unknown number of other types.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 4879
Build 4897: arc lint + arc unit
rjvbb created this revision.Oct 22 2018, 11:45 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptOct 22 2018, 11:45 AM
Restricted Application added a subscriber: kwrite-devel. · View Herald Transcript
rjvbb requested review of this revision.Oct 22 2018, 11:45 AM

+1 for the negative priority idea, might help some people.

For the tooltip stuff: I am not sure if that is not inconsistent with the remaining stuff on these pages.

Other opinions?

rjvbb added a comment.Nov 4 2018, 3:04 PM
For the tooltip stuff: I am not sure if that is not inconsistent with the remaining stuff on these pages.

Is there a platform-agnostic way to trigger the display of the "what's this" pop-up? If so a reminder of that could be shown somewhere, somehow?

dhaumann added inline comments.
src/mode/katemodeconfigpage.cpp
95

I would prefer to set this in the ui file: The maximum is already set to 99. I think it makes sense to set the minimum to -99 there. Can you provide an updated patch?

97

I agree with Christoph, we have no tooltip anywhere so far, so this would be inconsistent.

@ngraham Do you have any comment on this from a usability perspective? I have the feeling that how to show whats-this infos should be maybe solved in a more general way, and not for just one specific spin box.

rjvbb added a comment.Nov 4 2018, 5:58 PM

I would prefer to set this in the ui file: The maximum is already set to 99.

Of course. FWIW, I decided against it because my approach ensures the range is always symmetric and esp. because the comment makes it less likely that someone will clamp the minimum back to 0 because of some pre-conceived idea about priority values.

FWIW, inline "what's this" help is something we're considering removing altogether for a variety of reasons (T9986), so I would prefer to ensure user-friendliness via an intuitive UI, tooltips, and non-inline documentation. Often a little inline note can work. Here's an example from Gwenview's settings dialog, which makes use of this paradigm:

rjvbb updated this revision to Diff 45380.Nov 12 2018, 10:53 PM
rjvbb marked 2 inline comments as done.

updated as requested.

rjvbb set the repository for this revision to R39 KTextEditor.Nov 12 2018, 10:53 PM
rjvbb added inline comments.
src/mode/katemodeconfigpage.cpp
95

Actually, 99 must be the default maximum because I couldn't find where it's set in the ui file...

97

I'm removing the tooltip then. There's very little place to add an explicative label; the only thing I can imagine is adding one somewhere that says something like "select a control and hit Shift-F1 for instructions"

cullmann accepted this revision.Nov 24 2018, 4:41 PM

I think we merge the change here now.
The tooltip is no real issue, we can try to consolidate what-this-tooltip-inline help an other time if somebody has interest.
Allowing negative prios makes sense.

This revision is now accepted and ready to land.Nov 24 2018, 4:41 PM
This revision was automatically updated to reflect the committed changes.
rjvbb added a comment.Nov 25 2018, 9:46 AM
Allowing negative prios makes sense.

Yes, they do make life a bit more bearable but aren't the ultimate solution either, at least not on Mac. The other day I had to work my way through the entire list to set a whole bunch of positive priorities (which I never set) to 0 or -1 because C, C++ and ObjC++ and related files kept being treated as anything but the correct format in KDevelop. Not just inappropriate C-like formats (Ansi C89, SystemC, GCCExtensions) but also completely wrong formats (source code being treated as "Makefile" or vice-versa).
The UI is REALLY not suitable for that kind of mass editing... at the very least it could let the "Delete" button act in some kind of way on built-in formats (hide from list, and then use some Mod-Click to unhide all, a bit like how one can treat system notifications).