Skip to content

THIP-390: 희용 주석 및 개발 로그 제거#298

Merged
ljh130334 merged 2 commits into
THIP-386from
THIP-390
Nov 26, 2025
Merged

THIP-390: 희용 주석 및 개발 로그 제거#298
ljh130334 merged 2 commits into
THIP-386from
THIP-390

Conversation

@heeeeyong
Copy link
Copy Markdown
Collaborator

@heeeeyong heeeeyong commented Nov 25, 2025

#️⃣연관된 이슈

THIP-386

📝작업 내용

<chore: 전역 디버그 로그 및 군더더기 주석 정리하여 유지보수성 개선>

  • 코드 변경 사항 없음(무의미 로그/주석만 삭제)
  • 린트/빌드 영향 없음
  • 가독성/리뷰 효율 향상 목적으로 코드베이스 전반에 걸쳐 불필요한 주석과 console.log 메서드를 제거

💬리뷰 요구사항

try-catch문의 error 변수와 함께 쓰여진 console.log의 경우 추후 있을 Tanstack Query 도입과 함께 정리하도록 하는게 좋겠죠?

Summary by CodeRabbit

릴리스 노트

  • Bug Fixes

    • 팔로우/언팔로우 및 피드/팔로워 로딩 시 오류 처리 강화
    • 알림 읽음 처리의 즉시 반영 동작 제거(서버 확인 후 반영)
  • Refactor

    • 피드 로딩 상태 관리 간소화 및 스크롤 기반 로드 흐름 정리
    • 저장 페이지 페이징 상태 유지 및 저장 취소 시 자동 새로고침 제거
    • 일부 컴포넌트 레이아웃(책 카드 너비) 제약 완화
  • Chores

    • 불필요한 주석·디버그 로그 정리
    • 로그인 자동 리다이렉트 제거(토큰 존재 시 자동 이동 없음)
  • UI

    • 설정에서 일부 알림 토글(피드·그룹) 제거

✏️ Tip: You can customize this high-level summary in your review settings.

@heeeeyong heeeeyong self-assigned this Nov 25, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 25, 2025

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

Project Deployment Preview Comments Updated (UTC)
thip Ready Ready Preview Comment Nov 26, 2025 0:15am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 25, 2025

요약

주석과 디버그 로그를 대거 제거하고 일부 파일에서 경미한 동작 수정(요청 인터셉터의 config 반환, Feed 탭 상태 통합, OtherFeed 에러/로딩 개선, SavePage 페이징 상태 보존 등)을 포함한 리팩토링입니다. 인터페이스/공개 시그니처 변경은 거의 없으며 주로 코드 정리 목적입니다.

Walkthrough

주요 변경은 프로젝트 전반의 주석/콘솔 제거와 소수의 로직/상태 흐름 간소화(요청 인터셉터 반환, Feed 탭 상태 통합, 일부 에러/페이징 처리 보강)입니다.

Changes

