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

issue #732: allows users to do a refinement search #746

Open
wants to merge 54 commits into
base: development
Choose a base branch
from

Conversation

rzhang152
Copy link
Contributor

Give users option to refine a search inside the initial search results on Dimes.

helrond and others added 30 commits June 15, 2023 16:40
…veCenter/development

Supports translation of interface via lingui
…veCenter/development

Implement Style Library
…veCenter/development

Use bulk parse endpoint
…veCenter/development

Extract and recompile translation messages
…veCenter/development

Fix UI Issues and Updates Backstop
…veCenter/development

Construct correct search URL on agent pages
…veCenter/development

Replaces atomic loading skeleton with global loading indicator
…veCenter/development

Update dependencies
…veCenter/development

Ensure values from Wikidata are unique
…veCenter/development

Update styles, bug fixes, and update dependencies
…veCenter/development

Add Cite button to generate citation information
…veCenter/development

Update dependencies
…veCenter/development

Dependency updates and language force
…veCenter/development

Merge dependency updates from dev to base.
…veCenter/development

Update My List modals
…veCenter/development

Adds configurable Reading Room date picker
…veCenter/development

Import DatePicker css
…veCenter/development

Update DIMES Duplication Request Modal for Fee Changes
…veCenter/development

Toggle on automatic language detection
…veCenter/development

fix typo in workflows
…veCenter/development

Improve setting of narrative description source on Agent pages
…veCenter/development

Update version of node in dependency updates
…veCenter/development

Update dependencies
…veCenter/development

Removes translation of form _name_ attributes
p-galligan and others added 12 commits May 20, 2024 15:03
…veCenter/development

Adds github workflows
…veCenter/development

Add GitHub App support
…veCenter/development

Update link to appointment scheduling.
…veCenter/development

Remove translation of search inputs
…veCenter/development

Update stylesheet and footer contents
…veCenter/development

Lingua updates for social media icon and reading room hour updates
…veCenter/development

Support cases where there is no extent data.
Copy link

@ctgraham ctgraham left a comment

Choose a reason for hiding this comment

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

Hillel's team will be the authority, but some requests from me.

src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
@helrond
Copy link
Member

helrond commented Sep 27, 2024

I have some higher-level questions about the goals of this PR (aside from the specific things that @ctgraham identified).

First, it seems like the net effect of this PR would be to remove one click at the expense of masking a lot of search functionality. Users can already get back to the previous search and refine from there by clicking on the "Back to Search" button. I'm not sure that allowing them to update the query only from within a collection view outweighs the additional complexity in code and UI that results. Our user testing indicated that users had no problem identifying and using that "Back to Search" button for search refinement.

I'm still not sold that a "search within this collection only" is a use case that we are experiencing on our end, so I think if we're going to continue to go down this road this should probably be a configurable feature. That would also allow us to do some testing before we implement to make sure this is something that works for users.

…new env variable to make search refinement option configurable per code input
@rzhang152
Copy link
Contributor Author

Thanks for your inputs Hillel.

I think a main purpose of requesting a search refinement feature is to provide the users with a clear picture of their current query, and an options for easily pinning down their search based on the current results they are viewing.

With that in mind, I totally agree that the minimap features allow users to easily click and jump to matches within collections. We also brought your thought and inputs regarding this request during the meeting with our Archives&Special Collections team yesterday. However, from our users' perspectives, we recognize that there are cases where they want to narrow down a search by focusing on a specific collection within the initial results. For instance, a researcher might be looking for a particular name within a specific collection of correspondence found in the search results. In addition, providing option to refine a search within search result page make it more straightforward for users to pin down their finding effectively. The refined search will be conducted on-the-fly and will not directly overwrite the query parameter until execution. This approach aims to minimize the impact on the current minimap and other complex UI features.

I also revised the code based on Clinton's and your input. Please let me know if any q or feedback.
Thanks again,

Copy link
Member

@helrond helrond left a comment

Choose a reason for hiding this comment

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

A couple other things, mostly very minor.

The translation for the user-facing label will also need to be added as described in the README.

src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
…veCenter/development

Update Dependencies
@rzhang152 rzhang152 force-pushed the pr-dimes-refine-search branch from 46fc004 to 0eca0ad Compare October 10, 2024 15:53
@rzhang152 rzhang152 force-pushed the pr-dimes-refine-search branch from 0eca0ad to 1f9dcbd Compare October 10, 2024 15:59
@HaSistrunk HaSistrunk self-requested a review October 10, 2024 18:25
@HaSistrunk
Copy link
Member

Hi there! I'll weigh in with some feedback related to screenreader UX:

So for sighted users, the indication that a refined search has successfully completed is that they might see the minimap squares/links change, and they'll see their new search term in the input. For screenreader users, they'll submit the search and the page will reload with the focus moving to whatever record is in the url. If they've been exploring the collection, that will be somewhere in the collection context tree on the right side of the screen. The screenreader will then start from there since that has focus.

I'm open to ideas, but I'd suggest mitigating that potentially confusing pattern (that doesn't support WCAG SC 3.2.2) by adding an aria-live announcement with a message like "Links in minimap navigation have been updated to display new search results". We use an aria-live region already to tell users that collection details on the left side of the page have been updated when someone selects a new record using react-aria-live. You can see that implemented in components/PageRecords/index.js. It's not a perfect solution, but folks can at least receive some confirmation feedback after submitting a search and know to navigate back to the minimap to explore the new results.

Copy link
Member

@helrond helrond left a comment

Choose a reason for hiding this comment

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

I apologize for missing this earlier, but we've tried to use BEM class names so converting those here. I think I got all of them in my suggestions.

src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
src/styles/components/_records-detail.scss Outdated Show resolved Hide resolved
src/styles/components/_records-detail.scss Outdated Show resolved Hide resolved
src/styles/components/_records-detail.scss Outdated Show resolved Hide resolved
src/styles/components/_records-detail.scss Outdated Show resolved Hide resolved
src/components/RecordsDetail/index.js Outdated Show resolved Hide resolved
@helrond
Copy link
Member

helrond commented Oct 18, 2024

Hi @rzhang152 - I was just chatting with @HaSistrunk about the accessibility aspects of this PR. Fundamentally, the challenge here is that the refine search form reloads the page, which has a couple of knock-on implications related to both accessibility and usability:

  • Because the page simply reloads instead of going to a search results page, it's hard for users to know what's actually changed. The aria-live implementation, at least as it is currently, won't change that because the announcement is tied to the onChange handler of the form, so every time that form value changes screenreader users get an announcement, but they don't get an announcement when the page reloads.
  • Related, the focus on page reloads may not be where a user expects it to be - if a user has clicked down into a collection tree and then decides they want to do a refining search, they'll end up back at the same thing they had focused on, which may or may not have a hit associated with it.

After thinking about it, I'd like to suggest the following:

  1. I don't think the aria-live approach is going to work for this use case without a lot of additional work to store the previous query and then implement a conditional to trigger an announcement when it changes. So, with apologies for leading you down the wrong path, I'd suggest removing that code. Instead I think adding some text in the refine search component which tells users how many hits are in the collection and what the query is, something like "64 hits for 'my query'" would give all users a better indication of what's actually happening.
  2. The page focus could be changed by updating the target of the form to be the top-level collection rather than the object-specific URL, which would return users to the top of the collection tree. However, I think this is an area where user testing and feedback is needed - I'm not sure what users would expect exactly, and what's more or less confusing. This also has accessibility implications for folks using screenreaders.

Let us know how that sounds - we appreciate your thinking and work on this feature!

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.

5 participants