Skip to content

feat(web/hero): add view editorial CTA + skip entry on revisit#543

Merged
cocoyoon merged 1 commit into
devfrom
feature/hero-cta-view-editorial
May 16, 2026
Merged

feat(web/hero): add view editorial CTA + skip entry on revisit#543
cocoyoon merged 1 commit into
devfrom
feature/hero-cta-view-editorial

Conversation

@cocoyoon
Copy link
Copy Markdown
Member

Summary

홈 히어로 섹션에서 카드를 눌렀을 때 가운데로 확대만 되고 끝나는 문제 해결.

  • CTA 추가: focus 상태에서 카드 하단 바깥에 "View editorial" 버튼이 나타나고, 클릭 시 `/posts/[id]` 로 이동. 카드 회전을 상쇄해 버튼은 항상 수평 유지.
  • revisit 시 셔플 제거: 디테일 페이지에서 돌아왔을 때 카드들이 매번 화면 밖에서 다시 날아 들어와 "셔플"처럼 보이던 현상 제거. `MainHero`가 마운트 시점의 `sessionStorage("hero-cover-seen")` 값을 `skipEntry` prop으로 내려, 같은 세션 재방문에서는 burst 진입 애니메이션을 건너뛰고 카드를 즉시 제자리에 둠.

Why the CTA navigation needs special handling

GSAP Draggable은 native bubble 단계에서 카드 element에 직접 이벤트를 attach한다. React 합성 이벤트는 root에서 dispatch되어 native보다 늦게 발화하므로, Link 자체에 `stopPropagation`을 걸어도 Draggable의 `onClick` 콜백이 먼저 fire되어 focus toggle이 발생한다.

해결: CTA의 `onPointerDown`에서 `ctaPressedRef = true`를 세팅하고, Draggable `onClick` 콜백 안에서 이 ref를 보고 `router.push`로 분기. drag 발생 시 `onDrag`에서 ref를 리셋해 stale 상태 방지.

Test plan

  • 데스크탑 홈에서 카드 클릭 → focus 확대 후 카드 하단에 "View editorial" 페이드인 확인
  • CTA 클릭 → `/posts/[id]` 이동
  • 카드 본체 클릭 → focus toggle 동작 유지 (navigate 안 됨)
  • 배경 dim / Esc 키 → focus 해제
  • 디테일에서 뒤로 가기 후 히어로 카드가 셔플처럼 다시 날아 들어오지 않는지 확인 (즉시 제자리)
  • 새 시크릿 창에서 첫 방문 시 cover + 카드 burst entry 애니메이션은 정상 재생되는지 확인

🤖 Generated with Claude Code

홈 히어로 카드 클릭 시 모달처럼 가운데 확대만 되고 끝나던 문제를 해결한다.

- focus 상태에서 카드 하단 바깥에 "View editorial" CTA 표시 (카드 회전을 상쇄해 항상 수평 유지). pointerdown 발생 위치를 ref로 기억해 GSAP Draggable의 onClick 콜백에서 navigate 분기 — React stopPropagation은 native bubble 단계보다 늦게 발화해 안전하지 않음.
- MainHero가 마운트 시점의 sessionStorage(`hero-cover-seen`) 값을 기억해 skipEntry로 내려준다. 디테일에서 돌아온 같은 세션에서는 burst 진입 애니메이션을 건너뛰고 카드를 즉시 제자리에 두어 "셔플" 인상을 제거한다.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

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

Project Deployment Actions Updated (UTC)
decoded-app Ready Ready Preview, Comment May 16, 2026 9:12am

@cocoyoon cocoyoon added the bump:none Docs / CI / tests only label May 16, 2026
@cocoyoon cocoyoon merged commit 51aa59f into dev May 16, 2026
8 of 9 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in decoded-monorepo May 16, 2026
@cocoyoon cocoyoon deleted the feature/hero-cta-view-editorial branch May 16, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump:none Docs / CI / tests only

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant