Skip to content

[FEAT] Add Plant Theme #2

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

seock1000
Copy link

@seock1000 seock1000 commented Jun 25, 2025

πŸ“Œ Summary

  • Add new "Plant" theme for contribution chart
  • This theme visualizes contribution levels as seed🫘 β†’ sprout🌱 β†’ leaf🌿 β†’ flower 🌻

🎯 Motivation

  • To provide a more nature-inspired Git style

πŸ”§ Changes

  • Add PlantTheme object in themes.ts
  • Define custom backgroundPattern with SVG soil texture
  • Modify generateThemedSVG to apply pattern fill

βœ… Checklist

  • Tested new theme locally
  • Confirmed SVG renders without errors
  • Checked compatibility with existing themes

Summary by CodeRabbit

  • μ‹ κ·œ κΈ°λŠ₯

    • "plant" ν…Œλ§ˆκ°€ μΆ”κ°€λ˜μ–΄, 식물 ν…Œλ§ˆλ₯Ό 선택할 수 μžˆμŠ΅λ‹ˆλ‹€.
    • 식물 ν…Œλ§ˆμ—λŠ” μƒˆλ‘œμš΄ λ°°κ²½ νŒ¨ν„΄κ³Ό 식물 κ΄€λ ¨ 이λͺ¨μ§€κ°€ ν¬ν•¨λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
  • κ°œμ„  사항

    • SVG 생성 μ‹œ, ν…Œλ§ˆμ— 따라 λ°°κ²½ νŒ¨ν„΄μ΄ μ μš©λ˜μ–΄ λ”μš± λ‹€μ–‘ν•œ μ‹œκ°μ  μŠ€νƒ€μΌμ„ μ œκ³΅ν•©λ‹ˆλ‹€.

Copy link

vercel bot commented Jun 25, 2025

Someone is attempting to deploy a commit to the chapdo Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

coderabbitai bot commented Jun 25, 2025

"""

Walkthrough

μƒˆλ‘œμš΄ "plant" ν…Œλ§ˆκ°€ μΆ”κ°€λ˜μ–΄, κ΄€λ ¨ νƒœκ·Έμ™€ SVG λ°°κ²½ νŒ¨ν„΄ 지원이 ν™•μž₯λ˜μ—ˆμŠ΅λ‹ˆλ‹€. ThemeStyle μΈν„°νŽ˜μ΄μŠ€μ— 선택적 backgroundPattern 속성이 λ„μž…λ˜μ—ˆκ³ , SVG 생성 ν•¨μˆ˜λŠ” ν…Œλ§ˆμ˜ νŒ¨ν„΄μ„ λ™μ μœΌλ‘œ μ μš©ν•  수 μžˆλ„λ‘ κ°œμ„ λ˜μ—ˆμŠ΅λ‹ˆλ‹€. κΈ°μ‘΄ λ‘œμ§μ—λŠ” 영ν–₯이 μ—†μŠ΅λ‹ˆλ‹€.

Changes

파일/경둜 λ³€κ²½ μš”μ•½
app/page.tsx TAGS 배열에 { label: "plant" } νƒœκ·Έ μΆ”κ°€
lib/themes.ts ThemeStyle에 backgroundPattern 속성 μΆ”κ°€, PlantTheme ν…Œλ§ˆ 및 νŒ¨ν„΄, 이λͺ¨μ§€, 색상 μΆ”κ°€
lib/svg-generator.ts ν…Œλ§ˆμ˜ backgroundPattern 적용 둜직 μΆ”κ°€, SVG 배경에 νŒ¨ν„΄ 동적 ν• λ‹Ή

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Page
    participant SVGGen
    participant Themes

    User->>Page: plant νƒœκ·Έ 선택
    Page->>SVGGen: generateThemedSVG(username, "plant")
    SVGGen->>Themes: themes["plant"] 쑰회
    Themes-->>SVGGen: PlantTheme λ°˜ν™˜ (backgroundPattern 포함)
    SVGGen->>SVGGen: SVG <defs>에 backgroundPattern 적용
    SVGGen-->>Page: νŒ¨ν„΄μ΄ 적용된 SVG λ°˜ν™˜
    Page-->>User: SVG λ Œλ”λ§
Loading

Poem

🌱
μƒˆμ‹Ήμ΄ λ‹λŠ” ν…Œλ§ˆκ°€ μ™”μ–΄μš”,
머리카락, λΆˆκ½ƒ 사이에 초둝이 ν”Όμ—ˆμ£ .
νŒ¨ν„΄κ³Ό μƒ‰μœΌλ‘œ 화면을 μž₯식,
토끼도 기뻐 κΉ‘μΆ©κΉ‘μΆ© λ›°μ—ˆλ‹΅λ‹ˆλ‹€!
SVG 속에 숲이 μžλΌλ‚˜μš”.
πŸ‡βœ¨
"""


