Add project detail pages#1352
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR adds internal project detail pages. It introduces ChangesProject detail page feature
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Browser
participant SlugPage as [slug].astro
participant Helper as projectPages.ts
participant Content as Content Collection
Browser->>SlugPage: GET /projects/{slug}
SlugPage->>Helper: getProjectStaticPaths(projects)
Helper->>Content: map project entries
Content-->>Helper: project data (whatAndWhy, goalSummary, nextSteps, ...)
Helper-->>SlugPage: static paths with props
SlugPage-->>Browser: rendered project detail page
Related issues: Suggested labels: review_needed_junior_swe, review_depth_standard Suggested reviewers: schalkneethling 🐰 A helper hops, a schema grows, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/pages/projects/[slug].astro (1)
31-54: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
filter(Boolean)doesn't narrow outnullfrom the array type.
projectLinksremains typed as({ href, label } | null)[]sinceBooleanisn't a type predicate. The subsequentlink && (...)guard in the template compensates at runtime, but the type looseness defeats the point of filtering and could mask a real null downstream if the guard is ever removed.♻️ Proposed fix using a type predicate
-].filter(Boolean); +].filter((link): link is NonNullable<typeof link> => link !== null);Then the
link &&guard in the template (Line 121) becomes unnecessary.🤖 Prompt for 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. In `@src/pages/projects/`[slug].astro around lines 31 - 54, `projectLinks` is still typed with possible `null` entries because `filter(Boolean)` is not a type predicate. Update the `projectLinks` construction in the `[slug].astro` page to use a proper type-guard filter (or build the array without `null`s) so the result is inferred as only link objects. Then remove the redundant `link &&` check in the template and iterate directly over the narrowed `projectLinks` items.
🤖 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.
Nitpick comments:
In `@src/pages/projects/`[slug].astro:
- Around line 31-54: `projectLinks` is still typed with possible `null` entries
because `filter(Boolean)` is not a type predicate. Update the `projectLinks`
construction in the `[slug].astro` page to use a proper type-guard filter (or
build the array without `null`s) so the result is inferred as only link objects.
Then remove the redundant `link &&` check in the template and iterate directly
over the narrowed `projectLinks` items.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: cda4944f-79f2-46ea-b220-6f8e930b87ec
📒 Files selected for processing (8)
src/components/Projects/ProjectList.astrosrc/content.config.tssrc/content/projects/css-community-reset.mdsrc/content/projects/ossreleasefeed-v2.mdsrc/content/projects/web-platform-pulse.mdsrc/lib/projectPages.tssrc/pages/projects/[slug].astrotests/projectPages.test.ts
…-detail-pages-1345
…-detail-pages-1345
…-detail-pages-1345
8be9ce0
into
codex/curated-projects-listing-1344
Summary
/projects/[slug]into the project deep-dive page structurecss-community-reset,ossreleasefeed-v2, andweb-platform-pulseTesting
/projects/css-community-resetat desktop and mobile widthsStacked on #1350. Closes #1345.
Summary by CodeRabbit
New Features
Bug Fixes
Content Updates