Page MenuHomePhabricator

Pass timeline view data to comment previews, restoring Differential comment previews

Authored by epriestley on Jan 3 2019, 1:16 AM.



Ref T13222. In D19918, I refactored how timelines get "view data". Today, this is always additional data about which images/changesets/diffs are visible on the current revision/commit/mock, so we can tell if inline comments should be linked to a #anchor on the same page (if the inline is rendered there somewhere) or to a /D123?id=1&vs=2 full link on a different page (if it isn't), but in general this could be any sort of state information about the current page that affects how the timeline should render.

Previously, comment previews did not use any specialized object code and always rendered a "generic" timeline story. This was actually a bug, but none of the code we have today cares about this (since it's all inline related, and inlines render separately) so it never impacted anything.

After the TimelineEngine change, the preview renders with Differential-specific code. This is more correct, but we were not passing the preview the "view data" so it broke.

This preview doesn't actually need the view data and we could just make it bail out if it isn't present, but pass it through for consistency and so this works like we'd expect if we do something fancier with view data in the future.

Test Plan

Viewed comment and inline comment previews in Differential, saw old behavior restored.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Jan 3 2019, 1:16 AM
epriestley added inline comments.Jan 3 2019, 1:18 AM

This behavior has no callsites (it has been fully obsoleted by behavior-comment-actions.js, below) so I removed it. This was the old code for handling Differential actions before we switched it to EditEngine and the standard transaction stack.

epriestley requested review of this revision.Jan 3 2019, 1:18 AM
amckinley accepted this revision.Jan 3 2019, 7:41 PM
This revision is now accepted and ready to land.Jan 3 2019, 7:41 PM
This revision was automatically updated to reflect the committed changes.