Skip to content

feat: redesign movies view [P19.06]#173

Closed
cesarnml wants to merge 2 commits into
agents/p19-05-tv-show-detail-redesignfrom
agents/p19-06-movies-redesign
Closed

feat: redesign movies view [P19.06]#173
cesarnml wants to merge 2 commits into
agents/p19-05-tv-show-detail-redesignfrom
agents/p19-06-movies-redesign

Conversation

@cesarnml

@cesarnml cesarnml commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Summary

External AI Review

  • outcome: patched
  • reviewed commit: b6d9cb9eaddc
  • current branch head: f85357756228
  • the latest recorded external AI review applies to an older branch head; the prior review history is shown below for debugging.
  • patch commits after b6d9cb9eaddc address all findings from that review.
  • vendors: coderabbit, sonarqube

Resolved Review Findings

  • [coderabbit] Fix text-inherit/80 — not supported in Tailwind v4. (native GitHub thread resolved) web/src/routes/movies/+page.svelte:206 thread

@coderabbitai

coderabbitai Bot commented Apr 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 434b5e75-9b1f-4724-996c-401a280b1295

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This pull request refactors the movies page component and its supporting test suite. The StatusChip component's label mapping for the downloading status is updated from ACTIVE to DOWNLOADING. The movies page is restructured with a new filtering model (replacing completed/failed with wanted), command-based status categorization, updated UI layout with a "Movie Command Deck" section and backdrop-first card design, revised empty states, and new utility functions for image URL sanitization and date formatting. The test suite is updated to reflect the refactored component logic and new UI structure. No exported public entity signatures are changed.


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

@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: 1

🧹 Nitpick comments (5)
web/src/routes/movies/movies.test.ts (1)

136-139: Consider a more robust assertion for sorted headings.

The test slices the first 2 headings to check sort order, but this implicitly depends on the "Add New" card being rendered last. If the page structure changes (e.g., "Add New" moves or additional headings are added), this test could become brittle.

Consider using a more explicit query or filtering by specific class/data attributes to isolate movie card headings.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/routes/movies/movies.test.ts` around lines 136 - 139, The assertion
is brittle because it slices the first two headings from screen.getAllByRole and
assumes the "Add New" card's position; update the test to target only movie card
headings by querying the movies container and then collecting headings within it
(e.g., use the same test's container/query that renders the grid or a
data-testid/class for movie cards), then assert their sorted order (reference:
the headings variable and the screen.getAllByRole call and the "Add New" card
text) so the test no longer depends on global heading order.
web/src/routes/movies/+page.svelte (4)

342-358: Consider adding ARIA attributes for progress accessibility.

The progress bar visually shows download progress but lacks ARIA attributes for screen reader users. Consider adding role="progressbar" with aria-valuenow, aria-valuemin, and aria-valuemax.

♿ Suggested improvement
 <div class="h-2 overflow-hidden rounded-full bg-white/8">
 	<div
 		class="bg-primary h-full rounded-full transition-[width]"
 		style={`width: ${pct}%`}
+		role="progressbar"
+		aria-valuenow={pct}
+		aria-valuemin={0}
+		aria-valuemax={100}
+		aria-label="Download progress"
 	></div>
 </div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/routes/movies/`+page.svelte around lines 342 - 358, The progress bar
for the downloading state (inside the {`#if` status === 'downloading'} block using
the pct variable and the inner div with class "bg-primary") needs ARIA
attributes for accessibility: add role="progressbar" on the inner progress
element (or the wrapper) and include aria-valuenow={+pct} (numeric),
aria-valuemin="0", aria-valuemax="100" and an appropriate aria-label or
aria-valuetext (e.g., `${pct}% acquired`) so screen readers can announce current
progress; ensure the values reference the existing pct variable and do not pass
a percentage string to aria-valuenow.

236-241: Consider adding explicit dimensions to prevent layout shift.

The images use loading="lazy" which is good for performance. However, without explicit width and height attributes (or CSS aspect-ratio), the browser cannot reserve space before the image loads, potentially causing layout shift (CLS issues).

The current CSS (h-full w-full object-cover) relies on parent container dimensions, which may be sufficient if the container has fixed dimensions. Verify that the card layout doesn't shift when images load.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/routes/movies/`+page.svelte around lines 236 - 241, The image tag
using src={backdropUrl} (the <img> with class="h-full w-full object-cover...")
can cause layout shift because it relies on parent sizing and uses
loading="lazy"; add explicit intrinsic dimensions or enforce an aspect ratio so
the browser can reserve space before load. Fix by adding width and height
attributes matching the expected image dimensions (or apply a CSS aspect-ratio
on the img or its card container, e.g. aspect-ratio: 16/9) and ensure the parent
card/container has a stable size; update the <img> element and its container
styles (the same element with class "h-full w-full object-cover...")
accordingly.

54-65: Review the wanted categorization logic.

The commandStatus function categorizes movies as:

  • downloading: when actively downloading
  • missing: when lifecycleStatus === 'missing_from_transmission' or status is failed/rejected/duplicate
  • wanted: everything else (default fallback)

Consider whether movies with status: 'queued' or status: 'completed' should be categorized differently. Currently, completed movies would fall into wanted, which may not reflect user intent.

