Bug #19311
closedProject Search field auto-clears on first query, making the user to re-type the query.
Added by Lucas Di Pentima over 2 years ago. Updated about 2 years ago.
100%
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.
Updated by Lucas Di Pentima over 2 years ago
I've also seen this misbehavior on the Users UI's search field.
Updated by Peter Amstutz over 2 years ago
- Target version changed from 2022-08-17 sprint to 2022-08-31 sprint
Updated by Peter Amstutz over 2 years ago
- Target version changed from 2022-08-31 sprint to 2022-08-17 sprint
Updated by Peter Amstutz over 2 years ago
- Category set to Workbench2
- Assigned To set to Stephen Smith
Updated by Peter Amstutz over 2 years ago
- Assigned To changed from Stephen Smith to Daniel Kutyła
Updated by Peter Amstutz over 2 years ago
- Target version changed from 2022-08-17 sprint to 2022-08-31 sprint
Updated by Peter Amstutz over 2 years ago
- Target version changed from 2022-08-31 sprint to 2022-09-14 sprint
Updated by Peter Amstutz over 2 years ago
- Target version changed from 2022-09-14 sprint to 2022-09-28 sprint
Updated by Peter Amstutz over 2 years ago
- Target version changed from 2022-09-28 sprint to 2022-10-12 sprint
Updated by Peter Amstutz over 2 years ago
- Target version changed from 2022-10-12 sprint to 2022-10-26 sprint
Updated by Peter Amstutz about 2 years ago
- Target version changed from 2022-10-26 sprint to 2022-10-12 sprint
Updated by Daniel Kutyła about 2 years ago
- Status changed from New to In Progress
Updated by Daniel Kutyła about 2 years 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
Updated by Lucas Di Pentima about 2 years 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 atsrc/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?
Updated by Peter Amstutz about 2 years ago
- Target version changed from 2022-10-12 sprint to 2022-10-26 sprint
Updated by Daniel Kutyła about 2 years 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
Updated by Lucas Di Pentima about 2 years ago
Commit arvados-workbench2|e4f3504 seems to be just a main
merge, are you sure all the pending work was checked in and pushed?
Updated by Daniel Kutyła about 2 years 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
Updated by Lucas Di Pentima about 2 years 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 passingsetProps({ selfClearProp: 'abc' })
on line 101 and it also succeeds.
Updated by Daniel Kutyła about 2 years 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
Updated by Lucas Di Pentima about 2 years 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.
Updated by Daniel Kutyła about 2 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset arvados:arvados-workbench2|10959e316a13cb2b55b139fb48c26654a96de9a3.