RFR: 7904082: The UI for API Diff could be improved
Iris Clark
iris at openjdk.org
Tue Sep 23 17:52:51 UTC 2025
On Mon, 22 Sep 2025 15:41:29 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> This PR intends to improve the result of API diff in a few ways:
> - in the list of updated elements, using green for elements that were added (instead of elements that are unchanged), and red for removed elements. At least in cases two variants of an API are compared.
> - making added/removed elements more prominent by also coloring the signature lines
> - hiding unchanged elements by default.
>
> An example diff that is produced before this patch:
> https://cr.openjdk.org/~jlahoda/CODETOOLS-7904082/before/
> after this patch:
> https://cr.openjdk.org/~jlahoda/CODETOOLS-7904082/after/
>
> Please let me know what you think. I'll see if I can reasonably add some tests for this functionality.
Thanks for working on apidiff!
Can you also provide a an example of the "after" for the case when unchanged elements are included? (That's what I'd need to use for the Platform JSR Annex 2 (e.g. https://cr.openjdk.org/~iris/se/25/latestSpec/apidiffs/index.html).). I think if you're changing the default, there's probably a corresponding change you'll need to make in src/share/doc/apidiff.md, which is also published here: https://openjdk.org/projects/code-tools/apidiff/apidiff.html.
In the list of updated elements, the background for the "!=" is now appears purple-y grey (formerly pinkish) and the "!=" character itself is red (unchanged, I think). I think this combination isn't as easy to parse as the former, Perhaps it needs more context to appreciate?
The change in SourceCodeAnalysis.SnippetWrapper which adds the background color for the notes "Only in baseline; not in: demo" and "Only in: demo; not in: demo" looks good. (I noticed that there's a typo in report/html/resources/report.properties, line 126 "not i" should be "not in".)
I'm not sure I'm finding an example of coloring of the signature lines. Let me know which elements I should be looking at for the comparison.
Thanks again for all of your work to improve apidiff!
-------------
PR Comment: https://git.openjdk.org/apidiff/pull/32#issuecomment-3324992007
More information about the apidiff-dev
mailing list