openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Unify style of search buttons

Open RayBB opened this issue 1 year ago • 13 comments

Following #8963 we want to evaluate unifying the styles of the search buttons with something like cta-btn cta-btn--small cta-btn--vanilla etc.

This will potentially also require changing the text input to match the height and look nice. Maybe like the button group from bootstrap here.

Describe the problem that you'd like solved

Proposal & Constraints

Additional context

Stakeholders

RayBB avatar Apr 15 '24 10:04 RayBB

I'd like to work on this!

0simoo avatar Apr 20 '24 20:04 0simoo

@0simoo I've assigned you. Feel free to create a proof of concept that you think looks nice and we can discuss further from there.

RayBB avatar Apr 20 '24 20:04 RayBB

Here are some proof of concepts. Let me know what you think!

screenshot1 screenshot2

0simoo avatar Apr 22 '24 19:04 0simoo

@0simoo I like both of them a lot actually. A small personal preference for the 2nd one but both would be a great improvement. Can you join today's community call to share these?

If not, I'll try to share and see what people say!

RayBB avatar Apr 23 '24 09:04 RayBB

I should be able to attend today's community call!

0simoo avatar Apr 23 '24 12:04 0simoo

Thanks @0simoo! As discussed during today's community call:

  • Everybody generally seems to prefer the combined search box and button
  • Search button should have a slightly darker color in order to better indicate that it is indeed a button
    • @mekarpeles suggests trying the same color as the search facet selector (pictured below)

image

jimchamp avatar Apr 23 '24 20:04 jimchamp

Here's the updated search box!

Screenshot 2024-04-23 at 5 15 17 PM

I'm currently adding the new style rules directly to the element in the HTML, which might be bad practice. I've tried creating a new CSS class for the new changes, but I'm having some trouble getting it to work.

0simoo avatar Apr 23 '24 21:04 0simoo

Any changes that you make to a less file will need to be transpiled into CSS. You should see your changes after running the following: docker compose exec web make css

More information about this can be found here.

jimchamp avatar Apr 23 '24 22:04 jimchamp

I've made a pull request with the new designs. Let me know what you think! @jimchamp

0simoo avatar Apr 25 '24 18:04 0simoo

After decision today during design call, we'd like to move forward with a very similar design, inspired by what we already use in the header:

image

Instead of having "Search" be a button to the right of the input, we'll have a magnifying glass be the button within the input area.

Finally, we'd like to re-use this paradigm / component as a template for:

  • the Author page (https://openlibrary.org/authors/OL107911A/George_Bernard_Shaw)
  • the My Books Reading Log page (https://openlibrary.org/people/mekBot/books/want-to-read)
  • the Subject page (e.g. https://openlibrary.org/subjects/biology)

For now, we've decided that this template should be different that the one in the header navigation to keep things simple. cc: @0simoo

Also, just to be clear, we're not asking for all of these changes in 1 PR, for now, this PR can be closed when we have a template that achieves the design in this comment and it's being applied to the various search pages.

mekarpeles avatar May 03 '24 16:05 mekarpeles

So I should change the designs to the magnifying glass one? I think I'm bit confused about what you mean by the template should be different than the one in the header.

0simoo avatar May 06 '24 15:05 0simoo

@0simoo what he means is create: /openlibrary/templates/search/search_bar.html

In that file put (or whatever it is): <input type="text" class="search-input" name="q" size="100" value="$q"/><input type="submit" class="search-btn" value="$_('Search')"/>

In openlibrary/templates/search/authors.html (and all the other search pages) add: $:render_template("search/search_bar")

As for the other comment:

should be different than the one in the header

^ This just means don't try to reuse the search bar we currently have here https://github.com/internetarchive/openlibrary/blob/37db01e97fafaeec1f36951050b06f836442ca71/openlibrary/templates/lib/nav_head.html#L98-L111

RayBB avatar May 06 '24 21:05 RayBB

I've made a commit to the PR. Let me know if there's anything I misunderstood or should fix!

0simoo avatar May 08 '24 02:05 0simoo