Project

General

Profile

Actions

Bug #19311

closed

Project Search field auto-clears on first query, making the user to re-type the query.

Added by Lucas Di Pentima over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench2
Story points:
-
Release relationship:
Auto

Description

A user reported that they sometimes have to re-type the search string on projects.

This behavior is confirmed: upon application's first load, the first search made on a project UI is automatically cleared. Only subsequent queries work correctly.
This doesn't seem to happen on others panels like "Shared with me", "Public Favorites" or "My Favorites" but I think it's worth double checking.


Subtasks 1 (1 open0 closed)

Arvados - Task #19325: ReviewIn ProgressDaniel Kutyła10/11/2022Actions
Actions #1

Updated by Lucas Di Pentima over 1 year ago

I've also seen this misbehavior on the Users UI's search field.

Actions #2

Updated by Peter Amstutz over 1 year ago

  • Target version changed from 2022-08-17 sprint to 2022-08-31 sprint
Actions #3

Updated by Peter Amstutz over 1 year ago

  • Target version changed from 2022-08-31 sprint to 2022-08-17 sprint
Actions #4

Updated by Peter Amstutz over 1 year ago

  • Assigned To set to Stephen Smith
  • Category set to Workbench2
Actions #5

Updated by Peter Amstutz over 1 year ago

  • Assigned To changed from Stephen Smith to Daniel Kutyła
Actions #6

Updated by Peter Amstutz over 1 year ago

  • Release deleted (52)
Actions #7

Updated by Peter Amstutz over 1 year ago

  • Target version changed from 2022-08-17 sprint to 2022-08-31 sprint
Actions #8

Updated by Peter Amstutz over 1 year ago

  • Target version changed from 2022-08-31 sprint to 2022-09-14 sprint
Actions #9

Updated by Peter Amstutz over 1 year ago

  • Target version changed from 2022-09-14 sprint to 2022-09-28 sprint
Actions #10

Updated by Peter Amstutz over 1 year ago

  • Target version changed from 2022-09-28 sprint to 2022-10-12 sprint
Actions #11

Updated by Peter Amstutz over 1 year ago

  • Target version changed from 2022-10-12 sprint to 2022-10-26 sprint
Actions #12

Updated by Peter Amstutz over 1 year ago

  • Target version changed from 2022-10-26 sprint to 2022-10-12 sprint
Actions #13

Updated by Daniel Kutyła over 1 year ago

  • Status changed from New to In Progress
Actions #14

Updated by Daniel Kutyła over 1 year ago

New version: https://dev.arvados.org/projects/arvados/repository/arvados-workbench2/revisions/235d9456eb6679611af96383f9dfcadc3462a7da
Test run: developer-tests-workbench2: #953
Branch: 19311-Project-Search-field-auto-clears

Added inital check before search field clear

Actions #15

Updated by Lucas Di Pentima over 1 year ago

  • The reported issue on the projects view seems to be working well now, thanks.
  • OTOH, I've checked how the search input behaves on the collection's file browser and the previous problematic behavior persists. (try a collection with a subdirectory so that the search input is in both panels of the file browser)
  • I'm worried about that global selfClearPropState variable that was added at src/components/search-input/search-input.tsx, I'm thinking that it could create issues difficult to debug, can you make the component's state completely isolated? If more than one instance of the component is in use, that global would be a shared state between both input fields, and that's not what we want, right?
Actions #16

Updated by Peter Amstutz over 1 year ago

  • Target version changed from 2022-10-12 sprint to 2022-10-26 sprint
Actions #17

Updated by Daniel Kutyła over 1 year ago

New version: https://dev.arvados.org/projects/arvados/repository/arvados-workbench2/revisions/e4f350462118a86831f92eb375c2bc89cbf85920
Test run: developer-tests-workbench2: #962
Branch: 19311-Project-Search-field-auto-clears

Changed component type to a functional approach

Actions #18

Updated by Lucas Di Pentima over 1 year ago

Commit arvados-workbench2|e4f3504 seems to be just a main merge, are you sure all the pending work was checked in and pushed?

Actions #19

Updated by Daniel Kutyła over 1 year ago

New version: https://dev.arvados.org/projects/arvados/repository/arvados-workbench2/revisions/a9a30db7ec9505450da696ccf660edc20fe2ac0b
Test run: developer-tests-workbench2: #969
Branch: 19311-Project-Search-field-auto-clears

Changed component type to a functional approach

Actions #20

Updated by Lucas Di Pentima over 1 year ago

  • Manual tests show correct behavior.
  • There's some commented out code that could be just deleted.
  • On the test file src/components/search-input/search-input.test.tsx I'm not sure the modified test is correctly exercising the behavior, for example I tried commenting out line 101 and re-ran the test, still getting a success. I've even tried passing setProps({ selfClearProp: 'abc' }) on line 101 and it also succeeds.
Actions #21

Updated by Daniel Kutyła over 1 year ago

New version: https://dev.arvados.org/projects/arvados/repository/arvados-workbench2/revisions/cbe483113381e8c22b28a042479f5b7374a84744
Test run: developer-tests-workbench2: #970
Branch: 19311-Project-Search-field-auto-clears

Removed commented code, made tests clear

Actions #22

Updated by Lucas Di Pentima over 1 year ago

I think tests like this should usually exercise both ways of a behavior: when it should and shouldn't happen.
I've added a commit (arvados-workbench2|6887b04c) with the following:

diff --git a/src/components/search-input/search-input.test.tsx b/src/components/search-input/search-input.test.tsx
index ff1d30c4..ba70f752 100644
--- a/src/components/search-input/search-input.test.tsx
+++ b/src/components/search-input/search-input.test.tsx
@@ -104,6 +104,11 @@ describe("<SearchInput />", () => {
             expect(onSearch).toBeCalledWith("");
             expect(onSearch).toHaveBeenCalledTimes(1);

+            // component should not clear on same selfClearProp
+            searchInput.setProps({ selfClearProp: 'abc' });
+            jest.runTimersToTime(1000);
+            expect(onSearch).toHaveBeenCalledTimes(1);
+
             // component should clear on selfClearProp change
             searchInput.setProps({ selfClearProp: '111' });
             jest.runTimersToTime(1000);

...so that we make sure the cleaning is done only when it should.

With that, it LGTM.

Actions #23

Updated by Daniel Kutyła over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Resolved
Actions #24

Updated by Peter Amstutz over 1 year ago

  • Release set to 47
Actions

Also available in: Atom PDF