Skip to content

fix: QA 3์ฐจ#178

Merged
heeeeyong merged 6 commits into
developfrom
chore/minor-updates
Aug 20, 2025
Merged

fix: QA 3์ฐจ#178
heeeeyong merged 6 commits into
developfrom
chore/minor-updates

Conversation

@heeeeyong
Copy link
Copy Markdown
Collaborator

@heeeeyong heeeeyong commented Aug 20, 2025

#๏ธโƒฃ์—ฐ๊ด€๋œ ์ด์Šˆ

์—†์Œ

๐Ÿ“์ž‘์—… ๋‚ด์šฉ

  • ๋กœ๋”ฉ์Šคํ”ผ๋„ˆ design์ˆ˜์ •
  • ๋‚ด ๋ชจ์ž„๋ฐฉ ๋ชจ๋‹ฌ design์ˆ˜์ •
  • ๋‹ค๋ฅธ ์‚ฌ์šฉ์ž ๋ฑ ๋ชฉ๋ก ์กฐํšŒ API isMyself ๋ณ€์ˆ˜ ์ถ”๊ฐ€

๐Ÿ’ฌ๋ฆฌ๋ทฐ ์š”๊ตฌ์‚ฌํ•ญ

์—†์Œ

Summary by CodeRabbit

  • New Features

    • ํŒ”๋กœ์›Œ ๋ชฉ๋ก์—์„œ ์ž๊ธฐ ์ž์‹  ์ธ์‹: ๋‚ด ํ”„๋กœํ•„ ํด๋ฆญ ์‹œ ๋‚ด ํ”ผ๋“œ๋กœ ์ด๋™ํ•˜๊ณ , ์ž๊ธฐ์ž์‹ ์ด๋ฉด ํŒ”๋กœ์šฐ ๋ฒ„ํŠผ์„ ์ˆจ๊น๋‹ˆ๋‹ค.
    • ๊ฒŒ์‹œ๊ธ€ ์ €์žฅ ํ† ๊ธ€ ์—ฐ๋™: ์ €์žฅ/ํ•ด์ œ ์‹œ ์ƒ์œ„๋กœ ๋ณ€๊ฒฝ์„ ํ†ต์ง€ํ•ด ์ €์žฅ ๋ชฉ๋ก์— ์ฆ‰์‹œ ๋ฐ˜์˜๋ฉ๋‹ˆ๋‹ค.
    • ์ €์žฅ ํŽ˜์ด์ง€ ์ดˆ๊ธฐ ๋กœ๋”ฉ ๊ฐœ์„ : ์ €์žฅ๋œ ํ”ผ๋“œ์™€ ๋„์„œ๋ฅผ ๋ณ‘๋ ฌ๋กœ ๋ถˆ๋Ÿฌ์˜ค๊ณ  ์ „์ฒด ๋กœ๋”ฉ ์Šคํ”ผ๋„ˆ๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
    • ํฌ์ŠคํŠธ ํด๋ฆญ ๋™์ž‘ ๊ฐœ์„ : ๊ฒŒ์‹œ๊ธ€ ์˜์—ญ ํด๋ฆญ ์‹œ ํ”ผ๋“œ๋ฅผ ์ƒˆ ํƒญ์œผ๋กœ ์—ด๊ณ  ๋„์„œ ์˜์—ญ ํด๋ฆญ์€ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค.
  • Style

    • ๋กœ๋”ฉ ์Šคํ”ผ๋„ˆ ์ปจํ…Œ์ด๋„ˆ์— ๊ฐ€๋กœ ํญ ์ œํ•œ(์ตœ๋Œ€/์ตœ์†Œ)๊ณผ ์ค‘์•™ ์ •๋ ฌ ์ ์šฉ.
    • ๊ทธ๋ฃน ๋ชจ๋‹ฌ ์˜ค๋ฒ„๋ ˆ์ด๋ฅผ ํ™”๋ฉด ์ค‘์•™์— ์ •๋ ฌํ•˜๊ณ  ๋ฐ˜์‘ํ˜• ํญ ์ œํ•œ ์ถ”๊ฐ€.
  • UX

    • ๊ฒ€์ƒ‰/๋„์„œ ๋กœ๋”ฉ ์‹œ ๋” ํฐ ๋กœ๋”ฉ ์Šคํ”ผ๋„ˆ์™€ ์‚ฌ์šฉ์ž ๋ฉ”์‹œ์ง€ ํ‘œ์‹œ.

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 20, 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 20, 2025 0:09am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 20, 2025

Walkthrough

๋กœ๋”ฉ ์Šคํ”ผ๋„ˆ์™€ ๋ชจ๋‹ฌ ์˜ค๋ฒ„๋ ˆ์ด์— ๊ฐ€๋กœ ํญ ์ œํ•œ ๋ฐ ์ค‘์•™ ์ •๋ ฌ์„ ๋„์ž…ํ–ˆ๊ณ , UserProfileItem์— isMyself๋ฅผ ์ถ”๊ฐ€ํ•ด ํด๋ฆญ ๋ผ์šฐํŒ…๊ณผ ํŒ”๋กœ์šฐ ๋ฒ„ํŠผ ๋…ธ์ถœ์„ ๋ถ„๊ธฐํ–ˆ์Šต๋‹ˆ๋‹ค. Post ์ €์žฅ ํ† ๊ธ€์ด ๋ถ€๋ชจ๋กœ ์ „ํŒŒ๋˜๋„๋ก onSaveToggle์„ ์ถ”๊ฐ€ํ•˜๊ณ  SavePage์— ์ดˆ๊ธฐ ๋กœ๋“œ ๋ฐ saved books ๊ด€๋ฆฌ๋ฅผ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.

Changes

