Skip to content

fix: search flickering - #1965

Closed
vmnavarro94 wants to merge 1 commit into
openedx:masterfrom
vmnavarro94:fix/issue-478-search-flickering
Closed

fix: search flickering#1965
vmnavarro94 wants to merge 1 commit into
openedx:masterfrom
vmnavarro94:fix/issue-478-search-flickering

Conversation

@vmnavarro94

@vmnavarro94 vmnavarro94 commented May 14, 2025

Copy link
Copy Markdown
Contributor

Description

This PR addresses an issue where typing into the course search modal causes the page to refresh and the modal to close unexpectedly. The root cause is the search context updating the URL with each keystroke, which is useful for some scenarios (e.g. sharing URLs), but not for modal-based searches like the course outline.

To resolve this, we modified the SearchProvider used by the course search modal to skip the URL update. This avoids the need to track modal state in the URL and prevents unnecessary page refreshes—resulting in a smoother user experience.

Fixes: openedx/wg-build-test-release#478

Useful information to include:

In scenarios where search is embedded in the page, updating the URL makes sense.

  • In this case (course search modal), updating the URL:
  • Closes the modal on every keystroke
  • Causes jarring page reloads
  • Would require complex logic to preserve modal state in the URL
    By skipping the URL sync in this case, we simplify the behavior and improve usability.

Before

439974951-913eee02-1ee3-454c-afc5-603d1ef585f4.mov

After

Screen.Recording.2025-05-14.at.12.56.27.p.m.mov

Testing instructions

  1. Go to the Authoring module
  2. Open any course outline
  3. Click the search icon to open the modal
  4. Type into the search input

Expected Results

  • The modal remains open while typing
  • The page does not refresh on each keystroke
  • Search behaves smoothly inside the modal

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label May 14, 2025
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @vmnavarro94!

This repository is currently maintained by @bradenmacdonald.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@bradenmacdonald

bradenmacdonald commented May 14, 2025

Copy link
Copy Markdown
Contributor

Hey, thanks for looking at this! Sorry that you weren't aware, but I believe this was already fixed with #1938 . Though if you're still able to reproduce it on master, please let us know. We were working off the issue #1902 so the PR / assignee were updated on that one.

We also backported the fix to Teak: #1948

@vmnavarro94

Copy link
Copy Markdown
Contributor Author

Hey, thanks for looking at this! Sorry that you weren't aware, but I believe this was already fixed with #1938 . Though if you're still able to reproduce it on master, please let us know. We were working off the issue #1902 so the PR / assignee were updated on that one.

We also backported the fix to Teak: #1948

Yeah, I was able to reproduce it on master.

@bradenmacdonald

Copy link
Copy Markdown
Contributor

Weird; I just tried with master and I can't reproduce it. Any ideas on what's necessary to see the bug?

@vmnavarro94

Copy link
Copy Markdown
Contributor Author

Weird; I just tried with master and I can't reproduce it. Any ideas on what's necessary to see the bug?

I think I had something cached, reset my local environment and now the issue is gone, I will close this PR.

Thanks : D

@mariajgrimaldi

mariajgrimaldi commented May 15, 2025

Copy link
Copy Markdown
Member

Thank you both, @bradenmacdonald @vmnavarro94. However, this (or something similar) is still happening on the teak sandbox:

Screencast.from.15-05-25.09.57.27.webm

Can you help me find which PR fixed it? Thank you!

@bradenmacdonald

Copy link
Copy Markdown
Contributor

@mariajgrimaldi It's #1948 . Maybe the sandbox isn't updated with that fix yet?

@mariajgrimaldi

Copy link
Copy Markdown
Member

Now it's working! Thank you all for the help

@vmnavarro94
vmnavarro94 deleted the fix/issue-478-search-flickering branch June 5, 2025 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

There is debaunce and search engine error in the search model from Studio

5 participants