Skip to content

Added support for HTML in JSF UI for file description#12318

Merged
pdurbin merged 6 commits into
developfrom
11397-support-html-in-file-level-description
Jul 13, 2026
Merged

Added support for HTML in JSF UI for file description#12318
pdurbin merged 6 commits into
developfrom
11397-support-html-in-file-level-description

Conversation

@stevenwinship

@stevenwinship stevenwinship commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it: SPA already supports html in file description field. JSF UI also needs this functionality.

Which issue(s) this PR closes: #11397

Special notes for your reviewer:

Suggestions on how to test this:

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Before:

image

After:
image

Is there a release notes update needed for this change?: included

Additional documentation:

@github-actions github-actions Bot added Feature: Metadata Size: 10 A percentage of a sprint. 7 hours. Type: Feature a feature request labels Apr 10, 2026
@stevenwinship stevenwinship self-assigned this Apr 10, 2026
@stevenwinship stevenwinship moved this to In Progress 💻 in IQSS Dataverse Project Apr 10, 2026
@pdurbin pdurbin changed the title Added Suport for HTML in JSF UI for file description Added support for HTML in JSF UI for file description Apr 10, 2026
@stevenwinship stevenwinship removed their assignment Apr 10, 2026
@stevenwinship stevenwinship moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Apr 10, 2026
@stevenwinship stevenwinship force-pushed the 11397-support-html-in-file-level-description branch from bf89748 to 96433e0 Compare April 10, 2026 19:35
@coveralls

coveralls commented Apr 10, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 24.957%. remained the same — 11397-support-html-in-file-level-description into develop

@stevenwinship stevenwinship force-pushed the 11397-support-html-in-file-level-description branch 4 times, most recently from f6d772c to 094b9d4 Compare April 21, 2026 15:20
@cmbz cmbz added FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) labels Apr 22, 2026
@stevenwinship stevenwinship force-pushed the 11397-support-html-in-file-level-description branch 3 times, most recently from f2a16f3 to bf5b3b9 Compare May 2, 2026 14:12
@stevenwinship stevenwinship force-pushed the 11397-support-html-in-file-level-description branch from bf5b3b9 to be235cb Compare May 6, 2026 18:10
@cmbz cmbz added the FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) label May 6, 2026
@stevenwinship stevenwinship force-pushed the 11397-support-html-in-file-level-description branch 5 times, most recently from 93e4138 to 80faa68 Compare May 13, 2026 19:23
@sekmiller sekmiller self-assigned this May 19, 2026
@sekmiller sekmiller moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project May 19, 2026
Comment thread src/main/webapp/file.xhtml Outdated
@stevenwinship stevenwinship self-assigned this Jul 9, 2026
@stevenwinship

stevenwinship commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@pdurbin There is still a bug

@ekraffmiller

ekraffmiller commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

I like the idea of having parity between JSF and the SPA.

That is, I don't like the idea of JSF users becoming accustomed to having clickable links in file descriptions of search cards and then moving over the the SPA where there are no clickable links (and other formatting) because only the plain text version is shown in search cards for the SPA.

So maybe in JSF we should show the plain text version, like we do with the SPA, I'm saying, for search cards.

@sbarbosadataverse what do you think? You were the one who opened #11397.

As I mentioned above, the search API is stripping html from the dataset and collection descriptions, but not the file description. So can we make that change in this PR? Or open a new one?

@stevenwinship

Copy link
Copy Markdown
Contributor Author
image

This shows the link working in the files card but not the dataset or collection card as Ellen stated above

@qqmyers

qqmyers commented Jul 9, 2026

Copy link
Copy Markdown
Member

FWIW: As far as I can see, these are all short descriptions. What actually shows in the card is a subset of the description, which may also add highlighting of the search term - seems like both of those could make showing html difficult.

@ekraffmiller

ekraffmiller commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

FWIW: As far as I can see, these are all short descriptions. What actually shows in the card is a subset of the description, which may also add highlighting of the search term - seems like both of those could make showing html difficult.

Yes, I agree, that's why I was asking about creating an issue for the search API to make it consistent (ie strip the html for all descriptions)

@stevenwinship stevenwinship force-pushed the 11397-support-html-in-file-level-description branch from 97a9f8c to 6f66c9d Compare July 13, 2026 13:23
@stevenwinship stevenwinship removed their assignment Jul 13, 2026
@jggautier

Copy link
Copy Markdown
Contributor

Hey all. Following talks today at standup about this PR, I thought I'd share this GitHub issue about a bug that affects how Dataverse currently highlights search terms on the search cards: #11410

@stevenwinship stevenwinship force-pushed the 11397-support-html-in-file-level-description branch from 6f66c9d to 3bb0cc6 Compare July 13, 2026 17:40
Comment thread src/main/webapp/search-include-fragment.xhtml
@stevenwinship stevenwinship force-pushed the 11397-support-html-in-file-level-description branch from 3bb0cc6 to c1e3bca Compare July 13, 2026 18:42
Comment thread src/main/webapp/search-include-fragment.xhtml Outdated
</div>

<h:outputText value="#{Strings:abbreviate(result.descriptionNoSnippet, descriptionAbbreviationThreshold)}" rendered="#{result.descriptionSnippets.size() eq 0}"/>
<h:outputText value="#{Strings:abbreviate(MarkupChecker:sanitizeBasicHTML(result.descriptionNoSnippet), descriptionAbbreviationThreshold)}" escape="false" rendered="#{result.descriptionSnippets.size() eq 0}"/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For consistency, we want the search card to not have a clickable link, just like the collection card and dataset card.

@stevenwinship

Copy link
Copy Markdown
Contributor Author
image

@pdurbin

pdurbin commented Jul 13, 2026

Copy link
Copy Markdown
Member

Also to be clear, the html is stripped from the description within the search API, so if we want to show it in the results, the API would have to be updated. (It is stripped from dataset and collection results, but not file results)

@ekraffmiller thanks for creating the following issue:

@pdurbin pdurbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe this is working the way we want now.

@github-project-automation github-project-automation Bot moved this from QA ✅ to Ready for QA ⏩ in IQSS Dataverse Project Jul 13, 2026
@pdurbin

pdurbin commented Jul 13, 2026

Copy link
Copy Markdown
Member

The HTML in the description for a file landing page is working fine:

Screenshot 2026-07-13 at 4 20 43 PM

As discussed at standup today, we want consistency across search cards. All search cards strip out the HTML like this, which is what we want:

Screenshot 2026-07-13 at 3 52 37 PM

@ekraffmiller created this related issue about the Search API (thanks!):

@pdurbin pdurbin merged commit 6108e3a into develop Jul 13, 2026
8 of 9 checks passed
@pdurbin pdurbin deleted the 11397-support-html-in-file-level-description branch July 13, 2026 20:25
@github-project-automation github-project-automation Bot moved this from Ready for QA ⏩ to Merged 🚀 in IQSS Dataverse Project Jul 13, 2026
</div>

<h:outputText value="#{Strings:abbreviate(result.descriptionNoSnippet, descriptionAbbreviationThreshold)}" rendered="#{result.descriptionSnippets.size() eq 0}"/>
<h:outputText value="#{Strings:abbreviate(MarkupChecker:stripAllTags(result.descriptionNoSnippet), descriptionAbbreviationThreshold)}" escape="false" rendered="#{result.descriptionSnippets.size() eq 0}"/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@stevenwinship - this is a change to the Dataset card, but it looks to me like html already didn't show in search cards for datasets, e.g. for the test dataset in https://demo.dataverse.org/dataverse/jms3d where the description is bolded. What am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature: Metadata FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) FY26 Sprint 22 FY26 Sprint 22 (2026-04-22 - 2026-05-06) FY26 Sprint 23 FY26 Sprint 23 (2026-05-06 - 2026-05-20) FY26 Sprint 24 FY26 Sprint 24 (2026-05-20 - 2026-06-03) FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) FY27 Sprint 1 FY27 Sprint 1 (2026-07-01 - 2026-07-15) GREI Year 5 GREI 2 Consistent Metadata Size: 3 A percentage of a sprint. 2.1 hours. Type: Feature a feature request

Projects

Status: Merged 🚀

Development

Successfully merging this pull request may close these issues.

Feature Request: Allow the file level description field to support HTML

8 participants