Skip to content
Snippets Groups Projects

Rework search components

Merged Valentin Rigal requested to merge reactive-search into release-1.7.1
All threads resolved!
Edited by Valentin Rigal

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I made a few changes to simplify the code, use stricter typing and fix some typing errors I got in VSCode, but we still need to fix some bugs

  • added 1 commit

    Compare with previous version

  • Valentin Rigal added 2 commits

    added 2 commits

    • f9f11598 - Prevent triggering search with empty query
    • e653cc77 - Fix init with similar query terms

    Compare with previous version

  • Author Maintainer

    Me and @erouchet tried to handle route update (e.g. previous/next buttons), but the actual implementation do not allow to make this easily. Other points works. Erwan will try this approach today:

    • The form uses a v-model (SearchQuery) instead of a custom event, it never access the route.
    • The parent view handles route updates and triggers search.

    Then we will discuss this again this afternoon.

  • Erwan Rouchet added 33 commits

    added 33 commits

    Compare with previous version

  • Erwan Rouchet added 7 commits

    added 7 commits

    • 554ed187 - Fix typing issues
    • 8565d97b - Trigger full searches when loading the page
    • 6722b947 - Use the correct corpus ID when switching corpora
    • 947ff5a3 - Add page number to SearchQuery type
    • d9f5eac0 - Properly handle query changes, especially when switching corpora
    • 77633b0c - Overwrite checked facets when they are updated in the URL
    • 585fa22a - Handle selecting and unselecting a corpus

    Compare with previous version

  • Erwan Rouchet resolved all threads

    resolved all threads

  • I started from scratch and added a few of the typing fixes we wrote before, for example on the handling of MetaDataType. Then I did some tests and found that most of the route handling already worked. The browser previous/next buttons do work when editing a query in the same project, but not when switching to another project, and page numbers were not always preserved, along with some other edge cases.

    I removed the only_facets=true search. The original design for this search page was to only fetch facets and not show any result until an actual search was made, but now we want the search to run all the time, so it no longer made sense. This made all search queries load when reloading the page, and also got page numbers to work.

    I then worked on other edge cases like switching projects and using the browser prev/next buttons. Most of the work was in handling the currently selected facets and updating them when switching projects or when the available facets changed.

    @vrigal will now test with his own knowledge of the many ways in which one can try to break this page :fingers_crossed:

  • Author Maintainer

    I think it is the good approach, it works fine indeed. I noticed a few things that I will try to fix now (in order of importance):

    • The entire form must be reset when switching project (as we manually set query=*, this is already done for facets and terms).
    • sort query param should be restored in the form from initial query params (search request is fine though).
    • Fix loading attributes (done in !1817 (ef18b271), prevents race conditions).
    • It is kind of a hack, but we can try to reuse commit !1817 (3e5c4aea) to hide results when no source is selected (otherwise it is quite confusing). It should be easy.
    • I got duplicated route when clicking on search and no request is sent (this could be done via event, maybe this is not necessary). If a page is set returns to page 1.
    Edited by Valentin Rigal
  • Valentin Rigal added 6 commits

    added 6 commits

    • e102f099 - Completely reset form when switching project
    • a0057eba - Restore sort from the query parameters (initial and router navigation)
    • 3b191cac - Prevent duplicating search when sort value is restored
    • 02f5a733 - Disable all fields while loading
    • 888c7b6f - Fix query comparison to trigger new search
    • 346524a1 - Hide results when no source is selected

    Compare with previous version

  • Valentin Rigal added 3 commits

    added 3 commits

    • 6a32d0d3 - Disable all fields while loading
    • 3bfff756 - Fix query comparison to trigger new search
    • 2d7ea68d - Hide results when no source is selected

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Valentin Rigal requested review from @erouchet

    requested review from @erouchet

  • Please register or sign in to reply
    Loading