Skip to content

fix: resolve book story QA layout issues - #491

Merged
yhi9839 merged 3 commits into
mainfrom
fix-490-qa
Jul 11, 2026
Merged

yhi9839 merged 3 commits into
mainfrom
fix-490-qa

Conversation

@yhi9839

@yhi9839 yhi9839 commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

📌 개요 (Summary)

  • 변경 사항에 대한 간략한 요약을 적어주세요.
  • 관련 이슈가 있다면 링크를 걸어주세요 (예: [fix] cicd / build 문제 #123).

🛠️ 변경 사항 (Changes)

  • 새로운 기능 추가
  • 버그 수정
  • 코드 리팩토링
  • 문서 업데이트
  • 기타 (설명: )

📸 스크린샷 (Screenshots)

(UI 변경 사항이 있다면 첨부해주세요)

✅ 체크리스트 (Checklist)

  • 빌드가 성공적으로 수행되었나요? (pnpm build)
  • 린트 에러가 없나요? (pnpm lint)
  • 불필요한 콘솔 로그나 주석을 제거했나요?

Summary by CodeRabbit

  • New Features
    • Search results now require authentication for like/unlike actions.
    • Like status is preserved across search, recommendations, and detail screens.
    • Admin member role changes are now permission-aware and constrained to valid transitions.
  • Bug Fixes
    • Improved responsive layout behavior (reduced overflow) across book details, navigation, comments, and modals.
    • Fixed pagination handling for liked books.
  • UI Improvements
    • Standardized empty-state messages for library and reading club lists.
    • Improved loading presentation in the book selection modal.

@yhi9839 yhi9839 linked an issue Jul 11, 2026 that may be closed by this pull request
@vercel

vercel Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
checkmo Ready Ready Preview, Comment Jul 11, 2026 8:04am

@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 964bb6fe-20ed-402c-88bc-eb9bf0638655

📥 Commits

Reviewing files that changed from the base of the PR and between d72678a and e4aba96.

📒 Files selected for processing (3)
  • src/app/(main)/groups/[id]/admin/members/page.tsx
  • src/app/(main)/search/SearchPageClient.tsx
  • src/hooks/mutations/useClubMemberMutations.ts

📝 Walkthrough

Walkthrough

Search results now use authenticated like mutations and cached like state. Club member role changes are restricted by actor and target status, with ownership-transfer cache invalidation. Multiple lists share EmptyState, and responsive layouts receive sizing and overflow adjustments.

Changes

Book state and list presentation

Layer / File(s) Summary
Authenticated like state flow
src/hooks/queries/useBookQueries.ts, src/app/(main)/search/SearchPageClient.tsx
Search results invoke an auth-protected like mutation, while book details fall back to cached like state from recommendation and search queries.
Shared empty-state rendering
src/components/base-ui/MyPage/Lists/*, src/components/base-ui/Profile/Lists/*
Library and reading-club lists use the shared EmptyState component for empty results.
Responsive layout adjustments
src/components/base-ui/BookStory/Detatil/*, src/components/base-ui/Comment/comment_list.tsx, src/components/layout/BookSelectModal.tsx
Flex sizing, width, height, overflow, and loading alignment classes are updated across story, comment, and modal layouts.

Club member role permissions

Layer / File(s) Summary
Role transition authorization
src/app/(main)/groups/[id]/admin/members/page.tsx
Role actions are filtered and guarded using the acting member’s status and the target member’s status.
Ownership transfer cache refresh
src/hooks/mutations/useClubMemberMutations.ts
Ownership transfers additionally invalidate the current user’s club-home query after successful mutation completion.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AdminMembersPage
  participant useClubMeQuery
  participant RoleEditDropdown
  participant ClubMemberMutation
  participant ReactQueryCache
  AdminMembersPage->>useClubMeQuery: query actor status
  useClubMeQuery-->>AdminMembersPage: return actorStatus
  AdminMembersPage->>RoleEditDropdown: provide actorStatus and target status
  RoleEditDropdown-->>AdminMembersPage: render permitted actions
  AdminMembersPage->>ClubMemberMutation: submit authorized role change
  ClubMemberMutation->>ReactQueryCache: invalidate member queries
  ClubMemberMutation->>ReactQueryCache: invalidate club-home query for ownership transfer
Loading

Possibly related PRs

  • checkmo2025/FE#177: Both changes modify the admin member role-edit UI and RoleEditDropdown.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches one real part of the change set: Book Story layout fixes, though it misses other major updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-490-qa

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces layout fixes (using min-w-0 to prevent flex overflow), replaces inline empty states with a reusable EmptyState component, and integrates the book-liking mutation into the search page. It also attempts to sync the book detail query with cached like states. However, the reviewer noted a critical issue in useBookDetailQuery where overriding fresh server data with cached state can lead to UI bugs and stale data; they suggested using React Query's initialData or placeholderData instead.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +82 to +94
queryFn: async () => {
const book = await bookService.getBookDetail(isbn);
const cachedLikeState = getCachedBookLikeState(queryClient, isbn);

if (book.likedByMe || cachedLikeState === undefined) {
return book;
}

return {
...book,
likedByMe: cachedLikeState,
};
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

서버에서 조회한 최신 데이터(book.likedByMe)가 false임에도 불구하고, 클라이언트 캐시(cachedLikeState)가 true인 경우 캐시 값으로 덮어씌우도록 구현되어 있습니다.

이 방식은 다음과 같은 심각한 부작용을 초래할 수 있습니다:

  1. 서버 데이터와의 불일치: 다른 기기나 브라우저 탭에서 좋아요를 취소하여 서버 상태는 false가 되었더라도, 현재 기기의 로컬 캐시에 true가 남아있다면 사용자는 상세 페이지에서 계속 좋아요가 된 상태로 보게 됩니다. 즉, 서버의 최신 상태가 무시됩니다.
  2. 캐시 정합성 문제: getCachedBookLikeState는 여러 검색 쿼리 중 하나라도 true를 가지고 있으면 true를 반환합니다. 비활성화된(inactive) 오래된 검색 결과 캐시가 남아있는 경우, 사용자가 좋아요를 취소했음에도 계속 true로 덮어씌워져 좋아요 취소가 반영되지 않는 버그가 발생할 수 있습니다.

해당 기능을 구현한 의도가 상세 페이지 진입 시 로딩 중에도 이전 페이지(검색 결과 등)의 좋아요 상태를 즉시 보여주기 위함(낙관적 UI 또는 끊김 없는 UX)이라면, queryFn 내부에서 서버 데이터를 덮어쓰는 대신 React Query의 initialData 또는 placeholderData 옵션을 사용하는 것이 올바른 접근법입니다.

이렇게 하면 상세 페이지 진입 시 캐시된 데이터를 먼저 보여주고, 서버 요청이 완료되면 서버에서 가져온 최신 데이터로 자연스럽게 업데이트(refetch)됩니다.

        queryFn: () => bookService.getBookDetail(isbn),

@yhi9839
yhi9839 merged commit 1c2dcc0 into main Jul 11, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — e4aba96a Deployed Jul 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: QA 수정

1 participant