Skip to content

fix: 위시리스트 뒤로가기 시 스크롤 위치 복원 - #401

Merged
kanghaeun merged 11 commits into
devfrom
fix/392-wishlist-scroll-restoration
Jul 31, 2026
Merged

fix: 위시리스트 뒤로가기 시 스크롤 위치 복원#401
kanghaeun merged 11 commits into
devfrom
fix/392-wishlist-scroll-restoration

Conversation

@kanghaeun

@kanghaeun kanghaeun commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

작업 요약

  • 위시리스트에서 상품 상세로 들어갔다 뒤로가기로 돌아오면 스크롤이 최상단으로 초기화되던 문제 해결

작업 세부 내용

위시리스트를 아래로 스크롤해 상품을 클릭한 뒤 뒤로가기를 하면, 항상 리스트 최상단으로 돌아와 보던 위치를 다시 찾아 내려가야 하는 불편이 있었습니다.

이는 현재 구조가 html / body 가 모두 overflow-hidden 이고, 실제 스크롤은 루트 레이아웃의 max-w-120 overflow-y-auto div 이기 때문에 발생하는 문제였습니다. (Next.js 의 기본 스크롤 복원은 window기준으로 동작하기 때문에 복원이 이루어지지 않음)

리스트 데이터 자체는 캐시(['wishlists'])에서 즉시 복원되고 있어, 스크롤 위치만 별도로 저장·복원하면 되는 상황

픽셀 오프셋 vs 상품 기준

scrollTop 값을 그대로 저장하면 목록이 변하지 않는 경우에는 정확하지만, 위시 목록은 항목이 자주 변경되는 경로가 많습니다.

  • 삭제 모드에서 사용자가 직접 상품을 지움
  • 파싱 완료 시 WishProcessingCardWishCard 로 카드 종류가 전환됨
  • SSE 로 백그라운드에서 목록이 갱신됨

카드 하나가 약 290px 이라 위쪽에서 항목 하나만 바뀌어도 픽셀 기준은 한 줄씩 어긋납니다.
이에 반해 상품 기준은 클릭한 상품 id 를 기준점으로 삼으면 목록이 어떻게 바뀌어도 그 상품 위치로 돌아갑니다.


  1. 스크롤 컨테이너 식별자 추가apps/web/src/app/layout.tsx, apps/web/src/consts/layout.ts

    • 실제 스크롤이 일어나는 div 에 id 부여 (SCROLL_CONTAINER_ID 상수로 관리)
  2. 스크롤 저장·키 로직apps/web/src/app/archive/wish/_utils/wishScroll.ts (신규)

    • 뒤로가기 판별: history.state 에 식별자를 심어 같은 entry 로 돌아왔는지로 판별.
      저장값이 있으면 = 이 entry 에서 상세로 떠난 적 있음 = 뒤로/앞으로 복귀
    • 저장: 상세로 떠나는 순간 1회. 클릭한 상품 id카드 상단이 컨테이너 상단에서
      떨어진 거리
      를 기록
    • 정리: 복원에 성공한 시점에 저장값 삭제 → entry 마다 값이 쌓이지 않음.
      읽는 시점에 지우면 StrictMode 이중 마운트에서 첫 마운트가 값을 소비한 뒤 복원을 못 끝내고
      언마운트될 때 유실되므로, 성공 시점에만 지움
    • sessionStorage.setItemtry/catch — 할당량 초과·프라이빗 모드 대응
  3. 스크롤 복원 훅apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts

    • useLayoutEffect 에서 기준 카드를 찾아, 저장 시점과 같은 위치에 오도록 스크롤을 상대 조정
    • 카드가 아직 렌더되지 않았거나 목록 높이가 덜 자라면 한 번에 도달하지 못하므로,
      도달하거나 1초가 지날 때까지 requestAnimationFrame 으로 재시도
    • 하단 탭바 등으로 새로 진입한 경우에는 새 entry 라 저장값이 없어 복원하지 않고
      최상단에서 시작
    • 상태를 소비하지 않는 판별 방식이라 StrictMode 이중 마운트에도 멱등
  4. 기준점·저장 시점 연결apps/web/src/app/archive/wish/_components/wish-grid/index.tsx

    • 각 카드에 data-wish-id 부여 (복원 시 기준 카드 조회용)
    • 카드 클릭 시 saveWishScroll 호출
  5. 목록 복귀 방식 변경apps/web/src/app/archive/wish/[id]/_hooks/useDeleteWish.ts
    위시 삭제 후 router.replace(ROUTES.WISHLIST)router.back().
    새 history entry 를 쌓지 않고 원래 entry 로 돌아가야 복원이 동작

