Skip to content

Conversation

@nirnejak
Copy link
Collaborator

@nirnejak nirnejak commented Nov 23, 2025

Pull Request

Summary

  • Job Posts DB Fetching issue fixed
  • UI Improvements - more consistent with rest of UI

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that causes existing functionality to change)
  • Documentation update
  • Refactoring/code cleanup
  • Content update (blog posts, tools data, etc.)

Changes Made

Testing

  • Local development tested
  • Build passes (npm run build)
  • No TypeScript errors
  • No linting errors
  • Manual testing completed

Database Changes (if applicable)

  • Database migration included
  • Migration tested locally
  • Rollback plan documented

Content Changes (if applicable)

  • Tool data updated in src/lib/toolData.json
  • Blog post follows content guidelines
  • Images optimized and properly sized
  • SEO metadata updated

UI/UX Changes (if applicable)

  • Responsive design tested
  • Accessibility considerations addressed
  • Dark mode compatibility verified
  • Loading states implemented

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated if needed
  • No new console warnings or errors
  • Performance impact considered

Screenshots/Demo

Related Issues

Additional Notes

Summary by CodeRabbit

  • Style

    • Updated job listings, cards, hero and search UI with dashed borders, tighter spacing, adjusted paddings, and refined typography (gradient headline).
    • Repositioned and emphasized the "Hot role" badge; tightened grid and card layouts; unified input, pill, and button visuals across search, listings, and submission flows.
  • Accessibility

    • Improved form accessibility by associating labels with their inputs.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Nov 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
devtoolsacademy Ready Ready Preview Comment Dec 4, 2025 10:11am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

Walkthrough

Adds a global Prisma client declaration and an unconditional connect call; replaces direct Prisma calls in the jobs API with type-casts to bypass TypeScript checks; and applies broad UI styling changes (mostly dashed borders, spacing, and normalized icon sizing) across job-related components.

Changes

