Repository navigation
[DONE] 머리줄의 알림 수가 알림 쪽을 열면 사라지고, 쪽에 보이지 않는 알림은 세지 않는다 - #285
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y1tPTKaaeeyktG13KvmFsx
… they are read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y1tPTKaaeeyktG13KvmFsx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y1tPTKaaeeyktG13KvmFsx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y1tPTKaaeeyktG13KvmFsx
patternflow-bot
marked this pull request as ready for review
October 26, 2026 16:00
This was referenced Oct 26, 2026
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 27, 2026
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 27, 2026
Patternflow-lab#268 Patternflow-lab#271 Patternflow-lab#275 Patternflow-lab#276 Patternflow-lab#277 Patternflow-lab#279 Patternflow-lab#280 Patternflow-lab#281 Patternflow-lab#283 Patternflow-lab#284 Patternflow-lab#285 Patternflow-lab#286 Patternflow-lab#287 Patternflow-lab#288 Patternflow-lab#289 Patternflow-lab#290 Patternflow-lab#291 Patternflow-lab#292 Patternflow-lab#293 Patternflow-lab#294 Patternflow-lab#295 Patternflow-lab#296 Patternflow-lab#297 Patternflow-lab#298 Patternflow-lab#299 Patternflow-lab#300 Patternflow-lab#301 Patternflow-lab#302 Patternflow-lab#303
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lsh / https://claude.ai/code/session_01Y1tPTKaaeeyktG13KvmFsx
커뮤니티 머리줄의 Alerts 수를 알림 목록과 같은 줄로 세고, 알림 쪽이 읽음 처리를 마치면 쪽을 새로 그리게 했어요. 머지하면 「Alerts 3」 이 알림 쪽을 여는 순간 「Alerts」 로 바뀌고 Patterns 로 가도 다시 뜨지 않아요. 비공개가 된 패턴이나 걷어 낸 워크숍의 알림처럼 목록에 없는 알림은 더 세지 않아서, 빈 알림 쪽 위에 「Alerts 2」 가 뜨는 일도 없어요.
좋아지는 것: 알림을 읽으면 머리줄 수가 바로 사라진다 — 새로 고침하지 않아도 되고, 열어 볼 수 없는 알림은 세지 않는다
queries/notifications.ts세기와 목록이 같은 조인과 거르기NotificationsList.tsx읽음 POST 가 성공하면router.refresh()1ef2731그대로라 가져올 것 없음)4d437e6) · 겹치는 [DONE] PR 없음한 일
web/src/lib/community/server/queries/notifications.ts: 거르기를shownTo()하나로 옮겼어요. 비공개가 된 남의 패턴 · 덱, 지워진 대상, 워크숍post알림을 SQL 에서 빼고, 운영자는 비공개 대상의 알림을 그대로 받아요. 지금까지 목록이 JS 에서 하던 것과 같은 조건이에요.countUnreadNotifications와listNotifications가 같은 조인(PATTERN_TARGET,DECK_TARGET)과 이 조건을 써요. 세기는moderator를 받고, 목록은 거른 뒤에 50개를 잘라요(전엔 50개를 자른 뒤 걸러서 50개보다 적게 보일 수 있었어요).web/src/app/community/layout.tsx: 세기에{ moderator: isAdmin }를 넘겨요.web/src/components/community/NotificationsList.tsx: 읽음 POST 의 답이ok이고 들어올 때 안 읽은 줄이 있었으면router.refresh()를 불러요. 레이아웃이 다시 세서 수가 사라져요. 그 사이 다른 쪽으로 옮겼으면 그 쪽에서 사라져요. 401 이나 네트워크 오류면 수를 그대로 둬요. 새로 그리면 목록이 다 읽은 줄로 돌아오니, 들어올 때 안 읽었던 줄(unreadOnArrival)은 이 방문 동안 표시를 지켜요. POST 는 한 방문에 한 번이에요.queries/notifications.test.ts는 스크래치 DB 에서 진짜 댓글 경로와 편집 경로를 돌려요. bea 가 ada 의 공개 패턴에 댓글을 달고, ada 가 그 패턴을 비공개로 돌린 뒤 답을 달면 bea 의 수와 목록이 둘 다 0, 워크숍 알림을 하나 남겨도 0, 운영자로 읽으면 둘 다 1 · 2, 다시 공개하면 1 인지 봐요.NotificationsList.test.tsx는 POST 의 답이 오기 전엔 refresh 가 없고 답이 오면 한 번, 401 과 네트워크 오류엔 없고, 새로 그린 뒤에도 안 읽었던 줄이 표시를 지키는지 봐요.증거
Pi 와 같은
NEXT_PUBLIC_COMMUNITY_URL,NEXT_PUBLIC_BUILD_ENABLED로 빌드하고 스크래치 DB 에 HTTP 로 넣었어요. ada, bea, cal 이 가입하고, ada 가 「Tide」 와 「Harbour」 를 공개로 올려요. bea 가 Tide 에, cal 과 bea 가 Harbour 에 댓글을 달아요. ada 가 Harbour 를 비공개로 돌리고 거기 답을 달아요. 그래서 ada 는 알림 셋, bea 는 남이 비공개로 돌린 Harbour 의 알림 하나예요. bea 에겐 26일 전에 쌓인 워크숍 알림 하나를 DB 에 바로 넣었어요. playwright-core 1.56.1 로 로그인한 뒤/community를 열고 머리줄의 Alerts 링크를 눌러 3초를 기다렸어요. Patterns 와 뒤로 가기도 다 클라이언트 이동이에요. 한 번 돌 때마다read_at을 비워 같은 상태에서 시작했어요. 고치기 전은 같은 DB 를 복사해 dev 의 네 파일로 다시 빌드해서 쟀어요.390(
isMobile,hasTouch)과 1440 이 같았어요. 가로 넘침은 다 390/390, 1440/1440 이에요.새 시험을 dev 의 파일로 돌렸을 때:
고친 뒤:
다섯 검사(
web/에서,4d437e6):실행법
알림이 있는 계정으로 로그인해
/community의 「Alerts N」 을 누르면 몇 초 안에 「Alerts」 가 되고, Patterns 로 가도 그대로예요.가정
router.refresh()는useState를 지켜서 표시가 남아요(node_modules/next/dist/docs/01-app/03-api-reference/04-functions/use-router.md:46).isAdmin을 읽고 있어서 더 읽는 것은 없어요.Changelog
Web
경험
언제: 커뮤니티 레이아웃(머리줄)에 서버가 읽은 값을 바꾸는 일을 할 때
교훈: 같은 레이아웃 아래 클라이언트 이동은 레이아웃을 다시 그리지 않으니, 값을 바꾼 쪽이 서버 답을 받은 뒤
router.refresh()를 부르고 지켜야 할 화면 상태는useState에 둬요근거: #285 에서 dev 의 「Alerts 3」 은 알림 쪽, Patterns, 뒤로 가기에서 다 그대로였고, 읽음 POST 뒤 refresh 를 부르자 세 곳 다 「Alerts」 가 됐어요
바퀴
바퀴 114 · 후보 9 「머리줄의 알림 수가 알림 쪽을 열면 사라지고, 쪽에 보이지 않는 알림은 세지 않는다」
다음 바퀴
/pattern-labLink 가 Lab 덩이 여덟을 미리 받아요.{patterns:[null]}이 CORS 없는 500,?file=__proto__가 빈 200 이에요.AuthStatus가 세션을 받아올 때까지 「Sign in」 을 그려서 폰 머리줄이 두 줄이었다가 줄어요.https://claude.ai/code/session_01Y1tPTKaaeeyktG13KvmFsx
Generated by Claude Code