스크린샷

Before
2026-07-29.11.12.59.mov
After
2026-07-29.11.36.08.mov

popstate 로는 판별할 수 없었나

처음에는 popstate 이벤트를 모듈 스코프 플래그에 기록해두고, 마운트 시점에 그 플래그로 "뒤로가기로 진입했는지"를 구분했습니다. (popstate 가 새 라우트 마운트보다 먼저 발생한다는 전제)

하지만 /archive/wish 를 새로고침한 뒤에는 정상 동작하는데, 홈에서 탭바로 이동해 들어오면 항상 최상단으로 초기화되었습니다.

36: unmount   t=22181  top: 797            ← 상세로 이동, 저장값 정상
37: mount     t=24546  isPopNavigation: false, saved: 797
38: unmount   t=24550                      ← StrictMode 이중 마운트
39: mount     t=24552  isPopNavigation: false, saved: 797
40: popstate  t=24588                      ← 마운트보다 42ms 늦게 도착

-> 저장값(saved: 797)은 멀쩡히 읽혔지만 플래그가 아직 false 라 복원 분기를 타지 못함

원인: 리스너 등록 순서

같은 window 에 등록된 리스너는 등록 순서대로 호출됩니다. 그리고 Next 라우터의 popstate 핸들러는 그 안에서 라우터 상태를 갱신하고 React 가 동기로 커밋까지 끝냅니다.

Next 핸들러 하나가 도는 동안 컴포넌트 마운트와 useLayoutEffect 가 모두 끝남

  • 리스너가 Next 보다 뒤에 등록돼 있으면, 플래그를 세우는 시점에는 이미 복원 시점이 지나간 뒤
  • 등록 순서는 위시 페이지 청크가 언제 평가되는지에 따라 갈림
진입 경로 청크 평가 시점 리스너 등록 순서 결과
/archive/wish 하드 로드 초기 번들에 포함, 하이드레이션 중 Next 라우터보다 먼저 정상
홈 → 탭바 이동 (소프트 내비게이션) 지연 로드 Next 라우터보다 나중 항상 실패

-> popstate 기반 판별은 코드 스플리팅 결과에 동작이 좌우되는 구조
(리스너를 더 일찍 등록하도록 옮기더라도 청크 분할 방식이 바뀌면 다시 깨질 수 있어 순서에 의존하지 않는 방법이 필요했음)

대안: history.state

history.state 는 브라우저가 popstate 핸들러를 호출하기 전에 이미 해당 entry 의 값으로 복원해둡니다. 리스너 등록 순서와 무관하게, 마운트 시점에 읽으면 정확함

  • 탭바로 새로 진입 → 새 entry → 저장값 없음 → 복원하지 않음
  • 상세에서 뒤로가기 → 같은 entry 복귀 → 저장값 존재 → 복원

이벤트를 "한 번 받아서 소비하는" 방식이 아니라 entry 에 붙은 상태를 읽는 방식이라 StrictMode 이중 마운트처럼 마운트가 여러 번 일어나도 멱등하게 동작합니다.

연관 이슈

closes #392

Summary by CodeRabbit

요약(릴리스 노트)

  • 새로운 기능
    • 위시리스트에서 다른 화면으로 이동했다가 돌아오면, 이전에 보던 카드 위치로 스크롤이 더 정확하게 복원됩니다.
  • 개선 사항
    • 위시 삭제 후 이전 화면으로 돌아가도록 변경되어 탐색 흐름이 더 자연스러워졌습니다.
    • 웹뷰 환경에서 화면 이동과 스크롤 동작의 안정성이 향상되었습니다.

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
piki Ready Ready Preview Jul 31, 2026 5:01am

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 55d3f476-ecfd-4ae3-beb4-198f6a6f892c

📥 Commits

Reviewing files that changed from the base of the PR and between 62481bc and cefcf66.

📒 Files selected for processing (2)
  • apps/web/src/app/archive/wish/_components/wish-grid/index.tsx
  • apps/web/src/app/archive/wish/_utils/wishScroll.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/web/src/app/archive/wish/_components/wish-grid/index.tsx
  • apps/web/src/app/archive/wish/_utils/wishScroll.ts

