Page MenuHomePhabricator

VE can't edit tables nested inside a transcluded table (example: row number single-column table from {{Rank}} on English Wikipedia)
Open, Needs TriagePublic

Description

See template that adds the row number column:
*https://en.wikipedia.org/wiki/Template:Static_column_begin
*https://en.wikipedia.org/wiki/Template:Rank - {{Rank}} is a redirect.

There are more and more tables that use that template. See WhatLinksHere:
*https://en.wikipedia.org/wiki/Special:WhatLinksHere/Template:Static_column_begin

For example;
https://en.wikipedia.org/wiki/List_of_metropolitan_areas_by_population

Launch the Visual Editor. Click on the table anywhere. Try editing anything on the table. It's not possible.

This is another reason for implementing the built-in row number option here:
*T42618. jquery.tablesorter: Add support for a "fixed" column of row numbers.

Event Timeline

Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald TranscriptFri, Feb 14, 3:42 PM
Timeshifter updated the task description. (Show Details)Fri, Feb 14, 3:45 PM
Aklapper renamed this task from VE can't edit tables with row number column from {{Rank}}. Another reason to implement built-in row number option. to VE can't edit tables with row number column from {{Rank}}.Fri, Feb 14, 5:24 PM
Aklapper added a project: VisualEditor-Tables.

@Timeshifter: Assuming this task is about VisualEditor-Tables hence adding project tag so someone could find this task when searching for tasks under that project.

Restricted Application added a project: VisualEditor. · View Herald TranscriptFri, Feb 14, 5:25 PM

The example link at https://en.wikipedia.org/wiki/List_of_metropolitan_areas_by_population are two completely separate tables nested inside of a table.
Simplified structure, if you look at the source code:

<table>
  <tbody>
    <tr>
      <td>
        <table>
          <tbody>
            <tr>
              <th>Rank<br /></th>
            </tr>
            [...]
            <tr>
              <td>103<br /></td>
            </tr>
          </tbody>
        </table>
      </td>
      <td>
        <table>
          <tbody>
            <tr>
              <th>Metropolitan</th>
              <th>Country</th>
              <th>Continent</th>
              <th>Official population</th>
              <th>Year</th>
            </tr>
            [...]
          </tbody>
        </table>
      </td>
    </tr>
  </tbody>
</table>
<h2>See also</h2>

I'm wondering why one would use such broken designs and then expect things to somehow work.

Aklapper renamed this task from VE can't edit tables with row number column from {{Rank}} to VE can't edit tables nested inside a table (example: row number single-column table from {{Rank}} on English Wikipedia).Fri, Feb 14, 5:40 PM

VE can edit tables nested inside a table just fine. But it can't edit anything nested inside a transclusion, and in this case we have a table nested inside a transclusion.

Timeshifter added a comment.EditedSat, Feb 15, 1:18 AM

matmarex. You are correct. I found a table using the old method of adding a separate row number column. It is not inside a transclusion. It is editable with the visual editor. See table partway down this user page:
*https://en.wikipedia.org/wiki/User:Timeshifter/Sandbox74

It is two tables nested side-by-side inside another table. But it is editable with the Visual Editor.

Timeshifter renamed this task from VE can't edit tables nested inside a table (example: row number single-column table from {{Rank}} on English Wikipedia) to VE can't edit tables nested inside a transcluded table (example: row number single-column table from {{Rank}} on English Wikipedia).Sat, Feb 15, 1:20 AM
Timeshifter added a comment.EditedSun, Feb 16, 5:55 PM

The example link at https://en.wikipedia.org/wiki/List_of_metropolitan_areas_by_population are two completely separate tables nested inside of a table.
Simplified structure, if you look at the source code:

...

I'm wondering why one would use such broken designs and then expect things to somehow work.

The table can be edited easily in wikitext. The problem is editing in the Visual Editor.

And the row number column works fine with the table. Even with various text sizes in one's browser. Also, {{Rank}} is a much easier method of adding a row number column than the previous method.

With {{Rank}} one can add a row number column by adding a single line of wikitext at the top of the table. And {{End}} at the bottom of the table. That single line of wikitext though has to be specific to that table. It is not intuitive like the proposed solution via this:
T42618. jquery.tablesorter: Add support for a "fixed" column of row numbers.

That is where I would hope more developer energy would be expended. I thought a solution had been found there. What is holding up its implementation?

In the meantime people are adding {{Rank}} to tables because that is basically all we have. Maybe the visual editor could be programmed to ignore that {{Rank}} template and not try to show the row number column. Then the Visual editor could edit the main table and not the row number table.

But the problem remains that the rows will misalign between the 2 tables if there is any laddering due to smaller screen sizes. The addition of class=nowrap prevents that, but makes for wide tables extending past the screen when using smaller screens or lower display resolutions.

The T42618 solution does not have that problem because there is only one table, and the row-number column is integrated into it.

Timeshifter updated the task description. (Show Details)Sun, Feb 16, 5:55 PM

What is holding up its implementation?

You have not provided a patch yet. :) See https://www.mediawiki.org/wiki/Bug_management/Development_prioritization

Timeshifter added a comment.EditedMon, Feb 17, 12:38 PM

What is holding up its implementation?

You have not provided a patch yet. :) See https://www.mediawiki.org/wiki/Bug_management/Development_prioritization

Schnark and matmarex both provided patches years ago. I don't know why they are not being implemented. I would think by now that the problems blocking them years ago may have been fixed. I don't thing anybody is looking to see if that is true. In most cases I am not qualified to see if that is true. I know one reason is no longer true; the problem with old browser versions.

And adding class="sortable autonumber" was all that was needed for a solution provided by Yair Rand all the way back in 2014. So there are 3 patches. Surely by now, the problems blocking them have been solved? Or could be solved?