-
Notifications
You must be signed in to change notification settings - Fork 28
Blog Layout #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blog Layout #164
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@AGENTS.md`:
- Around line 411-412: Remove the stray XML/HTML closing tags at the end of the
Markdown file by deleting the unexpected tokens `</content>` and the `<parameter
name="filePath">...` (or its unmatched closing tag) that appear on lines
411-412; ensure the file ends with valid Markdown content or a single newline
and no leftover angle-bracket tags so AGENTS.md contains only Markdown.
- Around line 308-316: The example's onKeyDown only handles Enter and misses
Space and preventing default scrolling; update the keyboard handler for the
interactive element using onKeyDown={(e) => { if (e.key === 'Enter' || e.key ===
' ' || e.key === 'Spacebar') { e.preventDefault(); handleClick(); } }} and
mention that native <button> already handles Enter/Space so this pattern
(role="button"/custom element) is only needed for non-button elements; reference
the existing handleClick and the onKeyDown usage to locate the change.
🧹 Nitpick comments (2)
AGENTS.md (2)
42-56: Consider recommending a specific testing framework for the tech stack.While the documentation acknowledges that automated tests aren't configured, it could be more helpful to recommend Vitest (better Next.js/TypeScript integration) or Jest with React Testing Library, given the project's stack.
📝 Suggestion: Add framework recommendation
-**Note**: This project currently does not have automated tests configured. When adding tests: +**Note**: This project currently does not have automated tests configured. Recommended: Vitest with React Testing Library for optimal Next.js 15 and TypeScript integration. When adding tests: 1. Install a testing framework like Jest or Vitest
348-348: Add language specifiers to fenced code blocks.Markdownlint flags three code blocks missing language specifiers. Adding these improves syntax highlighting and documentation clarity.
📋 Add language specifiers
Line 348 - Commit message examples:
-``` +```text feat: add user authentication fix: resolve login form validation bugLine 358 - Branch naming examples:
-``` +```text feature/user-authentication bugfix/login-validationLine 373 - File structure:
-``` +```text src/ ├── app/ # Next.js app router pagesBased on static analysis hints from markdownlint.
Also applies to: 358-358, 373-373
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
AGENTS.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
AGENTS.md
348-348: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
358-358: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
373-373: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ 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)
🔇 Additional comments (4)
AGENTS.md (4)
1-16: LGTM! Clear documentation header and comprehensive tech stack.The introduction and tech stack section provide a solid foundation for understanding the project's technologies and purpose.
58-247: LGTM! Comprehensive and well-structured code style guidelines.The TypeScript configuration, component patterns, styling conventions, naming standards, error handling, and form validation examples all follow React and Next.js best practices.
322-389: LGTM! Security, Git workflow, and file structure guidelines are well-defined.The security considerations cover essential practices, Git conventions follow industry standards, and the file structure accurately represents Next.js 15 App Router organization.
253-265: Fix Prisma Client instantiation anti-pattern.Creating a new
PrismaClientinstance in API routes leads to connection pool exhaustion in serverless environments like Vercel. Use a singleton pattern instead.🔧 Correct Prisma singleton pattern
Update the example to reference the singleton:
// In API routes -import { PrismaClient } from "@prisma/client" -const prisma = new PrismaClient() +import { prisma } from "@/lib/prisma" export async function GET() { try {Ensure
lib/prisma.tsimplements the singleton pattern (as mentioned in line 383):import { PrismaClient } from '@prisma/client' const globalForPrisma = global as unknown as { prisma: PrismaClient } export const prisma = globalForPrisma.prisma || new PrismaClient() if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma⛔ Skipped due to learnings
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.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.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this 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
🤖 Fix all issues with AI agents
In `@AGENTS.md`:
- Around line 348-362: Add a language specifier (e.g., "text") to both fenced
code blocks shown: the commit message block starting with "feat: add user
authentication ..." and the branch naming block listing
"feature/user-authentication ...", by changing their opening fences from ``` to
```text so markdown linters stop flagging missing language specifiers.
- Around line 373-388: The fenced code block containing the file structure
diagram in AGENTS.md is missing a language specifier and triggers a markdown
lint warning; update that fenced code block that shows the "src/ ├── app/ ..."
file tree to include a language specifier (for example "text") immediately after
the opening fence so the block is recognized correctly by the linter.
♻️ Duplicate comments (1)
AGENTS.md (1)
308-316: Improve keyboard accessibility example.The keyboard handler only checks for Enter key, but accessible buttons must also respond to Space key. Additionally, native
<button>elements already handle both keys automatically, so this pattern is primarily needed for custom interactive elements withrole="button".♿ Improved keyboard accessibility pattern
-<button onClick={handleClick} onKeyDown={(e) => e.key === 'Enter' && handleClick()}> +// Note: Native <button> elements already handle Enter and Space automatically. +// This pattern is for custom interactive elements with role="button": +<div + role="button" + tabIndex={0} + onClick={handleClick} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault() + handleClick() + } + }} +> Click me -</button> +</div>
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
AGENTS.md
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-12-06T20:47:07.465Z
Learnt from: Rahulsoni9321
Repo: tyaga001/devtoolsacademy PR: 49
File: src/components/ChatSuggestions.tsx:16-27
Timestamp: 2024-12-06T20:47:07.465Z
Learning: In the `ChatSuggestions` component, keyboard accessibility for suggestions is intentionally not implemented because there are only two questions displayed, and the 'Enter' key is reserved for sending out user questions.
Applied to files:
AGENTS.md
📚 Learning: 2024-12-04T09:02:22.583Z
Learnt from: tyaga001
Repo: tyaga001/devtoolsacademy PR: 45
File: src/components/Footer.tsx:15-24
Timestamp: 2024-12-04T09:02:22.583Z
Learning: When verifying the accessibility of blog post URLs in `src/components/Footer.tsx`, ensure that accessible URLs are not incorrectly flagged as inaccessible. Double-check the URLs before reporting accessibility issues.
Applied to files:
AGENTS.md
📚 Learning: 2024-12-06T20:37:00.154Z
Learnt from: Rahulsoni9321
Repo: tyaga001/devtoolsacademy PR: 49
File: src/components/ChatSuggestions.tsx:19-24
Timestamp: 2024-12-06T20:37:00.154Z
Learning: Keyboard accessibility was not added to `ChatSuggestions.tsx` because it displays only two questions.
Applied to files:
AGENTS.md
🪛 markdownlint-cli2 (0.18.1)
AGENTS.md
348-348: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
358-358: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
373-373: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ 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)
🔇 Additional comments (1)
AGENTS.md (1)
252-265: Use Prisma singleton pattern to prevent connection exhaustion.Creating a new
PrismaClient()instance in API routes can exhaust database connections, especially in development where hot reloading creates multiple instances. Use a singleton pattern instead.🔧 Recommended singleton pattern
Update the example to use a singleton:
-// In API routes -import { PrismaClient } from "@prisma/client" -const prisma = new PrismaClient() +// In API routes +import prisma from "@/lib/prisma" export async function GET() { try { const data = await prisma.table.findMany() return Response.json(data) } catch (error) { return Response.json({ error: "Database error" }, { status: 500 }) } }And note that
@/lib/prisma.tsshould export a singleton:import { PrismaClient } from "@prisma/client" const globalForPrisma = globalThis as unknown as { prisma: PrismaClient | undefined } export const prisma = globalForPrisma.prisma ?? new PrismaClient() if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma export default prismaThis pattern is mentioned in the File Structure section at line 383, so the example should align with it.
⛔ Skipped due to learnings
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.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| ``` | ||
| feat: add user authentication | ||
| fix: resolve login form validation bug | ||
| docs: update API documentation | ||
| style: format code with prettier | ||
| refactor: simplify component structure | ||
| ``` | ||
|
|
||
| #### Branch Naming | ||
|
|
||
| ``` | ||
| feature/user-authentication | ||
| bugfix/login-validation | ||
| hotfix/security-patch | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language specifiers to fenced code blocks.
The fenced code blocks for commit message examples and branch naming patterns are missing language specifiers, which triggers markdown linting warnings.
📝 Add language specifiers
#### Commit Messages
Follow conventional commit format:
-```
+```text
feat: add user authentication
fix: resolve login form validation bug
docs: update API documentation
style: format code with prettier
refactor: simplify component structureBranch Naming
- +text
feature/user-authentication
bugfix/login-validation
hotfix/security-patch
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
348-348: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
358-358: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In `@AGENTS.md` around lines 348 - 362, Add a language specifier (e.g., "text") to
both fenced code blocks shown: the commit message block starting with "feat: add
user authentication ..." and the branch naming block listing
"feature/user-authentication ...", by changing their opening fences from ``` to
```text so markdown linters stop flagging missing language specifiers.
| ``` | ||
| src/ | ||
| ├── app/ # Next.js app router pages | ||
| │ ├── api/ # API routes | ||
| │ ├── (routes)/ # Route groups | ||
| │ └── globals.css # Global styles | ||
| ├── components/ # Reusable components | ||
| │ ├── ui/ # shadcn/ui components | ||
| │ └── (feature)/ # Feature-specific components | ||
| ├── lib/ # Utilities and configurations | ||
| │ ├── prisma.ts # Database client | ||
| │ ├── types.ts # TypeScript interfaces | ||
| │ ├── utils.ts # Utility functions | ||
| │ └── zodSchema.ts # Validation schemas | ||
| └── assets/ # Static assets | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language specifier to file structure code block.
The file structure diagram is missing a language specifier, triggering a markdown linting warning.
📝 Add language specifier
### File Structure
-```
+```text
src/
├── app/ # Next.js app router pages
│ ├── api/ # API routes📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` | |
| src/ | |
| ├── app/ # Next.js app router pages | |
| │ ├── api/ # API routes | |
| │ ├── (routes)/ # Route groups | |
| │ └── globals.css # Global styles | |
| ├── components/ # Reusable components | |
| │ ├── ui/ # shadcn/ui components | |
| │ └── (feature)/ # Feature-specific components | |
| ├── lib/ # Utilities and configurations | |
| │ ├── prisma.ts # Database client | |
| │ ├── types.ts # TypeScript interfaces | |
| │ ├── utils.ts # Utility functions | |
| │ └── zodSchema.ts # Validation schemas | |
| └── assets/ # Static assets | |
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
373-373: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In `@AGENTS.md` around lines 373 - 388, The fenced code block containing the file
structure diagram in AGENTS.md is missing a language specifier and triggers a
markdown lint warning; update that fenced code block that shows the "src/ ├──
app/ ..." file tree to include a language specifier (for example "text")
immediately after the opening fence so the block is recognized correctly by the
linter.
Pull Request
Summary
Type of Change
Changes Made
Testing
npm run build)Database Changes (if applicable)
Content Changes (if applicable)
src/lib/toolData.jsonUI/UX Changes (if applicable)
Checklist
Screenshots/Demo
Related Issues
Additional Notes
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.