Skip to content

fix: QA#219

Merged
heeeeyong merged 3 commits intodevelopfrom
chore/minor-updates
Aug 31, 2025
Merged

fix: QA#219
heeeeyong merged 3 commits intodevelopfrom
chore/minor-updates

Conversation

@heeeeyong
Copy link
Collaborator

@heeeeyong heeeeyong commented Aug 28, 2025

#οΈβƒ£μ—°κ΄€λœ 이슈

μ—†μŒ

πŸ“μž‘μ—… λ‚΄μš©

  • λ§ˆμ΄νŽ˜μ΄μ§€ ν”„λ‘œν•„ 폰트 μ‚¬μ΄μ¦ˆ μˆ˜μ •
  • 전체 ν”Όλ“œ μ‘°νšŒμ—μ„œ 이미지 κΉ¨μ§€λŠ” ν˜„μƒ μˆ˜μ •

πŸ’¬λ¦¬λ·° μš”κ΅¬μ‚¬ν•­

μ—†μŒ

Summary by CodeRabbit

  • μƒˆλ‘œμš΄ κΈ°λŠ₯

    • μ €μž₯ν•œ μ±… λͺ©λ‘μ— λ¬΄ν•œ 슀크둀 λ„μž…: ν•˜λ‹¨μœΌλ‘œ μŠ€ν¬λ‘€ν•˜λ©΄ μžλ™μœΌλ‘œ μΆ”κ°€ ν•­λͺ©μ„ 뢈러였고 λ‘œλ”© ν‘œμ‹œ 제곡.
  • μŠ€νƒ€μΌ

    • 썸넀일에 object-fit: cover 적용으둜 μžμ—°μŠ€λŸ¬μš΄ 크둭 및 λΉ„μœ¨ μœ μ§€.
    • λ§ˆμ΄νŽ˜μ΄μ§€ μ‚¬μš©μž ν”„λ‘œν•„ νƒ€μ΄ν¬κ·Έλž˜ν”Ό μ‘°μ •(μ΄λ¦„Β·νƒ€μ΄ν‹€μ˜ ν¬κΈ°Β·λ‘κ»˜Β·ν–‰κ°„Β·μžκ°„Β·μƒ‰μƒ κ°œμ„ ).
    • μ €μž₯ν•œ ν•­λͺ© λͺ©λ‘ λ ˆμ΄μ•„μ›ƒ 정리(ν•­λͺ© λ„ˆλΉ„ 쀑앙 μ •λ ¬, λ§ˆμ§€λ§‰ ν•­λͺ© ν•˜λ‹¨μ„  제거).
  • 버그 μˆ˜μ •

    • 100x100 썸넀일이 λŠ˜μ–΄μ§€λŠ” ν˜„μƒ ν•΄κ²°.

@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

PostBody의 이미지 μŠ€νƒ€μΌμ— object-fit: cover μΆ”κ°€. Mypage UserProfile의 νƒ€μ΄ν¬κ·Έλž˜ν”Ό 토큰(μƒ‰μƒΒ·ν¬κΈ°Β·λ‘κ»˜Β·ν–‰κ°„Β·μžκ°„) ꡐ체. SavePage에 μ €μž₯된 뢁 λͺ©λ‘ λ¬΄ν•œμŠ€ν¬λ‘€(μ»€μ„œ 기반) 및 BookItem λ ˆμ΄μ•„μ›ƒΒ·λ Œλ”λ§Β·κ΄€μ°°μž μΆ”κ°€. API getSavedBooksInMyκ°€ 선택적 cursor와 νŽ˜μ΄μ§• ν•„λ“œ(nextCursor, isLast)λ₯Ό λ°˜ν™˜ν•˜λ„λ‘ 변경됨.

Changes

