Page MenuHomePhabricator

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

Authored by epriestley on Jan 3 2019, 1:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 9:55 PM
Unknown Object (File)
Fri, Mar 22, 9:55 PM
Unknown Object (File)
Fri, Mar 22, 9:54 PM
Unknown Object (File)
Fri, Mar 22, 9:54 PM
Unknown Object (File)
Feb 12 2024, 9:19 AM
Unknown Object (File)
Feb 3 2024, 8:37 PM
Unknown Object (File)
Jan 9 2024, 8:03 PM
Unknown Object (File)
Dec 27 2023, 1:00 PM
Subscribers
None

Details

Summary

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

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

webroot/rsrc/js/application/differential/behavior-comment-preview.js
11

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.

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.