Skip to content

Move expiry date info inside ReturnForm and update My Loans table layout#12912

Open
Sadashii wants to merge 3 commits into
internetarchive:masterfrom
Sadashii:feat/move-expires-time-into-return-macro
Open

Move expiry date info inside ReturnForm and update My Loans table layout#12912
Sadashii wants to merge 3 commits into
internetarchive:masterfrom
Sadashii:feat/move-expires-time-into-return-macro

Conversation

@Sadashii

Copy link
Copy Markdown
Collaborator

Closes #12911

This PR fixes a layout and visual hierarchy issue with the loan expiration date and the "Return book" CTA button.

The expires in time on the my books page has too much distance from the Return Now button, and too less with the next element ruining visual hierarchy. This PR fixes that by moving the time into the return now macro.

This PR also removes the 'Expires in' time and download options on the my loans page from a seperate column into the actions column, tidying that up, hopefully clearing the path for possibly moving that table into a carousel.

Technical

  • Moved FormatExpiry(expiry) inside the <form class="return-form"> wrapper in ReturnForm.html.
  • Consolidated the expires and actions columns in loans.html into a single actions column. Consolidating the column handles Book Reader and Adobe Digital Editions (ADE) states cleanly, and ensures non-downloaded loans still show the correct "Not yet downloaded. Download Now" actions without leaving an empty column layout.

Testing

  1. Go to a book details page with an active loan:
    • Check the actions panel. The Return button and the "Expires" date should be closely grouped (separated by a clean 4px gap).
    • The date should have a 10px margin pushing down the next action in the list.
  2. Go to the User Loans page (/account/loans):
    • The table should now consist of 3 columns (Cover, Titles, Loan actions) without the blank space/column in the middle.
    • For an active loan, the Return button and expiration date should be aligned under "Loan actions".
    • For a non-downloaded loan, it should display "Not yet downloaded. Download Now" alongside the return option in the same cell.

Screenshot

image

Stakeholders

@mekarpeles

Copilot AI review requested due to automatic review settings June 12, 2026 13:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR refactors how loan expiry information is displayed, consolidating it around the ReturnForm macro and adjusting related styling.

Changes:

  • Move “Expires” rendering into ReturnForm by passing expiry into the macro.
  • Update loans and loan status templates to use the new ReturnForm(ocaid, expiry) signature and adjust the loans table layout.
  • Add/adjust CSS for .return-form spacing and remove padding from .hoverlink.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
static/css/components/read-panel.css Adds scoped spacing rules for .return-form and its CTA button in read panel contexts.
static/css/components/buttonCta.css Adds global .return-form spacing rules to align button/layout spacing.
static/css/base/helpers-common.css Removes top padding from .hoverlink.
openlibrary/templates/account/loans.html Removes dedicated “Loan Expires” column and reflows expiry/download messaging into the actions column; updates ReturnForm invocation.
openlibrary/macros/ReturnForm.html Changes macro signature to accept expiry and renders FormatExpiry(expiry) within the form.
openlibrary/macros/ManageLoansButtons.html Removes the macro file entirely.
openlibrary/macros/LoanStatus.html Updates to call ReturnForm(ocaid, expiry) instead of rendering expiry separately.
openlibrary/macros/FormatExpiry.html Re-formats HTML/indentation and consolidates <time> attributes.

Comment thread static/css/components/buttonCta.css Outdated
Comment on lines +236 to +242
.return-form {
margin-bottom: 10px;
}

.return-form .cta-btn {
margin-bottom: var(--spacing-stack-xs);
}
Comment thread static/css/components/read-panel.css Outdated
Comment on lines +37 to +45
.read-options .return-form,
.btn-notice .return-form {
margin-bottom: 10px;
}

.read-options .return-form .cta-btn,
.btn-notice .return-form .cta-btn {
margin-bottom: var(--spacing-stack-xs);
}
Comment thread openlibrary/macros/ReturnForm.html
Comment thread openlibrary/templates/account/loans.html
Comment thread openlibrary/macros/ReturnForm.html Outdated
@mekarpeles mekarpeles self-assigned this Jun 15, 2026
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.

Fix layout hierarchy of ReturnForm button and expiry date

3 participants