Skip to content

[FEAT] impact 에러 수정 2 - #25

Merged
suwonthugger merged 1 commit into
mainfrom
feat/24-impact-2
Jul 28, 2026
Merged

[FEAT] impact 에러 수정 2#25
suwonthugger merged 1 commit into
mainfrom
feat/24-impact-2

Conversation

@suwonthugger

@suwonthugger suwonthugger commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

👥 작업 배경 및 목적

🛠️ 주요 변경 사항

  • useNewsQuery()는 실 응답이 오기 전 placeholderData로 mock의 첫 항목을 즉시 보여준다. 이전 수정은 이 placeholder 값으로 selectedNewsId를 그대로 확정해버려서, 실제 응답이 도착한 뒤에도(selectedNewsId가 이미 차 있어useEffect 가드에 걸림) 갱신되지 않는 문제가 있었다.

  • isPlaceholderData가 false일 때(실제 응답 도착 후)만 firstNewsId를 계산하도록 수정.

🧪 테스트 결과 (선택)

  • 로컬 환경 테스트 결과나 실행 화면 스크린샷이 있다면 첨부해 주세요.

Summary by CodeRabbit

  • 버그 수정
    • 실제 뉴스 데이터가 준비되기 전에는 첫 번째 뉴스가 잘못 선택되지 않도록 개선했습니다.
    • 로딩 중 임시 데이터가 표시되는 동안 자동 선택이 실행되지 않도록 조정했습니다.

useNewsQuery()는 실 응답이 오기 전 placeholderData로 mock의 첫 항목을
즉시 보여준다. 이전 수정은 이 placeholder 값으로 selectedNewsId를 그대로
확정해버려서, 실제 응답이 도착한 뒤에도(selectedNewsId가 이미 차 있어
useEffect 가드에 걸림) 갱신되지 않는 문제가 있었다. isPlaceholderData가
false일 때(실제 응답 도착 후)만 firstNewsId를 계산하도록 수정.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@suwonthugger suwonthugger self-assigned this Jul 28, 2026
@suwonthugger suwonthugger linked an issue Jul 28, 2026 that may be closed by this pull request
1 task
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4910deee-0f57-4ed2-adfe-c26449059d5e

📥 Commits

Reviewing files that changed from the base of the PR and between c0cc095 and ef3e8cf.

📒 Files selected for processing (1)
  • src/routes/app.tsx

📝 Walkthrough

Walkthrough

뉴스 쿼리의 isPlaceholderData 상태를 활용해 placeholder 데이터가 표시되는 동안 첫 뉴스 선택을 보류하고, 실제 응답 이후에만 초기 선택 로직이 실행되도록 변경했다.

Changes

뉴스 초기 선택 제어

Layer / File(s) Summary
Placeholder 기반 초기 선택 제어
src/routes/app.tsx
useNewsQuery에서 isPlaceholderData를 받고, 실제 뉴스 데이터가 준비된 경우에만 firstNewsId를 계산하도록 변경했다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • koscom-team01/koslink-fe#23: 동일한 app.tsx의 뉴스 초기 선택 로직과 placeholder 상태 기반 초기화 시점을 변경한다.
✨ 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 feat/24-impact-2

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

@suwonthugger
suwonthugger merged commit 1fa68e3 into main Jul 28, 2026
1 of 2 checks passed
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.

[FEAT] impact 에러 수정 2 [FEAT] impact API 오류 수정

1 participant