Skip to content

feat: 목록으로 돌아오면 CursorPager의 '이전'과 구간 표시를 되살림 - #66

Merged
chanwoo7 merged 2 commits into
developfrom
feat/cursor-trail-restore
Oct 4, 2026
Merged

chanwoo7 merged 2 commits into
developfrom
feat/cursor-trail-restore

Conversation

@chanwoo7

@chanwoo7 chanwoo7 commented Oct 4, 2026

Copy link
Copy Markdown
Member

배경

  • 이슈 #44입니다. 목록 2쪽에서 상세로 들어갔다가 '목록으로'로 돌아오면 같은 커서 주소로 돌아오지만, CursorPager가 새로 마운트돼 '이전' 버튼과 '21–40 / 전체' 구간 표시가 사라졌습니다.

변경

  • CursorPager가 지나온 커서 순서를 경로별로 기억합니다(list-return.ts).
    • 검색 파라미터 기억과 같은 방식(모듈 메모리, 경로 50개 상한)이고, 로그아웃 때 forgetSearches()가 함께 비웁니다.
    • 다시 마운트되면 기억한 순서에서 시작합니다. 조건이 다르거나 지금 커서를 지나온 적이 없으면 지금처럼 새로 쌓습니다.
  • 경로는 라우터에서 마운트 때 한 번 읽습니다. 그래서 목록 화면 11곳의 호출부는 바뀌지 않습니다.
    • 라우터 밖에서 단독으로 렌더하면(일부 spec) 기억하지 않습니다.

테스트

  • 같은 경로·조건·커서로 다시 마운트하면 '이전'과 구간 표시가 돌아오고, '이전'을 누르면 앞 커서로 가는 것을 확인했습니다.
  • 다른 경로·다른 조건·지나오지 않은 커서는 되살리지 않는 것을 확인했습니다(it.each).
  • forgetSearches() 뒤에는 되살리지 않는 것을 확인했습니다.
  • 반증: 복원 코드를 되돌리면 복원 케이스가, 경로를 고정하면 다른 경로 케이스가, 비우기를 빼면 로그아웃 케이스가 각각 실패합니다.

플랜 대조

플랜 9번 불릿 상태
지나온 커서를 경로별로 기억(로그아웃 때 비움) 한 것
같은 조건·커서면 '이전'과 구간 표시 복원 한 것
조건이 다르거나 주소로 바로 들어오면 지금처럼 한 것
회귀: 2쪽 → 상세 → 목록으로 한 것(CursorPager 다시 마운트로 검증, 목록 화면 통합 테스트는 생략)

- 지나온 커서를 컴포넌트 상태에만 쌓아서, 상세 → '목록으로'로 같은 커서 주소에 돌아와도 페이저가 다시 마운트되며 [cursor]부터 시작 → '이전' 버튼과 "21–40 / 전체" 구간 표시가 사라졌음
- list-return에 경로별 커서 기억(rememberTrail·rememberedTrail) 추가. 검색 파라미터 기억과 같은 수명(최대 50경로, forgetSearches가 함께 비움)
- CursorPager는 마운트 때 라우터에서 경로를 읽어 기억한 것으로 시작하고, 쌓은 커서가 바뀔 때마다 기록
  - 기억한 것이 다른 목록 조건이거나 지금 커서를 지나오지 않았으면 기존 렌더 중 보정이 새로 쌓음(이전 동작)
  - 라우터 밖에서 단독 렌더하면 경로가 없어 기억하지 않음 → 호출부(11곳)·기존 spec은 그대로
- 회귀 5건: 같은 경로·조건·커서로 다시 마운트하면 '이전'·구간 복원 후 '이전'이 앞 커서로 이동 / 경로·조건이 다르거나 지나오지 않은 커서면 복원 안 함 / forgetSearches 뒤 복원 안 함
  - 페이저 변경을 되돌리면 복원 케이스, 경로를 무시하면 경로 케이스, forgetSearches에서 커서를 안 비우면 세션 케이스가 실패하는 것 확인
@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: CaQuick/caquick-admin-fe/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 406b4e48-f6a7-4c6d-b270-b9bafb942e80

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 96.07% (🎯 80%) 2447 / 2547
🟢 Statements 95.54% (🎯 80%) 2680 / 2805
🟢 Functions 94.29% (🎯 80%) 1008 / 1069
🟢 Branches 88.06% (🎯 70%) 2014 / 2287
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/shared/lib/list-return.ts 100% 100% 100% 100%
Generated in workflow #132 for commit e62ea1f by the Vitest Coverage Report Action

@chanwoo7
chanwoo7 merged commit 4ed8945 into develop Oct 4, 2026
9 checks passed
@chanwoo7
chanwoo7 deleted the feat/cursor-trail-restore branch October 4, 2026 15:58
@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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