Sublime Forum

An idea for building a visual interface for settings, etc

#1

Hi,
I feel sometimes using this editor I need some way to tweak/modify/remove/see/etc, preferences via a visual interface. Find a keymap, toggling something, etc

I think is great these settings are mainly json files because these provide flexibility. While at the same time, keep main developer with focus on important things such core behaviour, and low level APIs for developers. ; )

The idea is… instead of build a complicated python interface with little or limited options ( dialogs, forms, etc ) why not build a HTML/JavaScript interface using the new HTML5 File system API
html5rocks.com/en/tutorials/ … ir-reading

Anyone with a chrome browser or Mozilla browser will probably be able to scan the package directory and make changes via a cross platform interface, probably in a single HTML file.

I would like to think most of us, know little bits of JavaScript… is likely to not be so difficult to write or recycle some code, with bumped options, some of my imagination:

  • quickly find any setting/keymap etc
  • a boolean toggling
  • a colour picker
  • key bindings detection and modification, alert of already used keys

There is room for imagination, a lot of room,
don’t know just an idea.

Here comes the summer, is likely that I will not be able to work on this.
If some day I found the time and motivation needed, may I start something.

Regards

0 Likes

#2

It does sound like a nice idea, however one issue is that the range of valid options are not specified anywhere. For example, an interface needs to know which values to offer to the user - a checkbox, radio buttons, an array of textboxes, etc.

0 Likes

#3

I think I agree with spadgos on this one. Though the initial idea sounds nice, I am not sure how practical it is. If you were able to force a standard convention for naming settings (setting1_bool, setting2_list), you would have an easier time. Also, I am not sure I want to open a web browser window to change things in the editor.

It is true we are in age of the GUI, but to be honest, the settings are simple text strings that could easily be managed through sublime. You could pole all the settings and pop them up in a quick panel allowing for searching by typing. If one is selected, simply pop up an input panel with the name of the setting and the value in the editable box. I think this would be a very usable system, and probably not to hard to code up. I think it is one of those things were simplicity is best…but I realize this is also a personal preference thing.

**Edit: ** Thinking about this more, I think I am oversimplifying the issue. You would have to allow the adding additional settings files to pole that are not in the base file settings. You would also have to save the settings to “User” variants of the settings file (creating it if it does not exist). It does actually sound like a lot of work with or without a gui. I don’t know, I guess its a toss up, it might be one of those things, if someone came up with a really good implementation, everyone would use it. I don’t mind the json settings though, what might be nice is a quick panel plugin for showing all the settings files and allowing you to open the one you select; you could even show a transient view of the selection that is highlighted. I think this would be easier and obtainable.

0 Likes

#4

It should be very dynamic, yeah.
Detection of boolean and colours should be easy, also some value “keys” are easy parseable. Its possible.

0 Likes

#5

Double post.

0 Likes

#6

True, a lot of things can easily be identified, but how do you identify something like this:

"example_setting" : ],

It could be an array of anything: string, number, an array of arrays. Without some kind of convention set forth, you would be no better off than javascript is in these situations; all you know is it is an array…of something.

0 Likes

#7

The thing should be recursive. You will always end with a string, int or number or any other conventional type.

0 Likes

#8

Yes it should be recursive, but not all setting will end with a string. For instance, I think sublime linter provides empty arrays for defining lint parameter overrides, but they can be left empty if you wish to accept the defaults.

I guess you could pick an assumed default for empty arrays if you allow it to be changed. By no means do I think the project is impossible, I just wonder how practical it would be. Most settings dialogs work because they are planed out and designed. I worry that a dynamic dialog would be not much better than looking at a json structure, albeit a bit more pleasing in style.

It would seem if you wanted to make intuitive dialogs in a web app or whatever, you would need to require the json setting file, and maybe a dialog mapping config. That way you could render a dialog with tabs that sort related settings, the renderer would be aware of how to render the settings, provide explanations/help info for settings, etc.

I think organization of settings is the real benefit of using dialogs, if this was done, it would be worth using.

0 Likes

#9

Running with the dialog config mapping, this would also allow for the specifying of how to present data to the user.

If you had only certain valid ints: present a drop down menu

If you have a range of values: present a slider

If you have an unknown range, just give a text box

These things can only really be determined if there was some kind of config.

0 Likes

#10

I support this idea, and could help with a few aspects of it (GUI, design, code).

Regarding settings and what values should be attached to what setting - it could be easily fxed by creating a mapping file that will tell the configuration app what each thing is and how to display/interact with it. Plugins could have a small JSON file attached to them that would serve the same purpose. At the very first days of this settings GUI we could manually do the mapping and it will accumulate as we go on, nothing too complicated.

GUI can be initially be based on a free theme, while writing this reply I’ve started this: dl.dropbox.com/u/1290056/sublime … index.html .

If this moves anywhere, I’d be happy to be kept in the loop, my email is eli.sklar@gmail.com

0 Likes

#11

elis, I think you got where I am coming from. If something like this was going to work, this is the way I think it would need to be done. I like the demo site you posted up. The UI looks nice, and good be tailored to Sublime Settings very nice.

In general, with a nice front end like that, and UI mapping included in the plugin, I imagine it could go fairly smoothly. Really, all we would need now, is clearly defined specifications for the UI mapping, and the will to do it.

0 Likes

#12

#push

I like the idea. HTML UIs are greatly configurable and cross-platform (and afaik Sublime does not yet ship with a GUI-building lib for Python). You can parse settings with JS and export them. I don’t know how exactly the FileSystem works and I don’t know if you can access files on your HDD directly or at all.

I don’t have the time for this myself so please, anyone who can complete a task like that (concept, specifications, process, manage tasks (with other people) …), go for it!

0 Likes