If this is intentional (e.g., all non-downloading/non-missing movies are considered "wanted" in the command deck paradigm), the logic is fine. Otherwise, consider adding explicit handling.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/routes/movies/`+page.svelte around lines 54 - 65, The current
commandStatus(movie, live) defaults everything not downloading or flagged as
missing to 'wanted', which inadvertently classifies movie.status === 'completed'
(and maybe 'queued') as 'wanted'; update the commandStatus function to
explicitly handle status values you care about (e.g., add explicit checks for
movie.status === 'queued' and movie.status === 'completed') and return the
correct CommandStatus for each (or add/choose a new CommandStatus if needed)
instead of relying on the broad default; modify the conditional branch in
commandStatus to check those statuses before returning 'wanted' so
completed/queued movies are categorized as intended.

192-209: Tabs are missing aria-controls and corresponding tabpanel role.

The tabs have role="tab" and aria-selected, but for full accessibility compliance, each tab should have aria-controls pointing to the controlled panel, and the panel should have role="tabpanel" with aria-labelledby.

Since the filtered content is inline (not separate panels), this pattern may not apply directly. Consider either:

  1. Adding id and aria-controls/aria-labelledby attributes to connect tabs with the movie grid
  2. Documenting that this is a filtering UI rather than a true tabbed interface

For filtering UIs, some teams use toggle buttons instead of tabs, but the current approach is functional.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/routes/movies/`+page.svelte around lines 192 - 209, The tab buttons
(role="tab") lack aria-controls and the movie grid lacks
role="tabpanel"/aria-labelledby; give each button a stable id (e.g.
"tab-{tab.key}") and add aria-controls pointing to a single panel id (e.g.
"movies-panel") or per-tab panel id if you choose multiple panels, then on the
movie grid container add role="tabpanel", id="movies-panel" and set
aria-labelledby to the id of the currently selected tab (use activeTab to derive
the labelledby id), or alternatively change role="tab" to a toggle button role
and document that this is a filtering UI; update the button markup that
references activeTab/tab.key and the movie grid container that renders the
filtered movies (the element rendering the grid) accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/src/routes/movies/`+page.svelte:
- Line 206: The span rendering the tab count (the element containing
tabCount(tab.key)) uses the unsupported Tailwind class text-inherit/80; update
that span to either replace text-inherit/80 with text-current/80 if inheriting
currentColor with opacity is acceptable, or keep text-inherit and add a separate
opacity-80 utility (e.g., use classes ml-1 text-[10px] text-inherit opacity-80)
so the intended 80% opacity is applied correctly.

---

Nitpick comments:
In `@web/src/routes/movies/`+page.svelte:
- Around line 342-358: The progress bar for the downloading state (inside the
{`#if` status === 'downloading'} block using the pct variable and the inner div
with class "bg-primary") needs ARIA attributes for accessibility: add
role="progressbar" on the inner progress element (or the wrapper) and include
aria-valuenow={+pct} (numeric), aria-valuemin="0", aria-valuemax="100" and an
appropriate aria-label or aria-valuetext (e.g., `${pct}% acquired`) so screen
readers can announce current progress; ensure the values reference the existing
pct variable and do not pass a percentage string to aria-valuenow.
- Around line 236-241: The image tag using src={backdropUrl} (the <img> with
class="h-full w-full object-cover...") can cause layout shift because it relies
on parent sizing and uses loading="lazy"; add explicit intrinsic dimensions or
enforce an aspect ratio so the browser can reserve space before load. Fix by
adding width and height attributes matching the expected image dimensions (or
apply a CSS aspect-ratio on the img or its card container, e.g. aspect-ratio:
16/9) and ensure the parent card/container has a stable size; update the <img>
element and its container styles (the same element with class "h-full w-full
object-cover...") accordingly.
- Around line 54-65: The current commandStatus(movie, live) defaults everything
not downloading or flagged as missing to 'wanted', which inadvertently
classifies movie.status === 'completed' (and maybe 'queued') as 'wanted'; update
the commandStatus function to explicitly handle status values you care about
(e.g., add explicit checks for movie.status === 'queued' and movie.status ===
'completed') and return the correct CommandStatus for each (or add/choose a new
CommandStatus if needed) instead of relying on the broad default; modify the
conditional branch in commandStatus to check those statuses before returning
'wanted' so completed/queued movies are categorized as intended.
- Around line 192-209: The tab buttons (role="tab") lack aria-controls and the
movie grid lacks role="tabpanel"/aria-labelledby; give each button a stable id
(e.g. "tab-{tab.key}") and add aria-controls pointing to a single panel id (e.g.
"movies-panel") or per-tab panel id if you choose multiple panels, then on the
movie grid container add role="tabpanel", id="movies-panel" and set
aria-labelledby to the id of the currently selected tab (use activeTab to derive
the labelledby id), or alternatively change role="tab" to a toggle button role
and document that this is a filtering UI; update the button markup that
references activeTab/tab.key and the movie grid container that renders the
filtered movies (the element rendering the grid) accordingly.

In `@web/src/routes/movies/movies.test.ts`:
- Around line 136-139: The assertion is brittle because it slices the first two
headings from screen.getAllByRole and assumes the "Add New" card's position;
update the test to target only movie card headings by querying the movies
container and then collecting headings within it (e.g., use the same test's
container/query that renders the grid or a data-testid/class for movie cards),
then assert their sorted order (reference: the headings variable and the
screen.getAllByRole call and the "Add New" card text) so the test no longer
depends on global heading order.
🪄 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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 58f846cc-1c8c-4ca2-bc42-028a8eb0b0a6

📥 Commits

Reviewing files that changed from the base of the PR and between 21f9af9 and b6d9cb9.

📒 Files selected for processing (4)
  • web/src/lib/components/StatusChip.svelte
  • web/src/lib/components/status-chip.test.ts
  • web/src/routes/movies/+page.svelte
  • web/src/routes/movies/movies.test.ts

Comment thread web/src/routes/movies/+page.svelte Outdated
@sonarqubecloud

Copy link
Copy Markdown

@cesarnml cesarnml deleted the branch agents/p19-05-tv-show-detail-redesign April 17, 2026 02:33
@cesarnml cesarnml closed this Apr 17, 2026
@cesarnml cesarnml deleted the agents/p19-06-movies-redesign branch April 17, 2026 02:33
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