Skip to content

Overhaul search results style #3181

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

Merged
merged 1 commit into from
Sep 22, 2022
Merged

Overhaul search results style #3181

merged 1 commit into from
Sep 22, 2022

Conversation

srawlins
Copy link
Member

This should fix #3171 and #3175. It's a big PR as I refactored a lot of code so that I could understand it better.

Mini results

Screen Shot 2022-09-20 at 8 44 05 PM

Full page

Screen Shot 2022-09-20 at 8 40 26 PM

  • Separate the style of results shown in the "mini results" below the search bar, and those on the full search page.
    • Mini search results below search bar:
      • Use @Hixie's intuition that each result should be a single line of text
      • Add 60 pixels to the width, to accommodate for the single line results
      • Hide text overflow, but each result's full "one line doc" is available as title text (hover)
    • Full search bar: more or less unchanged
  • Search code
    • initializeSearch was ~450 lines, so I split out the local functions where I was editing code.
    • Change anything named "category" or "group" to be "container" which more closely aligns with other dartdoc terminology for "a thing that can be an enclosing element".
    • Delete iterateCategoriesMap and just inline its code.
    • Rename handle to handleSearch.
    • Change many comments to doc comments.
    • Wrap many comments.
    • Change handle's bool optional parameter to be named, to fit with Effective Dart.

There is a fair amount that could still be improved here (see other bugs), but (a) we don't have any automated testing for the generated JS app 😦 and (b) I should stop here and land something.

@srawlins
Copy link
Member Author

CC @keertip @kevmoo

@srawlins srawlins requested a review from keertip September 21, 2022 19:59
Copy link
Collaborator

@keertip keertip left a comment

Choose a reason for hiding this comment

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

Difficult to review due to the refactor, the diff does not really show only code that has changed. Went by your comments as to the changes.

@srawlins
Copy link
Member Author

I know, I apologize ☹️ . I tried to stop refactoring as early as I could. And I didn't want 2 or 4 refactor PRs to precede this one as I hope to get this fixes out quickly. My bad for rushing it maybe. Follow up PRs for search should be smaller.

@srawlins srawlins merged commit d4c344d into dart-lang:master Sep 22, 2022
@srawlins srawlins deleted the fix-3171 branch September 22, 2022 18:02
@parlough parlough mentioned this pull request Dec 5, 2022
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.

Search results dropdown should only use one line per result
2 participants