Skip to content

feat: open BookReader with search panel visible on Preview#12855

Open
mekarpeles wants to merge 2 commits into
masterfrom
11912/preview-open-search-panel
Open

feat: open BookReader with search panel visible on Preview#12855
mekarpeles wants to merge 2 commits into
masterfrom
11912/preview-open-search-panel

Conversation

@mekarpeles
Copy link
Copy Markdown
Member

Summary

Appends &q= to the BookReader embed URL in the Preview button so that clicking "Preview" on a book opens BookReader with the search-inside panel already visible.

Currently patrons who click "Preview" get a book reader with no obvious indication that full-text search exists. With this change, the search panel opens automatically, making search-inside discoverable from the first interaction.

Depends on: internetarchive/bookreader#1550 (must deploy before this takes effect)

Change

openlibrary/macros/BookPreview.html — 1 line
Added &q= to the data-iframe-src URL passed to the BookReader embed. BookReader #1550 treats ?q= (empty) as a signal to open the search panel on load without running a search.

Testing

Once internetarchive/bookreader#1550 is deployed to archive.org:

  1. Go to any search result page with a "Preview" button
  2. Click Preview
  3. Expected: BookReader opens with the search sidebar visible
  4. Type a term in the search box — it should search inside the book normally

References

Closes #11912

Appends &q= to the BookReader embed URL so that clicking Preview
opens BookReader with the search-inside panel already open, making
full-text search discoverable without requiring patrons to find
the search icon themselves.

Depends on: internetarchive/bookreader#<pr-number>
Closes: #11912
Copilot AI review requested due to automatic review settings June 4, 2026 20:08
@github-actions github-actions Bot added the Priority: 2 Important, as time permits. [managed] label Jun 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the BookReader embed URL used by the “Preview” button so BookReader opens with the search-inside panel visible by default (via an empty q query parameter), improving discoverability of full-text search from the first interaction.

Changes:

  • Append q= to the BookReader embed URL used in the Preview modal.

Comment thread openlibrary/macros/BookPreview.html Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: 2 Important, as time permits. [managed]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make default "Preview" open BookReader w/ Search panel open

2 participants