📝 Walkthrough

Walkthrough

위시리스트 카드의 위치 앵커를 저장하고 상세 복귀 시 카드 오프셋을 기준으로 스크롤을 복원합니다. 루트 스크롤 컨테이너를 식별 가능하게 만들고, 삭제 성공 시 이전 페이지로 이동합니다.

Changes

위시리스트 탐색 상태

Layer / File(s) Summary
스크롤 컨테이너 및 앵커 계약
apps/web/src/consts/layout.ts, apps/web/src/app/layout.tsx, apps/web/src/app/archive/wish/_utils/wishScroll.ts
스크롤 컨테이너 식별자와 위시 카드 복원 앵커 타입을 정의하고 루트 레이아웃에 적용합니다.
카드 오프셋 저장 및 복원
apps/web/src/app/archive/wish/_utils/wishScroll.ts, apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts
카드의 컨테이너 기준 오프셋을 저장·조회하고, 카드 렌더링 후 허용 오차와 제한 시간 내에 scrollTop을 보정합니다.
위시리스트 적용 및 뒤로가기
apps/web/src/app/archive/wish/_components/wish-grid/index.tsx, apps/web/src/app/archive/wish/_components/WishlistList.tsx, apps/web/src/app/archive/wish/[id]/_hooks/useDeleteWish.ts
카드 클릭 시 복원 앵커를 저장하고 목록에 복원 훅을 연결하며, 삭제 성공 후 router.back()으로 이동합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • TeamPiKi/client#347: useDeleteWish.tsWishlistList.tsx의 위시리스트 라우팅 변경과 연결됩니다.
  • TeamPiKi/client#354: 위시리스트 레이아웃과 Z_INDEX 연동 변경이 겹칩니다.

Sequence Diagram(s)

sequenceDiagram
  participant WishlistList
  participant WishGrid
  participant WishDetail
  participant wishScroll
  participant ScrollContainer
  WishGrid->>wishScroll: 카드 wishId와 오프셋 저장
  WishGrid->>WishDetail: 상품 상세로 이동
  WishDetail->>WishlistList: router.back()으로 복귀
  WishlistList->>wishScroll: 저장된 앵커 조회
  wishScroll->>WishlistList: wishId와 오프셋 반환
  WishlistList->>ScrollContainer: 카드 오프셋 기준 scrollTop 보정
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning layout.tsx의 isWebview(userAgent) 전환은 Issue #392의 스크롤 복원 요구와 관련이 없는 별도 변경입니다. isWebview 변경을 별도 PR로 분리하거나 Issue #392와의 필요성을 명시하세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 위시리스트 뒤로가기 시 스크롤 위치 복원이라는 주요 변경 사항을 간결하고 정확하게 설명합니다.
Linked Issues check ✅ Passed Issue #392의 핵심 요구사항인 카드 기준 저장과 뒤로가기 복원을 구현하고, 컨테이너 식별자와 복원 재시도도 추가했습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 fix/392-wishlist-scroll-restoration

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
apps/web/src/app/layout.tsx (1)

70-73: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

루트 콘텐츠 컨테이너를 <main>으로 변경하세요.

이 요소는 모든 페이지의 주 콘텐츠와 스크롤 영역을 감싸지만 현재 일반 <div>입니다.

