Skip to content

Add 10 lucide icons and replace their legacy image consumers - #13424

Closed
lokesh wants to merge 4 commits into
internetarchive:masterfrom
lokesh:icons/chore/phase2-icon-set
Closed

Add 10 lucide icons and replace their legacy image consumers#13424
lokesh wants to merge 4 commits into
internetarchive:masterfrom
lokesh:icons/chore/phase2-icon-set

Conversation

@lokesh

@lokesh lokesh commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Phase 2 of the icon-system migration (#12955): adds the sprite icons the legacy-icon audit called for, and switches every live consumer of the corresponding legacy images over to them in the same PR.

Icons added (10)

triangle-alert · info · circle-help · git-merge · headphones · map-pin · book-open · grip-vertical · square-arrow-out-up-right · heart

Seven icons from the original audit list were dropped: lock, octagon-x, and plus targeted CSS rules that turned out to be dead (deleted here instead); star belongs to the rating-widget rewrite; bell, download, and shopping-cart belong to the PNG sprite-sheet teardown. Each lands with the PR that wires it up.

Surfaces switched

  • Flash messages (site/body.html and the hand-rendered boxes on login, signup, book edit): type-mapped icons — error → triangle-alert, info/note → info, success → circle-check. The old CSS showed a checkmark for every non-error type, including info.
  • Author merge: #preMerge/#postMerge/#errorMerge banners, the authors-search "Merge authors" prompt, and the search-facet "Merge duplicates" link (previously a Python-built string, now template markup).
  • Read CTAs: dropper "Listen" → headphones, "Locate" → map-pin, audiobook button → headphones (was the one-off read aloud.svg), and all cta-btn--external buttons get a trailing square-arrow-out-up-right instead of a background image.
  • Covers admin: drag-to-trash can → trash, "Saved!" → circle-check, sortable-area affordance → grip-vertical.
  • Others: author-edit Identifiers help link (circle-help), lists landing CTA (heart), not-logged notice + edit-page alert banners (info), team-page links (ol-icon globe/book-open).

Three sites keep CSS-drawn glyphs as masked pseudo-elements because no template owns their markup: jQuery UI dialog paragraphs, the preview button's book glyph (was a mask: of open-book.svg), and the cover-sort drag affordance.

Dead code deleted along the way

page-plain.css's four message boxes (only the DAISY page loads that bundle, and it uses none of them), div.verify (template no longer exists), and button.addAnother (no consumer anywhere).

What this PR does NOT do

  • No image deletions. The now-unreferenced legacy files stay on disk so patch deploys keep working (binary deletions break git apply on GitHub's .diff, see Delete 68 legacy image files no longer referenced anywhere #13329). A follow-up chore deletes them once this lands.
  • stars.png (rating widget) and the tier-3 PNG sprite sheets (icons_sprite*.png, icons_lists.png) are separate follow-ups.

Testing

Verified on local dev: login flash box, lists CTA, search-result Locate buttons, Preview book mask, facet-head merge link, authors-search merge prompt, author-edit help icon, not-logged notice, and the sprite containing exactly the 10 new symbols. pre-commit (stylelint, eslint, i18n, unused-templates) passes on all changed files.

Note for reviewers

Found while auditing: buttonCta.css referenced read aloud.svg URL-encoded (read%20aloud.svg), which the #13329 deletion sweep missed; that file is restored there and its consumer switched to the sprite here.

Staged ahead of the replacement work so the sprite already carries them
when each legacy image swap lands. No references yet; the sprite build
auto-discovers everything under static/icons/src/.

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD
lokesh added a commit to lokesh/openlibrary that referenced this pull request Aug 25, 2026
The 17 lucide additions had ridden along in the ol-button commit with
nothing consuming them; they now land via internetarchive#13424 instead.

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD
lokesh added 3 commits August 24, 2026 22:56
lock, octagon-x, and plus targeted CSS rules that turn out to be dead
(page-plain message boxes, .addAnother); star belongs to the rating-widget
rewrite; bell, download, and shopping-cart belong to the PNG sprite-sheet
teardown. Each lands with the PR that wires it up.

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD
page-plain's message/alert/stop/info boxes serve only the DAISY page,
which uses none of them; div.verify came from a template that no longer
exists; button.addAnother has no consumer anywhere.

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD
Flash messages, edit-page alerts, and the not-logged notice render
type-mapped sprite icons in markup; merge surfaces (author banners,
authors-search prompt, facet head) use git-merge; the author-edit help
img, lists CTA heart, covers trash/saved, dropper listen, audiobook
button, and team-page links move to macros.icon or ol-icon; external
CTAs get a trailing square-arrow-out-up-right glyph.

Three sites keep CSS-drawn glyphs as masked pseudo-elements because no
template owns their markup: jQuery UI dialog paragraphs, the preview
button's book, and the cover-sort drag affordance.

The legacy images themselves stay on disk so patch deploys keep working
(binary deletions break git apply on the .diff endpoint); a follow-up
chore deletes them once this lands.

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD
@lokesh lokesh changed the title Add the 17 lucide icons for the remaining legacy-image replacements Add 10 lucide icons and replace their legacy image consumers Aug 25, 2026
@lokesh

lokesh commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Scrapping this approach for now. Final state was lokesh/openlibrary@b2cee0eb5 if we ever want to revisit.

@lokesh lokesh closed this Aug 25, 2026
@lokesh
lokesh deleted the icons/chore/phase2-icon-set branch August 25, 2026 06:26
lokesh added a commit that referenced this pull request Aug 25, 2026
* Delete 50 legacy image files replaced by the icon system

21 of these were replaced by sprite icons in #12955; the other 29 have
had no references in the codebase for years and turned up while auditing.
Verified none of the 50 is referenced from any template, JS, CSS or
Python on the icon-system branch.

Split out of #12955 so that PR carries no binary content: GitHub's .diff
omits binary data, so a patch deploy of a PR containing binary deletions
aborts unless it passes --exclude=static/images/*. This one never needs
to reach testing, so the flag stops mattering.

Merge after #12955.

Claude-Session: https://claude.ai/code/session_01Lv9GuFfV3JRG7hmKGmN1t4

* Replace the list delete trashcan link with an ol-button

The delete/remove control on list pages was an anchor with a sprite-image
trashcan; it now uses ol-button with the trash icon, which lets the last of
the legacy image files go. On a list's own page the button moves into the
CTA column under the lending button and dropper, so the dropper's ad-hoc
margin and its 50px reservation for the absolutely positioned control give
way to a single flex gap owning the rhythm.

Claude-Session: https://claude.ai/code/session_01NmxEn3FtZunApjLZAW78wo

* Move the unreferenced phase-2 icon set out to its own PR

The 17 lucide additions had ridden along in the ol-button commit with
nothing consuming them; they now land via #13424 instead.

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD

* Point the service-worker fixture at a surviving image

The matcher test used the now-deleted barcode_scanner.svg as its
sample path.

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD

* Scope the empty check-in-container rule to list pages

The grid variant applied to every .list-books--grid (search results,
author pages, reading log), not just list seeds.

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD

* Move the ol-button trashcan swap to its own PR

Restores the list templates, JS, and CSS to master and keeps
back_list-trash.png, whose last reference lives until #13425 lands.
This PR is back to being a pure deletion of unreferenced files.

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD

* Keep read aloud.svg: buttonCta.css still references it URL-encoded

The audit grep missed the %20-encoded url() in buttonCta.css:39, so
deleting the file would blank the open-access audiobook button icon.
It goes once that button is on the sprite (icons/chore/phase2-icon-set).

Claude-Session: https://claude.ai/code/session_01RtTEd3rAHJYz3zKi3zUWwD
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.

1 participant