Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add word matching functionality to search results #45

Open
3 tasks
seanprivett opened this issue Feb 6, 2024 · 3 comments
Open
3 tasks

Add word matching functionality to search results #45

seanprivett opened this issue Feb 6, 2024 · 3 comments
Assignees

Comments

@seanprivett
Copy link
Contributor

seanprivett commented Feb 6, 2024

DataHub search results indicate which part of the returned item matches the search term. Implement this functionality in the custom front end.

The DataHub highlight colours are a WCAG fail (I think it's FG #8C8C8C and BG #E6F4FF).
But what they have got right is the semantically correct use of the <mark> tag - I think this is equivalent to, but preferred over the ARIA role="mark" role)

GOV.UK implements this by avoiding a background "highlight" and adjusting the font-weight instead. (Don't know if this is in the SCSS out of the box, or if it's a custom addition)

also noticed DH's post-processing to surround search terms in tags isn't smart enough to handle multiple search terms ("offence" not highlighted in result 3)

check how a screen reader would handle the highlighted search terms

add to alpha assessment deck re usability and accessibility, pref screenshots

Image

GOV.UK publications - search term highlight using font-weight:700

Image

Raise WCAG fail with DataHub

Definition of done

  • Code to parse search results and modify markup
  • CSS change to "highlight" resulting tags
  • Test(s) written
@seanprivett seanprivett transferred this issue from ministryofjustice/analytical-platform Feb 6, 2024
@murdo-moj murdo-moj self-assigned this Feb 15, 2024
@murdo-moj murdo-moj moved this from Todo to In Progress in Data Catalogue Feb 15, 2024
@murdo-moj
Copy link
Contributor

murdo-moj commented Feb 19, 2024

Search searches on name, description, and on column names and descriptions in a dataset. These are the items which should be highlighted/bolded upon searching.

  • the dataset name is already bold as part of the govuk class
  • search summary is being used rather than description on the search screen
  • will we be copying datahub to display information about column names which match the search term?

@murdo-moj
Copy link
Contributor

#78

I have slightly got around the issue by surfacing the matched fields returned by the datahub GraphQL API

@murdo-moj murdo-moj moved this from In Progress to Review in Data Catalogue Feb 20, 2024
@murdo-moj
Copy link
Contributor

Highlighted markdown is rendered into a <strong> tag in html. This is theoretically something which screenreaders should be able to use, but when I used the Mac VoiceOver functionality to test it, there wasn't any difference with the surrounding text.

@murdo-moj murdo-moj moved this from Review to Done in Data Catalogue Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done ✅
Development

No branches or pull requests

2 participants