VisualEditor: Tab layout should be done from a top-loading module
Closed, ResolvedPublic

Description

The "Edit source" tab loads/renders a little bit after the "Edit" tab, sometimes more noticeably so, sometimes less. Relatedly, clicking the "Edit" tab very early on sometimes invokes the wikitext editor.

It would be preferable for both tabs to be rendered simultaneously with the correct default behavior.


Version: unspecified
Severity: normal

bzimport set Reference to bz50542.
Eloquence created this task.Via LegacyJul 2 2013, 12:43 AM
Mdennis-WMF added a comment.Via ConduitJul 2 2013, 1:38 AM

Should this be merged in some way with Bug 50540?

Eloquence added a comment.Via ConduitJul 2 2013, 1:39 AM

No, this bug is about the tabs at the top of the page (Read/Edit/Edit source), while bug 50540 is about the section-level edit links.

Jdforrester-WMF added a comment.Via ConduitJul 3 2013, 2:14 AM

Re-titling slightly per discussion; the suggestion is now:

  • VisualEditor (?in PHP for efficiency/simplicity) hooks into the page before display
  • On this hook,
    • we add the VE edit tab ("edit")
    • we switch out the WT edit tab with a new label and tool-tip ("edit source")
    • we display:none the former if the user doesn't pass the blacklist code
Patrick87 added a comment.Via ConduitJul 3 2013, 2:37 AM

Sounds good. This could also fix bug 50402 at the same time I think?

What do you mean by "we display:none the former if the user doesn't pass the blacklist code"? What is the "blacklist code"?

bzimport added a comment.Via ConduitJul 3 2013, 11:48 AM

pinkampersand.wikimedia wrote:

(In reply to comment #4)

What do you mean by "we display:none the former if the user doesn't pass the
blacklist code"? What is the "blacklist code"?

I believe James is referring to the part of VE that checks a user's browser and compares it against a "blacklist" of non-supported browsers. "display:none"-ing the VE edit tab thereby stops people from using VE if their browser's not going to let them.

One of y'all devs can correct me if I'm wrong here.

Patrick87 added a comment.Via ConduitJul 3 2013, 2:12 PM

Shouldn't blacklisting occur much earlier (before actually messing around with any buttons at all?). Before having done *anything* actually?

I'm hoping for a definite answer by James (or another dev involved).

Jdforrester-WMF added a comment.Via ConduitJul 3 2013, 8:27 PM

(In reply to comment #6)

Shouldn't blacklisting occur much earlier (before actually messing around
with any buttons at all?). Before having done *anything* actually?

I'm hoping for a definite answer by James (or another dev involved).

Yes; that's bug 50608. We're re-working a whole bunch of items around the initialisation and integration code for VisualEditor right now - bug 50612 tracks that.

Catrope added a comment.Via ConduitJul 3 2013, 8:30 PM

Ideally we'd alter the HTML using a PHP hook, then have a top-loading module that just conditionally adds some CSS to make the HTML generated by the PHP hook display correctly. That should allow us to get rid of the flashing tab behavior.

gerritbot added a comment.Via ConduitJul 3 2013, 10:16 PM

Change 71929 had a related patch set uploaded by Krinkle:
Split off setup from the rest of mw.ViewPageTarget

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

gerritbot added a comment.Via ConduitJul 3 2013, 11:26 PM

Change 71929 merged by jenkins-bot:
Split off setup from the rest of mw.ViewPageTarget

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

Catrope added a comment.Via ConduitJul 3 2013, 11:30 PM

(In reply to comment #10)

Change 71929 merged by jenkins-bot:
Split off setup from the rest of mw.ViewPageTarget

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

This introduces a top-loading module, but still does the tab layout from document ready, which means there's probably still is a flash. What we should really do is change the HTML from PHP, per comment 8.

gerritbot added a comment.Via ConduitAug 2 2013, 3:31 AM

Change 77165 had a related patch set uploaded by Catrope:
Move edit tab generation into PHP and make it more configurable

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

Jdforrester-WMF added a comment.Via ConduitAug 2 2013, 5:58 AM

This is now done, and deployed.

Add Comment