Cohort / File(s) Change Summary
๋กœ๋”ฉ UI ์ •๋ ฌ/์‚ฌ์ด์ฆˆ ์กฐ์ •
src/components/common/LoadingSpinner.tsx, src/pages/searchBook/SearchBook.tsx
LoadingSpinner ์ปจํ…Œ์ด๋„ˆ์— ๊ฐ€๋กœ ํญ ์ œ์•ฝ(width:100%, min-width:320px, max-width:767px)๊ณผ ์ค‘์•™ ์ •๋ ฌ(margin:0 auto) ์ถ”๊ฐ€. SearchBook์˜ ๋กœ๋”ฉ ๋ถ„๊ธฐ์—์„œ <LoadingSpinner fullHeight size="large" message="์ฑ… ์ •๋ณด ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ค‘..." />๋กœ ์‚ฌ์ด์ฆˆ/๋ฉ”์‹œ์ง€ ์ „๋‹ฌ ์ถ”๊ฐ€.
ํ”„๋กœํ•„ ์•„์ดํ…œ ์ž๊ธฐ์—ฌ๋ถ€ ๋ถ„๊ธฐ ๋„์ž…
src/components/feed/UserProfileItem.tsx, src/pages/feed/FollowerListPage.tsx, src/types/follow.ts, src/types/user.ts
UserProfileItem์— isMyself?: boolean prop ์ถ”๊ฐ€ ๋ฐ FollowerListPage์—์„œ ์ „๋‹ฌ. ํด๋ฆญ ์‹œ isMyself์— ๋”ฐ๋ผ /myfeed/{userId} ๋˜๋Š” /otherfeed/{userId}๋กœ ๋„ค๋น„๊ฒŒ์ดํŠธ. followlist ๋ชจ๋“œ์—์„œ ์ž๊ธฐ ์ž์‹ ์ด๋ฉด ํŒ”๋กœ์šฐ ๋ฒ„ํŠผ ์ˆจ๊น€. ํƒ€์ž…์— isMyself ํ•„๋“œ ์ถ”๊ฐ€.
๋ชจ๋‹ฌ ์˜ค๋ฒ„๋ ˆ์ด ๋ ˆ์ด์•„์›ƒ ์กฐ์ •
src/components/group/Modal.styles.ts
Overlay์˜ ๊ต์ฐจ์ถ• ์ •๋ ฌ์„ center๋กœ ๋ณ€๊ฒฝํ•˜๊ณ , ์ˆ˜ํ‰ ์ค‘์•™ ๋ฐฐ์น˜(left:50% + transform)์™€ ํญ ์ œ์•ฝ(min-width/max-width)์„ ์ถ”๊ฐ€ํ•ด ์ค‘์•™์— ์ •๋ ฌ๋œ, ํญ ์ œํ•œ๋œ ์˜ค๋ฒ„๋ ˆ์ด๋กœ ๋™์ž‘ํ•˜๋„๋ก ์ˆ˜์ •.
์ €์žฅ ํ† ๊ธ€ ์ฝœ๋ฐฑ ๋ฐ SavePage ์ดˆ๊ธฐ ๋กœ๋”ฉ
src/components/common/Post/PostFooter.tsx, src/components/feed/FeedPost.tsx, src/pages/mypage/SavePage.tsx, src/types/post.ts
PostFooter์— onSaveToggle?: (feedId, newSaveState) => void ์ถ”๊ฐ€ ๋ฐ ์ €์žฅ ์„ฑ๊ณต ์‹œ ๋ถ€๋ชจ์— ํ˜ธ์ถœ. FeedPost์— onSaveToggle ์ „๋‹ฌ. SavePage์— saved books ๋กœ๋” ์ถ”๊ฐ€, saved feeds/books ๋™์‹œ ์ดˆ๊ธฐ ๋กœ๋“œ(Promise.all), ์ดˆ๊ธฐ ๋กœ๋”ฉ ์Šคํ”ผ๋„ˆ ๋„์ž…. ์–ธ์„ธ์ด๋ธŒ ์‹œ savedBooks ์žฌ๋กœ๋”ฉ ๋ฐ savedFeeds์—์„œ ์ œ๊ฑฐ ์ฒ˜๋ฆฌ ๊ตฌํ˜„. BookList max-width ํ™•์žฅ.
ํฌ์ŠคํŠธ ๋ฐ”๋”” ํด๋ฆญ ํ•ธ๋“ค๋ง ์ด๋™
src/components/common/Post/PostBody.tsx
ํด๋ฆญ ํ•ธ๋“ค๋Ÿฌ๋ฅผ PostContent์—์„œ ์™ธ๋ถ€ Container๋กœ ์ด๋™ํ•ด ์ปจํ…Œ์ด๋„ˆ ํด๋ฆญ์œผ๋กœ ํ”ผ๋“œ ์ƒˆํƒญ ์—ด๊ธฐ ์ ์šฉ. BookInfoCard ํด๋ฆญ์€ stopPropagation์œผ๋กœ ๋ฐฉ์ง€. Cursor ์Šคํƒ€์ผ ์ถ”๊ฐ€.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as ์‚ฌ์šฉ์ž
  participant I as UserProfileItem
  participant R as Router

  U->>I: ํ”„๋กœํ•„ ํด๋ฆญ
  alt isMyself == true
    I->>R: navigate("/myfeed/{userId}")
  else isMyself == false
    I->>R: navigate("/otherfeed/{userId}")
  end
Loading
sequenceDiagram
  autonumber
  actor U as ์‚ฌ์šฉ์ž
  participant P as SearchBook ํŽ˜์ด์ง€
  participant S as LoadingSpinner

  U->>P: ํŽ˜์ด์ง€ ์ง„์ž… / ๊ฒ€์ƒ‰
  P->>P: isLoading = true
  P->>S: render(fullHeight=true, size="large", message="์ฑ… ์ •๋ณด ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ค‘...")
  note right of S: ์ค‘์•™ ์ •๋ ฌ ๋ฐ ํญ ์ œ์•ฝ ํฌํ•จ๋œ\nํ”„๋ ˆ์  ํ…Œ์ด์…˜ ๋ณ€๊ฒฝ
Loading
sequenceDiagram
  autonumber
  actor U as ์‚ฌ์šฉ์ž
  participant PF as PostFooter
  participant SP as SavePage
  participant API as ์„œ๋ฒ„

  U->>PF: ์ €์žฅ(ํ† ๊ธ€) ํด๋ฆญ
  PF->>API: save/unsave ์š”์ฒญ
  API-->>PF: ์‘๋‹ต (isSaved)
  PF->>PF: saved ์ƒํƒœ ๊ฐฑ์‹ 
  PF->>SP: onSaveToggle(feedId, newSaveState) [์„ ํƒ์  ์ฝœ๋ฐฑ]
  alt newSaveState == false
    SP->>SP: savedFeeds์—์„œ ํ•ญ๋ชฉ ์ œ๊ฑฐ / savedBooks ์žฌ๋กœ๋”ฉ ๊ฐ€๋Šฅ
  else newSaveState == true
    SP->>SP: ๋กœ์ปฌ ์ƒํƒœ์— ์ถ”๊ฐ€
  end
Loading

Estimated code review effort

๐ŸŽฏ 3 (Moderate) | โฑ๏ธ ~25 minutes

Possibly related PRs

Suggested labels

โœจ Feature, ๐ŸŽจ Html&css

Suggested reviewers

  • 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.


๐Ÿ“œ Recent 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 e3a5ccf and ae2f98a.

๐Ÿ“’ Files selected for processing (1)
  • src/pages/feed/FollowerListPage.tsx (2 hunks)
๐Ÿšง Files skipped from review as they are similar to previous changes (1)
  • src/pages/feed/FollowerListPage.tsx
โœจ 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 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.

@heeeeyong heeeeyong self-assigned this Aug 20, 2025
@heeeeyong heeeeyong added the ๐Ÿž BugFix Something isn't working label Aug 20, 2025
Copy link
Copy Markdown

@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: 1

๐Ÿงน Nitpick comments (7)
src/types/follow.ts (1)

9-9: isMyself ํ•„๋“œ ๋งคํ•‘ ๊ฒ€์ฆ ๋ฐ ํƒ€์ž… ์ˆ˜์ • ์ œ์•ˆ

API ํ˜ธ์ถœ๋ถ€์—์„œ response.data.followers/followings๋ฅผ ๊ทธ๋Œ€๋กœ FollowData[]๋กœ ์‚ฌ์šฉํ•˜๋ฉฐ, ๋ณ„๋„ ๋งคํ•‘์ด๋‚˜ ๊ธฐ๋ณธ๊ฐ’ ํ• ๋‹น ์—†์ด
isMyself={user.isMyself} ํ˜•ํƒœ๋กœ ๋„˜๊ธฐ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
์ด ๊ฒฝ์šฐ ๋ฐฑ์—”๋“œ๊ฐ€ isMyself๋ฅผ ๋ˆ„๋ฝํ•˜๋ฉด undefined๊ฐ€ false๋กœ ๊ฐ„์ฃผ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ฒ€ํ†  ๋ฐ ์ œ์•ˆ:

  • src/types/follow.ts
    โ€ข isMyself๊ฐ€ ํ•ญ์ƒ ๋ฐ˜ํ™˜๋œ๋‹ค๋ฉด optional(?)์„ ์ œ๊ฑฐํ•˜์—ฌ required๋กœ ๋ณ€๊ฒฝ
  • src/pages/feed/FollowerListPage.tsx (๋˜๋Š” API ๋ ˆ์ด์–ด)
    โ€ข ๋งคํ•‘ ์‹œ ๊ธฐ๋ณธ๊ฐ’ ํ• ๋‹น:
    const userData = (response.data as { followers: FollowData[] }).followers.map(f => ({
      ...f,
      isMyself: f.isMyself ?? false,
    }));
    โ€ข ๋˜๋Š” ์ปดํฌ๋„ŒํŠธ์— ์ „๋‹ฌํ•˜๊ธฐ ์ „ ๊ฐ€๋“œ ์ถ”๊ฐ€

