Skip to content
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

editing? #19

Open
arthurpsmith opened this issue May 29, 2020 · 15 comments
Open

editing? #19

arthurpsmith opened this issue May 29, 2020 · 15 comments

Comments

@arthurpsmith
Copy link
Contributor

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!

@thadguidry
Copy link

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/

@arthurpsmith
Copy link
Contributor Author

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

@vrandezo
Copy link
Contributor

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.

@arthurpsmith
Copy link
Contributor Author

@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

@vrandezo
Copy link
Contributor

vrandezo commented Jun 4, 2020

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

@arthurpsmith
Copy link
Contributor Author

@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?

@vrandezo
Copy link
Contributor

vrandezo commented Jun 7, 2020

Ouch, thanks, you're right.

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

761f090#diff-8089dfabe6f3be38e0bb698ca072cd53

Thanks for reporting!

@vrandezo
Copy link
Contributor

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

@arthurpsmith
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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...?

@thadguidry
Copy link

thadguidry commented Jun 18, 2020

@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)

@arthurpsmith
Copy link
Contributor Author

@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
Copy link
Contributor Author

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.

@thadguidry
Copy link

thadguidry commented Jun 27, 2020

@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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants