From c25034a31e1cc88dfbffb5d0383978b91278c3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Str=C3=B8m-Andersen?= Date: Sun, 15 Nov 2026 18:07:42 +0100 Subject: [PATCH 1/3] docs: comment on remaining div and span elements --- frontend/app/components/BookCard/BookCard.tsx | 1 + frontend/app/components/BookRating/BookRating.tsx | 2 ++ frontend/app/components/Footer/Footer.tsx | 1 + frontend/app/components/Header/Header.tsx | 1 + frontend/app/components/ReviewList/ReviewList.tsx | 2 ++ frontend/app/components/StarRating/StarRating.tsx | 1 + frontend/app/components/books/BookFilters/BookFilters.tsx | 1 + frontend/app/components/books/PagesFilter/PagesFilter.tsx | 2 ++ frontend/app/components/books/SearchBar/SearchBar.tsx | 5 +++-- frontend/app/components/home/HeroSection/HeroSection.tsx | 2 ++ .../components/home/HowItWorksSection/HowItWorksSection.tsx | 1 + frontend/app/components/home/StatsSection/StatsSection.tsx | 4 +++- .../app/components/selectedBook/ReviewForm/ReviewForm.tsx | 1 + frontend/app/root.tsx | 2 +- frontend/app/routes/books.tsx | 1 + 15 files changed, 23 insertions(+), 4 deletions(-) diff --git a/frontend/app/components/BookCard/BookCard.tsx b/frontend/app/components/BookCard/BookCard.tsx index 71d283a8..f77d0b92 100644 --- a/frontend/app/components/BookCard/BookCard.tsx +++ b/frontend/app/components/BookCard/BookCard.tsx @@ -62,6 +62,7 @@ function BookCard({ book, searchListParams }: BookCardProps) { aria-hidden="true" className="size-4 fill-amber-400 text-amber-400" /> + {/* used strictly for inline text styling */} {book.rating.toFixed(2)} diff --git a/frontend/app/components/BookRating/BookRating.tsx b/frontend/app/components/BookRating/BookRating.tsx index 551c1c39..4d0e1c05 100644 --- a/frontend/app/components/BookRating/BookRating.tsx +++ b/frontend/app/components/BookRating/BookRating.tsx @@ -2,6 +2,8 @@ import { StarIcon } from "lucide-react"; const MAX_RATING = 5; +// Uses span elements for grouping inline content, styling, and positioning the +// rating stars. No more suitable semantic HTML elements exist for these purposes. function BookRating({ rating, numRatings, diff --git a/frontend/app/components/Footer/Footer.tsx b/frontend/app/components/Footer/Footer.tsx index 4170a3ba..ce9b30f6 100644 --- a/frontend/app/components/Footer/Footer.tsx +++ b/frontend/app/components/Footer/Footer.tsx @@ -4,6 +4,7 @@ import { buttonVariants } from "~/components/ui/Button"; function Footer() { return (