Skip to content

Feat(client): acorns 추가 알림 tooltip window focus 될 때 뜨도록 변경#309

Open
constantly-dev wants to merge 2 commits intodevelopfrom
feat/#305-acorns-tooltip-window-focus-open
Open

Feat(client): acorns 추가 알림 tooltip window focus 될 때 뜨도록 변경#309
constantly-dev wants to merge 2 commits intodevelopfrom
feat/#305-acorns-tooltip-window-focus-open

Conversation

@constantly-dev
Copy link
Member

@constantly-dev constantly-dev commented Mar 10, 2026

📌 Related Issues

관련된 Issue를 태그해주세요. (e.g. - close #25)

📄 Tasks

  • acorns 추가 알림 tooltip window focus 될 때 뜨도록 변경

⭐ PR Point (To Reviewer)

  • 아티클 읽는 updateToReadStatus API 함수 설정에 invalidateQueries 제거하여 바로 반영 안되도록 하였습니다.
  • useGetAcornsrefetchOnWindowFocus 옵션을 줘 pinback dashboard window가 focus될 때 refetch하도록 하였습니다.
  • usePutArticleReadStatusrefetchType: 'none', 옵션을 통해 stale 상태로 변경은 하지만 refetch는 안되도록 설정하였습니다.

시나리오

  1. 사용자가 Pinback 대시보드에서 아티클 카드를 클릭합니다.
  2. 클릭 직후 window.open(article.url, '_blank')로 아티클이 새 탭/새 창에서 열립니다.
  3. 동시에 기존 탭에서는 updateToReadStatus가 호출되어 해당 아티클의 read status를 즉시 변경합니다.
  4. 이때 acorns 쿼리는 바로 refetch하지 않고, refetchType: 'none'으로 stale 상태만 표시합니다.
  5. 따라서 사용자가 아티클을 클릭한 직후에는 기존 Pinback 대시보드 탭의 Sidebar에서 도토리 개수가 즉시 갱신되지 않고, 풍선 토스트도 뜨지 않습니다.
  6. 이후 사용자가 다시 Pinback 대시보드 탭으로 돌아오면, useGetAcornsrefetchOnWindowFocus에 의해 acorns가 다시 조회됩니다.
  7. 이 시점에 최신 acornCount가 반영되고, 이전 값보다 증가한 경우에만 Sidebar의 풍선 토스트가 표시됩니다.

Summary by CodeRabbit

릴리스 노트

  • Refactor
    • 북마크 데이터 캐시 관리 최적화로 불필요한 새로고침 제거
    • 창 포커스 시 데이터 자동 동기화 개선

@vercel
Copy link

vercel bot commented Mar 10, 2026

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

Project Deployment Actions Updated (UTC)
pinback-client-client Ready Ready Preview, Comment Mar 10, 2026 11:21am
pinback-client-landing Ready Ready Preview, Comment Mar 10, 2026 11:21am

@github-actions github-actions bot added the feat 기능 개발하라 개발 달려라 달려 label Mar 10, 2026
@github-actions github-actions bot requested review from jjangminii and jllee000 March 10, 2026 11:21
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Walkthrough

도토리(acorns) 쿼리의 캐시 및 리페치 동작을 조정했습니다. MyBookmarkContent에서 도토리 캐시 무효화를 제거하고, queries.ts에서 윈도우 포커스 시 자동 리페치를 활성화하며 무효화 시 자동 리페치를 비활성화했습니다.

Changes

Cohort / File(s) Summary
도토리 캐시 무효화 제거
apps/client/src/pages/myBookmark/components/myBookmarkContent/MyBookmarkContent.tsx
updateToReadStatus 성공 핸들러에서 ['acorns'] 캐시 무효화 로직 제거
도토리 쿼리 리페치 동작 조정
apps/client/src/shared/apis/queries.ts
useGetAcorns 쿼리에 refetchOnWindowFocus: true 추가, usePutArticleReadStatus의 도토리 캐시 무효화에 refetchType: 'none' 추가

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • jllee000
  • jjangminii

Poem

🐰 도토리 쏟아지는 창 열릴 때마다
새로운 보물을 찾아내네요
캐시는 스마트하게, 리페치는 똑똑하게
토끼의 수고로움 조금 덜었다는 게 기쁨이에요! ✨🌰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경 사항의 주요 목적(도토리 추가 알림 tooltip을 window focus 시에 표시하도록 변경)을 명확하게 반영하고 있습니다.
Linked Issues check ✅ Passed 코드 변경 사항이 #305의 요구사항(도토리 툴팁을 window focus 조건으로 변경)을 충족하고 있습니다. #25는 연결되어 있으나 본 PR과는 관련이 없습니다.
Out of Scope Changes check ✅ Passed 모든 코드 변경 사항이 #305의 요구사항(window focus 시 도토리 툴팁 표시)과 관련된 범위 내에 있으며, 불필요한 변경은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed PR 설명이 필수 섹션(Related Issues, Tasks, PR Point)을 모두 포함하고 있으며, 변경사항의 의도와 구현 시나리오가 명확하게 설명되어 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#305-acorns-tooltip-window-focus-open

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.

@github-actions
Copy link

✅ Storybook chromatic 배포 확인:
🐿️ storybook

Copy link
Collaborator

@jjangminii jjangminii left a comment

Choose a reason for hiding this comment

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

저도 refetchOnWindowFocus: true 이걸로 테스트 해봤을 때 왜 안되나 했었는데 invalidateQueries이걸 까먹고 있었네요,, 👍 👍

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

Labels

feat 기능 개발하라 개발 달려라 달려

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 도토리 툴팁 open 조건 window 창 focus로 변경

2 participants