Page MenuHomePhabricator

Add a button to toggle syntax highlighting in Quarry
Closed, ResolvedPublic

Description

Problem

Sometimes people need to create/edit queries on Quarry while from mobile. It is quite glitchy to do it normally in my Firefox for Android now.

Proposed solution

It would be nice to have solution we have in Mediawiki for .js editing and similar: a button to toggle highlight. When pressed, replace the syntax-highlighted textarea with a normal textarea. When clicked again, re-enable syntax highlighting.

Related code

The syntax highlight is done using CodeMirror at line 11 of view.js of the Quarry repository analytics/quarry/web. Please send patches to Gerrit and claim this task.

Event Timeline

zhuyifei1999 renamed this task from It should be possible to disable syntax highlight to Add a button to toggle syntax highlighting in Quarry.Dec 22 2019, 5:42 AM
zhuyifei1999 updated the task description. (Show Details)
zhuyifei1999 updated the task description. (Show Details)

Change 561241 had a related patch set uploaded (by Safan41; owner: Safan41):
[analytics/quarry/web@master] Add a button to toggle syntax highlighting in Quarry

https://gerrit.wikimedia.org/r/561241

Change 561241 merged by jenkins-bot:
[analytics/quarry/web@master] Add a button to toggle syntax highlighting in Quarry

https://gerrit.wikimedia.org/r/561241

Mentioned in SAL (#wikimedia-cloud) [2020-01-01T05:58:50Z] <zhuyifei1999_> Deployed cd69638 on quarry-web-01 T147711

Mentioned in SAL (#wikimedia-cloud) [2020-01-01T06:06:37Z] <zhuyifei1999_> Deployed d7ddab8 on quarry-web-01 T147711

Ammarpad moved this task from Backlog to Done (closed) on the Quarry board.
DannyS712 moved this task from Done (closed) to Backlog on the Quarry board.

At least for me, the button doesn't actually disable the syntaxhighlighting...

@DannyS712 Any tracebacks on your side?

Nope, but when I tried on a different computer it worked fine - must be something on my end.
I did notice, however, that the text boxes are different sizes - at https://quarry.wmflabs.org/query/33797, if you click the button, the text box shrinks and a scroll bar appears. Is this intentional?

Mentioned in SAL (#wikimedia-cloud) [2020-01-01T06:47:38Z] <zhuyifei1999_> Deployed 3076232 on quarry-web-01 T147711

I fixed the shrinking issue for width in 849e942. Height... quarry with syntax highlighing enabled auto resizes; do we want to replicate this?

Nope, but when I tried on a different computer it worked fine - must be something on my end.

Probably browser cache.

I fixed the shrinking issue for width in 849e942. Height... quarry with syntax highlighing enabled auto resizes; do we want to replicate this?

Nope, but when I tried on a different computer it worked fine - must be something on my end.

Probably browser cache.

Not a cache issue, that was my first thought. I think a browser extension might be to blame, but that is outside of the scope of this task