์œ„ ๋ฐฉ์•ˆ ์ค‘ ์ ์ ˆํ•œ ๋ฐฉํ–ฅ์œผ๋กœ ๋ฐ˜์˜ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

src/components/common/LoadingSpinner.tsx (2)

27-31: fullHeight์ผ ๋•Œ ๋ฐฐ๊ฒฝ์ด ์–‘์˜†์œผ๋กœ โ€˜๋ ˆํ„ฐ๋ฐ•์Šคโ€™์ฒ˜๋Ÿผ ๋น„์–ด ๋ณด์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. fullHeight ์‹œ์—๋Š” ๊ฐ€๋กœ๋„ ๋ทฐํฌํŠธ ์ „์ฒด๋ฅผ ๋ฎ๋Š” ๊ฒŒ ์•ˆ์ „ํ•ฉ๋‹ˆ๋‹ค.

ํ˜„์žฌ ์ปจํ…Œ์ด๋„ˆ์— max/min-width์™€ ๊ฐ€์šด๋ฐ ์ •๋ ฌ์ด ํ•ญ์ƒ ์ ์šฉ๋˜๊ธฐ ๋•Œ๋ฌธ์—, fullHeight=true๋กœ ์ „์ฒด ํ™”๋ฉด ๋กœ๋”ฉ์„ ์˜๋„ํ•œ ๊ฒฝ์šฐ์—๋„ ๊ฐ€๋กœ๋Š” 767px๋งŒ ์น ํ•ด์ง€๊ณ  ์–‘์˜†์ด ๋น„์–ด ๋ณด์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค(ํŠนํžˆ ๋ฐ์Šคํฌํ†ฑ ํญ์—์„œ ๋” ๋‘๋“œ๋Ÿฌ์ง). fullHeight์ผ ๋•Œ๋งŒ width: 100vw๋กœ ์ „ํ™˜ํ•˜๋„๋ก ์กฐ๊ฑด๋ถ€ ์Šคํƒ€์ผ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •ํ•˜๋ฉด ์˜๋„์— ๋งž๊ฒŒ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.

-  width: 100%;
-  max-width: 767px;
-  min-width: 320px;
-  margin: 0 auto;
-  justify-content: center;
+  ${({ fullHeight }) =>
+    fullHeight
+      ? `
+    width: 100vw;
+    margin: 0;
+  `
+      : `
+    width: 100%;
+    max-width: 767px;
+    min-width: 320px;
+    margin: 0 auto;
+  `}
+  justify-content: center;

27-30: ๋งค์ง ๋„˜๋ฒ„(767, 320) ๋ฐ˜๋ณต ์‚ฌ์šฉ ์ตœ์†Œํ™” ์ œ์•ˆ

Modal.styles.ts ๋“ฑ ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ์—์„œ๋„ ๋™์ผํ•œ 767/320 ํญ ์ œ์•ฝ์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ํ…Œ๋งˆ(์˜ˆ: theme.breakpoints ๋˜๋Š” layout.containerMaxWidth)๋กœ ์ƒ์ˆ˜ํ™”ํ•ด ์ค‘๋ณต์„ ์ค„์ด๋ฉด ์œ ์ง€๋ณด์ˆ˜์„ฑ์ด ์˜ฌ๋ผ๊ฐ‘๋‹ˆ๋‹ค.

src/pages/feed/FollowerListPage.tsx (2)

138-139: isMyself ์ „๋‹ฌ ์ถ”๊ฐ€๋Š” ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋งŒ undefined ๋Œ€๋น„ ๋ช…์‹œ์  ๋ถˆ๋ฆฌ์–ธ ์บ์ŠคํŒ…์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

API๊ฐ€ isMyself๋ฅผ ์„ ํƒ์ ์œผ๋กœ ์ค„ ์ˆ˜ ์žˆ๋‹ค๋ฉด, ์˜๋„๋ฅผ ๋ช…ํ™•ํžˆ ํ•˜๊ธฐ ์œ„ํ•ด ๋ถˆ๋ฆฌ์–ธ ์บ์ŠคํŒ…์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค.

-            isMyself={user.isMyself}
+            isMyself={!!user.isMyself}

30-37: ๋ฌดํ•œ ์Šคํฌ๋กค์—์„œ ์ค‘๋ณต ์š”์ฒญ ๊ฐ€๋Šฅ์„ฑ: loadUserList์˜ loading ํด๋กœ์ €๊ฐ€ stale์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

useCallback์˜ deps์— loading์ด ์—†์–ด์„œ, ๋น ๋ฅด๊ฒŒ ์Šคํฌ๋กค๋  ๋•Œ ๋™์ผ ์ธ์Šคํ„ด์Šค์˜ loadUserList๊ฐ€ ์ด์ „ ๋ Œ๋”์˜ loading=false ์ƒํƒœ๋ฅผ ๊ณ„์† ์ฐธ์กฐํ•ด ์ค‘๋ณต ํ˜ธ์ถœ์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. in-flight ref ๊ฐ€๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ์‹์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

์ ์šฉ diff(์„ ํƒ๋œ ๋ฒ”์œ„ ๋‚ด ๋ณ€๊ฒฝ):

   const loadUserList = useCallback(
     async (cursor?: string) => {
-      if (loading) return;
+      if (loading || isFetchingRef.current) return;
 
       try {
         setLoading(true);
+        isFetchingRef.current = true;
         setError(null);
         let response;
@@
       } finally {
-        setLoading(false);
+        setLoading(false);
+        isFetchingRef.current = false;
       }
     },
     [type, userId],
   );

๋ฒ”์œ„ ๋ฐ– ์ถ”๊ฐ€ ์ฝ”๋“œ(์ฐธ๊ณ ):

// ์ƒ๋‹จ import์— useRef ์ถ”๊ฐ€
// import { useState, useEffect, useCallback, useRef } from 'react';

// ์ƒํƒœ ์„ ์–ธ ๊ทผ์ฒ˜์— ์ถ”๊ฐ€
const isFetchingRef = useRef(false);

Also applies to: 87-89

src/components/feed/UserProfileItem.tsx (2)

70-74: isMyself๊ฐ€ undefined์ผ ๋•Œ๋„ ๋ช…ํ™•ํžˆ ์ฒ˜๋ฆฌ๋˜๋„๋ก ๋ถˆ๋ฆฌ์–ธ ์บ์ŠคํŒ…์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

ํ˜„์žฌ๋„ ๋™์ž‘์—๋Š” ๋ฌธ์ œ ์—†์ง€๋งŒ, ์˜๋„๋ฅผ ์ฝ”๋“œ์— ๋“œ๋Ÿฌ๋‚ด๋Š” ์ธก๋ฉด์—์„œ ์„ ํ˜ธ๋ฉ๋‹ˆ๋‹ค.

