Fix commenting on text-based file attachments.
Review Request #7092 — Created March 19, 2015 and submitted — Latest diff uploaded
The recent work for retrofitting text-based file attachments for diff
support triggered some bad behavior in the commenting support.
TextCommentRowSelector
and comment flag placement needed to work on a
table rather than a tbody. This caused mismatches between the element's
list of rows and the rowIndexes. It also caused a reference to an
invalid variable for comment placement.One possible solution is to update
TextCommentRowSelector
to work with
tbodies, and a previous attempt went this route. However, future work
for diffviewer-style diffs for text attachments will require multiple
tbodies per table, so instead, this change splits the tbodies back out
into their own tables again.The tables, for both plain text and rendered text, are split off into
reusable templates, reducing the amount of code duplication. The
revision information has been moved into these tables, under the tabs.
This will help with future review UIs that want to render plain text,
but also want a different UI entirely under the Rendered tab (such as
SVGs).The revision label and selector rows are now hard-coded in the template,
as well, rather than being dynamically added later.There's also some visual fixes for the page to prevent unwanted
gradients and to fix borders at the bottom of the view.
Tested reviewing individual revisions and diffs of plain text and Markdown
attachments, both source and rendered.Verified in Chrome and Firefox that the visual styles were correct.