Cohort / File(s) Change summary
Post 이미지 μŠ€νƒ€μΌ μ‘°μ •
src/components/common/Post/PostBody.tsx
ImageContainer img에 object-fit: cover μΆ”κ°€ν•΄ 100x100 썸넀일을 λΉ„μœ¨ μœ μ§€λ‘œ μ±„μš°κ³  크둭 μ²˜λ¦¬ν•˜λ„λ‘ λ³€κ²½. 둜직/곡개 API λ³€κ²½ μ—†μŒ.
Mypage νƒ€μ΄ν¬κ·Έλž˜ν”Ό 토큰 ꡐ체
src/pages/mypage/Mypage.tsx
UserProfile λ‚΄ .username, .usertitle의 색상, 폰트 ν¬κΈ°Β·λ‘κ»˜Β·ν–‰κ°„Β·μžκ°„μ„ μƒˆλ‘œμš΄ λ””μžμΈ ν† ν°μœΌλ‘œ ꡐ체(일뢀 색상 μ œκ±°ν•˜μ—¬ 상속 ν™œμš©). μŠ€νƒ€μΌ λ³€κ²½λ§Œ.
SavePage λ¬΄ν•œμŠ€ν¬λ‘€ 및 λ ˆμ΄μ•„μ›ƒ λ³€κ²½
src/pages/mypage/SavePage.tsx
μ €μž₯ λ„μ„œ λ‘œλ”©μ„ μ»€μ„œ 기반 λ¬΄ν•œμŠ€ν¬λ‘€λ‘œ λ³€κ²½: bookNextCursor, bookIsLast, bookLoading, bookObserverRef μΆ”κ°€, loadSavedBooksκ°€ 선택적 cursor 인자 수용, λ§ˆμ§€λ§‰ ν•­λͺ©μ— λŒ€ν•œ IntersectionObserver 콜백 등둝, λ‘œλ”© μŠ€ν”Όλ„ˆ 및 ν•˜λ‹¨ μ˜΅μ €λ²„ μ—˜λ¦¬λ¨ΌνŠΈ μΆ”κ°€. λ˜ν•œ BookItem λ„ˆλΉ„(94.8%)Β·κ°€μš΄λ° μ •λ ¬Β·λ§ˆμ§€λ§‰ ν•­λͺ© 보더 제거 λ“± λ ˆμ΄μ•„μ›ƒ μ‘°μ •.
API: μ €μž₯ λ„μ„œ νŽ˜μ΄μ§• 지원 μΆ”κ°€
src/api/books/getSavedBooksInMy.ts
ν•¨μˆ˜ μ‹œκ·Έλ‹ˆμ²˜λ₯Ό `async (cursor: string

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as SavePage UI
  participant Obs as IntersectionObserver
  participant API as getSavedBooksInMy(cursor)
  participant State as Local State

  Note over UI,Obs: 초기 λ‘œλ“œ
  UI->>API: getSavedBooksInMy(null)
  API-->>UI: { bookList, nextCursor, isLast }
  UI->>State: set savedBooks, bookNextCursor, bookIsLast

  Note over UI,Obs: 슀크둀둜 λ§ˆμ§€λ§‰ ν•­λͺ© κ΄€μ°° μ‹œ
  Obs->>UI: lastItem intersecting
  alt 더 뢈러올 수 있음 (nextCursor && !isLast && !bookLoading)
    UI->>State: set bookLoading=true
    UI->>API: getSavedBooksInMy(bookNextCursor)
    API-->>UI: { bookList, nextCursor, isLast }
    UI->>State: append savedBooks, update bookNextCursor, bookIsLast, set bookLoading=false
  else λ‘œλ“œ λΆˆν•„μš”
    Obs-->>UI: no-op
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

🐞 BugFix, 🎨 Html&css, πŸ“¬ API

Suggested reviewers

  • ho0010
  • ljh130334

Poem

깑총깑총 토끼가 λ§ν•˜λ„€,
"μ΄λ―Έμ§€λŠ” μž˜λΌμ„œ 예쁘게, κΈ€μžλ“€μ€ μƒˆ 옷 μž…ν˜€μš”." πŸ‡
책듀은 λ°”λ‹₯을 바라보닀가,
μ˜΅μ €λ²„κ°€ μ†μ§“ν•˜λ©΄ 더 뢈러였고,
λ‹Ήκ·Ό ν•œμͺ½ μΆ•ν•˜λ‘œ μ˜€λŠ˜λ„ 배포! πŸ₯•

Tip

πŸ”Œ Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • πŸ“ Generate Docstrings
πŸ§ͺ Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/minor-updates

πŸͺ§ 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@vercel
Copy link

vercel bot commented Aug 28, 2025

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

Project Deployment Preview Comments Updated (UTC)
thip Ready Ready Preview Comment Aug 31, 2025 2:31pm

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

Caution

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

⚠️ Outside diff range comments (5)
src/components/common/Post/PostBody.tsx (2)

74-77: λ³΄μ•ˆ: reverse tabnabbing λ°©μ§€μš© noopener/noreferrer μΆ”κ°€ ν•„μš”

window.open(..., '_blank')λŠ” μƒˆ νƒ­μ—μ„œ λΆ€λͺ¨ μ°½ μ œμ–΄κ°€ κ°€λŠ₯ν•΄μ§‘λ‹ˆλ‹€. μ„Έ 번째 μΈμžμ— noopener,noreferrerλ₯Ό μ μš©ν•΄ μ£Όμ„Έμš”.

μ•„λž˜μ²˜λŸΌ μˆ˜μ • ꢌμž₯:

-    window.open(`/feed/${feedId}`, '_blank');
+    window.open(`/feed/${feedId}`, '_blank', 'noopener,noreferrer');

103-105: 이미지 μ ‘κ·Όμ„±/μ„±λŠ₯: alt, lazy λ‘œλ”©, μ•ˆμ • ν‚€ 적용

  • alt λΆ€μž¬: μ½˜ν…μΈ  μ΄λ―Έμ§€λ‘œ λ³΄μ΄λ―€λ‘œ λŒ€μ²΄ ν…μŠ€νŠΈ ν•„μš”
  • 퍼포먼슀: 썸넀일은 loading="lazy", decoding="async" ꢌμž₯
  • key: index λŒ€μ‹  μ•ˆμ • ν‚€ μ‚¬μš© ꢌμž₯
-            {contentUrls.map((src: string, i: number) => (
-              <img key={i} src={src} />
-            ))}
+            {contentUrls.map((src: string, i: number) => (
+              <img
+                key={`${i}-${src}`}
+                src={src}
+                alt={`ν”Όλ“œ 이미지 ${i + 1}`}
+                loading="lazy"
+                decoding="async"
+              />
+            ))}
src/pages/mypage/Mypage.tsx (3)

78-79: λ³΄μ•ˆ: μ™ΈλΆ€ 링크 window.open λͺ¨λ‘μ— noopener/noreferrer 적용

μ—¬λŸ¬ κ³³μ—μ„œ _blankλ₯Ό μ‚¬μš©ν•˜κ³  μžˆμ–΄ reverse tabnabbing μœ„ν—˜μ΄ μžˆμŠ΅λ‹ˆλ‹€. μ„Έ ꡰ데 λͺ¨λ‘ λ™μΌν•˜κ²Œ 보호 ν”Œλž˜κ·Έλ₯Ό μΆ”κ°€ν•΄ μ£Όμ„Έμš”.

-  window.open('https://slashpage.com/thip/7vgjr4m1nynpy2dwpy86', '_blank');
+  window.open('https://slashpage.com/thip/7vgjr4m1nynpy2dwpy86', '_blank', 'noopener,noreferrer');

-  window.open('https://slashpage.com/thip/ywk9j72989p6rmgpqvnd', '_blank');
+  window.open('https://slashpage.com/thip/ywk9j72989p6rmgpqvnd', '_blank', 'noopener,noreferrer');

-  window.open('https://slashpage.com/thip/dk58wg2e6yy3zmnqevxz', '_blank');
+  window.open('https://slashpage.com/thip/dk58wg2e6yy3zmnqevxz', '_blank', 'noopener,noreferrer');

-  window.open('https://slashpage.com/thip/7916x82r8y74n24kpyg3', '_blank');
+  window.open('https://slashpage.com/thip/7916x82r8y74n24kpyg3', '_blank', 'noopener,noreferrer');

-  window.open('https://slashpage.com/thip/1q3vdn2p9w93pmxy49pr', '_blank');
+  window.open('https://slashpage.com/thip/1q3vdn2p9w93pmxy49pr', '_blank', 'noopener,noreferrer');

Also applies to: 94-95, 98-99, 102-103, 106-107


115-116: ν”„λ‘œν•„ 이미지에 λŒ€μ²΄ ν…μŠ€νŠΈ μΆ”κ°€

μ‹œκ°μ  정보 전달 μš”μ†Œμ΄λ―€λ‘œ alt ν…μŠ€νŠΈλ₯Ό μ œκ³΅ν•˜μ„Έμš”. μ ‘κ·Όμ„± κΈ°λ³Έ μš”κ±΄μž…λ‹ˆλ‹€.

-            <img src={profile.profileImageUrl} />
+            <img src={profile.profileImageUrl} alt="ν”„λ‘œν•„ 이미지" />

146-146: μ‚¬μš©μž λ…ΈμΆœ ν…μŠ€νŠΈ μ˜€νƒˆμž μˆ˜μ •: β€œλ²„μ Όβ€ β†’ β€œλ²„μ „β€

ν•œκ΅­μ–΄ ν‘œμ€€ ν‘œκΈ°μž…λ‹ˆλ‹€. μ‚¬μš©μž 신뒰도 κ΄€μ μ—μ„œ μ¦‰μ‹œ μˆ˜μ • ꢌμž₯.

-            <MenuButton src={ver} name="버젼 1.0.0" isButton onClick={handleVersion} />
+            <MenuButton src={ver} name="버전 1.0.0" isButton onClick={handleVersion} />
🧹 Nitpick comments (4)
src/components/common/Post/PostBody.tsx (2)

79-86: λ§μ€„μž„ 감지 μ˜μ‘΄μ„± 보완

-webkit-line-clamp 값이 hasImage에 따라 λ‹¬λΌμ§€λ―€λ‘œ, 이미지 μœ λ¬΄κ°€ λ°”λ€” λ•Œλ„ λ§μ€„μž„ μž¬ν‰κ°€κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

μ•„λž˜μ²˜λŸΌ μ˜μ‘΄μ„±μ— hasImageλ₯Ό μΆ”κ°€ν•΄ μ£Όμ„Έμš”.

-  }, [contentBody]);
+  }, [contentBody, hasImage]);

97-99: μž₯식 μ•„μ΄μ½˜ μ ‘κ·Όμ„±: μŠ€ν¬λ¦°λ¦¬λ” λ…ΈμΆœ 제거

'더보기' μ•„μ΄μ½˜μ€ λΉ„μƒν˜Έμž‘μš© μž₯식 μš”μ†Œμž…λ‹ˆλ‹€. μŠ€ν¬λ¦°λ¦¬λ” λ…ΈμΆœμ„ 막아 ν˜Όλž€μ„ μ€„μ—¬μ£Όμ„Έμš”.

-        {isTruncated && <img src={lookmore} alt="더보기" className="lookmore-icon" />}
+        {isTruncated && <img src={lookmore} alt="" aria-hidden="true" className="lookmore-icon" />}
src/pages/mypage/Mypage.tsx (2)

222-227: νƒ€μ΄ν¬κ·Έλž˜ν”Ό 토큰 ꡐ체 LGTM + μžκ°„ κ°’ κ²€ν†  μ œμ•ˆ

토큰 μΉ˜ν™˜ 일관성 μ’‹μŠ΅λ‹ˆλ‹€. λ‹€λ§Œ letter-spacing: 0.018px;은 였차 μˆ˜μ€€μ˜ λ―Έμ†Œ κ°’μž…λ‹ˆλ‹€. λ””μžμΈ μ˜λ„λ©΄ ν† ν°ν™”ν•˜κ±°λ‚˜(예: var(--letter-spacing-md)) μ†Œμˆ˜ 자리 μ •κ·œν™” κ²€ν†  λ°”λžλ‹ˆλ‹€.


230-233: .usertitle 색상 μ œκ±°μ— λ”°λ₯Έ 폴백 확인 ν•„μš”

μŠ€νƒ€μΌμ—μ„œ 색상을 μ œκ±°ν–ˆκ³ , μ‹€μ œ 색상은 JSX 인라인 μŠ€νƒ€μΌ(라인 118) profile.aliasColor둜 μ μš©λ©λ‹ˆλ‹€. aliasColorκ°€ 없을 λ•Œμ˜ 폴백 색상이 μ‚¬λΌμ‘Œμ„ 수 μžˆμœΌλ‹ˆ 확인 λ°”λžλ‹ˆλ‹€.

인라인 μŠ€νƒ€μΌμ— μ•ˆμ „ν•œ 폴백 μΆ”κ°€ μ œμ•ˆ(라인 117-120 μ°Έκ³ ):

-              <div className="usertitle" style={{ color: profile.aliasColor }}>
+              <div
+                className="usertitle"
+                style={{ color: profile.aliasColor ?? 'var(--color-text-secondary_grey00, #dadada)' }}
+              >
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ’‘ Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 46dcfa8 and 4d12827.

πŸ“’ Files selected for processing (2)
  • src/components/common/Post/PostBody.tsx (1 hunks)
  • src/pages/mypage/Mypage.tsx (1 hunks)
πŸ”‡ Additional comments (1)
src/components/common/Post/PostBody.tsx (1)

55-59: 썸넀일 크둭 ν’ˆμ§ˆ κ°œμ„  LGTM

100x100 κ³ μ • μ˜μ—­μ—μ„œ λΉ„μœ¨ μœ μ§€ 크둭을 μœ„ν•œ object-fit: cover; μΆ”κ°€ μ μ ˆν•©λ‹ˆλ‹€. κΈ°λŒ€ν•œ β€œμ΄λ―Έμ§€ 깨짐” μ΄μŠˆμ— λ°”λ‘œ 효λ ₯이 μžˆμŠ΅λ‹ˆλ‹€.

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

🧹 Nitpick comments (6)
src/api/books/getSavedBooksInMy.ts (2)

15-19: nextCursor null κ°€λŠ₯μ„± λŒ€λΉ„: νƒ€μž…μ„ string | null둜 λ³€κ²½ ꢌμž₯

μ„œλ²„κ°€ λ§ˆμ§€λ§‰ νŽ˜μ΄μ§€μ—μ„œ nextCursorλ₯Ό null둜 쀄 수 μžˆμŠ΅λ‹ˆλ‹€. μ•ˆμ „ν•˜κ²Œ string | null둜 μ„ μ–Έν•΄ μ£Όμ„Έμš”. ν•„μš” μ‹œ μ„œλ²„ μŠ€νŽ™ 확인 λ°”λžλ‹ˆλ‹€.

 export interface SavedBooksInMyData {
   bookList: SavedBookInMy[];
-  nextCursor: string;
+  nextCursor: string | null;
   isLast: boolean;
 }

30-39: params λΉŒλ“œ κ°„μ†Œν™” 및 빈 params 전솑 λ°©μ§€ + λ°˜ν™˜ νƒ€μž… λͺ…μ‹œ

빈 객체λ₯Ό params둜 보내지 μ•Šλ„λ‘ ν•˜κ³ , ν•¨μˆ˜ λ°˜ν™˜ νƒ€μž…μ„ λͺ…μ‹œν•΄ νƒ€μž… μ•ˆμ „μ„±μ„ λ†’μ΄λŠ” 편이 μ’‹μŠ΅λ‹ˆλ‹€. 빈 λ¬Έμžμ—΄ cursorκ°€ λ“€μ–΄κ°€λŠ” 것도 λ°©μ§€ν•©λ‹ˆλ‹€.

-export const getSavedBooksInMy = async (cursor: string | null = null) => {
+export const getSavedBooksInMy = async (
+  cursor: string | null = null,
+): Promise<SavedBooksInMyResponse> => {
   try {
-    const params: { cursor?: string | null } = {};
-    if (cursor !== null) {
-      params.cursor = cursor;
-    }
+    const params = cursor ? { cursor } : undefined;

-    const response = await apiClient.get<SavedBooksInMyResponse>('/books/saved', {
-      params,
-    });
+    const response = await apiClient.get<SavedBooksInMyResponse>('/books/saved', { params });
     return response.data;
src/pages/mypage/SavePage.tsx (4)

40-40: IntersectionObserver λˆ„μˆ˜/쀑볡 κ΄€μ°° κ°€λŠ₯μ„± 및 λ―Έμ‚¬μš© ref 정리

  • lastBookElementCallback λ‚΄μ—μ„œ 맀번 μƒˆ Observerλ₯Ό λ§Œλ“€κ³  ν•΄μ œν•˜μ§€ μ•Šμ•„ λˆ„μˆ˜/쀑볡 트리거 κ°€λŠ₯성이 μžˆμŠ΅λ‹ˆλ‹€.
  • bookObserverRefλŠ” μƒμ„±λ§Œ 되고 관찰에 μ‚¬μš©λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

단일 Observer μΈμŠ€ν„΄μŠ€λ‘œ κ΄€λ¦¬ν•˜κ³ , 이전 관찰을 disconnect()둜 정리해 μ£Όμ„Έμš”. λ˜ν•œ μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” bookObserverRef와 JSX의 ν•΄λ‹Ή refλ₯Ό μ œκ±°ν•˜λŠ” 편이 λͺ…ν™•ν•©λ‹ˆλ‹€.

-  const bookObserverRef = useRef<HTMLDivElement>(null);
+  const bookLastObserverRef = useRef<IntersectionObserver | null>(null);
-  const lastBookElementCallback = useCallback(
-    (node: HTMLDivElement | null) => {
-      if (bookLoading || bookIsLast) return;
-
-      if (node) {
-        const observer = new IntersectionObserver(entries => {
-          if (entries[0].isIntersecting && !bookLoading && !bookIsLast) {
-            loadMoreBooks();
-          }
-        });
-
-        observer.observe(node);
-      }
-    },
-    [bookLoading, bookIsLast, loadMoreBooks],
-  );
+  const lastBookElementCallback = useCallback(
+    (node: HTMLDivElement | null) => {
+      if (bookLastObserverRef.current) {
+        bookLastObserverRef.current.disconnect();
+        bookLastObserverRef.current = null;
+      }
+      if (!node || bookLoading || bookIsLast) return;
+      bookLastObserverRef.current = new IntersectionObserver(
+        entries => {
+          if (entries[0].isIntersecting && !bookLoading && !bookIsLast && bookNextCursor) {
+            loadSavedBooks(bookNextCursor);
+          }
+        },
+        { threshold: 0.1 },
+      );
+      bookLastObserverRef.current.observe(node);
+    },
+    [bookLoading, bookIsLast, bookNextCursor, loadSavedBooks],
+  );
+
+  useEffect(() => {
+    return () => bookLastObserverRef.current?.disconnect();
+  }, []);
-            {savedBooks.map((book, index) => (
-              <BookItem
-                key={book.bookId}
-                ref={index === savedBooks.length - 1 ? lastBookElementCallback : null}
-              >
+            {savedBooks.map((book, index) => (
+              <BookItem
+                key={book.bookId}
+                ref={index === savedBooks.length - 1 ? lastBookElementCallback : null}
+              >

(μœ„ JSXλŠ” ref μœ μ§€, μ•„λž˜ sentinel ref만 제거)

-            {!bookIsLast && (
-              <div ref={bookObserverRef} style={{ height: '20px' }}>
+            {!bookIsLast && (
+              <div style={{ height: '20px' }}>
                 {bookLoading && <LoadingSpinner fullHeight={false} size="small" />}
               </div>
             )}

Also applies to: 103-119, 254-258, 277-281


92-101: loadMoreBooksλŠ” 콜백 λ‚΄λΆ€λ‘œ 흑수 κ°€λŠ₯

μœ„ κ°œμ„ μ•ˆ 적용 μ‹œ loadMoreBooksλŠ” λΆˆν•„μš”ν•΄μ§‘λ‹ˆλ‹€. μ œκ±°ν•΄ μ½”λ“œ κ²½λŸ‰ν™”ν•˜μ„Έμš”.

-  const loadMoreBooks = useCallback(async () => {
-    if (!bookNextCursor || bookIsLast || bookLoading) return;
-
-    try {
-      await loadSavedBooks(bookNextCursor);
-    } catch (error) {
-      console.error('μ±… μΆ”κ°€ λ‘œλ“œ μ‹€νŒ¨:', error);
-    }
-  }, [bookNextCursor, bookIsLast, bookLoading, loadSavedBooks]);

176-198: μ±… μ €μž₯ μ·¨μ†Œ μ‹œ 전체 재쑰회 λŒ€μ‹  둜컬 μƒνƒœμ—μ„œ 제거 ꢌμž₯

ν”Όλ“œ μ²˜λ¦¬μ™€ λ™μΌν•˜κ²Œ 둜컬 μƒνƒœλ₯Ό κ°±μ‹ ν•˜λ©΄ UX와 νŠΈλž˜ν”½ λͺ¨λ‘ κ°œμ„ λ©λ‹ˆλ‹€.

       // μ €μž₯ μ·¨μ†ŒμΈ 경우 μ €μž₯된 μ±… λͺ©λ‘μ„ λ‹€μ‹œ 뢈러옴
       if (!newSaveState) {
-        await loadSavedBooks();
+        setSavedBooks(prev => prev.filter(book => book.isbn !== isbn));
       } else {
         // μ €μž₯인 경우 둜컬 μƒνƒœλ§Œ μ—…λ°μ΄νŠΈ
         setSavedBooks(prev =>
           prev.map(book => (book.isbn === isbn ? { ...book, isSaved: newSaveState } : book)),
         );
       }

345-354: μ€‘λ³΅λœ width μ„ μ–Έ 제거

width: 100%κ°€ 두 번 μ„ μ–Έλ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. ν•˜λ‚˜λ§Œ λ‚¨κΈ°μ„Έμš”.

 const BookList = styled.div`
   display: flex;
   flex-direction: column;
   width: 100%;
   min-width: 320px;
   max-width: 767px;
   padding-top: 32px;
   margin: 0 auto;
-  width: 100%;
 `;
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ’‘ Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 5a8fcf6 and 36b92ee.

πŸ“’ Files selected for processing (2)
  • src/api/books/getSavedBooksInMy.ts (2 hunks)
  • src/pages/mypage/SavePage.tsx (6 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/api/books/getSavedBooksInMy.ts (1)
src/api/index.ts (1)
  • apiClient (7-14)
src/pages/mypage/SavePage.tsx (2)
src/api/books/getSavedBooksInMy.ts (1)
  • getSavedBooksInMy (30-45)
src/styles/global/global.ts (1)
  • colors (4-53)
πŸ”‡ Additional comments (1)
src/pages/mypage/SavePage.tsx (1)

31-34: λ¬΄ν•œμŠ€ν¬λ‘€ μƒνƒœ μΆ”κ°€ LGTM

bookNextCursor, bookIsLast, bookLoading μΆ”κ°€ λ°©ν–₯ μ μ ˆν•©λ‹ˆλ‹€.

@heeeeyong heeeeyong merged commit 9651f7e into develop Aug 31, 2025
3 checks passed
@heeeeyong heeeeyong self-assigned this Aug 31, 2025
@heeeeyong heeeeyong added the 🐞 BugFix Something isn't working label Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 BugFix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant