Skip to content

Fix search placeholder cover alignment and sizing - #14839

Merged
lokesh merged 5 commits into
internetarchive:masterfrom
pranshup04:14372/fix-search-placeholder-alignment
Dec 4, 2026
Merged

lokesh merged 5 commits into
internetarchive:masterfrom
pranshup04:14372/fix-search-placeholder-alignment

Conversation

@pranshup04

@pranshup04 pranshup04 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14372

Expands the missing-cover placeholder to fill the search results’ cover column, implementing option 1 approved in the issue discussion.

Technical

  • At viewport widths of 768px and above, expand avatar_book-sm.png from its intrinsic 84×115px size to 105px wide and approximately 144px tall.
  • Preserve its aspect ratio and the existing 170px maximum height.
  • Use text-align: start to align covers to the reading-start edge, supporting both LTR and RTL layouts.
  • Keep real-cover images at width: auto.
  • Keep the placeholder selector’s specificity low with :where() so the existing grid-view rule can override it.
  • Scope the changes to .search-results-container within the existing desktop/tablet media query.

Testing

Previously completed checks:

  • CSS linting with Stylelint.
  • Formatting with oxfmt.
  • Production asset builds: make css && make js.
  • Bundle-size checks: 22/22 passed.

Reviewer verification:

  1. Open /search?q=kubernetes+cookbook at a viewport width of at least 768px.
  2. Confirm the missing-cover placeholder fills the 105px cover column without distortion.
  3. Confirm narrower real covers align to the reading-start edge.
  4. Check grid view and viewports below 768px for regressions.
  5. Check an RTL layout to confirm alignment mirrors correctly.

The latest commit replaces text-align: left with text-align: start in response to automated review feedback.

Screenshot

Before/after mockups are available in the issue discussion:
#14372 (comment)

These mockups illustrate the approved design; they are not screenshots of the final implementation.

Stakeholders

@lokesh @mekarpeles

@openlibrary-bot
openlibrary-bot requested a review from a team December 1, 2026 20:30
@openlibrary-bot

Copy link
Copy Markdown
Collaborator

Thanks for the PR! 🙏

@lokesh is assigned to this PR and currently has:

  • 8 open PR(s) of equal or higher priority to review first.
PR triage checklist (maintainers / Pierre)
  • PR description — not empty; explains what the change does and how to verify it
  • References an issue — PR body contains a #NNN reference
    • Linked issue is triaged — has a Priority: * label (not just Needs: Triage)
    • Linked issue is assigned — has at least one assignee
  • Commit history clean — no WIP/fixup/conflict noise; commit messages are meaningful
  • CI passing — no failing check-runs
  • Test cases present — if the change touches substantive logic, test coverage exists or is explained
  • Proof of testing — PR body includes a description of what was tested, a screenshot, or a video

Note

This comment was automatically generated by Pierre, Open Library's PR first-touch assistant, on behalf of @mekarpeles. This is NOT a code review or sign-off.

@openlibrary-bot openlibrary-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

✅ Every finding in this review was fixed or dismissed.

1 finding on 40d8a86

Prompt for AI agents (1 open item)
Check if each issue is valid — if so, understand the root cause and fix it. If one isn't valid or won't be fixed in this PR, say why in its thread, or in a comment on the PR if it has none.

<file name="static/css/components/search-result-item.css">
<item location="365">text-align: left breaks RTL mirroring: `docs/frontend/design.md`'s Right-to-left section names `text-align: left` as exactly the non-mirroring bug the RTL playground check exists to catch. Use the logical `text-align: start` instead, which renders identically in LTR but correctly flips for Arabic/Hebrew/Persian readers.</item>
</file>
🎫 Linked issues ✅: #14372 ✅

#14372 - PR Code Verified

Compliant requirements:

  • Align the missing-cover placeholder with real book covers in search results

Requires further human verification:

  • Visual confirmation in a browser that the placeholder renders flush with real covers in both list and grid layouts, and at RTL locales

Please address the feedback above before a maintainer reviews this PR · How this bot works · Reviews new pushes after 10 minutes

@openlibrary-bot
openlibrary-bot requested a review from a team December 1, 2026 21:19

@openlibrary-bot openlibrary-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No blocking findings · 1 suggestion on 4aff755

✅ Earlier findings: 1 addressed.

Re-reviewed only the files changed since my last review, skipping merges of the base branch.

Prompt for AI agents (1 open item)
Check if each issue is valid — if so, understand the root cause and fix it. If one isn't valid or won't be fixed in this PR, say why in its thread, or in a comment on the PR if it has none.

<file name="static/css/components/search-result-item.css">
<item location="379">Selector wrapped across lines unlike the rest of the file: This is the only multi-line selector in the file; every other rule, including longer ones, is written on one line and the selector here is well under the 162-char limit. Collapsing it to one line matches the file's existing convention.</item>
</file>
🎫 Linked issues ✅: #14372 ✅