As per coding guidelines, "컨테이너에는 semantic tag인 <main>을 사용한다."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/app/layout.tsx` around lines 70 - 73, In the root content
container identified by SCROLL_CONTAINER_ID, replace the wrapping div with a
semantic main element while preserving its id, className, and existing children.

Source: Coding guidelines

apps/web/src/app/archive/wish/_components/WishlistList.tsx (1)

9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

상위 디렉터리의 훅은 절대 경로로 import하세요.

../_hooks/useScrollRestoration은 같은 디렉터리 밖의 상대 경로입니다. @/app/archive/wish/_hooks/useScrollRestoration로 변경하세요.

As per coding guidelines, "relative imports only for files in the same directory."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/app/archive/wish/_components/WishlistList.tsx` at line 9, Update
the useScrollRestoration import in WishlistList.tsx to use the absolute alias
path `@/app/archive/wish/_hooks/useScrollRestoration` instead of the
parent-directory relative path, while preserving the imported symbol and
behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts`:
- Around line 45-67: Update the scroll restoration logic around the saved value
and restore callback so that when no stored scroll position exists, the
container’s scrollTop is explicitly reset to 0. Preserve the existing
saved-position retry behavior for saved values greater than zero, using the same
container and restoration state flow.

In `@apps/web/src/app/archive/wish/`[id]/_hooks/useDeleteWish.ts:
- Line 19: Update the post-delete navigation in the delete-success flow of
useDeleteWish: call router.back() only when the wish detail was entered from the
wishlist, and otherwise navigate to ROUTES.WISHLIST with router.replace().
Preserve the existing success behavior while preventing users from remaining on
the deleted detail page when no usable history exists.

---

Nitpick comments:
In `@apps/web/src/app/archive/wish/_components/WishlistList.tsx`:
- Line 9: Update the useScrollRestoration import in WishlistList.tsx to use the
absolute alias path `@/app/archive/wish/_hooks/useScrollRestoration` instead of
the parent-directory relative path, while preserving the imported symbol and
behavior.

In `@apps/web/src/app/layout.tsx`:
- Around line 70-73: In the root content container identified by
SCROLL_CONTAINER_ID, replace the wrapping div with a semantic main element while
preserving its id, className, and existing children.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 00ae67fa-b47e-4d6b-b2b8-772f39e30964

📥 Commits

Reviewing files that changed from the base of the PR and between 8a395f5 and 1e57666.

📒 Files selected for processing (5)
  • apps/web/src/app/archive/wish/[id]/_hooks/useDeleteWish.ts
  • apps/web/src/app/archive/wish/_components/WishlistList.tsx
  • apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts
  • apps/web/src/app/layout.tsx
  • apps/web/src/consts/layout.ts

Comment thread apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts Outdated
Comment thread apps/web/src/app/archive/wish/[id]/_hooks/useDeleteWish.ts
@github-actions

Copy link
Copy Markdown

Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/web/src/app/archive/wish/_components/wish-grid/index.tsx (1)

30-35: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

클릭 가능한 Link에 cursor-pointer를 추가하세요.

두 카드 Link 모두 클릭 요소이지만 포인터 커서가 없습니다.

수정 예시
 <Link
   href={ROUTES.WISH_EDIT(item.id)}
+  className="cursor-pointer"
   key={item.id}

As per coding guidelines, "Add cursor-pointer to clickable elements unless a shared Button component already provides it through cva."

Also applies to: 73-78

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/app/archive/wish/_components/wish-grid/index.tsx` around lines
30 - 35, 두 카드의 Link 요소에 cursor-pointer 클래스를 추가하세요. `ROUTES.WISH_EDIT`를 사용하는
Link와 두 번째 카드 Link 모두에 적용하고, 기존 스타일 클래스와 클릭 동작은 유지하세요.

Source: Coding guidelines

apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts (1)

3-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

프로젝트 모듈 import를 @/ 절대 경로로 통일하세요.

  • apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts#L3-L9: ../_utils/wishScroll@/app/archive/wish/_utils/wishScroll로 변경하세요.
  • apps/web/src/app/archive/wish/_components/wish-grid/index.tsx#L9-L9: ../../_utils/wishScroll@/app/archive/wish/_utils/wishScroll로 변경하세요.

As per coding guidelines, "Use @/* absolute imports for project modules and relative imports only for files in the same directory."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts` around lines 3
- 9, Replace the relative wishScroll imports with the `@/` absolute alias in
useScrollRestoration.ts and wish-grid/index.tsx: use
`@/app/archive/wish/_utils/wishScroll` at both affected sites.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/src/app/archive/wish/_components/wish-grid/index.tsx`:
- Around line 21-23: Update handleCardClick to skip saveWishScroll when the
anchor is opened with Ctrl, Cmd, Shift, or Alt, while preserving the existing
save behavior for normal clicks.

---

Nitpick comments:
In `@apps/web/src/app/archive/wish/_components/wish-grid/index.tsx`:
- Around line 30-35: 두 카드의 Link 요소에 cursor-pointer 클래스를 추가하세요.
`ROUTES.WISH_EDIT`를 사용하는 Link와 두 번째 카드 Link 모두에 적용하고, 기존 스타일 클래스와 클릭 동작은 유지하세요.

