Page MenuHomePhorge

Allow to style deleted comments from CSS
Closed, ResolvedPublic

Description

At the moment, the body of deleted comments can be styled from CSS thanks to this CSS selector:

.phui-timeline-core-content .comment-deleted {
   ...
}

So, you can style the body, that contains this text:

This comment was removed by <USER>

The problem is: you can only style the content, and not the whole parent block, since there is not a selector associated to the whole parent container.

This feature would be useful, for example, to style deleted comments in order to make them semi-transparent. Here a cursed example:

Comment removed cursed.png (122ร—475 px, 9 KB)

Acceptance criteria

  1. when a comment is removed, that container has not just the CSS class phui-timeline-shell but also an additional one to identify that case. For example: phui-timeline-shell-removed

Implementation Notes

  • The base CSS class phui-timeline-shell is set from PHUITimelineEventView#render()
    • โ†’ it seems we need to call ->addClass('phui-timeline-shell-removed') or override ->getClasses() to return that
      • โ†’ the problem is: understand who should call addClass() (or where getClasses() should be overridden)
  • The classs PhabricatorApplicationTransaction has the needed business logic to understand if the comment was removed or not
    • โ†’ for example the getIcon() method that returns the trash icon is defined here
  • The class PhabricatorApplicationTransactionView instantiate the class PHUITimelineEventView
    • โ†’ probably this is the good point to call addClass()

Event Timeline

valerio.bozzolan created this task.
valerio.bozzolan created this object in space S1 Public.