Skip to content

Mobile layout fixes: pagination, related carousel, book-detail spacing - #310

Merged
fabiodalez-dev merged 2 commits into
mainfrom
fix/mobile-frontend-layout
Jul 31, 2026
Merged

Mobile layout fixes: pagination, related carousel, book-detail spacing#310
fabiodalez-dev merged 2 commits into
mainfrom
fix/mobile-frontend-layout

Conversation

@fabiodalez-dev

@fabiodalez-dev fabiodalez-dev commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Fixes a batch of mobile layout issues on the catalogue and book-detail pages, all verified in a real browser at a 390px viewport.

Fixes

  • Pagination — after Bootstrap was removed, .pagination/.page-item/.page-link had no framework CSS, so the page links stacked vertically. They now lay out as a centred, wrapping flex row (desktop + mobile).
  • Source links ("Cerca su") — on mobile they rendered ~300px wide and left-packed, misaligned with the full-width Reserve/Favourite buttons above them. They now stack full width so the action area reads as one consistent column.
  • Info sections — the 2rem all-around mobile padding doubled up with the column's px-3, leaving the info looking narrow. Vertical-only padding now makes the info span the same width as the title.
  • Card header (Informazioni Libro) — removed the bottom hairline (explicit border-bottom:none to beat the global .card-header rule in main.css) and balanced the vertical padding.
  • Related books (mobile carousel) — the real bug was the base grid's justify-content:center leaking into the overflowing flex strip: it centred the cells and showed two half-covers at scrollLeft:0. Reset to flex-start, start-aligned with scroll-snap-stop:always, and each cell now shows one dominant whole book with ~15% of the next peeking as the scroll affordance.
  • Breadcrumb divider — the separator was scoped to .book-breadcrumb only, so the catalogue breadcrumb had none. Generalised to every .breadcrumb, using currentColor so it works on both the dark book text and the white catalogue hero.
  • Mobile chrome colour — added a theme-color meta so the mobile browser chrome uses the active theme's primary colour, resolved server-side.

Notes

  • All changes are CSS / view-only; PHPStan level 5 clean; frontend unit tests pass.
  • The related-books <style> block lives inside a double-quoted PHP string, so the CSS comments avoid " and $.

Summary by CodeRabbit

  • Miglioramenti
    • Ottimizzata la visualizzazione mobile della pagina di dettaglio libro, con card correlate a scorrimento orizzontale.
    • Migliorata la disposizione della paginazione su più righe e dimensioni dello schermo.
    • Resi più coerenti breadcrumb e collegamenti alle azioni sui dispositivi mobili.
    • Aggiunto il colore del tema del sito alla barra del browser sui dispositivi compatibili.

- Pagination: the .pagination/.page-item/.page-link classes carried no
  framework CSS after Bootstrap's removal, so the page links stacked
  vertically. Lay them out as a centred, wrapping flex row.
- Source links ("Cerca su"): on mobile they rendered ~300px wide and
  left-packed, misaligned with the full-width Reserve/Favourite buttons above.
  Stack them full width so the whole action area reads as one column.
- Info sections: dropped the 2rem all-around mobile padding that doubled up
  with the column's px-3; vertical-only padding makes the info span the same
  width as the title above.
- Card header (Informazioni Libro): removed the bottom hairline (explicit
  border-bottom:none to beat the global .card-header rule) and balanced the
  vertical padding.
- Related books (mobile carousel): below 767px it is a snap-scroll strip
  showing one dominant whole book with ~15% of the next peeking as the scroll
  affordance. Fixed the real bug: the base grid's justify-content:center leaked
  into the overflowing flex strip and centred the cells, showing two half-covers
  at scrollLeft 0 — reset to flex-start, start-aligned, snap-stop:always.
- Breadcrumb: the divider was scoped to .book-breadcrumb only, so the
  catalogue breadcrumb had none — generalise it to every .breadcrumb, with
  currentColor so it works on dark and light backgrounds.
- Add a theme-color meta so the mobile browser chrome uses the theme's
  primary colour.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@fabiodalez-dev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c7e3106d-58d8-4f64-ad6d-a411af7e7f17

📥 Commits

Reviewing files that changed from the base of the PR and between a8195c1 and a206a56.

📒 Files selected for processing (2)
  • app/Views/frontend/book-detail.php
  • public/assets/frontend-layouts.css
📝 Walkthrough

Walkthrough

Il PR aggiorna gli stili responsive del dettaglio libro e del catalogo. Aggiunge il colore del tema del browser. Estende gli stili condivisi per breadcrumb e link sorgente su schermi piccoli.

Changes

Frontend responsive

Layer / File(s) Summary
Layout mobile del dettaglio libro
app/Views/frontend/book-detail.php
Riduce il padding delle sezioni informative. Rimuove il bordo inferiore dalle intestazioni delle card. Estende lo scorrimento orizzontale delle card correlate fino a 767px, con snap obbligatorio e card all’85% della larghezza.
Layout della paginazione
app/Views/frontend/catalog.php
Dispone la paginazione in una riga flex centrata e avvolgibile. Rimuove la spaziatura fissa di 20px.
Tema e componenti condivisi
app/Views/frontend/layout.php, public/assets/frontend-layouts.css
Aggiunge il meta tag theme-color con valore derivato dal tema attivo e fallback #d70161. Estende i separatori breadcrumb e rende a larghezza completa i link sorgente su schermi fino a 767px.

Estimated code review effort: 2 (Simple) | ~10 minuti

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Il titolo descrive in modo chiaro e conciso le principali correzioni al layout mobile, inclusi paginazione, carosello correlato e spaziatura del dettaglio libro.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mobile-frontend-layout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/Views/frontend/book-detail.php`:
- Around line 1126-1133: Update the responsive styling for the card header so
that at viewports of 576px or less its horizontal margins become 1rem, matching
the mobile .card-body padding. Preserve the existing default margin for larger
viewports and the current border and vertical padding behavior.

In `@public/assets/frontend-layouts.css`:
- Line 61: Update the color-mix declaration in frontend-layouts.css to use the
lowercase CSS keyword currentcolor instead of currentColor, preserving the
existing color-mix values and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 99d34f97-8cfd-4b9d-903b-bed12894c8c2

📥 Commits

Reviewing files that changed from the base of the PR and between 0fefe89 and a8195c1.

📒 Files selected for processing (4)
  • app/Views/frontend/book-detail.php
  • app/Views/frontend/catalog.php
  • app/Views/frontend/layout.php
  • public/assets/frontend-layouts.css

Comment thread app/Views/frontend/book-detail.php
Comment thread public/assets/frontend-layouts.css Outdated
- Align the book-info card header with the reduced card-body padding on
  mobile (<=576px), overriding main.css's `.card-header { margin:0 !important }`
  so the section label lines up with the meta rows below it.
- Lowercase `currentcolor` in the breadcrumb separator (stylelint
  value-keyword-case).
@fabiodalez-dev
fabiodalez-dev merged commit d38f599 into main Jul 31, 2026
6 checks passed
@fabiodalez-dev
fabiodalez-dev deleted the fix/mobile-frontend-layout branch July 31, 2026 19:00
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