Skip to content

fix: 내 프로필, 다른 사용자 프로필 클릭 시 분기 처리#130

Merged
heeeeyong merged 2 commits into
developfrom
chore/minor-updates
Aug 17, 2025
Merged

fix: 내 프로필, 다른 사용자 프로필 클릭 시 분기 처리#130
heeeeyong merged 2 commits into
developfrom
chore/minor-updates

Conversation

@heeeeyong
Copy link
Copy Markdown
Collaborator

@heeeeyong heeeeyong commented Aug 17, 2025

#️⃣연관된 이슈

#71 [API] feeds API

📝작업 내용

isWriter 변수를 추가하여 내 프로필을 눌렀을때와 다른사용자의 프로필을 눌렀을 때 나오는 화면에서 팔로우 버튼의 유무를 설정하도록 했습니다.

💬리뷰 요구사항

없습니다!

Summary by CodeRabbit

  • 새 기능
    • 사용자 개인 피드 페이지(/myfeed/:userId) 추가. 게시물 헤더를 탭하면 작성자인 경우 개인 피드로, 아닌 경우 타인 피드로 이동.
  • 개선
    • 팔로우 버튼 표시 조건 개선: 내 피드에서는 숨김, 상대 프로필이 작성자인 경우 기본적으로 숨김.
    • 댓글/대댓글 헤더에서도 작성자 상태가 일관되게 반영되도록 표시/이동 동작 정비.
  • 작업
    • OAuth 토큰 발급 엔드포인트 경로 업데이트로 인증 흐름 안정화.

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 17, 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 17, 2025 4:56am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 17, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

isWriter/isMyFeed 플래그를 도입해 헤더 클릭 시 이동 경로 및 팔로우 버튼 표시를 분기하고, 해당 플래그를 Reply/SubReply/Feed/Profile로 전파했습니다. /myfeed/:userId 라우트와 MyFeedPage를 추가했으며, OAuth 토큰 발급 엔드포인트를 /auth/set-cookie로 변경했습니다. 타입과 목데이터를 확장했습니다.

Changes

Cohort / File(s) Summary
Post 헤더·댓글 컴포넌트
src/components/common/Post/PostHeader.tsx, src/components/common/Post/Reply.tsx, src/components/common/Post/SubReply.tsx
PostHeader에 isWriter? 추가 및 클릭 시 /myfeed/{creatorId} 또는 /otherfeed/{creatorId}로 분기. Reply/SubReply가 isWriter를 Prop으로 받아 PostHeader에 전달. 퍼블릭 시그니처 갱신.
피드 UI
src/components/feed/OtherFeed.tsx, src/components/feed/Profile.tsx
OtherFeed에 showFollowButton?, isMyFeed 전파. Profile에 isMyFeed? 추가하고 showFollowButton && !isMyFeed로 팔로우 버튼 표시 제어.
페이지·라우팅
src/pages/feed/MyFeedPage.tsx, src/pages/feed/OtherFeedPage.tsx, src/pages/index.tsx
MyFeedPage 신설(/myfeed/:userId), 피드/프로필 병렬 로딩 및 NavBar 액션 추가. OtherFeedPage에서 showFollowButton!profileData?.isWriter로 전달. index 라우트에 myfeed/:userId 추가.
타입 확장
src/types/post.ts, src/types/profile.ts
Post/Reply/SubReply/프로필 타입에 isWriter(필수/옵셔널 혼합) 추가.
목데이터 반영
src/data/postData.ts
mock 포스트/피드/댓글 데이터에 isWriter: false 필드 추가.
OAuth 훅
src/hooks/useOAuthToken.ts
토큰 발급 POST 경로를 /api/set-cookie/auth/set-cookie로 변경. 동작은 동일.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant PostHeader
  participant Router

  User->>PostHeader: click header
  PostHeader->>Router: if isWriter && creatorId -> /myfeed/{creatorId}
  PostHeader->>Router: else if creatorId -> /otherfeed/{creatorId}
  Router-->>User: navigate to target feed
Loading
sequenceDiagram
  participant User as User
  participant MyFeedPage as MyFeedPage
  participant API as API

  User->>MyFeedPage: visit /myfeed/:userId
  MyFeedPage->>MyFeedPage: read userId
  MyFeedPage->>API: getOtherFeed(userId)
  MyFeedPage->>API: getOtherProfile(userId)
  API-->>MyFeedPage: feedData
  API-->>MyFeedPage: profileData
  MyFeedPage-->>User: render OtherFeed(showHeader=false, isMyFeed=true, showFollowButton=false)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

✨ Feature

Suggested reviewers

  • ljh130334

Poem

새 길이 열렸지, /myfeed로 쏜살같이!
귀 쫑긋 토끼는 헤더를 톡—누르니, 길이 갈라지네.
작가면 나의 숲, 아니면 너의 들.
팔로우 버튼은 살짝 숨바꼭질.
쿠키 길도 바뀌었고, 데이터엔 잉크 한 점—isWriter: true/false! 🥕

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 c35ba06 and 4a5ab81.

📒 Files selected for processing (12)
  • src/components/common/Post/PostHeader.tsx (2 hunks)
  • src/components/common/Post/Reply.tsx (3 hunks)
  • src/components/common/Post/SubReply.tsx (3 hunks)
  • src/components/feed/OtherFeed.tsx (2 hunks)
  • src/components/feed/Profile.tsx (4 hunks)
  • src/data/postData.ts (8 hunks)
  • src/hooks/useOAuthToken.ts (1 hunks)
  • src/pages/feed/MyFeedPage.tsx (1 hunks)
  • src/pages/feed/OtherFeedPage.tsx (1 hunks)
  • src/pages/index.tsx (2 hunks)
  • src/types/post.ts (3 hunks)
  • src/types/profile.ts (1 hunks)
✨ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant