Page MenuHomePhabricator

Changing criteria for showing badges in object timeline view
ClosedPublic

Authored by lpriestley on Mar 28 2016, 10:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 12:30 AM
Unknown Object (File)
Thu, Apr 11, 10:30 AM
Unknown Object (File)
Wed, Apr 3, 11:15 PM
Unknown Object (File)
Mar 18 2024, 9:44 PM
Unknown Object (File)
Mar 10 2024, 11:46 AM
Unknown Object (File)
Feb 24 2024, 2:21 AM
Unknown Object (File)
Feb 23 2024, 11:39 PM
Unknown Object (File)
Feb 14 2024, 4:20 AM
Subscribers

Details

Summary

Ref T8941

Test Plan

Create an object and create multiple transactions, some time apart to ensure that time clumping isn't interfering. Make sure that events that are large enough to have a dropdown menu show badges under author pic.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lpriestley retitled this revision from to Changing criteria for showing badges in object timeline view.
lpriestley updated this object.
lpriestley edited the test plan for this revision. (Show Details)
lpriestley added a reviewer: epriestley.
src/view/phui/PHUITimelineView.php
226–227

This was filtering out an event that had a large icon, despite having children. I think the correct fix would be to have a separate attribute on the event view that determines whether events should have badges or not, but I'm not sure if there's a better way to identify the events that need to be unset than by calling getHideCommentOptions.

227

This was filtering out an event that had a large icon, despite having children. I think the correct fix would be to have a separate attribute on the event view that determines whether events should have badges or not, but I'm not sure if there's a better way to identify the events that need to be unset than by calling getHideCommentOptions.

epriestley edited edge metadata.

Here are a couple of cases this seems to get wrong.

Preview with a comment doesn't show badge, but should:

Screen Shot 2016-03-28 at 3.23.01 PM.png (132×1 px, 19 KB)

These individual stories with small icons show badges, but should not:

Screen Shot 2016-03-28 at 3.23.04 PM.png (96×442 px, 20 KB)

(It's fine to add a separate attribute if that looks like the best approach.)

This revision now requires changes to proceed.Mar 28 2016, 10:26 PM

Are you sure the profile image in the preview should have badges? Depending on the timing and on other things happening with the object, the preview won't be able to predict if it's a major event or not...

lpriestley edited edge metadata.

Not sure why this works better, but moved the badge-showing logic to the event view

epriestley edited edge metadata.

I do think we should show badges on previews eventually, but that didn't work before so this change strictly makes the behavior better.

This change will cause us to fetch some badge data which we may not end up showing. The intent of the old code was to avoid fetching badges unless we needed them. However, fetching this data is cheap (we issue the same number of queries, just fetch slightly more data) and I think fixing the behavior is more important than micro-optimizing the data fetching.

src/view/phui/PHUITimelineEventView.php
363

Can this just be a local variable instead? It looks like it's only used in this method.

This revision is now accepted and ready to land.Mar 28 2016, 11:10 PM
lpriestley marked an inline comment as done.
lpriestley edited edge metadata.

Switching to local variable

What is your reasoning for wanting to show badges in previews?

Primarily, it makes them a more accurate representation of what the transaction will actually look like when submitted.

You're right that in some cases we'll show a preview which isn't the same as what actually posts, but I think we'll almost always guess whether it will be a major event or not correctly, since the primary factor there is "did the user post a comment?" and race conditions don't change/suppress comments.

Okay I agree that it would be nice to show badges under all instance of the profile image if it has the appropriate size.

src/view/phui/PHUITimelineEventView.php
500–501

It seems like this is the only code in this file that deals with getIsPreview, but I still don't understand how the profile image gets attached to the comment preview at all. Could you point me to that code?

This revision was automatically updated to reflect the committed changes.