-        {type === 'followlist' && !isMyself && (
+        {type === 'followlist' && !Boolean(isMyself) && (
           <div className="followbutton" onClick={toggleFollow}>
             {followed ? '๋ฑ ์ทจ์†Œ' : '๋ฑ ํ•˜๊ธฐ'}
           </div>
         )}

34-56: ํŒ”๋กœ์šฐ ํ† ๊ธ€ ์ค‘๋ณต ํด๋ฆญ ๋ฐฉ์ง€(UX ์•ˆ์ •ํ™”) ์ œ์•ˆ

์—ฐ์† ํด๋ฆญ ์‹œ ์ค‘๋ณต ์š”์ฒญ์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•œ ๋กœ์ปฌ ๋กœ๋”ฉ ์ƒํƒœ๋กœ ๋ฐฉ์ง€ํ•˜๋ฉด UX์™€ ์•ˆ์ „์„ฑ์ด ๊ฐœ์„ ๋ฉ๋‹ˆ๋‹ค.

์„ ํƒ๋œ ๋ฒ”์œ„ ๋‚ด ๋ณ€๊ฒฝ:

   const toggleFollow = async (e: React.MouseEvent) => {
     e.stopPropagation();
 
-    try {
+    if (isToggling) return;
+    setIsToggling(true);
+    try {
       const response = await postFollow(userId, !followed);
@@
-    } catch (error) {
+    } catch (error) {
       console.error('ํŒ”๋กœ์šฐ/์–ธํŒ”๋กœ์šฐ ์‹คํŒจ:', error);
-    }
+    } finally {
+      setIsToggling(false);
+    }
   };
-          <div className="followbutton" onClick={toggleFollow}>
+          <div
+            className="followbutton"
+            onClick={toggleFollow}
+            aria-disabled={isToggling}
+            style={{ pointerEvents: isToggling ? 'none' : 'auto', opacity: isToggling ? 0.6 : 1 }}
+          >
             {followed ? '๋ฑ ์ทจ์†Œ' : '๋ฑ ํ•˜๊ธฐ'}
           </div>

๋ฒ”์œ„ ๋ฐ– ์ถ”๊ฐ€ ์ฝ”๋“œ(์ฐธ๊ณ ):

// ์ƒํƒœ ์„ ์–ธ๋ถ€ ๊ทผ์ฒ˜์— ์ถ”๊ฐ€
const [isToggling, setIsToggling] = useState(false);

Also applies to: 71-73

๐Ÿ“œ 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 0e071c9 and fdc64e5.

๐Ÿ“’ Files selected for processing (7)
  • src/components/common/LoadingSpinner.tsx (1 hunks)
  • src/components/feed/UserProfileItem.tsx (2 hunks)
  • src/components/group/Modal.styles.ts (1 hunks)
  • src/pages/feed/FollowerListPage.tsx (1 hunks)
  • src/pages/searchBook/SearchBook.tsx (1 hunks)
  • src/types/follow.ts (1 hunks)
  • src/types/user.ts (1 hunks)
๐Ÿงฐ Additional context used
๐Ÿงฌ Code Graph Analysis (1)
src/components/feed/UserProfileItem.tsx (2)
src/types/user.ts (1)
  • UserProfileItemProps (3-14)
src/stores/usePopupStore.ts (1)
  • usePopupStore (67-73)
๐Ÿ”‡ Additional comments (4)
src/types/user.ts (1)

13-13: UserProfileItemProps: isMyself ๊ณ„์•ฝ ๋ฐ ๊ธฐ๋ณธ๊ฐ’ ์ฒ˜๋ฆฌ ํ™•์ธ ํ•„์š”

  • ๊ธฐํš ํ™•์ธ
    followlist ๋ชจ๋“œ์—์„œ๋Š” !isMyself ์ฒดํฌ๋กœ ํŒ”๋กœ์šฐ ๋ฒ„ํŠผ์„ ์ˆจ๊ธฐ๊ณ  ์žˆ์ง€๋งŒ, followerlist ๋ชจ๋“œ์—๋Š” ๋ณ„๋„ ์ •์ฑ…์ด ์—†์Šต๋‹ˆ๋‹ค.
    โ†’ ๊ธฐํš์ƒ followerlist์—์„œ๋„ ์ž๊ธฐ ์ž์‹ ์ธ ๊ฒฝ์šฐ UI(ํ™”์‚ดํ‘œ ํด๋ฆญยท์ˆ˜์น˜ ๋…ธ์ถœ ๋“ฑ)์— ์ œํ•œ์ด ํ•„์š”ํ•œ์ง€ ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.
  • boolean ๋ณด์žฅ
    isMyself?: boolean์ด๋ฏ€๋กœ undefined๊ฐ€ ๋“ค์–ด์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    โ†’ UserProfileItem ์ปดํฌ๋„ŒํŠธ props ๋””์ŠคํŠธ๋Ÿญ์ฒ˜๋ง ์‹œ isMyself = false ๋””ํดํŠธ ํ• ๋‹น ๋˜๋Š” ๋ถ„๊ธฐ ์‹œ !!isMyself ๋ณ€ํ™˜์œผ๋กœ ํ•ญ์ƒ boolean์ด ๋˜๋„๋ก ์ฒ˜๋ฆฌํ•ด์ฃผ์„ธ์š”.

[src/components/feed/UserProfileItem.tsx ๋ผ์ธ 20โ€“21]:

// ๋ณ€๊ฒฝ ์ „
({ userId, isLast, type, isMyself }: UserProfileItemProps)

// ๋ณ€๊ฒฝ ์˜ˆ์‹œ
({ userId, isLast, type, isMyself = false }: UserProfileItemProps)
src/pages/searchBook/SearchBook.tsx (1)

241-241: ๋กœ๋”ฉ UX ๊ฐœ์„  LGTM

์‚ฌ์ด์ฆˆ๋ฅผ ํ‚ค์šฐ๊ณ  ๋ฉ”์‹œ์ง€๋ฅผ ์ถ”๊ฐ€ํ•ด ํ”ผ๋“œ๋ฐฑ์ด ๋ช…ํ™•ํ•ด์กŒ์Šต๋‹ˆ๋‹ค. ์ปดํฌ๋„ŒํŠธ ๋ณ€๊ฒฝ ์—†์ด ์†Œ๋น„ ์ธก์—์„œ๋งŒ ๊ฐœ์„ ํ•œ ์ ๋„ ์ข‹์Šต๋‹ˆ๋‹ค.

src/pages/feed/FollowerListPage.tsx (1)

52-58: isMyself ํ•„๋“œ ํด๋ผ์ด์–ธํŠธ ๋งคํ•‘/API ์ œ๊ณต ์—ฌ๋ถ€ ํ™•์ธ ํ•„์š”

ํ˜„์žฌ getFollowerList/getFollowingList ์‘๋‹ต์„ ๊ทธ๋Œ€๋กœ FollowData[]๋กœ ์‚ฌ์šฉํ•˜๋ฉฐ, ํด๋ผ์ด์–ธํŠธ์—์„œ isMyself๋ฅผ ๋ณ„๋„ ํ• ๋‹นํ•˜๋Š” ๋กœ์ง์ด ์—†์Šต๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ:

  • ํŒ”๋กœ์›Œ ๋ชฉ๋ก์—์„œ ๋ณธ์ธ ํด๋ฆญ ์‹œ /otherfeed๋กœ ์ž˜๋ชป ๋ผ์šฐํŒ…
  • (ํ–ฅํ›„) ๋‹ค๋ฅธ ์œ ์ €์˜ ํŒ”๋กœ์ž‰ ์กฐํšŒ ์‹œ ๋ณธ์ธ ์—ฌ๋ถ€์— ๋”ฐ๋ฅธ ๋ฒ„ํŠผ ์ˆจ๊น€ ๋ถ„๊ธฐ ์˜ค๋ฅ˜

๋‹ค์Œ ๋ถ€๋ถ„์„ ํ™•์ธํ•ด์ฃผ์„ธ์š”:

  • src/api/users/getFollowerList.ts, getFollowingList.ts: ์„œ๋ฒ„๊ฐ€ ๊ฐ FollowData ํ•ญ๋ชฉ์— isMyself ํ•„๋“œ๋ฅผ ๋‚ด๋ ค์ฃผ๋Š”์ง€
  • src/pages/feed/FollowerListPage.tsx: ์„œ๋ฒ„ ์‘๋‹ต์„ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉ ์ค‘์ด๋ฏ€๋กœ, ๋ˆ„๋ฝ ์‹œ userId === currentUser.id ๊ธฐ๋ฐ˜์œผ๋กœ isMyself๋ฅผ ํ• ๋‹นํ•˜๋Š” ๋กœ์ง ์ถ”๊ฐ€ ๊ฒ€ํ† 
src/components/feed/UserProfileItem.tsx (1)

27-31: ๋ผ์šฐํ„ฐ ์ •์˜ ๊ฒ€์ฆ ์™„๋ฃŒ: /myfeed/:userId ๋ฐ /otherfeed/:userId ์ง€์›๋จ
์•„๋ž˜ ๊ฒฝ๋กœ๊ฐ€ src/pages/index.tsx์— ์ •์˜๋˜์–ด ์žˆ์–ด, navigate(/myfeed/${userId}) ํ˜ธ์ถœ์€ ์œ ํšจํ•ฉ๋‹ˆ๋‹ค. ๋ถ„๊ธฐ ๋กœ์ง์„ ๊ทธ๋Œ€๋กœ ์œ ์ง€ํ•ด ์ฃผ์„ธ์š”.

  • src/pages/index.tsx:73 โ€“ <Route path="otherfeed/:userId" element={<OtherFeedPage />} />
  • src/pages/index.tsx:74 โ€“ <Route path="myfeed/:userId" element={<MyFeedPage />} />

Comment on lines +7 to 15
align-items: center;
position: fixed;
top: 0;
left: 0;
width: 100vw;
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: 767px;
min-width: 320px;
height: 100vh;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

โš ๏ธ Potential issue

Overlay๊ฐ€ ์ „์ฒด ๊ฐ€๋กœํญ์„ ๋ฎ์ง€ ์•Š์•„ ๋ฐฐ๊ฒฝ ํด๋ฆญ/์Šคํฌ๋กค์ด โ€˜์˜†์œผ๋กœโ€™ ์ƒˆ๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ˜„์žฌ Overlay์— max/min-width์™€ ๊ฐ€์šด๋ฐ ์ •๋ ฌ์ด ์ ์šฉ๋˜์–ด, ํฐ ํ™”๋ฉด์—์„œ Overlay๊ฐ€ ๋ทฐํฌํŠธ ์ „์ฒด๋ฅผ ๋ฎ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ:

  • ์ขŒ์šฐ ์—ฌ๋ฐฑ ์˜์—ญ์ด Overlay ๋ฐ–์œผ๋กœ ๋‚จ์•„, ๋ฐฐ๊ฒฝ ํด๋ฆญ์ด ํ†ต๊ณผ๋˜๊ฑฐ๋‚˜ ์Šคํฌ๋กค ๋ฝ์ด ์™„์ „ํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ผ๋ฐ˜์ ์œผ๋กœ๋Š” Overlay๊ฐ€ ๋ทฐํฌํŠธ ์ „์ฒด๋ฅผ ๋ฎ๊ณ , ์•ˆ์ชฝ Modal๋งŒ max-width๋กœ ์„ผํ„ฐ๋งํ•˜๋Š” ํŒจํ„ด์ด ์•ˆ์ „ํ•ฉ๋‹ˆ๋‹ค.

Overlay๋Š” 100vw/100vh๋กœ ์ „์ฒด๋ฅผ ๋ฎ๊ณ , Modal์—๋งŒ max-width๋ฅผ ๋‘๋Š” ํ˜•ํƒœ๋กœ ๋˜๋Œ๋ฆฌ๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ ๋ณ€๊ฒฝ์œผ๋กœ ๋ฌธ์ œ๋ฅผ ํ•ด์†Œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

   align-items: center;
   position: fixed;
   top: 0;
-  left: 50%;
-  transform: translateX(-50%);
-  width: 100%;
-  max-width: 767px;
-  min-width: 320px;
+  left: 0;
+  width: 100vw;
   height: 100vh;

์ฐธ๊ณ :

  • ์ด๋ฏธ Modal ์ž์ฒด์— width: 100%; max-width: 767px;๊ฐ€ ์žˆ์–ด, Overlay๋ฅผ ์ „์ฒดํ™”๋ฉด์œผ๋กœ ์œ ์ง€ํ•ด๋„ ์ฝ˜ํ…์ธ ๋Š” ๋™์ผํ•˜๊ฒŒ ๊ฐ€์šด๋ฐ ์ •๋ ฌ๋ฉ๋‹ˆ๋‹ค(Overlay์˜ flex ์ •๋ ฌ์— ์˜ํ•ด ์ˆ˜ํ‰ยท์ˆ˜์ง ์„ผํ„ฐ๋ง).
๐Ÿค– Prompt for AI Agents
In src/components/group/Modal.styles.ts around lines 7 to 15, the Overlay
currently uses fixed positioning with left: 50%, translateX(-50%) and
width/max-width/min-width which prevents it from covering the full viewport;
change the Overlay to span the full viewport (e.g., width: 100vw; height: 100vh;
left: 0; top: 0) and remove the centering width constraints from the Overlay,
keeping max-width/width only on the inner Modal so the Overlay covers the entire
screen while the Modal remains centered and constrained.

Copy link
Copy Markdown

@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/common/Post/PostFooter.tsx (1)

112-115: ๋ณด์•ˆ: window.open ์‚ฌ์šฉ ์‹œ reverse tabnabbing ์ทจ์•ฝ์ 

์ƒˆ ํƒญ์„ ์—ด ๋•Œ opener ์—ฐ๊ฒฐ์ด ์œ ์ง€๋˜์–ด ๋ณด์•ˆ ์ด์Šˆ๊ฐ€ ์ƒ๊ธธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. noopener/noreferrer๋ฅผ ์ง€์ •ํ•˜๊ณ  opener๋ฅผ ๋ช…์‹œ์ ์œผ๋กœ ๋Š์–ด์ฃผ์„ธ์š”.

 const handleComment = () => {
   if (isDetail) return;
-  window.open(`/feed/${feedId}`, '_blank');
+  const newWindow = window.open(`/feed/${feedId}`, '_blank', 'noopener,noreferrer');
+  if (newWindow) newWindow.opener = null;
 };
๐Ÿงน Nitpick comments (7)
src/components/common/Post/PostFooter.tsx (3)

73-88: ์ข‹์•„์š” ๋‹ค์ค‘ ํด๋ฆญ ๋ ˆ์ด์Šค์ปจ๋””์…˜ ๋ฐฉ์ง€ ๊ฐ€๋“œ ์ถ”๊ฐ€ ๊ถŒ์žฅ

์—ฐ์† ํด๋ฆญ ์‹œ ๋™์ผํ•œ ์ด์ „ ์ƒํƒœ(saved/liked)๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์—ฌ๋Ÿฌ ์š”์ฒญ์ด ๋‚˜๊ฐ€ ๊ฒฐ๊ณผ๊ฐ€ ๋’ค์—‰ํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. in-flight ๊ฐ€๋“œ๋กœ ์ค‘๋ณต ์š”์ฒญ์„ ๋ง‰์•„์ฃผ์„ธ์š”.

์•„๋ž˜์™€ ๊ฐ™์ด ๊ฐ€๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค.

 const handleLike = async () => {
+  if (liking) return;
+  setLiking(true);
   try {
     const response = await postFeedLike(feedId, !liked);

     if (response.isSuccess) {
       // ์„ฑ๊ณต ์‹œ ์ƒํƒœ ์—…๋ฐ์ดํŠธ
       setLiked(response.data.isLiked);
       setLikeCount(prev => (response.data.isLiked ? prev + 1 : prev - 1));
       console.log('์ข‹์•„์š” ์ƒํƒœ ๋ณ€๊ฒฝ ์„ฑ๊ณต:', response.data.isLiked);
     } else {
       console.error('์ข‹์•„์š” ์ƒํƒœ ๋ณ€๊ฒฝ ์‹คํŒจ:', response.message);
     }
   } catch (error) {
     console.error('์ข‹์•„์š” API ํ˜ธ์ถœ ์‹คํŒจ:', error);
+  } finally {
+    setLiking(false);
   }
 };

๊ทธ๋ฆฌ๊ณ  ์ƒํƒœ ์„ ์–ธ์„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”(์ปดํฌ๋„ŒํŠธ ์ƒ๋‹จ state ์„ ์–ธ๋ถ€ ์ธ์ ‘ ์œ„์น˜).

const [liking, setLiking] = useState(false);

90-110: ์ €์žฅ ํ† ๊ธ€ ์ค‘๋ณต ํด๋ฆญ/๋ ˆ์ด์Šค ์ปจ๋””์…˜ ๋ฐฉ์ง€

์ €์žฅ ์•„์ด์ฝ˜๋„ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ €์žฅ ์ค‘์—๋Š” ์ถ”๊ฐ€ ํด๋ฆญ์„ ๋ฌด์‹œํ•˜๋„๋ก in-flight ๊ฐ€๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜์„ธ์š”.

 const handleSave = async () => {
+  if (saving) return;
+  setSaving(true);
   try {
     const response = await postSaveFeed(feedId, !saved);

     if (response.isSuccess) {
       const newSaveState = response.data?.isSaved ?? !saved;
       // ์„ฑ๊ณต ์‹œ ์ƒํƒœ ์—…๋ฐ์ดํŠธ
       setSaved(newSaveState);
       console.log('์ €์žฅ ์ƒํƒœ ๋ณ€๊ฒฝ ์„ฑ๊ณต:', newSaveState);
       
       // ๋ถ€๋ชจ ์ปดํฌ๋„ŒํŠธ์— ์•Œ๋ฆผ
       if (onSaveToggle) {
         onSaveToggle(feedId, newSaveState);
       }
     } else {
       console.error('์ €์žฅ ์ƒํƒœ ๋ณ€๊ฒฝ ์‹คํŒจ:', response.message);
     }
   } catch (error) {
     console.error('์ €์žฅ API ํ˜ธ์ถœ ์‹คํŒจ:', error);
+  } finally {
+    setSaving(false);
   }
 };

์ƒํƒœ ์„ ์–ธ์„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”(์ปดํฌ๋„ŒํŠธ ์ƒ๋‹จ state ์„ ์–ธ๋ถ€ ์ธ์ ‘ ์œ„์น˜).

const [saving, setSaving] = useState(false);

121-127: ์ ‘๊ทผ์„ฑ: ์•„์ด์ฝ˜์— ์ ์ ˆํ•œ ๋Œ€์ฒด ํ…์ŠคํŠธ ์ถ”๊ฐ€ ๊ถŒ์žฅ

like/comment ์•„์ด์ฝ˜์— alt๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด ์Šคํฌ๋ฆฐ ๋ฆฌ๋” ํ˜ธํ™˜์„ฑ์ด ์ข‹์•„์ง‘๋‹ˆ๋‹ค.

-<img src={liked ? activeLike : like} onClick={handleLike} />
+<img
+  src={liked ? activeLike : like}
+  onClick={handleLike}
+  alt={liked ? '์ข‹์•„์š” ์ทจ์†Œ' : '์ข‹์•„์š”'}
+/>

-<img src={comment} onClick={handleComment} />
+<img src={comment} onClick={handleComment} alt="๋Œ“๊ธ€" />
src/pages/mypage/SavePage.tsx (4)

75-103: ์ดˆ๊ธฐ ๋ฐ์ดํ„ฐ ๋ณ‘๋ ฌ ๋กœ๋“œ OK โ€” ๊ณตํ†ต ๋กœ๋” ์žฌ์‚ฌ์šฉ์œผ๋กœ ์ค‘๋ณต ์ œ๊ฑฐ ๊ฐ€๋Šฅ

์ง€๊ธˆ๋„ ๋™์ž‘์—” ๋ฌธ์ œ ์—†์ง€๋งŒ, ์ด๋ฏธ ์ •์˜ํ•œ ๋กœ๋”(loadSavedFeeds, loadSavedBooks)๋ฅผ ์žฌ์‚ฌ์šฉํ•˜๋ฉด ์ฝ”๋“œ๊ฐ€ ๋” ๊ฐ„๊ฒฐํ•ด์ง‘๋‹ˆ๋‹ค. ์ดˆ๊ธฐ ๋กœ๋”ฉ ์Šคํ”ผ๋„ˆ๋Š” initialLoading์œผ๋กœ ์ปค๋ฒ„๋˜๋ฏ€๋กœ feedLoading์„ ๊ตณ์ด ๊ฑด๋“œ๋ฆฌ์ง€ ์•Š์•„๋„ ๋ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

 useEffect(() => {
   const loadAllData = async () => {
     try {
       setInitialLoading(true);
-      // ๋‘ API๋ฅผ ๋ณ‘๋ ฌ๋กœ ํ˜ธ์ถœ
-      const [feedsResponse, booksResponse] = await Promise.all([
-        getSavedFeedsInMy(null),
-        getSavedBooksInMy(),
-      ]);
-
-      // ํ”ผ๋“œ ๋ฐ์ดํ„ฐ ์„ค์ •
-      setSavedFeeds(feedsResponse.data.feedList);
-      setFeedNextCursor(feedsResponse.data.nextCursor);
-      setFeedIsLast(feedsResponse.data.isLast);
-
-      // ์ฑ… ๋ฐ์ดํ„ฐ ์„ค์ •
-      setSavedBooks(booksResponse.data.bookList);
+      await Promise.all([loadSavedFeeds(null), loadSavedBooks()]);
     } catch (error) {
       console.error('์ดˆ๊ธฐ ๋ฐ์ดํ„ฐ ๋กœ๋“œ ์‹คํŒจ:', error);
     } finally {
       setInitialLoading(false);
     }
   };

   loadAllData();
 }, []);

128-150: ํ•จ์ˆ˜๋ช… ๋ช…ํ™•ํ™” ์ œ์•ˆ: handleSaveToggle โ†’ handleBookSaveToggle

๋™์ผ ํŒŒ์ผ์— ํ”ผ๋“œ์šฉ handleFeedSaveToggle์ด ์žˆ์–ด ํ˜ผ๋™ ์—ฌ์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฑ…/ํ”ผ๋“œ ๊ตฌ๋ถ„์ด ๋“œ๋Ÿฌ๋‚˜๋„๋ก ์ด๋ฆ„์„ ๋ฐ”๊พธ๋ฉด ๊ฐ€๋…์„ฑ์ด ์ข‹์•„์ง‘๋‹ˆ๋‹ค.

-const handleSaveToggle = async (isbn: string) => {
+const handleBookSaveToggle = async (isbn: string) => {
   try {
     const currentBook = savedBooks.find(book => book.isbn === isbn);
     if (!currentBook) return;

     const newSaveState = !currentBook.isSaved;
     await postSaveBook(isbn, newSaveState);

     // ์ €์žฅ ์ทจ์†Œ์ธ ๊ฒฝ์šฐ ์ €์žฅ๋œ ์ฑ… ๋ชฉ๋ก์„ ๋‹ค์‹œ ๋ถˆ๋Ÿฌ์˜ด
     if (!newSaveState) {
       await loadSavedBooks();
     } else {
       // ์ €์žฅ์ธ ๊ฒฝ์šฐ ๋กœ์ปฌ ์ƒํƒœ๋งŒ ์—…๋ฐ์ดํŠธ
       setSavedBooks(prev =>
         prev.map(book => (book.isbn === isbn ? { ...book, isSaved: newSaveState } : book)),
       );
     }

     console.log('์ €์žฅ ํ† ๊ธ€:', isbn, newSaveState);
   } catch (error) {
     console.error('์ €์žฅ ํ† ๊ธ€ ์‹คํŒจ:', error);
   }
 };

์•„๋ž˜ ํ˜ธ์ถœ๋ถ€๋„ ํ•จ๊ป˜ ๋ณ€๊ฒฝํ•ด์ฃผ์„ธ์š”(์ฐธ๊ณ  ์ฝ”๋“œ):

<SaveIcon onClick={() => handleBookSaveToggle(book.isbn)}>

152-164: ๋ถˆํ•„์š”ํ•œ async/try-catch ์ œ๊ฑฐ + useCallback์œผ๋กœ ๋ฉ”๋ชจ์ด์ฆˆ

๋น„๋™๊ธฐ ๋กœ์ง์ด ์—†์œผ๋ฏ€๋กœ async/try-catch๋Š” ๋ถˆํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. useCallback์œผ๋กœ ๋ž˜ํ•‘ํ•˜๋ฉด ์ž์‹(FeedPost)๋กœ ๋‚ด๋ ค๊ฐˆ ๋•Œ ํ•จ์ˆ˜ ์•„์ด๋ดํ‹ฐํ‹ฐ๊ฐ€ ์•ˆ์ •๋ผ ์˜๋ฏธ ์—†๋Š” ๋ฆฌ๋ Œ๋”๊ฐ€ ์ค„์–ด๋“ญ๋‹ˆ๋‹ค.

-const handleFeedSaveToggle = async (feedId: number, newSaveState: boolean) => {
-  try {
-    if (!newSaveState) {
-      // ์ €์žฅ ์ทจ์†Œ์ธ ๊ฒฝ์šฐ ๋ฆฌ์ŠคํŠธ์—์„œ ์ œ๊ฑฐ
-      setSavedFeeds(prev => prev.filter(feed => feed.feedId !== feedId));
-      console.log('ํ”ผ๋“œ ์ €์žฅ ์ทจ์†Œ ์™„๋ฃŒ:', feedId);
-    }
-  } catch (error) {
-    console.error('ํ”ผ๋“œ ์ €์žฅ ์ƒํƒœ ๋ณ€๊ฒฝ ์‹คํŒจ:', error);
-  }
-};
+const handleFeedSaveToggle = useCallback((feedId: number, newSaveState: boolean) => {
+  if (!newSaveState) {
+    // ์ €์žฅ ์ทจ์†Œ์ธ ๊ฒฝ์šฐ ๋ฆฌ์ŠคํŠธ์—์„œ ์ œ๊ฑฐ
+    setSavedFeeds(prev => prev.filter(feed => feed.feedId !== feedId));
+    console.log('ํ”ผ๋“œ ์ €์žฅ ์ทจ์†Œ ์™„๋ฃŒ:', feedId);
+  }
+}, []);

291-297: ์ค‘๋ณต ์Šคํƒ€์ผ ์ œ๊ฑฐ: width: 100%๊ฐ€ ๋‘ ๋ฒˆ ์„ ์–ธ๋จ

BookList์—์„œ 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 fdc64e5 and 489aa46.

๐Ÿ“’ Files selected for processing (4)
  • src/components/common/Post/PostFooter.tsx (3 hunks)
  • src/components/feed/FeedPost.tsx (1 hunks)
  • src/pages/mypage/SavePage.tsx (7 hunks)
  • src/types/post.ts (1 hunks)
๐Ÿงฐ Additional context used
๐Ÿงฌ Code Graph Analysis (2)
src/components/feed/FeedPost.tsx (1)
src/types/post.ts (1)
  • FeedPostProps (29-35)
src/pages/mypage/SavePage.tsx (1)
src/api/books/getSavedBooksInMy.ts (1)
  • getSavedBooksInMy (28-36)
๐Ÿ”‡ Additional comments (5)
src/types/post.ts (1)

34-34: onSaveToggle ์ฝœ๋ฐฑ ์ถ”๊ฐ€ ์ ์ ˆ

FeedPost์—์„œ ์ €์žฅ ์ƒํƒœ ๋ณ€ํ™” ์ด๋ฒคํŠธ๋ฅผ ์ƒ์œ„๋กœ ํ†ต์ง€ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์–ด ์ƒํƒœ ๋™๊ธฐํ™”๊ฐ€ ๊น”๋”ํ•ด์กŒ์Šต๋‹ˆ๋‹ค. PostFooter ์ชฝ ์‹œ๊ทธ๋‹ˆ์ฒ˜์™€๋„ ์ผ์น˜ํ•ฉ๋‹ˆ๋‹ค.

src/components/common/Post/PostFooter.tsx (1)

55-56: PostFooter์— onSaveToggle ์ถ”๊ฐ€ ๋ฐ ์ „๋‹ฌ OK

์˜ต์…”๋„ ์ฝœ๋ฐฑ์œผ๋กœ ์•ˆ์ „ํ•˜๊ฒŒ ์ฒ˜๋ฆฌํ–ˆ๊ณ , ๋ถ€๋ชจ ํ†ต์ง€ ๊ฒฝ๋กœ๊ฐ€ ๋ช…ํ™•ํ•ฉ๋‹ˆ๋‹ค.

Also applies to: 67-68

src/components/feed/FeedPost.tsx (1)

29-36: onSaveToggle ์ „๋‹ฌ ๊ฒฝ๋กœ ์ •์ƒ

Props ๋ถ„ํ•ด/์ „๋‹ฌ ์ˆœ์„œ๊ฐ€ ์ ์ ˆํ•˜๊ณ , spread๋กœ ๋ฎ์–ด์“ฐ์ง€ ์•Š๋„๋ก ์ฃผ์˜ํ•œ ์ ๋„ ์ข‹์Šต๋‹ˆ๋‹ค. PostFooter์™€ ํƒ€์ž…๋„ ์ผ์น˜ํ•ฉ๋‹ˆ๋‹ค.

src/pages/mypage/SavePage.tsx (2)

42-51: ์ €์žฅ๋œ ์ฑ… ๋ชฉ๋ก ๋กœ๋” ๋ถ„๋ฆฌ ์ข‹์Šต๋‹ˆ๋‹ค

API ์˜ค๋ฅ˜ ๋กœ๊น…๊ณผ ์ƒํƒœ ๋ฐ˜์˜์ด ๋ช…ํ™•ํ•ฉ๋‹ˆ๋‹ค. ์ดํ›„ ๋‹ค๋ฅธ ๊ณณ์—์„œ๋„ ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•ด ์œ ์ง€๋ณด์ˆ˜์„ฑ์— ์ด์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค.


185-186: FeedPost์— onSaveToggle ์—ฐ๋™ OK

์–ธ์„ธ์ด๋ธŒ ์‹œ ๋ฆฌ์ŠคํŠธ์—์„œ ์ œ๊ฑฐ๋˜๋Š” UX๊ฐ€ ์ž์—ฐ์Šค๋Ÿฝ์Šต๋‹ˆ๋‹ค. ์ฝœ๋ฐฑ ์‹œ๊ทธ๋‹ˆ์ฒ˜๋„ ์ผ์น˜ํ•ฉ๋‹ˆ๋‹ค.

Copy link
Copy Markdown

@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 (2)
src/components/common/Post/PostBody.tsx (2)

12-12: ์นด๋“œ ์ „์ฒด์— pointer ์ ์šฉ์€ ์ข‹์Šต๋‹ˆ๋‹ค. ๋‹ค๋งŒ BookInfo ์˜์—ญ์—๋Š” ํฌ์ธํ„ฐ ํ•ด์ œ๋ฅผ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

์ปจํ…Œ์ด๋„ˆ์— cursor: pointer ์ถ”๊ฐ€๋กœ ํด๋ฆญ ๊ฐ€๋Šฅ์„ฑ์ด ์ž˜ ๋“œ๋Ÿฌ๋‚ฉ๋‹ˆ๋‹ค. ๋ฐ˜๋ฉด, BookInfoCard ์˜์—ญ์€ ํด๋ฆญ ์ „ํŒŒ๋ฅผ ๋ง‰์•„ ์ƒ์„ธ ์ด๋™์ด ์•ˆ ๋˜๋ฏ€๋กœ, ํฌ์ธํ„ฐ ์ปค์„œ๊ฐ€ ์œ ์ง€๋˜๋ฉด ์‚ฌ์šฉ์ž์—๊ฒŒ ํ˜ผ์„ ์„ ์ค„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ๋ž˜ํผ์— cursor: default๋งŒ ์ง€์ •ํ•ด์ฃผ๋ฉด ์‹œ๊ฐ์  ํ”ผ๋“œ๋ฐฑ์ด ์ผ๊ด€๋ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ .content์—๋„ ๋ณ„๋„ cursor: pointer๊ฐ€ ์žˆ์–ด ์ค‘๋ณต์ž…๋‹ˆ๋‹ค. ์ปจํ…Œ์ด๋„ˆ์—์„œ ์ด๋ฏธ ํฌ์ธํ„ฐ๋ฅผ ์ฃผ๊ณ  ์žˆ์œผ๋ฏ€๋กœ .content์˜ ํฌ์ธํ„ฐ๋Š” ์ œ๊ฑฐํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค.

์•„๋ž˜์ฒ˜๋Ÿผ BookInfoCard ๋ž˜ํผ์— ์ปค์„œ๋งŒ ๋ฎ์–ด์”Œ์šฐ๋ฉด ์ถฉ๋ถ„ํ•ฉ๋‹ˆ๋‹ค:

-      <div onClick={(e) => e.stopPropagation()}>
+      <div onClick={(e) => e.stopPropagation()} style={{ cursor: 'default' }}>
         <BookInfoCard bookTitle={bookTitle} bookAuthor={bookAuthor} isbn={isbn} />
       </div>

Also applies to: 87-87


71-74: ์ƒˆ ํƒญ ์—ด๊ธฐ ๋ณด์•ˆยท์ ‘๊ทผ์„ฑ ๋ณด์™„: noopener/noreferrer, ํ‚ค๋ณด๋“œ ์ ‘๊ทผ์„ฑ, ํ…์ŠคํŠธ ๋“œ๋ž˜๊ทธ ๊ฐ€๋“œ ์ถ”๊ฐ€ ์ œ์•ˆ

  • ๋ณด์•ˆ: window.open์— noopener,noreferrer๋ฅผ ์ง€์ •ํ•˜๊ณ  opener๋ฅผ ๋ช…์‹œ์ ์œผ๋กœ ๋Š์–ด reverse tabnabbing์„ ์˜ˆ๋ฐฉํ•˜์„ธ์š”.
  • ์ ‘๊ทผ์„ฑ: div ํด๋ฆญ ๋‚ด๋น„๊ฒŒ์ด์…˜์—๋Š” role="link"์™€ tabIndex=0, Enter/Space ํ‚ค ์ฒ˜๋ฆฌ๋กœ ํ‚ค๋ณด๋“œ ์ ‘๊ทผ์„ฑ์„ ์ œ๊ณตํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
  • UX: ํ…์ŠคํŠธ ๋“œ๋ž˜๊ทธ ํ›„ ํด๋ฆญ์œผ๋กœ ์˜๋„์น˜ ์•Š๊ฒŒ ์ƒˆ ํƒญ์ด ์—ด๋ฆฌ๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์„ ํƒ ํ…์ŠคํŠธ ์กด์žฌ ์‹œ ๋„ค๋น„๊ฒŒ์ด์…˜์„ ๊ฑด๋„ˆ๋›ฐ๋Š” ๊ฐ€๋“œ๋ฅผ ๋‘๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

์•„๋ž˜์ฒ˜๋Ÿผ ์ตœ์†Œ ์ˆ˜์ •์œผ๋กœ ๋ฐ˜์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

@@
-  const handlePostClick = (feedId: number) => {
-    // ์ƒˆ ํƒญ์—์„œ ํ”ผ๋“œ ์ƒ์„ธ ํŽ˜์ด์ง€ ์—ด๊ธฐ
-    window.open(`/feed/${feedId}`, '_blank');
-  };
+  const handlePostClick = (feedId: number) => {
+    // ์ƒˆ ํƒญ์—์„œ ํ”ผ๋“œ ์ƒ์„ธ ํŽ˜์ด์ง€ ์—ด๊ธฐ (๋ณด์•ˆ: noopener/noreferrer)
+    const win = window.open(`/feed/${feedId}`, '_blank', 'noopener,noreferrer');
+    if (win) win.opener = null;
+  };
@@
-    <Container onClick={() => handlePostClick(feedId)}>
+    <Container
+      role="link"
+      tabIndex={0}
+      onKeyDown={(e) => {
+        if (e.key === 'Enter' || e.key === ' ') {
+          e.preventDefault();
+          handlePostClick(feedId);
+        }
+      }}
+      onClick={(e) => {
+        const selection = window.getSelection?.();
+        if (selection && selection.toString()) return;
+        handlePostClick(feedId);
+      }}
+    >

์ฐธ๊ณ : ๊ฐ€๋Šฅํ•˜๋ฉด ์‹œ๋งจํ‹ฑํ•˜๊ฒŒ <a> ์‚ฌ์šฉ๋„ ๊ณ ๋ คํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค(์˜ˆ: <Container as="a" href=... target="_blank" rel="noopener noreferrer">). ๋‹ค๋งŒ ๋‚ด๋ถ€์— ๋˜ ๋‹ค๋ฅธ ์•ต์ปค๊ฐ€ ์ค‘์ฒฉ๋  ์ˆ˜ ์žˆ์œผ๋ฉด ํ˜„์žฌ div + ํ•ธ๋“ค๋Ÿฌ ์ ‘๊ทผ์ด ๋” ์•ˆ์ „ํ•ฉ๋‹ˆ๋‹ค.

Also applies to: 86-90

๐Ÿ“œ 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 489aa46 and e3a5ccf.

๐Ÿ“’ Files selected for processing (1)
  • src/components/common/Post/PostBody.tsx (2 hunks)

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