Cohort / File(s) Summary
API type-casting
src/app/api/jobs/route.ts
Replaces prisma.job.findMany, prisma.job.count, and prisma.job.create with (prisma as any).job.* to bypass TypeScript checks; runtime queries and logic unchanged.
Prisma client init
src/lib/prisma.ts
Adds `declare global { var prisma: PrismaClient
Top-level Jobs page
src/app/jobs/page.tsx
Visual refactor: many borders -> dashed, adjusted hero typography (gradient headline), spacing, container max-width, card paddings, and submit section styling.
Job card UI
src/components/jobs/JobCard.tsx
Adds top-right "Hot role" badge (when job.featured), converts borders to dashed, tweaks header/content/footer padding, updates detail grid and icon colors, minor typography tweaks.
Search & filters
src/components/jobs/JobSearch.tsx
Changes container and input borders to dashed, inputs to rounded-none, adjusts search button padding; no structural/behavior changes.
Jobs list / page layout
src/components/jobs/JobsPage.tsx
Converts empty/error state and action pills to dashed borders, tightens spacing and grid gap, small text spacing tweaks.
Submission form & accessibility
src/components/jobs/JobSubmissionForm.tsx
Normalizes icon sizing to size-*, reorders classNames, and adds htmlFor/id pairs for labels/inputs; no business-logic changes.
Pagination icons
src/components/jobs/JobsPagination.tsx
Replaces h-4 w-4 with size-4 on chevrons; no behavior change.
Skeleton / loading items
src/components/jobs/JobSkeleton.tsx, src/components/jobs/LoadingCategories.tsx
ClassName reordering and minor utility adjustments only; functionally equivalent.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant NextAPI as Next.js API Route
  participant Prisma as Prisma Client

  Client->>NextAPI: GET /api/jobs (or POST create)
  Note right of NextAPI: Route uses (prisma as any).job.*\n(ensure prisma is connected)
  NextAPI->>Prisma: Ensure prisma.$connect() (called at init)
  NextAPI->>Prisma: job.findMany / job.count / job.create
  Prisma-->>NextAPI: Query result
  NextAPI-->>Client: Response (jobs / created job)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Repeated UI styling changes reduce per-file reasoning but require visual verification.
  • Type-casting in src/app/api/jobs/route.ts and unconditional prisma.$connect() in src/lib/prisma.ts warrant careful review.

Files/areas to focus on:

  • src/lib/prisma.ts — check lifecycle effects (hot-reload, connection duplication, error handling).
  • src/app/api/jobs/route.ts — confirm (prisma as any) is intentional and acceptable.
  • src/components/jobs/JobSubmissionForm.tsx — verify label htmlFor/input id correctness and accessible behavior.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 2 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Job posts fix' is vague and does not clearly convey the specific changes made, using a generic term that could refer to many different types of fixes. Revise the title to be more specific about the nature of the fix, such as 'Fix job posts database fetching and update UI styling' to better communicate the main changes.
Description check ❓ Inconclusive The PR description follows the template structure and includes key sections checked as complete, but the 'Changes Made' section is empty despite significant modifications across multiple files. Populate the 'Changes Made' section with bullet points summarizing the key changes, such as Prisma database fetching fixes and UI styling updates, to provide clarity on what was modified.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch job-posts-fix

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ab801b and eae6cf2.

📒 Files selected for processing (1)
  • src/lib/prisma.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/prisma.ts
⏰ 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). (1)
  • GitHub Check: build (18.x)

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.

❤️ Share

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

Copy link
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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/app/api/jobs/route.ts (1)

89-112: Remove type casting and fix the underlying Prisma type issue.

Casting prisma to any (lines 89, 112, and 187) completely bypasses TypeScript's type checking, which defeats the purpose of using TypeScript and Prisma's generated types. This approach is brittle and could allow invalid queries or schema mismatches to pass compilation.

The proper solution is to ensure the Prisma client is correctly generated and typed. Run the following to verify and regenerate:

#!/bin/bash
# Verify Prisma client generation and schema

# Check if Prisma schema exists and is valid
echo "=== Checking Prisma schema ==="
fd -e prisma -x cat {}

# Check if @prisma/client is properly installed
echo -e "\n=== Checking Prisma client installation ==="
cat package.json | jq '.dependencies."@prisma/client", .devDependencies.prisma'

# Check if node_modules/.prisma/client exists
echo -e "\n=== Checking generated Prisma client ==="
fd -t d -p "node_modules/.prisma/client" -x ls -la {}

After verification, regenerate the Prisma client:

npx prisma generate

Then remove the as any casts and use the properly typed prisma.job methods directly.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af5a904 and 0a53081.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • src/app/api/jobs/route.ts (3 hunks)
  • src/app/jobs/page.tsx (3 hunks)
  • src/components/jobs/JobCard.tsx (4 hunks)
  • src/components/jobs/JobSearch.tsx (3 hunks)
  • src/components/jobs/JobsPage.tsx (3 hunks)
  • src/lib/prisma.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-11-23T11:57:43.371Z
Learnt from: Ankur1493
Repo: tyaga001/devtoolsacademy PR: 39
File: src/lib/tools.ts:1-1
Timestamp: 2024-11-23T11:57:43.371Z
Learning: In `src/lib/tools.ts`, creating a new `PrismaClient` instance for each request is acceptable in this project and does not cause connection pool exhaustion due to previous optimizations.

Applied to files:

  • src/lib/prisma.ts
📚 Learning: 2025-04-14T07:46:36.019Z
Learnt from: tyaga001
Repo: tyaga001/devtoolsacademy PR: 110
File: package.json:39-39
Timestamp: 2025-04-14T07:46:36.019Z
Learning: The "prisma" package should be placed in devDependencies rather than dependencies, as it's only needed during development. The "prisma/client" package should remain in dependencies as it's used at runtime.

Applied to files:

  • src/lib/prisma.ts
🧬 Code graph analysis (1)
src/components/jobs/JobCard.tsx (3)
src/components/ui/card.tsx (4)
  • Card (77-77)
  • CardHeader (77-77)
  • CardContent (77-77)
  • CardFooter (77-77)
src/components/ui/badge.tsx (1)
  • Badge (39-39)
src/lib/utils.ts (1)
  • formatDate (14-20)
🪛 GitHub Actions: Node.js CI
src/lib/prisma.ts

[error] 4-4: 'prisma' is defined but never used. (no-unused-vars)

🔇 Additional comments (4)
src/components/jobs/JobCard.tsx (1)

47-135: LGTM! Cohesive UI refresh with improved visual hierarchy.

The styling updates successfully implement a consistent dashed-border design system while improving readability and visual hierarchy. The featured badge repositioning to the top-right (lines 48-52) creates better visual prominence, and the uniform application of dashed borders across detail blocks maintains design consistency throughout the card.

src/components/jobs/JobSearch.tsx (1)

85-111: LGTM! Styling updates align with the broader design refresh.

The dashed border styling and layout adjustments maintain consistency with the updated JobCard and JobsPage components, creating a cohesive visual language across the jobs interface.

src/components/jobs/JobsPage.tsx (1)

110-160: LGTM! Consistent UI polish across empty states and job grid.

The styling updates maintain visual consistency with the dashed-border design system introduced across other job components, while the tightened grid gap (line 160) improves information density on larger screens.

src/app/jobs/page.tsx (1)

48-106: LGTM! Effective hero redesign with improved visual hierarchy.

The hero section updates successfully integrate the dashed-border design language while improving content hierarchy. The gradient text treatment (lines 52-55), restructured CTA card (lines 85-106), and refined spacing create a more polished landing experience that aligns with the component-level styling updates throughout the PR.

Copy link
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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/jobs/JobSubmissionForm.tsx (1)

212-257: Fix contact name error binding; label/id changes look good

The new htmlFor/id wiring for contact name/email improves accessibility and is correct, but the error block under “Contact name” is still checking and rendering errors.contactEmail. That means name-specific validation errors won’t show.

Suggested fix:

-              {errors.contactEmail && (
+              {errors.contactName && (
                 <p className="mt-2 text-sm text-red-600">
-                  {errors.contactEmail}
+                  {errors.contactName}
                 </p>
               )}
🧹 Nitpick comments (2)
src/components/jobs/JobSubmissionForm.tsx (2)

139-194: Unreachable success state; consider wiring it up or removing it

submitSuccess is never set to true, so this success card UI is effectively dead code even as a Stripe redirect fallback. Either:

  • set submitSuccess(true) somewhere on successful submission when you intend to fall back to this UI, or
  • remove this branch and state if you’ve decided the redirect is the only happy path.

451-525: List field labels are good; consider accessibility for icon-only buttons

The new labels/ids for Categories, Requirements, Benefits, and Tags correctly match their respective inputs and fields, and the Plus/X icon sizing aligns with your size-* convention.

One improvement: the “add” and “remove” buttons in these sections are icon-only, so they currently have no accessible name for screen readers.

Consider something along these lines:

-                <Button ...>
-                  <Plus className="size-4" />
-                </Button>
+                <Button ... aria-label="Add category">
+                  <Plus className="size-4" />
+                </Button>
...
-                      <button
-                        type="button"
-                        onClick={() => removeArrayItem("categories", index)}
-                        className="text-blue-300 hover:text-blue-100"
-                      >
-                        <X className="size-3" />
-                      </button>
+                      <button
+                        type="button"
+                        onClick={() => removeArrayItem("categories", index)}
+                        className="text-blue-300 hover:text-blue-100"
+                        aria-label={`Remove category ${category}`}
+                      >
+                        <X className="size-3" />
+                      </button>

and similarly for requirements, benefits, and tags.

Also applies to: 528-585, 587-643, 646-701

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a53081 and 2ab801b.

📒 Files selected for processing (5)
  • src/components/jobs/JobSkeleton.tsx (1 hunks)
  • src/components/jobs/JobSubmissionForm.tsx (27 hunks)
  • src/components/jobs/JobsPagination.tsx (2 hunks)
  • src/components/jobs/LoadingCategories.tsx (1 hunks)
  • src/lib/prisma.ts (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/components/jobs/JobSkeleton.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/prisma.ts
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-11-30T20:41:53.463Z
Learnt from: Ankur1493
Repo: tyaga001/devtoolsacademy PR: 44
File: src/components/tools/ToolsPagination.tsx:19-19
Timestamp: 2024-11-30T20:41:53.463Z
Learning: In `src/components/tools/ToolsPagination.tsx`, the application handles invalid page numbers by showing a proper error, so additional input validation for the page parameter is not required.

Applied to files:

  • src/components/jobs/JobsPagination.tsx
📚 Learning: 2024-11-30T20:29:45.779Z
Learnt from: Ankur1493
Repo: tyaga001/devtoolsacademy PR: 44
File: src/components/tools/ToolCard.tsx:19-23
Timestamp: 2024-11-30T20:29:45.779Z
Learning: In the `src/components/tools/ToolCard.tsx` file, it's acceptable to use `tool.logo` directly in the `img` `src` attribute without additional validation because the image URLs are controlled by the backend, and overengineering is to be avoided before the MVP is complete.

Applied to files:

  • src/components/jobs/JobSubmissionForm.tsx
📚 Learning: 2024-11-23T12:17:36.011Z
Learnt from: Ankur1493
Repo: tyaga001/devtoolsacademy PR: 39
File: src/components/tools/toolDetails/ToolDetailsPage.tsx:186-197
Timestamp: 2024-11-23T12:17:36.011Z
Learning: In `src/components/tools/toolDetails/ToolDetailsPage.tsx`, the `ToolDetailsPage` component contains a hardcoded description in the about section.

Applied to files:

  • src/components/jobs/JobSubmissionForm.tsx
🧬 Code graph analysis (1)
src/components/jobs/LoadingCategories.tsx (2)
src/components/tools/LoadingCategories.tsx (2)
  • LoadingCategories (3-34)
  • _ (17-28)
src/components/jobs/JobCategories.tsx (4)
  • _ (142-155)
  • categories (125-125)
  • a (125-125)
  • category (50-76)
⏰ 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: build (20.x)
  • GitHub Check: build (18.x)
🔇 Additional comments (6)
src/components/jobs/JobSubmissionForm.tsx (4)

145-183: Success state icon sizing changes are consistent

The updated size-* classes on the success icon wrapper and ArrowLeft keep visuals consistent with the rest of the job UI while preserving behavior. No issues here.


263-305: Company name/logo label wiring and styling are solid

The htmlFor/id additions for company and companyLogo correctly associate labels with inputs, and the Tailwind class reordering doesn’t change behavior. Looks good.


310-424: Job details, type dropdown, and description updates are coherent

The added htmlFor/id pairs for title, apply URL, location, job type, salary, and description improve accessibility and match the bound fields. The job type dropdown styling (button classes, ChevronDown size, DropdownMenuContent border/background) is purely presentational and consistent with the rest of the UI. No functional issues spotted.

Also applies to: 429-445


706-720: Submit button and loader sizing look appropriate

Standardizing the submit button classes and using size-4 on Loader2 keeps the CTA visually consistent; disabling while submitting is already correctly handled.

src/components/jobs/JobsPagination.tsx (1)

131-155: Chevron icon sizing change is safe and consistent

Updating ChevronLeft and ChevronRight to use size-4 is a purely visual Tailwind change and keeps pagination controls consistent with other icons in the app. No functional impact.

src/components/jobs/LoadingCategories.tsx (1)

17-23: Loading skeleton class tweak is benign

The updated class list on the loading pill keeps the same dimensions and behavior (animate-pulse, rounded, dark background). No issues from this change.

tyaga001
tyaga001 previously approved these changes Dec 4, 2025
@tyaga001 tyaga001 merged commit 75c9426 into main Dec 4, 2025
6 checks passed
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.

3 participants