Skip to content

6.27 업데이트 - #428

Merged
yhi9839 merged 4 commits into
mainfrom
dev
Jun 27, 2026
Merged

yhi9839 merged 4 commits into
mainfrom
dev

Conversation

@yhi9839

@yhi9839 yhi9839 commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added unsaved-changes warnings across create/edit flows so in-progress forms, drafts, and replies are harder to lose.
    • Improved navigation safety in key areas like news, stories, groups, bookshelves, comments, search, notifications, and the header.
    • Added a confirmation dialog that appears when leaving with unsaved work.
  • Bug Fixes

    • Successful saves and redirects now bypass the warning prompt, preventing interruptions after submit.

yhi9839 and others added 3 commits June 27, 2026 14:09
플랫 endpoints.ts와 endpoints/ 폴더의 이중 정의로 인한 drift 위험 제거.

- 플랫 src/lib/api/endpoints.ts 삭제 (파일/폴더 이름 충돌로 barrel을 가리던 문제 해소)
- API_BASE_URL을 endpoints/base.ts 단일 정의로 통일
  (운영 URL 하드코딩 fallback 제거 → Clubs/Image/Clubnotification/ClubsBookshelf를 ./base로 이전)
- member 도메인 엔드포인트(check-nickname/additional-info/members/me/login-status)를
  endpoints/member.ts로 일원화하고, auth.ts는 auth/* 만 보유
- authService가 member 도메인 호출은 MEMBER_ENDPOINTS를 사용하도록 변경
- URL 값은 모두 동일하여 동작 변화 없음 (tsc/lint 통과)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
refactor(api): API 엔드포인트 정의 단일 출처화 (#424)
@vercel

vercel Bot commented Jun 27, 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 Jun 27, 2026 7:45am

@coderabbitai

coderabbitai Bot commented Jun 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR adds a shared unsaved-changes guard, wires it into multiple create/edit and navigation flows, and separates auth/member API endpoints into dedicated modules with updated service calls.

Changes

Unsaved changes guard rollout

Layer / File(s) Summary
Guard core and modal
src/hooks/useUnsavedChangesGuard.tsx, src/components/common/UnsavedChangesConfirmModal.tsx, src/app/providers.tsx
Adds the shared guard context, confirmation modal, and top-level provider wrapper.
Draft reporting and editor guards
src/components/base-ui/LongtermInput.tsx, src/components/base-ui/Bookcase/bookid/ReviewList.tsx, src/components/base-ui/Group/DebateList.tsx, src/app/(main)/groups/[id]/bookcase/[bookId]/DebateSection.tsx, src/app/(main)/groups/[id]/bookcase/[bookId]/ReviewSection.tsx
LongtermChatInput now reports live draft text, and review/debate editors use that state to guard switching, cancelling, and write toggles.
Comment drafts and cancel flows
src/components/base-ui/Comment/comment_input.tsx, src/components/base-ui/Comment/comment_item.tsx, src/components/base-ui/Comment/comment_list.tsx
Comment input, edit, and reply flows now confirm before discarding typed content.
Shared navigation surfaces
src/components/layout/Header.tsx, src/components/layout/NotificationDropdown.tsx, src/components/layout/SearchModal.tsx, src/components/base-ui/Comment/comment_section_*, src/app/(main)/groups/[id]/bookcase/[bookId]/BookDetailPageClient.tsx
Header, notification, search, profile-link, and book-detail navigation now route through confirmation or bypass logic; SearchModal also reads the header height directly.
Admin news and notice forms
src/app/(admin)/admin/(app)/news/*, src/app/(main)/groups/[id]/admin/notice/*
News and notice create/edit pages snapshot form state, confirm cancel or back navigation, and bypass the guard after successful redirects.
Group and story form guards
src/app/(main)/groups/[id]/admin/edit/page.tsx, src/app/(main)/groups/[id]/admin/bookcase/*, src/app/(main)/groups/create/CreateGroupPageClient.tsx, src/app/(main)/stories/*
Group admin, bookcase, create-group, and story pages compute dirty state from form inputs and bypass the guard after submit navigation.

API endpoint split

Layer / File(s) Summary
Endpoint modules
src/lib/api/endpoints.ts, src/lib/api/endpoints/auth.ts, src/lib/api/endpoints/member.ts, src/lib/api/endpoints/{Clubnotification,Clubs,ClubsBookshelf,Image}.ts
Auth and member endpoint maps are separated, TEMP_PASSWORD moves into auth endpoints, and API_BASE_URL imports point at the new base module.
Auth service wiring
src/services/authService.ts
Member-related auth service methods now read from MEMBER_ENDPOINTS while auth-only calls keep using AUTH_ENDPOINTS.

Sequence Diagram(s)

sequenceDiagram
  participant Header
  participant UnsavedChangesProvider
  participant UnsavedChangesConfirmModal
  participant router

  Header->>UnsavedChangesProvider: confirmNavigation(() => router.push(href))
  UnsavedChangesProvider->>UnsavedChangesConfirmModal: open prompt
  UnsavedChangesConfirmModal->>UnsavedChangesProvider: Leave or Stay
  UnsavedChangesProvider->>router: execute navigation
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • checkmo2025/FE#22: It also touches src/components/layout/Header.tsx, and this PR extends that header navigation path with unsaved-changes confirmation.
  • checkmo2025/FE#232: It adds the expired-news delete flow in src/app/(admin)/admin/(app)/news/[id]/edit/page.tsx, which this PR now wraps with runWithoutGuard during the redirect path.

Suggested labels

✨ feat, ♻️ refactor

Suggested reviewers

  • shinwokkang

Poem

I twitched my nose at the prompt so bright,
and guarded my hops from edits tonight.
With modal and provider, I bounce with grace,
leaving no draft crumbs in the wrong place.
🐇✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Title check ❓ Inconclusive The title is too vague and only states a date-based update, so it does not describe the main change. Rename it to a short, specific summary of the primary change, such as adding unsaved-changes guards and related navigation updates.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 dev

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 refactors API endpoints by moving member-related endpoints (such as ADDITIONAL_INFO, CHECK_NICKNAME, and PROFILE) from AUTH_ENDPOINTS to MEMBER_ENDPOINTS, updating their imports and usages across services. The review feedback suggests simplifying imports in authService.ts by utilizing the existing barrel export, and consolidating duplicate profile and login status retrieval methods between authService and memberService to eliminate redundant code and ensure consistent error handling.

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 +2 to +3
import { AUTH_ENDPOINTS } from "@/lib/api/endpoints/auth";
import { MEMBER_ENDPOINTS } from "@/lib/api/endpoints/member";

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.

medium

기존에 src/lib/api/endpoints/index.ts 파일에서 모든 엔드포인트를 export하는 배럴(barrel) 구조가 이미 정의되어 있습니다. 따라서 개별 파일에서 직접 가져오는 대신, @/lib/api/endpoints 경로를 통해 한 번에 가져오도록 코드를 단순화할 수 있습니다.

Suggested change
import { AUTH_ENDPOINTS } from "@/lib/api/endpoints/auth";
import { MEMBER_ENDPOINTS } from "@/lib/api/endpoints/member";
import { AUTH_ENDPOINTS, MEMBER_ENDPOINTS } from "@/lib/api/endpoints";

Comment on lines 47 to 49
getProfile: async (): Promise<ApiResponse<User>> => {
return await apiClient.get<ApiResponse<User>>(AUTH_ENDPOINTS.PROFILE, {
return await apiClient.get<ApiResponse<User>>(MEMBER_ENDPOINTS.GET_PROFILE, {
silentAuthError: true,

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.

medium

현재 authService.getProfile과 memberService.getProfile 모두 동일한 엔드포인트(/members/me)를 호출하고 있어 기능이 중복됩니다.\n\n또한 authService에서는 silentAuthError: true 옵션을 사용하고 있으나 memberService에서는 누락되어 있어, 인증 에러 발생 시 일관되지 않은 사용자 경험(예: 불필요한 에러 토스트 노출 등)을 초래할 수 있습니다. 동일한 엔드포인트를 호출하는 서비스 메서드는 하나로 통합하고, 필요한 옵션은 매개변수로 전달받아 처리하도록 개선하는 것을 권장합니다.

Comment on lines 53 to 57
getLoginStatus: async (): Promise<ApiResponse<LoginStatusResponse>> => {
return await apiClient.get<ApiResponse<LoginStatusResponse>>(
AUTH_ENDPOINTS.LOGIN_STATUS,
MEMBER_ENDPOINTS.GET_LOGIN_STATUS,
{ silentAuthError: true }
);

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.

medium

현재 authService.getLoginStatus와 memberService.getLoginStatus 모두 동일한 엔드포인트(/members/me/login-status)를 호출하고 있어 기능이 중복됩니다.\n\nauthService에서는 silentAuthError: true 옵션을 사용하여 비로그인 상태에서 불필요한 에러 처리를 방지하고 있으나, memberService에서는 해당 옵션이 누락되어 있습니다. 중복 코드를 제거하고 일관된 에러 처리를 위해 하나의 서비스 메서드로 통합하는 것을 권장합니다.

@yhi9839
yhi9839 merged commit 875e9a5 into main Jun 27, 2026
2 of 3 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 28, 2026

This branch was successfully deployed

1 active deployment
Preview — 71b9555d Deployed Jun 27, 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.

1 participant