WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 2 days ago

#41112 assigned enhancement

Show WordCamps higher up in the News Dashboard widget

Reported by: grapplerulrich Owned by: metalandcoffee
Milestone: 5.0 Priority: normal
Severity: normal Version: 4.8
Component: Administration Keywords: ui-feedback good-first-bug has-patch has-unit-tests needs-testing
Focuses: Cc:

Description

WordCamp Bern is planned for 9th September. Till then we have three Meetups planned for June, July and August. Due to this the WordCamp is not being displayed on the list of events.

It is not really important for us that people see the Meetup happening in August but that people see that there is a WordCamp in September.

As there is less organising for meetup it does not mater if people sign up a few days before but for WordCamp we want people to buy their tickets as soon as possible.

If there is a WordCamp nearby it should be shown at the top of list of events.

Related #40702

Attachments (7)

events.jpeg (105.6 KB) - added by grapplerulrich 6 months ago.
events dashboard widget with only meetups and not the WordCamp
events.2.jpeg (101.7 KB) - added by grapplerulrich 6 months ago.
Now that the Meetup has passed the WordCamp is being shown
41112.diff (1.4 KB) - added by metalandcoffee 7 weeks ago.
before and after.png (166.3 KB) - added by grapplerulrich 7 weeks ago.
Screenshot before and after applying the patch
Screenshot at 2017-11-15 10:47:55.png (27.1 KB) - added by vertizio 5 weeks ago.
WordCamp Utrecht gone in favour of pinned WCUS, meetups still showing though
41112.2.diff (6.2 KB) - added by iandunn 3 days ago.
Pin to bottom, add test case
41112.3.diff (10.8 KB) - added by iandunn 2 days ago.
Restores continue to simplify diff, adds more tests

Download all attachments as: .zip

Change History (23)

@grapplerulrich
6 months ago

events dashboard widget with only meetups and not the WordCamp

#1 @rmccue
6 months ago

  • Focuses rest-api removed
  • Milestone changed from Awaiting Review to WordPress.org

Not related to the REST API; data is provided by WordPress.org under the hood, and it seems like that's probably where this wants to be fixed.

#2 @iandunn
6 months ago

  • Focuses javascript removed
  • Keywords ui-feedback good-first-bug added

This was brought up previously, and I think it's a great idea; there just wasn't time for it in v1.

It'll require some changes on the API side to make camps sticky in API responses, but I think it'll also require some minor (PHP and CSS) tweaks in Core.

cc @mrwweb, @mapk

@grapplerulrich
6 months ago

Now that the Meetup has passed the WordCamp is being shown

#3 @DrewAPicture
6 months ago

  • Keywords has-patch added
  • Owner set to grapplerulrich
  • Status changed from new to assigned

Assigning ownership to mark the good-first-bug as "claimed".

#4 @swissspidy
6 months ago

@iandunn Is there already a meta ticket for the API change? Without that change, one cannot really work on this ticket.

#6 @iandunn
5 months ago

The Meta ticket is meta:#2994.

#7 @iandunn
7 weeks ago

  • Keywords needs-patch added; has-patch removed
  • Owner grapplerulrich deleted

#8 @jorbin
7 weeks ago

  • Owner set to metalandcoffee

This is being worked on at WordCamp Philly contributor day . Assigning to @metalandcoffee as her computer is being used for the patch.

@metalandcoffee
7 weeks ago

#9 @metalandcoffee
7 weeks ago

  • Keywords has-patch added; needs-patch removed

The above patch was worked on at WordCamp Philly Contributor Day by myself, @warmlaundry, and @alejandroxlopez along with @jorbin.

We found a way to do this without any API changes being necessary. Feedback is encouraged.

@grapplerulrich
7 weeks ago

Screenshot before and after applying the patch

#10 @grapplerulrich
7 weeks ago

I tested it with the location Utrecht as I knew there was a WordCamp planned but at least three meetups till then. See the screenshot above of the before and after applying the patch.

#11 @iandunn
7 weeks ago

  • Milestone changed from WordPress.org to 5.0

Thanks @metalandcoffee, I think 41112.diff moves this forward :)

My hunch is that we'll also need some changes on the API side. In some active cities, there can be 2-3 meetup events per week. Since Core only requests 5 events from the API, the WordCamp wouldn't show up in the API response until about 2-3 weeks before the date.

Regardless of that, though, this is still an improvement on the current situation. If the API changes are languishing, then maybe we can do something like this for 5.0, and then iterate on it once the API is ready. If anyone wants to work on that side of things, the details are in #meta2994, and I posted some instructions for setting up the dev environment in Slack.

I think the widget will probably feel the most intuitive to people if the camp is just listed in the normal chronological flow, rather than having a fixed position at the top. We talked about it a bit before, but there wasn't a lot of feedback, so I'm definitely open to other ideas if you think having it at the top is better.

This ticket was mentioned in Slack in #meta-wordcamp by mrwweb. View the logs.


5 weeks ago

@vertizio
5 weeks ago

WordCamp Utrecht gone in favour of pinned WCUS, meetups still showing though

#13 follow-up: @vertizio
5 weeks ago

Some suggestions for improvement:

  • The ‘Community Events’ widget could be tabbed. One tab for WordCamps, one for meetups. That way we still could stick to 3 items and not mix up the types of events.
  • Fix with: next local WordCamp, Local Meetup and Regional WordCamp. If there is not alocal WordCamp or a Regional WordCamp then show a meetup.

#14 in reply to: ↑ 13 @iandunn
3 weeks ago

Replying to vertizio:

The ‘Community Events’ widget could be tabbed. One tab for WordCamps, one for meetups. That way we still could stick to 3 items and not mix up the types of events.

I think one of the great things about the way the widget is currently designed, is that the user doesn't have to do anything. Their location is detected automatically, and the relevant events are shown automatically.

The goal of the widget is to promote WP events to users who aren't already aware of the community, so we can't expect them to do any work in order to get the information. We're just trying to pique their interest.

If we switch to tabs, then the user has to do extra work to see the extra events, and I'd worry that the vast majority would never do that.

The current approach feels like it lines up much more with the design for the majority and decisions not options part of WP's philosophy.

@iandunn
3 days ago

Pin to bottom, add test case

#15 @iandunn
3 days ago

  • Keywords has-unit-tests needs-testing added

A camp is now pinned to the API response, as of [meta6275].

41112.2.diff moves the pinned camp from the top to the bottom, and adds a unit test. It needs a bit more testing, but I think it's in good shape.

@iandunn
2 days ago

Restores continue to simplify diff, adds more tests

#16 @iandunn
2 days ago

41112.3.diff restores the continue, in order to make the diff a bit simpler, and also adds some more tests.

For manual testing, you should see it working for Albuquerque and Philly right now, since they have camps coming up in the next 6 weeks, but 3+ meetups before then.

Sticking this in an mu-plugin is helpful, to avoid having to manually clear the local cache:

add_action( 'init', 'clear_events_cache' );
function clear_events_cache() {
        $location = get_user_option( 'community-events-location', get_current_user_id() );

        if ( isset( $location['ip']  ) ) {
                delete_site_transient( 'community-events-' . md5( $location['ip'] ) );
        }

        if ( isset( $location['latitude'], $location['longitude'] ) ) {
                delete_site_transient( 'community-events-' . md5( $location['latitude'] . $location['longitude'] ) );
        }
}
Note: See TracTickets for help on using tickets.