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

Wizard: Switch view to "Available" when searching for package (HMS-5480) #2873

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mgold1234
Copy link
Collaborator

@mgold1234 mgold1234 commented Feb 10, 2025

this fix an issue when user search for a package, the viewv stay "Selected" instead of switching to "Available

FIX ISSUE: (#2864)

JIRA: HMS-5480

@mgold1234
Copy link
Collaborator Author

/jira-epic HMS-5294

@schutzbot schutzbot changed the title Wizard: Switch view to "Available" when searching for package Wizard: Switch view to "Available" when searching for package (HMS-5480) Feb 10, 2025
Copy link
Collaborator

@lucasgarfield lucasgarfield left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for taking this one!

Would you mind getting the tests passing?

@mgold1234 mgold1234 force-pushed the add_v branch 2 times, most recently from e39a94c to aa0fc37 Compare February 11, 2025 08:58
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.14%. Comparing base (52c790b) to head (ffa909a).

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2873   +/-   ##
=======================================
  Coverage   82.14%   82.14%           
=======================================
  Files         207      207           
  Lines       23220    23221    +1     
  Branches     2270     2270           
=======================================
+ Hits        19074    19075    +1     
  Misses       4119     4119           
  Partials       27       27           
Files with missing lines Coverage Δ
...ents/CreateImageWizard/steps/Packages/Packages.tsx 79.22% <100.00%> (+0.01%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52c790b...ffa909a. Read the comment docs.

@mgold1234 mgold1234 force-pushed the add_v branch 3 times, most recently from b458bef to 4dbe2d4 Compare February 11, 2025 11:55
@mgold1234
Copy link
Collaborator Author

mgold1234 commented Feb 11, 2025

after this small change - setToggleSelected('toggle-available');
one test was failing-
should display relevant results in selected first
I investigate it and figure out that when we press on

 await toggleSelected();
    await clearSearchInput();
    await typeIntoSearchBox('test');
 we now see all the list - available and selected packages ( this is the change that I did)
 so we should update the fixture with all the pakcages -
  https://github.com/osbuild/image-builder-frontend/pull/2873/files#diff-0e6259b7bae68a7c74bc6a5d690681a6399caa397d3ba5abe457064c699e8c9bR31

and now there are 3 tests that failing, and it is very wired,
you can see in the recording that the packages that were added to the fixutre now appear twice.

Screen.Recording.2025-02-11.at.17.54.28.mov

I think this is a bug in the mock data, I couldnt reproduce that manully

@lucasgarfield need your advice here

for now I fixed the failing tests respectivally to the bug in the mock, but maybe you will have different approach here

@regexowl
Copy link
Collaborator

Ah nice! The problem with the tests suddenly makes sense after noticing it should sort selected packages 😅 but that brings a question - aren't we losing the option to sort through those?

Imagine a situation where you have one hundred selected packages. And you want to know if tmux is one of them. You'd have to click through pages, scroll through and check manually, right? Previously you could just search the package in "Selected packages" and the selected packages would get filtered. But now it would automatically switch you to available and you would have to switch back to Selected to see the results.

@mgold1234
Copy link
Collaborator Author

While I understand the concern about losing the ability to filter within the 'Selected' tab, my belief is that user primarily initiates a search when he intend to add new packages. User familiar with his current selections would likely navigate directly to the 'Selected' tab for review, rather than using search to locate specific items within that list.
@lucasgarfield wdyt?

this fix an issue when user search for a package, the viewv stay "Selected"
instead of switching to "Available

fix one test
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