abstracttext icon indicating copy to clipboard operation
abstracttext copied to clipboard

editing?

Open arthurpsmith opened this issue 4 years ago • 15 comments

So, there's still some cleanup to do on the work I've done so far, but the next major thing I was thinking of looking at was the editing UI. The JsonContentHandler we're deferring to right now doesn't seem to do much; I guess I'll look around if there's existing php JSON editors that might be usable as a starting point. Of course what would really be nice is being able to enter zobject's and keys by name via auto-complete etc. Don't know how far I can get on this, but any pointers on what to look for (or avoid) would be appreciated!

arthurpsmith avatar May 29 '20 21:05 arthurpsmith

Codemirror supports many, and has auto-completion if need be. Here's some starting pages: https://codemirror.net/index.html https://codemirror.net/mode/javascript/index.html https://codemirror.net/1/contrib/php/

thadguidry avatar May 29 '20 21:05 thadguidry

@thadguidry excellent, that looks very close to what's needed, I'll have to check out what it does for json in javascript!

arthurpsmith avatar May 29 '20 23:05 arthurpsmith

Yes, editing is... A VERY BIG OPPORTUNITY for improvement :)

To be honest, I don't really know how to tackle it. I guess, the first step is always to choose the type (dropdown?), and then the rest of the screen gets created based on the type.

But really I was leaving that in the proposal to have designers figure that out and implement it, because it is a very open space still.

My advice would actually be to kinda go crazy and not be too constrained and or conservative, since the first try will likely be wrong anyway, so you can go and just try things out, and then we can learn what works and what doesn't.

vrandezo avatar May 30 '20 00:05 vrandezo

@vrandezo so I'm exploring doing this with the Mediawiki built-in "OOUI" (used for visual editor) - do you have any experience with this? There were other options I looked at but all required additional extensions while this doesn't, so it seemed maybe simpler to try first... Reference: https://www.mediawiki.org/wiki/OOUI

arthurpsmith avatar Jun 03 '20 17:06 arthurpsmith

Sorry, no experience with that. I think it's more than a decade since I did any UI work on MediaWiki the last time :)

vrandezo avatar Jun 04 '20 03:06 vrandezo

@vrandezo slightly unrelated question (related in the sense that I'm trying to figure out in a little more detail how the ZObjects are structured) - Z1 lists TWO key values Z1K6 - for "documentation" and "Wikidata item". I assume one of those should be Z1K7? Neither of them seem to be used so far in the data/Z*.json files; though I notice that Z180 (language) defines its own key for "Q item" - maybe languages should use Z1K7 instead?

arthurpsmith avatar Jun 05 '20 19:06 arthurpsmith

Ouch, thanks, you're right.

I removed the Q item key. I actually don't think that's a good idea anymore.

https://github.com/google/abstracttext/commit/761f090127852c7b0d57a0d77ff56f12a2202900#diff-8089dfabe6f3be38e0bb698ca072cd53

Thanks for reporting!

vrandezo avatar Jun 07 '20 20:06 vrandezo

Probably not OOUI but vue.js is the way forward, as far as I understand.

vrandezo avatar Jun 15 '20 16:06 vrandezo

I'll take a look. OOUI is definitely not as simple to use as I'd hoped. I've gone through a couple of iterations so far and got to the point of modifying a zobject's type, labels, and other string values, but anything more sophisticated is going to need something more!

arthurpsmith avatar Jun 15 '20 17:06 arthurpsmith

Well it seems Vue.js is not supported yet in the released version of Mediawiki, so it looks like working with it requires going to an unreleased version - at least until version 1.35 comes out. That means a bit of fiddling with docker unfortunately. This may take a bit of time to sort out...

arthurpsmith avatar Jun 16 '20 14:06 arthurpsmith

FYI I'm making good progress with Vue - also it looks like MW 1.35 may be out before the end of June, so maybe I can get something useful up around then...?

arthurpsmith avatar Jun 18 '20 18:06 arthurpsmith

@arthurpsmith Great! You could go all the way into embracing the ideas of Abstract Text and Lamda by using Elm :-)

(and this is a useful primer for lots of folks: https://blog.crisp.se/2018/03/08/perlundholm/elm-for-backend-developers)

thadguidry avatar Jun 18 '20 18:06 thadguidry

@vrandezo see pull request #23 - hopefully it's not too much of a pain working with the master branch of Mediawiki; they have been updating the Vue support so something in the last 10 days broke what I'd done and I had to add some further fixes today. I may explore trying to get slightly more stable versions to make this a little easier...? But hopefully 1.35 will be released soon and we can just use that!

arthurpsmith avatar Jun 23 '20 18:06 arthurpsmith

Ah, now I'm seeing an August release date for 1.35. I've updated the pull request to use a specific tagged version that should keep things stable, and fixed all the related issues, so I think it's ready to use when you'd like to try it out.

arthurpsmith avatar Jun 25 '20 17:06 arthurpsmith

@arthurpsmith I think I found perhaps a better editor... https://ace.c9.io/ (Both Cloud9 IDE and Mozilla are actively developing and maintaining Ace.) It's used in many JSON editors as well, like this one: https://jsoneditoronline.org/

thadguidry avatar Jun 27 '20 19:06 thadguidry