Document `check-result-expanded` plugin endpoint

In the Check UI, a CheckResult can optionally have a `message` which is
raw unformatted text. A summary is displayed and when the result row is
clicked, it is expanded and the full message is shown.

I8dc5befc6a8fe4297709988b36ba489de5065b7b add `check-result-expanded`
endpoint to the expanded component. That lets one add a Web Component
with rich formatting. This was done for Chromium buildbucket plugin back
in early 2021 and released in Gerrit 3.4.0, it was however left
undocumented.

Document the plugin end point. The code pass two parameters `result` and
`run` which are set to be the `result`, I think it is a mistake in the
original code which probably wanted to also pass the run, short of
fixing the issue, document the `run` parameter is the same as the
`result` one.

I found out about the expanded results via the TypeScript API
documentation. Remove the TBD comment about making CheckResults.message
to support richer formatting and hint about using that endpoint which,
as far as I am concerned, fulfill my need to beautify a check result.

Test plan:

  bazel build Documentation
  xdg-open bazel-bin/Documentation/pg-plugin-endpoints.html

Bug: Issue 308818104
Release-Notes: document `check-result-expanded` plugin endpoint
Change-Id: Ifcc30aaa2c293bc515cac76052e3fc8b2d17471b
diff --git a/Documentation/pg-plugin-endpoints.txt b/Documentation/pg-plugin-endpoints.txt
index f2a72f1..2227e79 100644
--- a/Documentation/pg-plugin-endpoints.txt
+++ b/Documentation/pg-plugin-endpoints.txt
@@ -86,6 +86,25 @@
 labels with scores applied to the change, map of the label names to
 link:rest-api-changes.html#label-info[LabelInfo] entries
 
+=== check-result-expanded
+The `check-result-expanded` extension point is attached to a result
+of the link:pg-plugin-checks-api.html[ChecksAPI] when it is expanded. This can
+be used to attach a Web Component displaying results instead of the
+`CheckResult.message` field which is limited to raw unformatted text.
+
+In addition to default parameters, the following are available:
+
+* `result`
++
+The `CheckResult` object for the currently expanded result row.
+
+* `run`
++
+Same as `result`. The `CheckRun` object is not passed to the endpoint.
+
+The end point contains the `<gr-formatted-text>` element holding the
+`CheckResult.message` (if any was set).
+
 === robot-comment-controls
 The `robot-comment-controls` extension point is located inside each comment
 rendered on the diff page, and is only visible when the comment is a robot
@@ -237,4 +256,4 @@
 
 * `accountId`
 +
-the Id of the account that the status icon should correspond to.
\ No newline at end of file
+the Id of the account that the status icon should correspond to.
diff --git a/polygerrit-ui/app/api/checks.ts b/polygerrit-ui/app/api/checks.ts
index aa0b05d..3d2b1bd 100644
--- a/polygerrit-ui/app/api/checks.ts
+++ b/polygerrit-ui/app/api/checks.ts
@@ -387,9 +387,11 @@
    * responsible for not killing the browser. :-)
    *
    * For now this is just a plain unformatted string. The only formatting
-   * applied is the one that Gerrit also applies to human comments. TBD: Both
-   * human comments and check result messages should get richer formatting
-   * options.
+   * applied is the one that Gerrit also applies to human comments.
+   *
+   * To provide richer formatting to the check result messages you should use
+   * the `check-result-expanded` plugin endpoint to attach a Web Component.
+   * See `Documentation/pg-plugin-endpoints.txt`.
    */
   message?: string;