#14372 - PR Code Verified

Compliant requirements:

  • Placeholder aligned to the reading-start edge via text-align: start
  • Placeholder expanded to fill the 105px cover column while preserving aspect ratio

Requires further human verification:

  • Visual confirmation in a browser across grid/list views, viewports, and RTL layout per the PR's reviewer verification steps

Please address the feedback above before a maintainer reviews this PR · How this bot works · Reviews new pushes after 10 minutes

Comment on lines +376 to +379
.search-results-container
.searchResultItem
.bookcover
:where(img[src$="avatar_book-sm.png"]) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggestion (won't block) · Styleguide — Selector wrapped across lines unlike the rest of the file

This is the only multi-line selector in the file; every other rule, including longer ones, is written on one line and the selector here is well under the 162-char limit. Collapsing it to one line matches the file's existing convention.

Apply it or ignore it.

Suggested change
.search-results-container
.searchResultItem
.bookcover
:where(img[src$="avatar_book-sm.png"]) {
.search-results-container .searchResultItem .bookcover :where(img[src$="avatar_book-sm.png"]) {

The placeholder now fills the 105px cover slot, so it no longer needs the
column's text alignment changed. Overriding it moved real covers narrower
than 105px away from the title and details.
@openlibrary-bot
openlibrary-bot requested a review from a team December 4, 2026 19:58

@openlibrary-bot openlibrary-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This review is of daddbb6. 7bf5909 was pushed while it ran, so this review neither approves nor blocks. 7bf5909 needs its own review: its code-review check says whether one will start or has to be requested.

No blocking findings · 1 suggestion on daddbb6

Suggestions (won't block)

  • Description describes a text-align: start change that isn't in the diff
    The PR body says covers are aligned with text-align: start and that the latest commit replaced text-align: left with text-align: start for RTL support, but the whole-PR diff only adds a width: 105px rule — no text-align property is touched anywhere in this file. Update the description to match what actually shipped, or confirm the text-align change landed somewhere else.
Prompt for AI agents (1 open item)
Check if each issue is valid — if so, understand the root cause and fix it. If one isn't valid or won't be fixed in this PR, say why in its thread, or in a comment on the PR if it has none.

<item>Description describes a text-align: start change that isn't in the diff: The PR body says covers are aligned with `text-align: start` and that the latest commit replaced `text-align: left` with `text-align: start` for RTL support, but the whole-PR diff only adds a `width: 105px` rule — no `text-align` property is touched anywhere in this file. Update the description to match what actually shipped, or confirm the text-align change landed somewhere else.</item>

Please address the feedback above before a maintainer reviews this PR · How this bot works · Reviews new pushes after 10 minutes

@openlibrary-bot openlibrary-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No blocking findings · 1 suggestion on 7bf5909

Suggestions (won't block)

  • PR description describes a text-align change absent from the diff
    The description says the latest commit replaced text-align: left with text-align: start in response to review feedback, but the PR's only file (search-result-item.css) contains no text-align change at all, and no other file is touched. Update the description, or confirm whether the RTL alignment fix still needs to be made.
Prompt for AI agents (1 open item)
Check if each issue is valid — if so, understand the root cause and fix it. If one isn't valid or won't be fixed in this PR, say why in its thread, or in a comment on the PR if it has none.

<item>PR description describes a text-align change absent from the diff: The description says the latest commit replaced `text-align: left` with `text-align: start` in response to review feedback, but the PR's only file (`search-result-item.css`) contains no text-align change at all, and no other file is touched. Update the description, or confirm whether the RTL alignment fix still needs to be made.</item>

Please address the feedback above before a maintainer reviews this PR · How this bot works · Reviews new pushes after 10 minutes

@openlibrary-bot

Copy link
Copy Markdown
Collaborator

Code review of 7bf5909

No blocking findings · 1 suggestion on 7bf5909 See the review.

Re-reviewed only the files changed since my last review, skipping merges of the base branch.

🎫 Linked issues ✅: #14372 ✅

#14372 - PR Code Verified

Compliant requirements:

  • Placeholder widened to 105px to fill the cover column at >=768px widths, with aspect ratio preserved via existing width/height attributes

Requires further human verification:

  • Visual check at >=768px, in grid view, below 768px, and under an RTL layout, as the PR's own test plan calls for
Review history (1)
  • 7bf5909 · 2026-12-04 20:06 UTC · No blocking findings · 1 suggestion on 7bf5909 · review

Please address the feedback before a maintainer reviews this PR · How this bot works · Updated after each review; new pushes are reviewed after 10 minutes

@lokesh
lokesh merged commit 16f9ed1 into internetarchive:master Dec 4, 2026
9 checks passed
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.

Placeholder cover image in search results not properly aligned

3 participants