πŸ“œ Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between d3af33d and c1ec071.

πŸ“’ Files selected for processing (2)
  • lib/svg-generator.ts (2 hunks)
  • lib/themes.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/svg-generator.ts
  • lib/themes.ts
✨ Finishing Touches
  • πŸ“ Generate Docstrings
πŸ§ͺ Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment

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
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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

🧹 Nitpick comments (1)
lib/svg-generator.ts (1)

58-59: 디버깅 둜그λ₯Ό μ œκ±°ν•˜μ„Έμš”.

ν”„λ‘œλ•μ…˜ μ½”λ“œμ—μ„œ console.log 문듀을 μ œκ±°ν•΄μ•Ό ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•˜μ„Έμš”:

-	console.log("defs:", defs);
-	console.log("fillValue:", fillValue);
πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 19bba8a and d3af33d.

πŸ“’ Files selected for processing (3)
  • app/page.tsx (1 hunks)
  • lib/svg-generator.ts (2 hunks)
  • lib/themes.ts (2 hunks)
πŸ”‡ Additional comments (6)
lib/themes.ts (3)

10-10: μΈν„°νŽ˜μ΄μŠ€ ν™•μž₯이 μ μ ˆν•©λ‹ˆλ‹€.

ThemeStyle μΈν„°νŽ˜μ΄μŠ€μ— 선택적 backgroundPattern 속성을 μΆ”κ°€ν•œ 것이 μ μ ˆν•©λ‹ˆλ‹€. κΈ°μ‘΄ ν…Œλ§ˆλ“€κ³Όμ˜ ν˜Έν™˜μ„±μ„ μœ μ§€ν•˜λ©΄μ„œ μƒˆλ‘œμš΄ κΈ°λŠ₯을 지원할 수 μžˆμŠ΅λ‹ˆλ‹€.


84-98: 이λͺ¨μ§€ 맀핑이 μ§κ΄€μ μž…λ‹ˆλ‹€.

μ‹λ¬Όμ˜ μ„±μž₯ 단계λ₯Ό λ‚˜νƒ€λ‚΄λŠ” 이λͺ¨μ§€ 선택이 맀우 μ§κ΄€μ μž…λ‹ˆλ‹€ (씨앗 β†’ μƒˆμ‹Ή β†’ ν’€μžŽ β†’ 꽃). μ‚¬μš©μžκ°€ 컀밋 λ ˆλ²¨μ„ μ‰½κ²Œ 이해할 수 μžˆμ„ κ²ƒμž…λ‹ˆλ‹€.


65-82: SVG νŒ¨ν„΄ ꡬ쑰λ₯Ό κ²€μ¦ν•˜μ„Έμš”.

ν† μ–‘ μ§ˆκ°μ„ ν‘œν˜„ν•˜λŠ” SVG νŒ¨ν„΄μ΄ μƒμ„Έν•˜κ²Œ κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ νŒ¨ν„΄μ˜ λ³΅μž‘μ„±κ³Ό λ Œλ”λ§ μ„±λŠ₯에 λŒ€ν•œ 검증이 ν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒ 슀크립트λ₯Ό μ‹€ν–‰ν•˜μ—¬ SVG νŒ¨ν„΄μ˜ μœ νš¨μ„±μ„ κ²€μ¦ν•΄λ³΄μ„Έμš”:

#!/bin/bash
# SVG νŒ¨ν„΄ μœ νš¨μ„± 검증