Cohort / File(s) 변경 사항
API — 주석/예제 제거
src/api/books/getSavedBooksInMy.ts, src/api/feeds/getFeedDetail.ts, src/api/feeds/getMyFeed.ts, src/api/feeds/getMyProfile.ts, src/api/feeds/getOtherFeed.ts, src/api/feeds/getSavedFeedsInMy.ts, src/api/feeds/getTotalFeed.ts, src/api/feeds/postSave.ts, src/api/users/getOtherProfile.ts
설명 주석 및 사용 예제 블록 제거. 인터페이스/함수 시그니처 유지(대부분 문서 정리)
API 인프라 — 인터셉터 변경
src/api/index.ts
요청 인터셉터가 수정된 config를 반환하도록 변경(기존에 누락된 반환 추가), 불필요 콘솔 제거
공통 컴포넌트 — 주석/로그 정리
src/components/common/AsideDecoration.tsx, src/components/common/Layout.tsx, src/components/common/Modal/MoreMenu.tsx, src/components/common/Modal/ReplyModal.tsx, src/components/common/Post/PostFooter.tsx, src/components/common/Post/Reply.tsx, src/components/common/Post/SubReply.tsx, src/components/common/ScrollToTop.tsx, src/components/common/TokenStatus.tsx
인라인 주석 및 디버깅 로그 제거. UI/동작 변화 없음
Feed 컴포넌트 — CSS/주석 정리 및 일부 동작 변경
src/components/feed/BookInfoCard.tsx, src/components/feed/FeedDetailPost.tsx, src/components/feed/FeedDetailPostBody.tsx, src/components/feed/FeedPost.tsx, src/components/feed/TabBar.tsx, src/components/feed/TotalBar.tsx, src/components/feed/TotalFeed.tsx
주석 및 주석 처리된 CSS 규칙 제거. 일부 컴포넌트에서 min/max-width 주석 삭제(실행 스타일은 동일)
Follow/Profile 관련
src/components/feed/FollowList.tsx, src/components/feed/Profile.tsx, src/components/feed/UserProfileItem.tsx
로딩/에러 처리 보강(FollowList), 디버그 로그 제거(Profile, UserProfileItem). 기능 시그니처 유지
Feed 상태 리팩토링
src/pages/feed/Feed.tsx
탭별 상태(total/my 등) 통합 → single initialLoading 및 통합 로드 흐름으로 단순화. 무한 스크롤 관련 로직 간소화
OtherFeed 로드 안정화
src/components/feed/OtherFeed.tsx, src/pages/feed/OtherFeedPage.tsx
병렬 페칭 유지, try/catch/finally 추가로 에러/로딩 상태 관리 개선
세이브/페이징 동작 변경
src/pages/mypage/SavePage.tsx
loadSavedBooks/loadSavedFeeds에서 nextCursor/isLast를 상태에 전파하도록 추가. 북 언세이브 시 전체 리프레시 제거(로컬 상태만 갱신)
로그인/회원가입 및 라우트
src/pages/login/Login.tsx, src/pages/index.tsx, src/pages/signup/*
Login: 자동 리다이렉트(useEffect) 제거. index: 불필요 주석화 import 제거. signup 관련 주석/로그 정리
유저검색/팔로워 목록
src/pages/feed/UserSearch.tsx, src/pages/feed/UserSearchResult.tsx, src/pages/feed/FollowerListPage.tsx
UserSearch: 예외 처리/검증 간소화(try/catch 제거). FollowerListPage: 페이징 상태(nextCursor, isLast, retryCount) 추가 및 에러/로딩 처리 보완
마이페이지/설정/편집
src/pages/mypage/AlertPage.tsx, src/pages/mypage/EditPage.tsx, src/pages/mypage/Mypage.tsx
AlertPage: feed/group 토글 항목 삭제. EditPage: 닉네임 클라이언트 검증 제거(검증 관련 useEffect 삭제). Mypage: 디버그 로그 제거
기타 페이지/설정
src/pages/feed/FeedDetailPage.tsx, src/pages/feed/MyFeedPage.tsx, src/pages/feed/Feed.tsx, src/pages/notice/Notice.tsx, src/pages/Guide.tsx, vite.config.ts
주석/콘솔 정리. FeedDetailPage: 댓글 관련 카운트 업데이트 주석 제거(일부 업데이트 로직 삭제 아님). Notice: optimistic read UI 업데이트 제거. vite.config.ts: 주석 제거

Sequence Diagram(s)

sequenceDiagram
    participant UI as Feed Page (UI)
    participant Token as Token Ready
    participant Loader as loadFeedsWithToken
    participant API as API layer

    Note over UI,Token: 이전: 탭별 개별 로드 시퀀스
    UI->>Token: 대기 (useEffect)
    Token-->>UI: token ready
    UI->>Loader: loadFeedsWithToken(activeTab)
    Loader->>API: fetch feeds (activeTab)
    API-->>Loader: feeds & cursor
    Loader-->>UI: set posts, set nextCursor/isLast
    Note over UI,Loader: 이제: 단일 초기 로드 흐름으로 통합되어 트리거됨
Loading

(간단한 통합 로드 흐름을 보여줍니다; 변경은 탭별 상태에서 단일 초기 로드/무한스크롤 흐름으로의 통합입니다.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20-30 분

주의 깊게 검토해야 할 부분:

  • src/pages/feed/Feed.tsx: 탭 상태 통합과 무한 스크롤 변화로 인한 경계 조건(탭 전환 시 커서/로딩 초기화 등) 확인
  • src/api/index.ts: 요청 인터셉터에서 변경된 config 반환이 모든 요청 경로에서 의도대로 동작하는지 확인
  • src/pages/mypage/EditPage.tsx: 클라이언트 닉네임 검증 제거로 인한 서버 오류 처리/UX 영향 검토
  • src/pages/feed/UserSearch.tsx: try/catch 제거로 네트워크/예외 상황에서의 실패 처리 누락 여부 검토
  • src/pages/mypage/SavePage.tsx: 언세이브 시 전체 재요청 제거가 UI 동기화 문제를 일으키지 않는지 확인

Possibly related PRs

Suggested reviewers

  • ho0010

Poem

🐰 주석들 한 움큼 모아 던지고,
콘솔들 조용히 잠들게 하니,
코드 길도 더 반짝이고,
커피 한 잔이 더 달콤하네.
토끼가 홱! 뛰어가며 축하해요 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning 일부 변경사항(Feed.tsx, UserSearch.tsx 등)에서 주석 제거 범위를 벗어나 실제 기능 로직이 수정되었습니다. 예를 들어 UserSearch.tsx의 try-catch 제거, Feed.tsx의 상태 관리 단순화 등이 포함되어 있어 순수 주석/로그 제거만 하는 것이 아닙니다. 주석 및 console.log 제거만 수행하고, 실제 기능 로직 변경(try-catch 제거, 상태 관리 리팩토링 등)은 별도의 PR로 분리하여 진행하기를 권장합니다.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 목적을 명확하게 나타냅니다. '희용 주석 및 개발 로그 제거'는 이슈 ID(THIP-390)와 함께 코드베이스에서 주석과 console.log를 제거하는 리팩토링 작업을 정확히 설명합니다.
Linked Issues check ✅ Passed PR의 변경사항이 링크된 이슈(THIP-386)의 목표를 충족합니다. 전역 디버그 로그와 불필요한 주석 제거로 유지보수성을 개선하는 것이 이슈의 핵심 목표이며, 제출된 변경사항들이 정확히 이를 달성합니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch THIP-390

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira 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 2fb2c6a and 5b6350e.

📒 Files selected for processing (2)
  • src/components/common/Post/Reply.tsx (0 hunks)
  • src/components/common/Post/SubReply.tsx (0 hunks)
💤 Files with no reviewable changes (2)
  • src/components/common/Post/Reply.tsx
  • src/components/common/Post/SubReply.tsx

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • THIP-390: Request failed with status code 404
  • THIP-386: Request failed with status code 404

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Caution

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

⚠️ Outside diff range comments (1)
src/pages/mypage/EditPage.tsx (1)

46-69: 클라이언트 측 유효성 검증을 추가하세요.

API 호출 전에 다음 조건들을 검증하지 않아 불필요한 네트워크 요청과 열악한 사용자 경험을 초래합니다:

  • nicknamenull이거나 빈 문자열인지 확인
  • nicknamecurrentNickname과 동일한지(변경되지 않음) 확인

다음 diff를 적용하여 클라이언트 측 검증을 추가하세요:

  const onRightClick = async () => {
+   if (!nickname || nickname.trim() === '') {
+     setNicknameError('닉네임을 입력해주세요.');
+     return;
+   }
+
+   if (nickname === currentNickname) {
+     setNicknameError('기존 닉네임과 동일합니다.');
+     return;
+   }
+
    const selectedGenre = genres.find(g => g.id === selectedId);
    if (!selectedGenre) {
      console.error('선택된 장르를 찾을 수 없습니다.');
      return;
    }

    try {
      const result = await patchProfile({
        nickname: nickname,
        aliasName: selectedGenre.subTitle,
      });

      if (result.isSuccess) {
        navigate('/mypage');
      } else {
        const errorMessage = result.message;
        setNicknameError(errorMessage);
      }
    } catch (error) {
      console.error('프로필 편집 중 오류 발생:', error);
      setNicknameError('프로필 편집에 실패했어요.');
    }
  };
🧹 Nitpick comments (4)
src/pages/feed/UserSearchResult.tsx (1)

96-109: Empty 상태 스타일 및 전반 변경 방향 모두 무난합니다

  • Line [96-109] 기준으로 EmptyWrapper의 스타일(특히 line-height 포함)이 그대로 유지되고, 변경점이 주석 제거 수준이라 런타임 동작이나 레이아웃이 바뀔 가능성은 거의 없어 보입니다. 이 파일은 그대로 머지해도 될 것 같습니다.
  • IntersectionObserver 기반 무한 스크롤 로직도 hasMore, loading, onLoadMore 체크가 잘 걸려 있어, 이번 주석/로그 정리와 충돌하는 부분은 없어 보입니다.

PR 전반에 대해서는, 요청해주신 것처럼:

  • try { ... } catch (error) { console.log(error); } 형태로 error 객체를 단순 로그만 남기는 구문들은
    TanStack Query를 도입하면서 요청/응답 에러를 Query 레벨 에러 핸들링(에러 토스트, 상태 관리 등)으로 이관할 때 함께 정리하는 쪽이 좋겠습니다.
    그 시점에:
    • 사용자에게 보이는 에러는 UI/알림 컴포넌트로,
    • 디버깅용 정보는 전역 로깅/모니터링 도구(Sentry 등)로,
    • 개발 중 일시적인 console.log는 제거하는 기준을 잡으면 유지보수성이 더 좋아질 것 같습니다.
src/hooks/useSocialLoginToken.ts (1)

37-42: 에러 로그 메시지 정리 방향 적절합니다

console.error만 남기고 메시지만 단순화한 변경이라 동작 영향은 없고, 디버그용 console.log 정리라는 PR 목적에도 잘 맞습니다. 현재 수준의 에러 로그는 장애 시 원인 파악에 도움 되니 유지해도 좋다고 생각합니다.

다만 이 try/catch 블록의 에러 로깅은 나중에 TanStack Query 등으로 에러 상태/토스트를 통합 관리하게 되면,

  • 사용자에게는 UI 피드백(토스트, 에러 바운더리 등)으로 노출하고
  • 콘솔 출력은 최소화하거나 제거하는 방향으로 한 번 더 정리해도 좋겠습니다.
src/pages/notice/Notice.tsx (1)

146-148: 추후 TanStack Query 도입 시 try-catch + console.error 정리 제안

현재 handleNotificationClickcatch에서 error 객체는 console.error 로그 용도로만 사용되고 있습니다. 나중에 알림 확인 요청을 TanStack Query mutation으로 옮길 계획이라면, 이런 형태의 로컬 try-catch + console.* 로그들은 mutation의 onError 콜백이나 전역 에러 핸들링(예: 토스트, 에러 바운더리)으로 통합 관리하면서 정리해 두는 게 좋을 것 같습니다. 특히 “error 변수를 console.* 로그 외에는 사용하지 않는 try-catch”들은 TanStack Query 도입 시 함께 제거 대상으로 보는 것을 제안드립니다.

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

53-58: 삭제 실패 시 에러 처리 및 TanStack Query로의 이전 방향 제안

handleDelete에서 로컬 try/catch가 제거되면서, deleteRecentSearch 내부에서 rethrow된 예외가 이제 컴포넌트까지 그대로 올라오지만, handleDeleteWrapper가 async가 아니고 Promise를 다루지 않아서 삭제 실패 시 unhandled promise rejection이 발생할 수 있습니다. UX에는 당장 큰 영향이 없을 수 있지만, PR 설명 상 “동작 변경 없음”이라는 점을 고려하면 이 부분도 의도된 변경인지 한 번 확인해 보시면 좋겠습니다.

기존 동작을 유지하면서 로그만 제거하고 싶다면, 아래처럼 최소한의 try/catch만 다시 감싸는 것도 한 가지 방법입니다.

  const handleDelete = async (recentSearchId: number) => {
-    const response = await deleteRecentSearch(recentSearchId);
-
-    if (response.isSuccess) {
-      await fetchRecentSearches();
-    }
+    try {
+      const response = await deleteRecentSearch(recentSearchId);
+      if (response.isSuccess) {
+        await fetchRecentSearches();
+      }
+    } catch (error) {
+      // TODO: TanStack Query 도입 시 공통 에러 처리로 이관
+    }
  };

또한 src/api/recentsearch/deleteRecentSearch.ts(10-22행)의 catch에서 console.error로만 처리하는 부분은, 추후 TanStack Query 도입 시 mutation의 onError 혹은 전역 에러 핸들러로 넘기고 API 함수는 예외만 전달하는 방향으로 정리하면 책임 분리가 더 명확해질 것 같습니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira 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 f4a52ab and 2fb2c6a.

📒 Files selected for processing (53)
  • src/api/books/getSavedBooksInMy.ts (1 hunks)
  • src/api/feeds/getFeedDetail.ts (0 hunks)
  • src/api/feeds/getMyFeed.ts (1 hunks)
  • src/api/feeds/getMyProfile.ts (0 hunks)
  • src/api/feeds/getOtherFeed.ts (0 hunks)
  • src/api/feeds/getSavedFeedsInMy.ts (0 hunks)
  • src/api/feeds/getTotalFeed.ts (1 hunks)
  • src/api/feeds/postSave.ts (1 hunks)
  • src/api/index.ts (0 hunks)
  • src/api/users/getOtherProfile.ts (0 hunks)
  • src/components/common/AsideDecoration.tsx (0 hunks)
  • src/components/common/Layout.tsx (0 hunks)
  • src/components/common/Modal/MoreMenu.tsx (0 hunks)
  • src/components/common/Modal/ReplyModal.tsx (0 hunks)
  • src/components/common/Post/PostFooter.tsx (1 hunks)
  • src/components/common/Post/Reply.tsx (0 hunks)
  • src/components/common/Post/SubReply.tsx (0 hunks)
  • src/components/common/ScrollToTop.tsx (1 hunks)
  • src/components/common/TokenStatus.tsx (0 hunks)
  • src/components/feed/BookInfoCard.tsx (0 hunks)
  • src/components/feed/FeedDetailPost.tsx (0 hunks)
  • src/components/feed/FeedDetailPostBody.tsx (3 hunks)
  • src/components/feed/FeedPost.tsx (0 hunks)
  • src/components/feed/FollowList.tsx (1 hunks)
  • src/components/feed/MyFeed.tsx (2 hunks)
  • src/components/feed/OtherFeed.tsx (2 hunks)
  • src/components/feed/Profile.tsx (1 hunks)
  • src/components/feed/TabBar.tsx (0 hunks)
  • src/components/feed/TotalBar.tsx (0 hunks)
  • src/components/feed/TotalFeed.tsx (1 hunks)
  • src/components/feed/UserProfileItem.tsx (0 hunks)
  • src/hooks/useReplyActions.ts (1 hunks)
  • src/hooks/useSocialLoginToken.ts (1 hunks)
  • src/hooks/useUserSearch.ts (0 hunks)
  • src/pages/Guide.tsx (2 hunks)
  • src/pages/feed/Feed.tsx (1 hunks)
  • src/pages/feed/FeedDetailPage.tsx (0 hunks)
  • src/pages/feed/FollowerListPage.tsx (0 hunks)
  • src/pages/feed/MyFeedPage.tsx (1 hunks)
  • src/pages/feed/OtherFeedPage.tsx (1 hunks)
  • src/pages/feed/UserSearch.tsx (2 hunks)
  • src/pages/feed/UserSearchResult.tsx (1 hunks)
  • src/pages/index.tsx (0 hunks)
  • src/pages/login/Login.tsx (0 hunks)
  • src/pages/mypage/AlertPage.tsx (0 hunks)
  • src/pages/mypage/EditPage.tsx (1 hunks)
  • src/pages/mypage/Mypage.tsx (1 hunks)
  • src/pages/mypage/SavePage.tsx (1 hunks)
  • src/pages/notice/Notice.tsx (1 hunks)
  • src/pages/signup/SignupDone.tsx (0 hunks)
  • src/pages/signup/SignupGenre.tsx (0 hunks)
  • src/pages/signup/SignupNickname.tsx (0 hunks)
  • vite.config.ts (0 hunks)
💤 Files with no reviewable changes (29)
  • src/components/feed/BookInfoCard.tsx
  • src/components/common/Modal/ReplyModal.tsx
  • src/components/common/AsideDecoration.tsx
  • src/api/feeds/getMyProfile.ts
  • src/api/users/getOtherProfile.ts
  • src/components/feed/UserProfileItem.tsx
  • src/components/common/Layout.tsx
  • src/components/common/Modal/MoreMenu.tsx
  • src/components/common/Post/SubReply.tsx
  • src/components/feed/TabBar.tsx
  • src/components/common/TokenStatus.tsx
  • src/pages/login/Login.tsx
  • src/pages/signup/SignupDone.tsx
  • src/pages/feed/FollowerListPage.tsx
  • src/api/feeds/getSavedFeedsInMy.ts
  • src/pages/index.tsx
  • src/pages/mypage/AlertPage.tsx
  • src/components/common/Post/Reply.tsx
  • src/pages/signup/SignupGenre.tsx
  • src/components/feed/FeedPost.tsx
  • src/api/feeds/getFeedDetail.ts
  • vite.config.ts
  • src/pages/signup/SignupNickname.tsx
  • src/hooks/useUserSearch.ts
  • src/components/feed/FeedDetailPost.tsx
  • src/api/feeds/getOtherFeed.ts
  • src/pages/feed/FeedDetailPage.tsx
  • src/api/index.ts
  • src/components/feed/TotalBar.tsx
🧰 Additional context used
🧬 Code graph analysis (2)
src/pages/feed/UserSearch.tsx (2)
src/api/recentsearch/getRecentSearch.ts (1)
  • getRecentSearch (22-25)
src/api/recentsearch/deleteRecentSearch.ts (1)
  • deleteRecentSearch (11-23)
src/components/feed/OtherFeed.tsx (1)
src/api/feeds/getMyProfile.ts (1)
  • getMyProfile (10-13)
🔇 Additional comments (30)
src/components/common/ScrollToTop.tsx (1)

11-11: 불필요한 주석 제거로 코드 가독성 개선.

반환문에서 불필요한 주석을 제거하여 코드를 간결하게 만들었습니다. 컴포넌트의 동작(useEffect를 통한 스크롤 제어)과 렌더링 결과(null 반환)는 변경되지 않았으며, PR의 목표인 코드베이스 정리에 잘 부합합니다.

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

35-35: 주석 제거로 코드 정리 완료 — 승인합니다.

스타일 값(padding-bottom: 125px)은 유지되고 있으므로, 레이아웃이나 기능에는 영향을 미치지 않습니다. PR 목표인 불필요한 주석 제거를 적절히 수행했습니다.

src/api/feeds/postSave.ts (1)

3-26: 좋은 코드 정리 작업입니다.

이 파일의 변경 사항은 불필요한 주석을 제거하면서 코드의 간결성과 가독성을 향상시켰습니다. 인터페이스 정의와 API 호출 로직이 명확하게 유지되어 있으며, 필드명과 함수명만으로도 의도가 충분히 전달됩니다.

  • SaveFeedRequest: type: boolean으로 단순화되어 필드의 목적이 명확함
  • SaveFeedResponse: optional data 필드로 타입 안전성 개선
  • postSaveFeed 함수: 핵심 로직만 남겨 유지보수성 향상

변경 사항에 문제가 없습니다.

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

73-87: 주석 정리가 적절하게 수행됨.

handleLike 함수의 불필요한 주석 제거로 코드 가독성이 개선되었습니다. 현재 코드의 흐름이 명확하므로 제거된 주석이 실질적 손실을 야기하지 않습니다.

다만 PR 검토 요구사항에 따라, 라인 85의 try-catch 에러 핸들링 console.error는 향후 TanStack Query 도입 시 정리하는 것을 권장합니다.


89-107: 주석 및 공백줄 정리가 효과적으로 수행됨.

handleSave 함수에서 불필요한 설명 주석과 여백이 제거되어 코드 정리가 완료되었습니다. 라인 98-100의 onSaveToggle 콜백 호출 로직이 명확하게 드러나므로, 제거된 "notify parent" 주석의 의도가 코드 자체에서 충분히 전달됩니다.

PR 검토 요구사항에 따라, 라인 105의 try-catch 에러 핸들링 console.error는 향후 TanStack Query 도입 시 정리하는 것을 권장합니다.

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

26-27: PR 범위와 변경사항의 불일치 확인 필요

PR 목표는 불필요한 주석과 console.log 제거입니다. 그러나 이 파일의 표시된 변경사항은 CSS 속성 추가(white-space, word-wrap, flex-shrink, object-fit)로 보입니다. 이러한 CSS 변경이 의도된 기능 개선인지, 아니면 이 PR에서 제외되어야 하는지 확인해주시기 바랍니다.

Also applies to: 38-39


80-137: 코드 로직은 정상입니다

컴포넌트의 상태 관리, Props 처리, 렌더링 로직은 모두 올바르게 구현되어 있습니다. 이 파일에는 제거해야 할 console.log나 불필요한 주석이 없습니다.

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

32-34: 에러 핸들링의 console.error는 적절합니다.

try-catch 블록의 에러 변수와 함께 사용된 console.error는 PR 설명에 따라 추후 TanStack Query 도입 시 정리 예정이므로, 현재 상태로 유지하는 것이 맞습니다.


69-71: 팝업 닫기 로직이 적절합니다.

onClose 핸들러에서 불필요한 console.log를 제거하고 closePopup()만 호출하도록 정리한 것은 PR 목적에 부합하며 적절합니다.

src/pages/notice/Notice.tsx (2)

233-237: 스크롤바 숨김 스타일 정리는 동작에 영향 없어 보입니다.

-ms-overflow-style, scrollbar-width, ::-webkit-scrollbar 설정 자체는 그대로 유지되고 주석/포맷만 정리된 것으로 보여서, 실제 스크롤 동작 변경 없이 코드만 깔끔해진 것 같습니다. 이 방향 괜찮아 보입니다.


85-89: 알림 읽음 처리(isChecked) UI 반영 시점 한 번만 확인 부탁드립니다.

리스트 렌더링에서 notif.isChecked 값을 그대로 사용하고, 클릭 시에는 postNotificationsCheck만 호출하고 있어 로컬 notifications 상태를 따로 갱신하지는 않는 구조입니다. 만약 이전에 성공 시 해당 알림의 isChecked를 즉시 true로 바꾸는 setNotifications 로직이 있었다면, 제거되면서 클릭 직후에는 읽음 표시/불투명도 변화가 없고 목록 재조회 시점에만 반영되는 UX로 바뀌었을 수 있습니다. PR 설명이 “코드 변경 없음”이라 되어 있어서, 혹시 의도치 않은 UX 변화가 아닌지만 한 번 더 확인해 주시면 좋겠습니다.

Also applies to: 171-177

src/api/books/getSavedBooksInMy.ts (1)

3-3: 주석 정리 완료

코드 동작에 영향 없이 주석만 정리되었습니다.

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

33-35: 로딩 상태 간소화

빈 프래그먼트 반환으로 단순화되었습니다. 동작에는 문제가 없습니다.


72-72: 불필요한 주석 제거 완료

src/hooks/useReplyActions.ts (1)

22-42: 디버그 로그 정리 완료

요청 시작 로그는 제거하고 성공/실패 로그는 유지하여 PR 목표에 부합합니다. 에러 핸들링 로그는 향후 TanStack Query 도입 시 활용 가능합니다.

src/pages/Guide.tsx (2)

40-55: 불필요한 주석 제거

스와이프 감지 로직은 코드만으로 충분히 명확하여 주석 제거가 적절합니다.


212-213: 스타일링 주석 정리

user-select: none 속성명으로 의도가 명확하여 주석이 불필요합니다.

src/api/feeds/getMyFeed.ts (1)

21-32: URL 쿼리 파라미터 처리 개선

cursor 파라미터가 존재할 때만 쿼리 스트링에 포함하도록 개선되었습니다. 구현이 올바릅니다.

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

42-60: 페이징 상태 업데이트 추가

loadSavedBooks 함수에 nextCursorisLast 상태 업데이트가 추가되어 무한 스크롤이 제대로 동작하게 되었습니다. 이는 중요한 버그 수정입니다.


62-80: 페이징 상태 업데이트 추가

loadSavedFeeds 함수에도 동일하게 페이징 상태 관리가 추가되었습니다.


159-177: 저장 토글 로직 개선

저장 취소 시에는 목록을 새로고침하여 항목을 제거하고, 저장 시에는 로컬 상태만 업데이트하는 로직이 적절합니다.

src/api/feeds/getTotalFeed.ts (1)

21-32: URL 쿼리 파라미터 처리 개선

getMyFeed.ts와 동일한 패턴으로 쿼리 파라미터 처리가 개선되었습니다.

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

15-31: 에러 핸들링 개선

finally 블록 추가로 에러 발생 시에도 로딩 상태가 확실히 해제되도록 개선되었습니다. 좋은 방어적 프로그래밍 사례입니다.


119-123: 스타일링 주석 정리

스크롤바 숨김 처리 관련 주석이 정리되었습니다.

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

81-81: LGTM!

주석 제거가 적절하게 이루어졌으며, 코드 동작에는 영향이 없습니다.

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

81-81: LGTM!

주석 제거가 깔끔하게 처리되었으며, 로직에는 변경사항이 없습니다.

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

21-21: LGTM!

인터페이스 정의가 올바르게 유지되고 있으며, 컴포넌트 전체에서 일관되게 사용되고 있습니다.


47-47: LGTM!

트레일링 쉼표 추가는 향후 코드 변경 시 더 깔끔한 diff를 생성하는 좋은 관행입니다.

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

59-59: LGTM!

앱의 용어("띱하기")와 일관성을 유지하도록 에러 메시지가 업데이트되었습니다. PR 설명대로 에러 핸들링 관련 console.error는 TanStack Query 도입 시 정리 예정인 것으로 이해됩니다.

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

30-33: 최근 검색어 조회 에러 처리/전파 방식 변경 점검

이전 구현이 try/catch 안에서 로그만 남기고 에러를 삼키는 형태였다면, 지금은 getRecentSearch에서 발생한 예외가 fetchRecentSearchesuseEffect까지 그대로 전파되어 unhandled promise rejection으로 떨어질 수 있습니다(useEffect 안에서 반환값을 기다리지 않기 때문에).

PR 설명이 “로그/주석만 제거(동작 변경 없음)”이라서, 에러 전파 전략까지 바꾸려는 의도가 맞는지만 한 번 확인해 보시는 게 좋겠습니다. 만약 기존과 동일하게 “UI는 그대로 두고 로그만 제거”가 목적이라면, 아래처럼 console만 뺀 try/catch를 유지하는 식도 고려할 수 있습니다.

  const fetchRecentSearches = async () => {
-    const response = await getRecentSearch('USER');
-    setRecentSearches(response.data.recentSearchList);
+    try {
+      const response = await getRecentSearch('USER');
+      setRecentSearches(response.data.recentSearchList);
+    } catch (error) {
+      // TODO: TanStack Query 도입 시 공통 에러 처리로 이관
+    }
  };

Comment thread src/pages/feed/Feed.tsx
Comment on lines +44 to 45

const [initialLoading, setInitialLoading] = useState(true);
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 | 🟡 Minor

PR 설명과 불일치하는 기능적 변경사항

PR 설명에서는 "코드 변경은 없음(무의미한 로그/주석만 삭제)"이라고 명시했지만, initialLoading 상태가 새롭게 추가되어 초기 로딩 플로우가 변경되었습니다. 이는 주석 제거 범위를 벗어난 기능적 개선입니다.

만약 의도된 개선사항이라면 PR 설명에 이를 명시하는 것이 좋겠습니다.

🤖 Prompt for AI Agents
In src/pages/feed/Feed.tsx around lines 44-45 you've introduced a new
initialLoading state which changes the component's initial-loading behavior
contrary to the PR description; either remove this new state (undo the useState
addition and any code paths that rely on initialLoading) to keep the PR purely
non-functional, or explicitly update the PR description and add a brief code
comment explaining the intended functional change; if you choose to remove it,
also remove any associated imports/usages and verify existing loading logic
still behaves as before.

useEffect(() => {
console.log('nicknameError 상태가 변경됨:', nicknameError);
}, [nicknameError]);
useEffect(() => {}, [nicknameError]);
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 | 🟠 Major

불필요한 빈 useEffect를 제거하세요.

이 useEffect는 아무런 동작도 수행하지 않으면서 nicknameError가 변경될 때마다 불필요한 재실행을 유발합니다. 리팩토링 과정에서 로직을 제거한 후 useEffect 자체를 삭제하지 않은 것으로 보입니다.

다음 diff를 적용하여 불필요한 코드를 제거하세요:

-  useEffect(() => {}, [nicknameError]);
-
📝 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
useEffect(() => {}, [nicknameError]);
🤖 Prompt for AI Agents
In src/pages/mypage/EditPage.tsx around line 40, there is an empty useEffect
hook that only lists [nicknameError] as a dependency and performs no actions;
remove the entire empty useEffect declaration so the component no longer re-runs
on nicknameError changes for no reason.

Comment on lines 65 to 68
onConfirm: () => {
console.log('로그아웃 실행');
closePopup();
logout(); // 실제 로그아웃 로직 실행
logout();
},
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 | 🟠 Major

PR 설명과 불일치하는 기능적 변경사항이 있습니다.

PR 설명에는 "코드 변경은 없음(무의미한 로그/주석만 삭제)"라고 명시되어 있으나, 67번 라인에서 logout() 호출이 추가되었습니다. AI 요약에 따르면 이는 이전의 console.log 플레이스홀더를 실제 로그아웃 로직으로 교체한 것으로, 단순한 정리 작업이 아닌 기능적 변경에 해당합니다.

만약 의도한 변경사항이라면 PR 설명을 업데이트하여 이 기능적 변경을 명시하는 것이 좋겠습니다. 실제 로그아웃이 실행되지 않아야 한다면, 이 변경사항을 재검토해야 합니다.

🤖 Prompt for AI Agents
In src/pages/mypage/Mypage.tsx around lines 65 to 68 there is an unintended
functional change: a call to logout() was added inside the onConfirm handler
(line 67) despite the PR claiming "no code changes"; either remove or revert
that logout() call back to the original placeholder behavior (e.g. console.log
or no-op) if this PR should be non-functional, or if the logout addition is
intentional update the PR description to state that a logout action was
introduced and ensure tests/UX reflect the new behavior.

@ljh130334 ljh130334 changed the title chore: 불필요한 주석 및 console.log 메서드 제거 THIP-390: 희용 주석 및 개발 로그 제거 Nov 26, 2025
@ljh130334 ljh130334 merged commit 41e1a72 into THIP-386 Nov 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants