Skip to content

Add the comment inline suggestion to the transaction.search conduit endpoint#28

Open
SpangleLabs wants to merge 4 commits into
thought-machine:tm-masterfrom
SpangleLabs:vent--inline-suggestion-in-tx-api
Open

Add the comment inline suggestion to the transaction.search conduit endpoint#28
SpangleLabs wants to merge 4 commits into
thought-machine:tm-masterfrom
SpangleLabs:vent--inline-suggestion-in-tx-api

Conversation

@SpangleLabs
Copy link
Copy Markdown

It was mentioned that this doesn't exist in this API endpoint at the moment. It would be very helpful, so let's add it!

Here's the method to fetch the inline suggestion:
https://github.com/thought-machine/phorge/blob/tm-master/src/infrastructure/diff/inline/PhabricatorDiffInlineCommentContentState.php#L28

And here's the method to get that comment state:
https://github.com/thought-machine/phorge/blob/tm-master/src/infrastructure/diff/interface/PhabricatorInlineComment.php#L362

I'm not able to test locally, but we can test this on our dev environment after landing (or before if we want to deploy from a fork)

…ndpoint

It was mentioned that this doesn't exist in this API endpoint at the moment. It would be very helpful, so let's add it
@Birkalo Birkalo self-requested a review May 29, 2026 13:20
);
} else {
$inline_suggestion = null;
$comment_state = $comment->getContentState();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to check first if comment is an instance of PhabricatorInlineCommentInterface, instantiate a newInlineCommentObject(), on which we can then call getContentState() and do if getContentHasSuggestion()... ; i'd need to test this locally and see what the api returns for other objects with comments (it may complain about missing getContentState(), but I may be wrong)

I'm rusty on this, so take it with 2 pinches of salt: not all PhabricatorApplicationTransactionComments may implement getContentState()

~/src/phorge$ cat src/applications/differential/storage/DifferentialTransactionComment.php | grep -B 1 -A 2   getContentState
    return $this->newInlineCommentObject()
      ->getContentState()
      ->isEmptyContentState();
  }

(I suspect comments are rows from the db,

~/src/phorge$ cat src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php | grep -A4 PhabricatorApplicationTransactionComment
abstract class PhabricatorApplicationTransactionComment
 extends PhabricatorLiskDAO
 implements
<..>
```)

Copy link
Copy Markdown
Author

@SpangleLabs SpangleLabs May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, might not be right with the PhabricatorInlineComment type here, especially if we're looking at a non-differential object, hmm

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There we go, updated it

…ifferential comment and grab inline suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants