Page MenuHomePhabricator

Automatically update participant list on event page after new registration
Closed, ResolvedPublic

Description

As a campaign participant, I want to see my username automatically added and the number of participants to go up by 1 when I register for an event, so that I can know that I am fully registered without any confusion or need to refresh the page.

Acceptance Criteria:

  • When a participant registers for an event on the event page, the registration header and the 'more details' display should:
    • Automatically update to show the new number of participants (it should go up by 1) in the registration header and 'more details' section
    • Automatically display the username of the participant who registered in the 'more details' section
  • Note: It is acceptable behavior for the page to be refreshed in order for these changes to be displayed to the user for V1. We may want to change this behavior in later versions, but it is fine for V1.

Visual examples of current behavior (see that person is attending, but 0 participants are displayed):

Screen Shot 2022-07-08 at 9.31.40 AM.png (1ร—2 px, 600 KB)

Screen Shot 2022-07-08 at 9.31.50 AM.png (1ร—2 px, 465 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJul 8 2022, 1:34 PM

Noting here for posterity that we will refresh the page when you register so that you always see the latest version of the list. Since the dialog is generated on the PHP side (because of limitations like T21992 and T181684), controlling its behaviour from JS is a bit challenging. There would be many edge cases like:

  • If an event has 40 participants (only 20 are shown) and you register, should we show 21 (you + others) or 20 (you + others - last previous)?
    • If 21: should we still show 21 when you refresh the page or go back to 20?
  • We would need to conditionally hide/show the "view full list" link if the limit of 20 is crossed when you (un)register

All in all, it seems unnecessarily complex to make this work now. Instead, it would be much easier to make it work properly once the dialog logic is moved to the JS side (i.e., when the tasks linked above are fixed).

Change 817313 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] Improve behaviour of registration header and dialog

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

Change 817313 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Improve behaviour of registration header and dialog

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

vaughnwalters subscribed.

Registration header and more details display are correctly updated when a participant registers

Screen Recording 2022-08-15 at 1.51.14 PM.mov-6182BF8E-88F8-4818-8F7D-143542A05A42.gif (506ร—720 px, 2 MB)

This is now working as expected (as shown in video example shared above). I'm marking this as Done.