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

Display search results as cards #2055

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Conversation

kathy-t
Copy link
Contributor

@kathy-t kathy-t commented Jan 16, 2025

Description
Webservice PR: dockstore/dockstore#6071

This PR turns the search results into search cards based on the mockups shared in dockstore-devs. Alot of the code between the various entry type search tables were the same, so I refactored it into one component.

Slightly different from the mockups: I moved the "Popular Keywords button" down so that it's on the same line as the "Sort by" selector because it looks better IMO and it prevents the tag cloud from blocking the Sort by options which would've happened in the original mockup. Note that the Popular Keywords button background color is slightly less vibrant because I modified it to use the existing <entry-trype>-background-color classes.

For the "Sort By" options, you can only sort by Stars, Name, and Authors. I removed the descriptor type because the sort by drop down was getting long with all the options and descriptor type sorting didn't seem as helpful since we have descriptor type facets.

Original mockups for reference

Without highlighting
Search cards

With highlighting
Search card highlighting

Before

Without highlighting:
image

With highlighting:
image

After

Search cards:
Screenshot 2025-01-16 at 14-45-43 Dockstore Workflow

Sort by options:
Screenshot 2025-01-16 at 14-48-50 Dockstore Workflow

With DOIs:
Screenshot 2025-01-16 at 14-46-05 Dockstore Workflow

Tools:
Screenshot 2025-01-16 at 14-46-18 Dockstore Workflow

Notebooks:
Screenshot 2025-01-16 at 14-46-30 Dockstore Workflow

Search highlighting:
Screenshot 2025-01-16 at 14-48-35 Dockstore Workflow

Review Instructions
Go to the search page and interact with it by selecting facets (languages, categories, etc) and verifying that the search result cards get updated accordingly. Verify that pagination works as expected. Interact with the Popular Keywords tag cloud and verify it works. Repeat for the other entry search tables.

Issue
dockstore/dockstore#5726
https://ucsc-cgl.atlassian.net/browse/DOCK-2482

Security
If there are any concerns that require extra attention from the security team, highlight them here.

Please make sure that you've checked the following before submitting your pull request. Thanks!

  • Check that your code compiles by running npm run build
  • Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.
  • If this is the first time you're submitting a PR or even if you just need a refresher, consider reviewing our style guide
  • Do not bypass Angular sanitization (bypassSecurityTrustHtml, etc.), or justify why you need to do so
  • If displaying markdown, use the markdown-wrapper component, which does extra sanitization
  • Do not use cookies, although this may change in the future
  • Run npm audit and ensure you are not introducing new vulnerabilities
  • Do due diligence on new 3rd party libraries, checking for CVEs
  • Don't allow user-uploaded images to be served from the Dockstore domain
  • If this PR is for a user-facing feature, create and link a documentation ticket for this feature (usually in the same milestone as the linked issue). Style points if you create a documentation PR directly and link that instead.
  • Check whether this PR disables tests. If it legitimately needs to disable a test, create a new ticket to re-enable it in a specific milestone.

@kathy-t kathy-t self-assigned this Jan 16, 2025
<span class="size-small" [matTooltip]="entry.topic" matTooltipPosition="left">
{{ entry.topic }}
</span>
<app-ai-bubble *ngIf="entry.topicSelection === TopicSelectionEnum.AI && !entry.isApprovedAITopic"></app-ai-bubble>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the cards in the collection so they match the search cards more, i.e. the AI bubble is after the topic instead of before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new component that is used for all entry type search tables. It contains alot of the code from the old individual entry type tables, in addition to the tag cloud code, which is moved from search-results.component to this component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These styles were moved from search-results.component.scss to here

@@ -40,21 +40,18 @@
<img class="site-icons-tab m-2" src="../assets/svg/sub-nav/workflow.svg" alt="workflow icon" />
<b>Workflows</b>
</ng-template>
<div class="mat-tab-content"></div>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This class didn't actually exist in the component scss file, so removed

Copy link
Contributor

@svonworl svonworl left a comment

Choose a reason for hiding this comment

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

This is great, Kathy! Before reviewing the code, some questions/observations about the design/layout/UI itself:

  • If no author exists, omit the "authors" line/info completely?
  • Circular "authors" icon is similar to circular "entry type" icon, and thus dilutes the utility of the "entry type" icon as a visual "bullet". Change to something different, perhaps an icon similar to the mockup, or change the icon to text ("Authors:")?
  • The mockup has less spacing between successive lines of the topic text. Saves a bit of vertical space and, IMHO, looks nice. Replicate in the actual version?
  • Is sorting by "Least Stars" gonna be useful to anyone?
  • Some other potentially-useful sorting criteria: Recently Updated
  • To save vertical space, put authors somewhere else? Could float it somewhere, maybe in a block with an author per line.
  • The "Popular Keywords" button is still visually obnoxious, should we further deemphasize?
  • Horizontal spacing between "last updated" text and bubbles is tight. Increase?
  • "Star number" appears slightly higher on the page than the accompanying star. Fix?

Would love to hear what everyone thinks!

@svonworl
Copy link
Contributor

This is great, Kathy! Before reviewing the code, some questions/observations about the design/layout/UI itself:
[list of questions]
Would love to hear what everyone thinks!

Forgot to note that none of these are "mandatory" changes, but rather they're some ideas/etc that we might consider/implement (or not).

@denis-yuen
Copy link
Member

Very satisfying, looks really good!

I agree with most of @svonworl's comments (both in terms of nice to have but not essential and/or could be follow-up tickets , just noting the ones with a bit of disagreement)

If no author exists, omit the "authors" line/info completely?

I can see where this is coming from but I also like the "advertising" or get your name here aspect of things. It fits well with the drive toward more DOIs as well. Is there a way to save space but also act as a subtle hint that users should tie in some form of authorship whether ORCID or whatnot?

The "Popular Keywords" button is still visually obnoxious, should we further deemphasize?

Kinda like this as a fun touch, but the grey is fine.

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