π Bug: λ‘€λ§νμ΄νΌμμ± νμ΄μ§ μ§μ μ ν μ€νΈ μλν° λ΄λΆ ν¬μ»€μ±#174
π Bug: λ‘€λ§νμ΄νΌμμ± νμ΄μ§ μ§μ
μ ν
μ€νΈ μλν° λ΄λΆ ν¬μ»€μ±#174
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @Greensod-96, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! μ΄ PRμ λ‘€λ§νμ΄νΌ μμ± νμ΄μ§μμ ν μ€νΈ μλν°κ° μλμΌλ‘ ν¬μ»€μ±λλ μ¬μ©μ κ²½ν λ¬Έμ λ₯Ό ν΄κ²°ν©λλ€. μλν°μ μ΄κΈ° ν¬μ»€μ€ λμμ μ μ΄νκ³ , λ©μμ§ μ½ν μΈ κ° νμλλ λ°©μμ λ°λΌ 컀μ μ€νμΌμ λμ μΌλ‘ μ‘°μ νμ¬ μ¬μ©μκ° μΈν°νμ΄μ€λ₯Ό λ μ§κ΄μ μΌλ‘ μ΄ν΄νκ³ μνΈμμ©ν μ μλλ‘ ν©λλ€. λν, μ½λλ² μ΄μ€μ μ λ°μ μΈ κ°λ μ±μ λμ΄κΈ° μν μκ·λͺ¨ μ 리 μμ λ ν¬ν¨λμ΄ μμ΅λλ€. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with π and π on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
π ꡬνν κΈ°λ₯ Preview: https://frontend-2oc5neq1h-fe-19-seongihuns-projects.vercel.app |
Summary of ChangesHello @Greensod-96, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! μ΄ PRμ λ‘€λ§νμ΄νΌ μμ± νμ΄μ§μμ ν
μ€νΈ μλν°κ° μλμΌλ‘ ν¬μ»€μ±λλ λ²κ·Έλ₯Ό ν΄κ²°νκ³ , μ½ν
μΈ νμ λ°©μμ λ°λΌ 컀μ μ€νμΌμ λ€λ₯΄κ² μ μ©νμ¬ μ¬μ©μ κ²½νμ κ°μ ν©λλ€. μ£Όμ λ³κ²½ μ¬νμ Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with π and π on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
λ‘€λ§νμ΄νΌ μμ± νμ΄μ§ μ§μ
μ ν
μ€νΈ μλν°μ μλμΌλ‘ ν¬μ»€μ±λλ λ²κ·Έλ₯Ό μμ ν PR μ 보μμ΅λλ€. setTimeoutκ³Ό autoFocus={false}λ₯Ό μ¬μ©νμ¬ λ¬Έμ λ₯Ό ν΄κ²°νμ
¨λ€μ. μ΄μ ν¨κ» μ½λ κ°λ
μ±κ³Ό μ μ§λ³΄μμ±μ λμ΄κΈ° μν μ¬λ¬ 리ν©ν λ§λ μ§νλμμ΅λλ€. λͺ κ°μ§ μΆκ°μ μΌλ‘ κ°μ ν μ μλ λΆλΆμ λν΄ λ¦¬λ·° μ½λ©νΈλ₯Ό λ¨κ²Όμ΅λλ€. μ€λ³΅ λ‘μ§μ μ κ±°νκ³ , λΆνμν DOM μ§μ μ‘°μμ νΌνλ©°, μ½λμ λͺ
νμ±μ λμ΄λ λ° μ€μ μ λμμ΅λλ€. νμΈ λΆνλ립λλ€.
| useEffect(() => { | ||
| if (!cardRef.current) { | ||
| return; | ||
| } | ||
| const editor = cardRef.current.querySelector('.ql-editor'); | ||
| if (editor) { | ||
| editor.style.cursor = 'pointer'; | ||
| } | ||
| }, [content]); |
There was a problem hiding this comment.
μ΄ useEffect ν
μ DOMμ μ§μ μ‘°μνμ¬ μ»€μ μ€νμΌμ λ³κ²½νκ³ μμ΅λλ€. PostContent μ»΄ν¬λνΈκ° card propμ κΈ°λ°μΌλ‘ 컀μ μ€νμΌμ κ΄λ¦¬νλλ‘ λ³κ²½λμκΈ° λλ¬Έμ μ΄ μ½λλ λ μ΄μ νμνμ§ μμ΅λλ€. μ΄ ν
κ³Ό ν¨κ» cardRef μ μΈ(35ν), ref prop(61ν)λ ν¨κ» μ κ±°νλ κ²μ΄ μ’μ΅λλ€.
| onChange(content); | ||
| }; | ||
| useEffect(() => { | ||
| const timer = setTimeout(() => setReady(true), 50); // 50ms λ€ λ λ |
| if (!range) { | ||
| // ν¬μ»€μ€κ° μμΌλ©΄ λ€μ μ λ ₯μ μ μ©λ ν¬λ§·λ§ μ€μ | ||
| quill.format('font', font, 'api'); | ||
| } else if (range.length === 0) { | ||
| // 컀μλ§ μκ³ μ ν μμμ΄ μμΌλ©΄ λ€μ μ λ ₯μ μ μ© | ||
| quill.format('font', font, 'api'); | ||
| } else { | ||
| // μ ν μμμ΄ μμΌλ©΄ ν΄λΉ μμμλ§ ν°νΈ μ μ© | ||
| quill.formatText(range.index, range.length, { font }, 'api'); | ||
| } |
There was a problem hiding this comment.
if (!range) λΈλ‘κ³Ό else if (range.length === 0) λΈλ‘μ λ΄μ©μ΄ λμΌν©λλ€. λ 쑰건μ || μ°μ°μλ‘ ν΅ν©νμ¬ μ½λλ₯Ό λ κ°κ²°νκ² λ§λ€ μ μμ΅λλ€.
if (!range || range.length === 0) {
quill.format('font', font, 'api');
} else {
quill.formatText(range.index, range.length, { font }, 'api');
}| <PostContent | ||
| htmlContent={content} | ||
| className={'line-clamp-2 sm:line-clamp-3'} | ||
| className="line-clamp-2 cursor-pointer sm:line-clamp-3" |
There was a problem hiding this comment.
PostContent μ»΄ν¬λνΈμ cursor-pointer ν΄λμ€λ₯Ό μ§μ μΆκ°νμ
¨μ΅λλ€. νμ§λ§ PostContent μ»΄ν¬λνΈλ μ΄μ card propμ΄ trueμΌ λ λ΄λΆμ μΌλ‘ pointer-mode ν΄λμ€λ₯Ό μ μ©νμ¬ μ»€μ μ€νμΌμ κ΄λ¦¬ν©λλ€. λ°λΌμ μ΄ ν΄λμ€λ μ€λ³΅λλ―λ‘ μ κ±°ν΄λ λ©λλ€.
| className="line-clamp-2 cursor-pointer sm:line-clamp-3" | |
| className="line-clamp-2 sm:line-clamp-3" |
There was a problem hiding this comment.
Code Review
λ‘€λ§νμ΄νΌ μμ± νμ΄μ§ μ§μ
μ ν
μ€νΈ μλν°μ μλμΌλ‘ ν¬μ»€μ±λλ λ²κ·Έλ₯Ό μμ ν μ μ΄ μ’μ΅λλ€. useEffectμ setTimeoutμ μ¬μ©νμ¬ ReactQuill μ»΄ν¬λνΈμ λ λλ§μ μ§μ°μν€κ³ autoFocus={false} μμ±μ λͺ
μμ μΌλ‘ μΆκ°νμ¬ λ¬Έμ λ₯Ό ν΄κ²°ν μ κ·Ό λ°©μμ΄ μΈμμ μ
λλ€. λν, μΉ΄λ ννμ λͺ¨λ¬ ννμμ μ½ν
μΈ μ 컀μ μ€νμΌμ λ€λ₯΄κ² μ²λ¦¬νκΈ° μν΄ CSS ν΄λμ€λ₯Ό λμ
ν κ²λ μ’μ κ°μ μ
λλ€. λ€λ§, 컀μ μ€νμΌμ μ μ©νλ λΆλΆμμ μΌλΆ μ€λ³΅λλ μ½λκ° μμ΄ μ΄μ λν 리뷰 μ견μ λ¨κ²Όμ΅λλ€. ν΄λΉ λΆλΆμ μ 리νλ©΄ μ½λκ° λ κΉλνκ³ μ μ§λ³΄μνκΈ° μ’μμ§ κ² κ°μ΅λλ€.
| useEffect(() => { | ||
| if (!cardRef.current) { | ||
| return; | ||
| } | ||
| const editor = cardRef.current.querySelector('.ql-editor'); | ||
| if (editor) { | ||
| editor.style.cursor = 'pointer'; | ||
| } | ||
| }, [content]); |
There was a problem hiding this comment.
μ΄ useEffect ν
μ μ€λ³΅λ λ‘μ§μΌλ‘ 보μ
λλ€. PostContent μ»΄ν¬λνΈκ° card propμ ν΅ν΄ pointer-mode ν΄λμ€λ₯Ό μ΄λ―Έ μ μ©νκ³ μμΌλ©°, μ΄ ν΄λμ€λ quill-custom.cssμμ 컀μ μ€νμΌμ pointerλ‘ μ€μ νκ³ μμ΅λλ€. λ°λΌμ μ΄ ν
μ λΆνμνλ©°, Reactμμ μ§μ DOM μ€νμΌμ μ‘°μνλ λμ CSS ν΄λμ€λ₯Ό ν΅ν΄ μ€νμΌμ κ΄λ¦¬νλ κ²μ΄ λ λ°λμ§ν©λλ€. μ΄ ν
μ μ κ±°νμ¬ μ½λλ₯Ό λ¨μννλ κ²μ΄ μ’κ² μ΅λλ€.
| className={`ql-editor w-full ${textStyle(font)} ${quillFontClass} ${className} ${ | ||
| card ? 'pointer-mode cursor-pointer' : 'default-mode cursor-default' | ||
| }`} |
There was a problem hiding this comment.
pointer-mode ν΄λμ€κ° μ΄λ―Έ quill-custom.cssμμ cursor: pointer !important;λ₯Ό μ μ©νκ³ μμΌλ―λ‘, cursor-pointer ν΄λμ€λ₯Ό ν¨κ» μ¬μ©νλ κ²μ μ€λ³΅μ
λλ€. default-modeμ κ²½μ°μλ cursor-defaultκ° μ€λ³΅λ©λλ€. μ½λλ₯Ό λ κ°κ²°νκ² μ μ§νκΈ° μν΄ μ€λ³΅λλ TailwindCSS μ νΈλ¦¬ν° ν΄λμ€λ₯Ό μ κ±°νλ κ²μ΄ μ’μ΅λλ€.
| className={`ql-editor w-full ${textStyle(font)} ${quillFontClass} ${className} ${ | |
| card ? 'pointer-mode cursor-pointer' : 'default-mode cursor-default' | |
| }`} | |
| className={`ql-editor w-full ${textStyle(font)} ${quillFontClass} ${className} ${ | |
| card ? 'pointer-mode' : 'default-mode' | |
| }`} |
| <PostContent | ||
| htmlContent={content} | ||
| className={'line-clamp-2 sm:line-clamp-3'} | ||
| className="line-clamp-2 cursor-pointer sm:line-clamp-3" |
There was a problem hiding this comment.
PostContentμ μ λ¬λλ classNameμ cursor-pointerλ λΆνμν©λλ€. PostContent μ»΄ν¬λνΈ λ΄λΆμμ card propμ΄ trueμΌ λ pointer-mode ν΄λμ€κ° μ μ©λμ΄ μ΄λ―Έ 컀μ μ€νμΌμ μ²λ¦¬νκ³ μμ΅λλ€. μ€λ³΅λλ μ€νμΌμ μ κ±°νμ¬ μ½λλ₯Ό λ λͺ
ννκ² λ§λ€ μ μμ΅λλ€.
| className="line-clamp-2 cursor-pointer sm:line-clamp-3" | |
| className="line-clamp-2 sm:line-clamp-3" |
π μ΄μ λ²νΈ
β¨ μμ ν λ΄μ©
π Review Point
π‘ μ°Έκ³ μ¬ν