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

Unselecting or selecting a sub-category scrolls back to the top of the list when switching from search to browse mode #2349

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

amdomanska
Copy link
Contributor

@amdomanska amdomanska commented Feb 12, 2024

Introduce stringSearch flag

Please don't delete any sections when completing this PR template; instead enter N/A for checkboxes or sections which are not applicable, unless otherwise stated below
See #2832

Describe the scope/purpose of the PR here in as much detail as you like

Categorisation

This PR...

  • has scripts to run
  • has migrations to run
  • adds new infrastructure
  • changes the CI pipeline
  • affects the public site
  • affects the editorial area
  • affects the publisher area
  • affects the monitoring

Basic PR Checklist

Instructions for developers:

  • For each checklist item, if it is N/A to your PR check the N/A box
  • For each item that you have done and confirmed for yourself, check Developer box (including if you have checked the N/A box)

Instructions for reviewers:

  • For each checklist item that has been confirmed by the Developer, check the Reviewer box if you agree
  • For multiple reviewers, feel free to add your own checkbox with your github username next to it if that helps with review tracking

Code Style

  • No deprecated methods are used

    • N/A
    • Developer
    • Reviewer
  • No magic strings/numbers - all strings are in constants or messages files

    • N/A
    • Developer
    • Reviewer
  • ES queries are wrapped in a Query object rather than inlined in the code

    • N/A
    • Developer
    • Reviewer
  • Where possible our common library functions have been used (e.g. dates manipulated via dates)

    • N/A
    • Developer
    • Reviewer
  • Cleaned up commented out code, etc

    • N/A
    • Developer
    • Reviewer
  • Urls are constructed with url_for not hard-coded

    • N/A
    • Developer
    • Reviewer

Testing

  • Unit tests have been added/modified

    • N/A
    • Developer
    • Reviewer
  • Functional tests have been added/modified

    • N/A
    • Developer
    • Reviewer
  • Code has been run manually in development, and functional tests followed locally

    • N/A
    • Developer
    • Reviewer
  • Have CSS/style changes been implemented? If they are of a global scope (e.g. on base HTML elements) have the downstream impacts of the change in other areas of the system been considered?

    • N/A
    • Developer
    • Reviewer

Documentation

Release Readiness

Testing

Requirements doc: https://docs.google.com/spreadsheets/d/1T_zIXfmWd7i0MyMbrL8hpg6zczml39-gcejTwDVvWAo/edit?gid=0#gid=0

List the Functional Tests that must be run to confirm this feature

  1. Subject Facet

Deployment

What deployment considerations are there? (delete any sections you don't need)

Configuration changes

What configuration changes are included in this PR, and do we need to set specific values for production

Scripts

What scripts need to be run from the PR (e.g. if this is a report generating feature), and when (once, regularly, etc).

Migrations

What migrations need to be run to deploy this

Monitoring

What additional monitoring is required of the application as a result of this feature

New Infrastructure

What new infrastructure does this PR require (e.g. new services that need to run on the back-end).

Continuous Integration

What CI changes are required for this

@amdomanska amdomanska requested review from richard-jones, Steven-Eardley, philipkcl, Zhan4i and RK206 and removed request for Zhan4i February 12, 2024 13:03
@amdomanska amdomanska marked this pull request as ready for review February 12, 2024 13:14
@philipkcl philipkcl removed their request for review February 15, 2024 14:40
@RK206
Copy link
Contributor

RK206 commented Feb 26, 2024

Tested the functionality. Selection is preserved.
But, I have some observations. Not sure if these are issues to be considered. Listing my observations below.

  1. Enter the text in the search and select any category. Now remove the text in the search and the selection of the category is disappeared.
  2. Selection of sub category does not auto select the top level category.
  3. Similarly deletion of top level category does not delete sub categories
  4. Top level and sub level categories displayed separately at selected categories

Adding some screenshots for reference.

Screenshot 2024-02-26 at 7 59 56 PM Screenshot 2024-02-26 at 9 19 53 PM Screenshot 2024-02-26 at 9 20 22 PM

@RK206 RK206 requested review from RK206 and removed request for RK206 February 26, 2024 16:46
@richard-jones
Copy link
Contributor

I can see the issues that @RK206 has raised when I use this too, and they are introducing different behaviours to the existing search, and we need to resolve them. The PR is quite small, so I'm not sure what creates the changes, but I would guess that code which needs to execute to maintain context is not being executed any more.

In addition I found the following issue:

If you select multiple sub categories from different parts of the tree, and then remove one of them from the "selected filters" pill navigation at the top, the scroll position doesn't necessarily make sense. If you remove all of the selections from the pill navigation, the scroll position does not return to the top, which I think it probably should.

I think that this change is actually complex enough that we need to lay out the behaviours first more clearly before we try to reimplement.

@richard-jones
Copy link
Contributor

I've provided feedback in the issue, this needs to go round development again

Copy link
Contributor

@richard-jones richard-jones left a comment

Choose a reason for hiding this comment

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

This is much closer but there's still a mismatch to our expectations. See Testing Round 2 in this spreadsheet https://docs.google.com/spreadsheets/d/1T_zIXfmWd7i0MyMbrL8hpg6zczml39-gcejTwDVvWAo/edit#gid=419458697

@amdomanska
Copy link
Contributor Author

Develop merged into the branch 23/09/24

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.

3 participants