# SVG νŒ¨ν„΄μ—μ„œ μ‚¬μš©λœ μš”μ†Œλ“€ 확인
echo "SVG νŒ¨ν„΄μ— μ‚¬μš©λœ μš”μ†Œλ“€:"
cat lib/themes.ts | grep -A 15 "backgroundPattern:" | grep -E "(rect|ellipse|circle)"

# νŒ¨ν„΄ 크기와 λ³΅μž‘λ„ 뢄석
echo "νŒ¨ν„΄ λ³΅μž‘λ„ 뢄석:"
cat lib/themes.ts | grep -A 15 "backgroundPattern:" | grep -c -E "(rect|ellipse|circle)"
app/page.tsx (1)

63-63: νƒœκ·Έ μΆ”κ°€κ°€ μ μ ˆν•©λ‹ˆλ‹€.

μƒˆλ‘œμš΄ "plant" νƒœκ·Έκ°€ κΈ°μ‘΄ νƒœκ·Έλ“€κ³Ό μΌκ΄€λœ ꡬ쑰둜 μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ‚¬μš©μžκ°€ μƒˆλ‘œμš΄ ν…Œλ§ˆλ₯Ό 선택할 수 있게 λ©λ‹ˆλ‹€.

lib/svg-generator.ts (2)

13-14: νŒ¨ν„΄ 처리 λ³€μˆ˜κ°€ μ μ ˆν•˜κ²Œ μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

λ°°κ²½ νŒ¨ν„΄κ³Ό 고유 νŒ¨ν„΄ IDλ₯Ό μœ„ν•œ λ³€μˆ˜λ“€μ΄ μ μ ˆν•˜κ²Œ μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.


63-64: SVG ꡬ쑰가 μ˜¬λ°”λ₯΄κ²Œ κ°œμ„ λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

<defs> μš”μ†Œμ™€ νŒ¨ν„΄ 기반 fill 속성이 μ˜¬λ°”λ₯΄κ²Œ μΆ”κ°€λ˜μ–΄ λ°°κ²½ νŒ¨ν„΄μ„ μ§€μ›ν•©λ‹ˆλ‹€.

lib/themes.ts Outdated
Comment on lines 100 to 107
colorMap: {
none: "#f0fdf4",
low: "#bbf7d0",
medium: "#86efac",
high: "#4ade80",
max: "#f472b6",
},
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

색상 λ§€ν•‘μ—μ„œ 일관성 λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€.

max 레벨의 색상이 #f472b6 (뢄홍색)으둜 μ„€μ •λ˜μ–΄ μžˆμ–΄ λ‹€λ₯Έ 녹색 계열 색상듀과 일관성이 λ–¨μ–΄μ§‘λ‹ˆλ‹€. 식물 ν…Œλ§ˆμ— 더 μ ν•©ν•œ 색상을 κ³ λ €ν•΄λ³΄μ„Έμš”.

λ‹€μŒκ³Ό 같이 μˆ˜μ •μ„ μ œμ•ˆν•©λ‹ˆλ‹€:

	colorMap: {
		none: "#f0fdf4",
		low: "#bbf7d0",
		medium: "#86efac",
		high: "#4ade80",
-		max: "#f472b6",
+		max: "#16a34a", // 더 μ§„ν•œ 녹색 λ˜λŠ” ν™©κΈˆμƒ‰ "#fbbf24"
	},
πŸ“ 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.

Suggested change
colorMap: {
none: "#f0fdf4",
low: "#bbf7d0",
medium: "#86efac",
high: "#4ade80",
max: "#f472b6",
},
};
colorMap: {
none: "#f0fdf4",
low: "#bbf7d0",
medium: "#86efac",
high: "#4ade80",
max: "#16a34a", // 더 μ§„ν•œ 녹색 λ˜λŠ” ν™©κΈˆμƒ‰ "#fbbf24"
},
};
πŸ€– Prompt for AI Agents
In lib/themes.ts around lines 100 to 107, the color assigned to the 'max' level
in the colorMap is inconsistent with the other green shades, as it is currently
set to a pink color (#f472b6). To fix this, replace the 'max' color value with a
green shade that aligns with the existing green palette to maintain theme
consistency.

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