fix: Create table view for all films - #6
Conversation
Closes yiqu#4 Patch generated by qwen3.8-27b-nvfp4 via local API.
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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. Comment |
There was a problem hiding this comment.
2 issues found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/core/movies/movies/AllFilmsTable.tsx">
<violation number="1" location="src/core/movies/movies/AllFilmsTable.tsx:12">
P1: Because no module renders `AllFilmsTable`, users never get the table view promised by this change. Add it to the `Movies` display path and pass the fetched film properties to it.</violation>
<violation number="2" location="src/core/movies/movies/AllFilmsTable.tsx:47">
P2: `DateDisplay` keeps its default `fromNow={true}`, so the `format` prop is ignored in the visible cell and Release Date renders relatively. Pass `fromNow={false}` to render the formatted release date.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| const COLUMNS = [ "Title", "Episode", "Director", "Release Date" ]; | ||
|
|
||
| export default function AllFilmsTable({ films }: AllFilmsTableProps) { |
There was a problem hiding this comment.
P1: Because no module renders AllFilmsTable, users never get the table view promised by this change. Add it to the Movies display path and pass the fetched film properties to it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/core/movies/movies/AllFilmsTable.tsx, line 12:
<comment>Because no module renders `AllFilmsTable`, users never get the table view promised by this change. Add it to the `Movies` display path and pass the fetched film properties to it.</comment>
<file context>
@@ -0,0 +1,58 @@
+
+const COLUMNS = [ "Title", "Episode", "Director", "Release Date" ];
+
+export default function AllFilmsTable({ films }: AllFilmsTableProps) {
+
+ const getFilmId = (film: StarwarsFilm): string => {
</file context>
| <TableCell>{ film.episode_id }</TableCell> | ||
| <TableCell>{ film.director }</TableCell> | ||
| <TableCell> | ||
| <DateDisplay date={ film.release_date } format="MMM Do YYYY" /> |
There was a problem hiding this comment.
P2: DateDisplay keeps its default fromNow={true}, so the format prop is ignored in the visible cell and Release Date renders relatively. Pass fromNow={false} to render the formatted release date.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/core/movies/movies/AllFilmsTable.tsx, line 47:
<comment>`DateDisplay` keeps its default `fromNow={true}`, so the `format` prop is ignored in the visible cell and Release Date renders relatively. Pass `fromNow={false}` to render the formatted release date.</comment>
<file context>
@@ -0,0 +1,58 @@
+ <TableCell>{ film.episode_id }</TableCell>
+ <TableCell>{ film.director }</TableCell>
+ <TableCell>
+ <DateDisplay date={ film.release_date } format="MMM Do YYYY" />
+ </TableCell>
+ </TableRow>
</file context>
Closes #4
Patch generated by
qwen3.8-27b-nvfp4 via local API.Summary by cubic
Adds
AllFilmsTableto render all Star Wars films in a material table for quick scan and navigation. Previously there was no table view; now we show Title, Episode, Director, and formatted Release Date, with Title linking to the film detail route../${filmId}usingreact-router-dom; confirm the parent route supports relative./:idnavigation.film.urlby taking the last path segment; if the API URL ends with a trailing slash, this will be empty—verify sample data or switch to the next-to-last segment.DateDisplaywith format "MMM Do YYYY"; ensure required date plugins/locales are loaded.Written for commit 0eb4375. Summary will update on new commits.