Page MenuHomePhabricator

Empty space in IPInfo menu when no edit from an IP address
Closed, ResolvedPublic2 Estimated Story Points

Description

Example: https://www.wikidata.org/wiki/Special:Contributions/1.1.1.1

image.png (608×1 px, 18 KB)

Its height is controlled by this css rule, and maybe such rule should only applied to IP address with existed edits only.

.ext-ipinfo-panel-layout > :not(.mw-collapsed) {
    min-height: 20em;
}

AC

  • There is no extra jump (if not possible we will have to chat to @Prtksxna) <-- This was not possible, so we have reintroduced T306746, but only in the error state (see T315005#8177790)

Event Timeline

TThoabala set the point value for this task to 2.
TThoabala added a subscriber: Prtksxna.

I don't know if we can tell what the correct height should be before making the request to the IP Information API.

Another example, although slightly less noticeable:

height_reserved_enable_form.png (446×994 px, 52 KB)

Prtksxna moved this task from Up Next to In Progress on the IP Info board.

@Tchanders , @TThoabala , it seems to have been solved while working on this task https://phabricator.wikimedia.org/T314394. How do i go about this?Should i move this to code review?Thanks

@Cyndymediawiksim I'm still seeing the problem in this task, even with the patch from T314394 applied. E.g. I go to Special:Contributions/<some IP that has no edits>, and I see the same as the screenshot in this task's description, with lots of space below the error message.

However, I agree with @dom_walden that it may not be possible to fix this. What's happening:

  1. The JS loads on the page and determines that the infobox should be open
  2. The infobox is rendered open, with a loading bar
  3. The data are returned - either full IP information or an error. This may take some time on some setups.
  4. The information/error is displayed in the already-open infobox

We set the height of the infobox before step (3), to avoid a jump during (4). At that point we do not know whether we will get full IP information or an error, so we set it to the height that is needed to contain the full information.

@Prtksxna Do you think it is acceptable to close this, or should we do something else here?

@Prtksxna Do you think it is acceptable to close this, or should we do something else here?

Thanks for the explanation! Is it possible to set the height of the box to match its content after step 4? It might introduce another jump (the third one?) but since this an error case its probably okay.

We could set a different min-height whenever the infobox contains the error message. (In theory the error message could be different lengths, but we could guess and make it closer.)

Change 828491 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/IPInfo@master] Remove empty space when no edit from an IP Address

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

Change 828491 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Remove empty space when no edit from an IP Address

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

@Cyndymediawiksim The height of the infobox without an error is slightly less now:

infobox_height_T315005.png (371×1 px, 87 KB)

On Vector 2022:
Before: 308.017px
After: 298.883px

I notice that the new CSS also matches in the case when there is no error.

Change 829842 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/IPInfo@master] Resize infobox if no revisions exist

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

@Prtksxna @dom_walden After discussing with @Cyndymediawiksim, we're going to take a different approach.

The new patch fixes only the problem in the task description: when the IP address has no revisions, and so no API call is ever made. (In this situation, keeping the infobox shorter does not cause an extra jump when the error is appended.)

It doesn't fix the situation when the API returns an error, because that would cause an extra jump. Since it is a rarer occurrence, I think it is less likely to be reported as a bug.

@Prtksxna Is this OK? We could make a simple update to the patch to fix the second situation too, but I'm wary of reintroducing the jump since we don't need to in order to fix the problem that was reported...

Since it is a rarer occurrence, I think it is less likely to be reported as a bug.

Yep that makes sense. I agree, let's not reintroduce the jump in fixing parts of this.

@Prtksxna Is this OK?

Wanted to confirm that the box will keep its original size (bigger) after the error message has loaded. Like in F35423635?

Wanted to confirm that the box will keep its original size (bigger) after the error message has loaded. Like in F35423635?

Not for that particular error. That error occurs before the API call is made, so it will display like this (and with no jump):

image.png (310×1 px, 30 KB)

But when the API returns an error, we would see (which avoids a jump when the infobox shrinks):

image.png (442×1 px, 18 KB)

That second case should be rare from the UI though - in theory the user shouldn't be able to get there if they don't have permission, the revision doesn't exist, they're blocked, etc.

Change 829842 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Resize infobox if no revisions exist

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

Thanks for explaining @Tchanders. All makes sense 👍🏾

Dom and I validated that the empty space does not exist in IPInfo in Beta as seen in the screenshot. We also validated that the empty space does not exist when a user does not have rights.

We did have a question for @Tchanders regarding your comment on Fri, Sep 9, 7:51 AM. What were the steps did you take to create that screenshot error with "You do not have permission to perform the action"? Does that need to be tested?

Empty Space IPInfo_PASS.png (749×3 px, 165 KB)

We did have a question for @Tchanders regarding your comment on Fri, Sep 9, 7:51 AM. What were the steps did you take to create that screenshot error with "You do not have permission to perform the action"? Does that need to be tested?

Empty Space IPInfo_PASS.png (749×3 px, 165 KB)

Ah, good question. It wasn't a real case - I forced the API to return the error by changing the code - so no extra testing needed. Thank you both!

Ok sounds good, we'll mark it as done!

We did have a question for @Tchanders regarding your comment on Fri, Sep 9, 7:51 AM. What were the steps did you take to create that screenshot error with "You do not have permission to perform the action"? Does that need to be tested?

Empty Space IPInfo_PASS.png (749×3 px, 165 KB)

Ah, good question. It wasn't a real case - I forced the API to return the error by changing the code - so no extra testing needed. Thank you both!