Page MenuHomePhabricator

Submit Wish (or Focus Area) appears briefly after Refresh when already voted
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
GMikesell-WMF
Aug 12 2025, 5:40 PM
Referenced Files
F65986992: 2025-09-08_10-38-34.mp4
Sep 8 2025, 5:54 PM
F65986987: 2025-09-08_10-41-26.mp4
Sep 8 2025, 5:54 PM
F65961456: 2025-09-04_11-28-36.mp4
Sep 4 2025, 6:32 PM
F65961454: 2025-09-04_11-27-33.mp4
Sep 4 2025, 6:32 PM
F65961337: 2025-09-03_09-14-45.mp4
Sep 4 2025, 6:32 PM
F65961335: 2025-09-03_09-11-24 copy.mp4
Sep 4 2025, 6:32 PM
F65742716: 2025-08-12_10-35-00.mp4
Aug 12 2025, 5:40 PM

Description

Steps to replicate the issue (include links if applicable):

What happens?:

Support Wish appears briefly before it changes back to Already Supported

What should have happened instead?:

Support Wish should not appear briefly

Other information (browser name/version, screenshots, etc.):
OS: macOS Sequoia 15.6
Browser: Chrome 138


Derived Requirements

  1. On wish or focus area pages, if the user has already voted, the correct state (Already Supported) must be displayed immediately on page load.
  2. The "Support Wish" (or "Submit Focus Area") button must not briefly appear after a page refresh before switching to the correct voted state.
  3. Voting state persistence must be handled in a way that avoids UI flicker, ensuring seamless user experience across reloads.
  4. This behavior must be consistent across all supported browsers and devices.
Test Steps

Test Case 1: Prevent flicker after voting on a wish

  1. Navigate to a wish page without an existing vote.
  2. Click Support Wish to cast a vote.
  3. Refresh the page.
  4. ✅❓❌⬜ AC1: Confirm that Already Supported displays immediately with no flicker of "Support Wish".

Test Case 2: Refresh when already voted

  1. Navigate to a wish page where you have already voted (e.g., W1).
  2. Refresh the page.
  3. ✅❓❌⬜ AC2: Confirm that Already Supported displays immediately without showing "Support Wish" first.

Test Case 3: Verify consistency across focus areas

  1. Navigate to a focus area where you have already voted.
  2. Refresh the page.
  3. ✅❓❌⬜ AC3: Confirm that Already Supported (or equivalent) appears instantly without flicker.

Test Case 4: Verify unaffected behavior for non-voters

  1. Navigate to a wish/focus area where you have not voted.
  2. Refresh the page.
  3. ✅❓❌⬜ AC4: Confirm that the "Support Wish" button remains available and does not incorrectly display Already Supported.

QA Results - Meta Beta

ACStatusDetails
1pass per T401726#11160990
2T401726#11149532
3pass per T401726#11160990
4T401726#11149532

Event Timeline

MusikAnimal renamed this task from Submit Wish appears briefly after Refresh when already voted to Submit Wish (or Focus Area) appears briefly after Refresh when already voted .Aug 27 2025, 6:41 AM
Samwilson changed the task status from Open to In Progress.Sep 1 2025, 3:21 AM
Samwilson claimed this task.
Samwilson subscribed.

If we don't show the button until we've retrieved the vote status, there would be a vertical jump in the content. So perhaps an initially disabled button should be shown, with text "Fetching vote details…" or something? Or even an icon-only button, showing the check mark and then changing to having the text when the state is known?

Oh no I wasn't thinking right: the jump is from just loading the button's Vue app, so will happen regardless. So it seems like it's find to delay showing the button until we've fetched the vote status. A disabled button could perhaps be output in the HTML as the .ext-communityrequests-voting-btn element, but that's a separate issue.

Change #1183282 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/CommunityRequests@master] Only show voting button after fetching vote status

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

Change #1183282 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] Only show voting button after fetching vote status

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

Thanks @GMikesell-WMF! The flash of the wrong button text should be fixed now.

@Samwilson Can you please review AC1 and AC3 to see if those flickers are fine? Thanks!

Test Result - Meta Beta

Status: ✅ PASS / ❓Need More Info
Environment: Meta Beta
OS: macOS Sequoia 15.6.1
Browser: Chrome 139
Device: MBA
Emulated Device: NA

Test Artifact(s):
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/Wishes/W1
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/Wishes/W2
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/Focus_areas/FA1
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/Focus_areas/FA6

Test Steps

Test Case 1: Prevent flicker after voting on a wish

  1. Navigate to a wish page without an existing vote.
  2. Click Support Wish to cast a vote.
  3. Refresh the page.
  4. AC1: Confirm that Already Supported displays immediately with no flicker of "Support Wish".

It's not a "Support Wish" flicker, but it does flicker as seen in the video. Only saying this because in AC2, with one that's already voted, has no flicker.

Test Case 2: Refresh when already voted

  1. Navigate to a wish page where you have already voted (e.g., W1).
  2. Refresh the page.
  3. AC2: Confirm that Already Supported displays immediately without showing "Support Wish" first.

Test Case 3: Verify consistency across focus areas

  1. Navigate to a focus area where you have already voted.
  2. Refresh the page.
  3. AC3: Confirm that Already Supported (or equivalent) appears instantly without flicker.

Same as AC1 if this flicker is fine or not

Test Case 4: Verify unaffected behavior for non-voters

  1. Navigate to a wish/focus area where you have not voted.
  2. Refresh the page.
  3. AC4: Confirm that the "Support Wish" button remains available and does not incorrectly display Already Supported.

Change #1184964 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/CommunityRequests@master] Set min-height for voting button HTML to avoid layout shift

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

I'd thought perhaps this wasn't worth fixing, but really it is fairly annoying to have the votes list jump downwards like that, and the fix appears to be pretty simple.

Maybe at some point we'll be able to hydrate the rendered HTML, but for now we can cheat I think.

Change #1184964 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] Set min-height for voting button HTML to avoid layout shift

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

Thanks @GMikesell-WMF, can you check again? The vertical space should stay blank and large enough for the button, until the button loads. The text lower down the page shouldn't move now when the button loads.

@Samwilson It still flickers and with slight page scroll moves when it pops back. If the videos below are fine, I'm ok with passing it through. Just let me know, thanks!

Test Artifact(s):
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/Wishes/W1
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/Wishes/W2
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/Focus_areas/FA1
https://meta.wikimedia.beta.wmcloud.org/wiki/Community_Wishlist/Focus_areas/FA6

Test Steps

Test Case 1: Prevent flicker after voting on a wish

  1. Navigate to a wish page without an existing vote.
  2. Click Support Wish to cast a vote.
  3. Refresh the page.
  4. AC1: Confirm that Already Supported displays immediately with no flicker of "Support Wish".

It flickers but it is faster. I would fine if you say this is ok.

Test Case 3: Verify consistency across focus areas

  1. Navigate to a focus area where you have already voted.
  2. Refresh the page.
  3. AC3: Confirm that Already Supported (or equivalent) appears instantly without flicker.

Same as AC1 if this flicker is fine or not

The support text at the bottom shifts down a couple of pixels in your video, but the biggest shift down is I think because of the central notice banner at the top loading. So yep I think it's all fine!

(I wonder if there's a quick way to make slo-mo screencasts…)

Great, I will mark this as Resolved. Thanks for all your work!

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.