In `@apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts`:
- Around line 3-9: Replace the relative wishScroll imports with the `@/` absolute
alias in useScrollRestoration.ts and wish-grid/index.tsx: use
`@/app/archive/wish/_utils/wishScroll` at both affected sites.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 39760991-15f3-46d6-8c17-325693acb507

📥 Commits

Reviewing files that changed from the base of the PR and between 1e57666 and 45cb351.

📒 Files selected for processing (4)
  • apps/web/src/app/archive/wish/_components/wish-grid/index.tsx
  • apps/web/src/app/archive/wish/_hooks/useScrollRestoration.ts
  • apps/web/src/app/archive/wish/_utils/wishScroll.ts
  • apps/web/src/app/layout.tsx

Comment thread apps/web/src/app/archive/wish/_components/wish-grid/index.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/src/app/archive/wish/_components/wish-grid/index.tsx (1)

33-40: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

카드 Link에 cursor-pointer를 추가해 주세요.

두 카드 Link가 클릭 가능하지만 cursor-pointer가 없어 저장소 UI 규칙을 위반합니다. 두 Link에 동일한 클래스를 추가해 주세요.

수정 예시
           <Link
             href={ROUTES.WISH_EDIT(item.id)}
             key={item.id}
             data-wish-id={item.id}
+            className="cursor-pointer"
             onClick={event => handleCardClick(event, item.id)}
           >

Also applies to: 76-89

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/app/archive/wish/_components/wish-grid/index.tsx` around lines
33 - 40, Update both card Link elements in the wish grid, including the Link
wrapping WishFailedCard and the corresponding Link at the referenced second
section, to include the shared cursor-pointer class. Keep their existing href,
key, data attributes, and click handlers unchanged.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@apps/web/src/app/archive/wish/_components/wish-grid/index.tsx`:
- Around line 33-40: Update both card Link elements in the wish grid, including
the Link wrapping WishFailedCard and the corresponding Link at the referenced
second section, to include the shared cursor-pointer class. Keep their existing
href, key, data attributes, and click handlers unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 82ad5173-db8e-401a-9046-d748d761e0f8

📥 Commits

Reviewing files that changed from the base of the PR and between 45cb351 and 62481bc.

📒 Files selected for processing (1)
  • apps/web/src/app/archive/wish/_components/wish-grid/index.tsx

@iOdiO89 iOdiO89 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.

내 토너먼트 페이지에도 useScrollRestoration 훅 적용하면 어떨까
data-wish-id 같은 위시 종속적인 키값들만 일반화하면 될 것 같아
ux 고려 짱짱

@@ -0,0 +1,64 @@
import { SCROLL_CONTAINER_ID } from '@/consts/layout';

const STORAGE_KEY_PREFIX = 'piki.wishScroll.';

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.

키값은 piki: 형식으로 통일해줘!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

반영했어~! 3c83ed0

Comment on lines 61 to 64
<div
className={`pointer-events-none absolute top-0 right-0 left-0 z-[11] aspect-[201/166] bg-black/20 transition-opacity duration-200 ${isSelected ? 'opacity-100' : 'opacity-0'}`}
/>
<span className="pointer-events-none absolute top-3 left-3 z-[12] block size-5">

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.

Suggested change
<div
className={`pointer-events-none absolute top-0 right-0 left-0 z-[11] aspect-[201/166] bg-black/20 transition-opacity duration-200 ${isSelected ? 'opacity-100' : 'opacity-0'}`}
/>
<span className="pointer-events-none absolute top-3 left-3 z-[12] block size-5">
<div
style={{ zIndex: Z_INDEX.BASE_IMAGE + 1 }}
className={`pointer-events-none absolute top-0 right-0 left-0 aspect-[201/166] bg-black/20 transition-opacity duration-200 ${isSelected ? 'opacity-100' : 'opacity-0'}`}
/>
<span
style={{ zIndex: Z_INDEX.BASE_IMAGE + 2 }}
className="pointer-events-none absolute top-3 left-3 block size-5"
>

이거 zindex만 이렇게 바꿔줄 수 있을까!?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

좋다 수정해놨어! cefcf66

@kanghaeun
kanghaeun merged commit 6a07452 into dev Jul 31, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Something isn't working WEB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 위시리스트 뒤로가기 시 스크롤 위치 리셋되는 문제

2 participants