Page MenuHomePhabricator

The LaTeX formula inspector jumps around a lot when making mistakes and stopping typing whilst editing large formula
Closed, ResolvedPublic8 Estimated Story Points

Description

When editing a large formula such as the one is https://en.wikipedia.org/wiki/Matrix_(mathematics) definition section the edit window moves about at lot.

This happens because while editing the you will create syntax errors when adding a new command, say adding the variable \theta you first have to type \the which causes an error. This in turn changes the displayed equation to a long error message which has a different size to the equation, both the height and width change. The editing window seems to be positioned center aligned with the bottom displayed equation. So its position moves.

This behaviour is really distracting as the place your editing keeps moving. There might be a way to position the edit window with a more stable position, making it left aligned would reduce some of the problem.

Still better would be some other way of indicating errors.Say display the last working formula together with turning the done button red and making it inactive. This would have the beneficial side-effect of preventing broken code being inserted.

Event Timeline

SalixAlba raised the priority of this task from to Needs Triage.
SalixAlba updated the task description. (Show Details)
SalixAlba subscribed.
Jdforrester-WMF renamed this task from The latex math inspector jumps around a lot when editing large formula to The latex math inspector jumps around a lot when making mistakes and stopping typing whilst editing large formula.Sep 15 2015, 6:08 PM
Jdforrester-WMF set Security to None.
Jdforrester-WMF added a project: Math.

Making it left-aligned would be out of keeping with everything else, and not very helpful for very long formulæ. Maybe we could increase the debounce so it takes longer to update (giving you the opportunity to fix your mistake)? But that would make it less responsive, which is sad. :-(

If we adjusted the extension to return failure state to the editor (so it shows as 'wrong' by the input being red ringed in the editor, rather than in the formula, and doesn't let you save), that would fix the issue you're talking about, but changing a matrix to a vector or other large (if rare) changes would still result in the editor moving around. Would that be enough for your concerns?

Jdforrester-WMF renamed this task from The latex math inspector jumps around a lot when making mistakes and stopping typing whilst editing large formula to The LaTeX formula inspector jumps around a lot when making mistakes and stopping typing whilst editing large formula.Sep 15 2015, 6:13 PM
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF edited a custom field.

This is indeed an annoying problem when using these inspectors. As a quick fix we can stop updating the rendering if there is an error and instead add some red highlighting to indicate that there's a problem.

Having the error state in the inspector would be even better but is a bigger problem to fix, addressed by bug T113172.

Preventing saving if there is an error is also a complicated issue (view/model problem) but since wikitext lets you do this anyway at least it wouldn't be a regression.

Change 242561 had a related patch set uploaded (by Tchanders):
Check for error in Parsoid response for score node

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

Change 242722 had a related patch set uploaded (by Tchanders):
Check for error in Parsoid response for math node

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

Change 242558 merged by jenkins-bot:
Don't render errors in generated content

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

Change 242561 merged by jenkins-bot:
Check for error in Parsoid response for score node

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

Change 242722 merged by jenkins-bot:
Check for error in Parsoid response for math node

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

This has introduced some side effects which we probably need to consider fixing:

1.When I change a LaTeX formula from \pi to \p it still renders as pi on CE with red highlight.
2.If you have saved some wrong LaTeX formula added in CE, it does not show up as an inspectable node to correct it even though it shows as "Failed to parse" error. There is no way to edit and correct it from VE.

I have created two separate issues on this and marking this one as verified :

https://phabricator.wikimedia.org/T114453
https://phabricator.wikimedia.org/T114455