Changeset View
Standalone View
src/infrastructure/diff/PhabricatorInlineCommentController.php
Show First 20 Lines • Show All 225 Lines • ▼ Show 20 Lines | switch ($op) { | ||||
->setLineLength($this->getLineLength()) | ->setLineLength($this->getLineLength()) | ||||
->setIsNewFile($this->getIsNewFile()) | ->setIsNewFile($this->getIsNewFile()) | ||||
->setContent($text); | ->setContent($text); | ||||
if ($this->getReplyToCommentPHID()) { | if ($this->getReplyToCommentPHID()) { | ||||
$inline->setReplyToCommentPHID($this->getReplyToCommentPHID()); | $inline->setReplyToCommentPHID($this->getReplyToCommentPHID()); | ||||
} | } | ||||
// If you own this object, mark your own inlines as "Done" by default. | |||||
$owner_phid = $this->loadObjectOwnerPHID($inline); | |||||
if ($owner_phid) { | |||||
if ($viewer->getPHID() == $owner_phid) { | |||||
$fixed_state = PhabricatorInlineCommentInterface::STATE_DRAFT; | |||||
amckinley: Shouldn't this be `PhabricatorInlineCommentInterface::STATE_DONE`? | |||||
Not Done Inline ActionsThe checkbox has four states, because checking the box doesn't apply immediately. When you check the box, only you can see that you've checked it until you submit it (in the UI, there's a dashed outline). The states are:
This is different from the inline itself being a "draft", which is confusing since both mechanisms use the same term. So "Draft" means that the box is not checked, but the author will see a dashed checkmark indicating that when they submit a comment it will become checked. This is the same state you get into if we remove this logic, then you manually click the box -- when you click, your checkoff is still a draft. Basically, this is simulating clicking the box. (Possible that some of this logic isn't entirely right since there are so many different states, of course.) epriestley: The checkbox has four states, because checking the box doesn't apply immediately. When you… | |||||
Not Done Inline Actions👍 amckinley: 👍 | |||||
$inline->setFixedState($fixed_state); | |||||
} | |||||
} | |||||
$this->saveComment($inline); | $this->saveComment($inline); | ||||
return $this->buildRenderedCommentResponse( | return $this->buildRenderedCommentResponse( | ||||
$inline, | $inline, | ||||
$this->getIsOnRight()); | $this->getIsOnRight()); | ||||
case 'reply': | case 'reply': | ||||
default: | default: | ||||
$edit_dialog = $this->buildEditDialog(); | $edit_dialog = $this->buildEditDialog(); | ||||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |
Shouldn't this be PhabricatorInlineCommentInterface::STATE_DONE?