Skip to content

chore(ui): enforce placeholder aspect ratios#320

Open
alexhb1 wants to merge 2 commits intogrimmory-tools:developfrom
alexhb1:placeholder-followup
Open

chore(ui): enforce placeholder aspect ratios#320
alexhb1 wants to merge 2 commits intogrimmory-tools:developfrom
alexhb1:placeholder-followup

Conversation

@alexhb1
Copy link
Copy Markdown
Contributor

@alexhb1 alexhb1 commented Apr 1, 2026

Description

I noticed a couple areas in the UI (E.g. book details similar books) that weren't correctly enforcing the correct aspect ratio or rounded corners for the new CSS placeholders.

Linked Issue: Fixes #

Changes

  • Enforced aspect ratios in the book lite cards
  • Enforced the placeholder border radius to be inherited by the cards themselves

Summary by CodeRabbit

  • Style
    • Standardized book cover visuals by enforcing a consistent 5:7 aspect ratio for cover images in tooltips and card views, improving layout uniformity.
    • Ensured cover images use cropping behavior that preserves focal content for varied image sizes.
    • Enhanced placeholder styling so placeholders inherit parent border-radius, producing smoother corners and visual consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c071f8af-a0ff-408e-911f-0bb27b8f38c3

📥 Commits

Reviewing files that changed from the base of the PR and between d0d8b73 and cb4fe2c.

📒 Files selected for processing (1)
  • frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.scss
✅ Files skipped from review due to trivial changes (1)
  • frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.scss
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test Suite / Backend Tests
  • GitHub Check: Analyze (java-kotlin)
🧰 Additional context used
🔀 Multi-repo context grimmory-tools/grimmory-docs

grimmory-tools/grimmory-docs

  • docs/tools/cover-art-settings.md — Contains cover cropping and bulk cover actions (regenerate, upload) and mentions the portrait ratio used for thumbnails. [::grimmory-tools/grimmory-docs::docs/tools/cover-art-settings.md]
  • docs/tools/global-preferences.md — Describes cover thumbnail generation, cover-cropping thresholds and guidance to "Regenerate Covers" after changing cropping settings. [::grimmory-tools/grimmory-docs::docs/tools/global-preferences.md]
  • docs/book-browser/grid.md — Documents the grid/card layout used for cover cards (UI surface where aspect-ratio changes will be visible). [::grimmory-tools/grimmory-docs::docs/book-browser/grid.md]
  • docs/metadata/metadata-center.md — References the Metadata Center UI that displays the book cover (click to enlarge). Changes to placeholder rounding/aspect may affect screenshots or wording. [::grimmory-tools/grimmory-docs::docs/metadata/metadata-center.md]
  • docs/integration/opds.md and docs/integration/komga-api.md — API docs that reference thumbnail/cover endpoints (e.g., GET /komga/api/v1/books/{id}/thumbnail). UI placeholder/aspect-ratio changes do not alter these APIs but are relevant for any documentation/screenshots of thumbnail behavior. [::grimmory-tools/grimmory-docs::docs/integration/opds.md] [::grimmory-tools/grimmory-docs::docs/integration/komga-api.md]
  • Multiple other docs reference "thumbnailUrl", "thumbnail"/"cover" presence (magic-shelf, dashboard, series, metadata fetch docs). No code consumers or runtime code found in this repo — only documentation that may need screenshot/text updates if the visual result changes. Representative files: docs/magic-shelf.md, docs/dashboard.md, docs/series.md, docs/metadata/metadata-fetch-configuration.md. [::grimmory-tools/grimmory-docs::docs/magic-shelf.md] [::grimmory-tools/grimmory-docs::docs/dashboard.md] [::grimmory-tools/grimmory-docs::docs/series.md] [::grimmory-tools/grimmory-docs::docs/metadata/metadata-fetch-configuration.md]

Assessment: documentation references cover generation, cropping, thumbnails, and grid/card displays that are relevant context for this PR's enforced aspect-ratio and border-radius fixes. No code-level consumers or breaking API changes were found in this repo.


📝 Walkthrough

Walkthrough

Three small styling updates: two components now enforce a 5:7 aspect-ratio for cover images, and the cover placeholder gains border-radius: inherit to match parent radii.

Changes

Cohort / File(s) Summary
Book Table Cover
frontend/src/app/features/book/components/book-table/book-table.component.scss
Replaced height: auto with aspect-ratio: 5 / 7 and retained width: 40rem for .tooltip-cover-image, shifting height to ratio-based sizing.
Book Card Cover
frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.scss
Added aspect-ratio: 5 / 7 and object-fit: cover to .book-cover; existing audiobook override keeps aspect-ratio: 1 / 1.
Cover Placeholder
frontend/src/app/shared/components/cover-generator/cover-generator.component.ts
Added border-radius: inherit; to the .placeholder styles so placeholders adopt parent border radii.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • imajes
  • balazs-szucs

Poem

🐰 Tiny covers dressed so neat,
Five to seven — tidy sheet.
Placeholders wear radius true,
Rounded corners snug for you. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commit format with 'chore' type and descriptive subject about enforcing placeholder aspect ratios.
Description check ✅ Passed The description covers the required sections with clear motivation, changes list, and includes the linked issue template (though none specified).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.scss`:
- Around line 7-11: The .book-cover rule forces a 5:7 aspect ratio but lacks
object-fit, causing <img class="book-cover"> images to stretch; update the base
.book-cover CSS rule in book-card-lite-component.scss to include object-fit:
cover so images maintain aspect ratio and fill the box (keeping any existing
audiobook-only override as is).
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5a8582d4-29c0-4355-8fcd-f8ae6fafed53

📥 Commits

Reviewing files that changed from the base of the PR and between c48298c and d0d8b73.

📒 Files selected for processing (3)
  • frontend/src/app/features/book/components/book-browser/book-table/book-table.component.scss
  • frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.scss
  • frontend/src/app/shared/components/cover-generator/cover-generator.component.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Test Suite / Backend Tests
  • GitHub Check: Test Suite / Frontend Tests
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (java-kotlin)
🧰 Additional context used
📓 Path-based instructions (3)
frontend/src/**/*.{ts,tsx,html,scss}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation in TypeScript, HTML, and SCSS files

Files:

  • frontend/src/app/shared/components/cover-generator/cover-generator.component.ts
  • frontend/src/app/features/book/components/book-card-lite/book-card-lite-component.scss
  • frontend/src/app/features/book/components/book-browser/book-table/book-table.component.scss
frontend/src/app/**/*.component.ts

📄 CodeRabbit inference engine (AGENTS.md)

Keep Angular code on standalone components. Do not add NgModules

Files:

  • frontend/src/app/shared/components/cover-generator/cover-generator.component.ts
frontend/src/app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

frontend/src/app/**/*.{ts,tsx}: Prefer inject() over constructor injection
Follow frontend/eslint.config.js: component selectors use app-*, directive selectors use app*, and any is disallowed

Files:

  • frontend/src/app/shared/components/cover-generator/cover-generator.component.ts
🔀 Multi-repo context grimmory-tools/grimmory-docs

Linked repositories findings

grimmory-tools/grimmory-docs

  • docs/tools/cover-art-settings.md — Documentation for cover image handling and settings; mentions cropping and cover processing that may relate to UI changes for cover placeholders. [::grimmory-tools/grimmory-docs::docs/tools/cover-art-settings.md]
  • docs/tools/global-preferences.md — Describes cover thumbnail generation, aspect-ratio threshold and regeneration instructions (lines referencing aspect ratio/cover processing). UI behaviour changes around aspect-ratio/placeholders might warrant doc updates here. [::grimmory-tools/grimmory-docs::docs/tools/global-preferences.md]
  • docs/view-preferences.md — Contains omitted long matching lines but is part of display preferences; could reference cover display options affected by placeholder aspect-ratio changes. [::grimmory-tools/grimmory-docs::docs/view-preferences.md]
  • docs/book-browser/grid.md — Describes grid view of cover cards (cover sizing/layout UI); front-end aspect-ratio fixes may affect examples or screenshots referenced here. [::grimmory-tools/grimmory-docs::docs/book-browser/grid.md]
  • Multiple other docs reference "cover" broadly (getting-started, metadata docs, library docs, readers, integrations) — these are documentation surfaces that mention covers and might need minor wording/screenshots if the visual behaviour changed (examples: docs/getting-started.md, docs/metadata/, docs/library/, docs/readers/, docs/integration/). Representative file list:
    • docs/getting-started.md [::grimmory-tools/grimmory-docs::docs/getting-started.md]
    • docs/metadata/file-naming-patterns.md [::grimmory-tools/grimmory-docs::docs/metadata/file-naming-patterns.md]
    • docs/metadata/metadata-settings.md [::grimmory-tools/grimmory-docs::docs/metadata/metadata-settings.md]
    • docs/library/physical-books.md [::grimmory-tools/grimmory-docs::docs/library/physical-books.md]
    • docs/readers/audiobook-player.md [::grimmory-tools/grimmory-docs::docs/readers/audiobook-player.md]
    • docs/integration/opds.md (thumbnail API reference) [::grimmory-tools/grimmory-docs::docs/integration/opds.md]

Summary: No code consumers found in this repository (it's documentation). Relevant doc pages mention cover handling, aspect-ratio, thumbnails, and display preferences — consider updating wording/screenshots if the UI visual behavior changed due to enforced aspect-ratio and border-radius inheritance.

🔇 Additional comments (2)
frontend/src/app/features/book/components/book-browser/book-table/book-table.component.scss (1)

61-64: Same fixed-ratio image stretching risk here.

This repeats the same pattern flagged in book-card-lite-component.scss: fixed aspect-ratio on an image class without object-fit.

frontend/src/app/shared/components/cover-generator/cover-generator.component.ts (1)

54-54: Good fix for placeholder corner consistency.

border-radius: inherit on Line 54 cleanly aligns placeholder rendering with the card radius.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant