Skip to content

Fix entire thumbnail card clickable#1098

Merged
yuni-ju merged 2 commits intodevelopfrom
qa/bookmark
Apr 11, 2026
Merged

Fix entire thumbnail card clickable#1098
yuni-ju merged 2 commits intodevelopfrom
qa/bookmark

Conversation

@yuni-ju
Copy link
Copy Markdown
Member

@yuni-ju yuni-ju commented Apr 8, 2026

작업 내용

  • 북마크 게시글 편집 시 썸네일 카드 전체를 클릭 영역으로 지정
  • 편집 상태가 아닐 때 북마크 게시글 클릭 시 해당 게시글로 이동하는 기능 추가

참고

기능적 영향 및 사용자 경험 변화

  • Bookmark 화면(presentation/src/.../bookmark/BookmarkScreen.kt)

    • 썸네일 카드 전체(이미지 포함)를 클릭 가능한 영역으로 변경하여 카드 전체 탭으로 게시글 열람 또는 편집 선택이 가능해짐.
    • 일반 모드: 카드 클릭 시 onPostClick(postId)를 호출해 해당 게시글로 네비게이트(편집 모드가 아닐 때의 동작).
    • 편집 모드: 카드 클릭(및 체크박스 조작)은 onBookmarkEditClick() → ViewModel의 toggleSelection(postId)를 호출해 선택/해제 처리.
    • 중복 클릭 방지용 clickableSingle(약 300ms) 적용으로 우발적 다중 클릭 방지.
  • 내 정보 네비게이션(presentation/src/.../mypage/MypageNavigation.kt)

    • MyPageRoute.bookmark()에서 BookmarkScreen에 onPostClick 콜백을 전달하도록 변경 — 네비게이션/라우팅 쪽에서 게시글 클릭 핸들러를 수용.

위험 포인트

  • 상태 일관성

    • 편집 모드에서 카드(Box)와 체크박스가 각기 onBookmarkEditClick()을 호출하므로 동일 액션으로 수렴하지만 클릭 이벤트가 중복 전달되거나 toggleSelection이 중복 호출될 수 있는 경로(체크박스 클릭 시 부모 Box로 이벤트 전파) 존재.
    • selectedBookmarks 집합 및 UI(체크박스 표시)가 비동기적으로 업데이트될 때 일시적 불일치(리컴포지션 시점) 가능성.
  • 이벤트 소비/전파 충돌

    • 체크박스가 클릭 이벤트를 완전히 소비하지 않으면 부모 클릭 핸들러도 트리거되어 의도치 않은 이중 토글 발생 가능.
  • 스레딩/네트워크 영향

    • 본 변경은 UI 이벤트/네비게이션 연결에 국한되어 네트워크 호출이나 백그라운드 스레드 변경은 없음. 다만 삭제(하단 버튼)나 선택 변경 시 ViewModel에서 비동기 작업(예: 서버 동기화)이 있다면 상태 반영 순서 관련 경합 가능성 존재.
  • 에러 처리

    • 네비게이션(onPostClick) 경로가 null/잘못된 id를 전달하는 케이스나 선택 삭제 실패 시 사용자 피드백 처리(에러 토스트/롤백)가 충분히 보장되어야 함.

필수 후속 검증 및 테스트

  1. 편집 모드 동작 검증

    • 카드(썸네일 포함) 클릭 시 toggleSelection(postId)가 정확히 한 번 호출되는지 확인.
    • 체크박스 클릭 시 부모 Box의 클릭이 중복 호출되지 않고 선택 상태가 한 번만 토글되는지 확인(이벤트 소비 여부 확인).
    • 빠른 연속 클릭(중복 클릭) 시 clickableSingle로 중복 토글 방지되는지 확인.
  2. 일반 모드 동작 검증

    • 편집 모드가 아닐 때 카드 클릭이 onPostClick(postId)를 호출하여 정상적으로 상세 화면으로 네비게이트되는지 확인.
    • onPostClick에 전달되는 postId 값이 올바른지 검사(경계값/널 검사).
  3. 상태 일관성 및 UI 동기화

    • selectedBookmarks 컬렉션과 체크박스 UI가 항상 동기화되는지(리컴포지션/페이징 항목 교체 시 포함) 확인.
    • 다수 아이템 선택/삭제 후 화면 상태(카운트, 버튼 활성화 등)가 정확히 반영되는지 확인.
  4. 오류 및 네비게이션 예외

    • 삭제 실패 또는 서버 동기화 실패 시 롤백/에러 노출이 적절히 동작하는지 확인.
    • onPostClick으로 네비게이션 실패(잘못된 id) 시 앱 비정상 종료 방지 및 적절한 핸들링 확인.
  5. 접근성 및 UX

    • 전체 카드가 클릭 대상이 된 만큼 터치 타깃이 적절한지, 보이스오버 등 접근성 도구에서의 포커스/설명(체크박스와 카드의 역할)이 명확한지 점검.

(변경된 주요 파일: presentation/src/main/java/daily/dayo/presentation/screen/bookmark/BookmarkScreen.kt, presentation/src/main/java/daily/dayo/presentation/screen/mypage/MypageNavigation.kt)

@yuni-ju yuni-ju requested a review from DongJun-H April 8, 2026 11:54
@yuni-ju yuni-ju self-assigned this Apr 8, 2026
@yuni-ju yuni-ju added this to DAYO 2.0 Apr 8, 2026
@yuni-ju yuni-ju added the QA label Apr 8, 2026
@github-project-automation github-project-automation bot moved this to Todo in DAYO 2.0 Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Walkthrough

BookmarkScreenonPostClick: (Long) -> Unit 파라미터가 추가되고, BookmarkPostItem의 콜백 API가 onBookmarkPostClick: (BookmarkPost) -> UnitonBookmarkEditClick: () -> Unit으로 분리되었습니다. 이미지 영역과 아이템 컨테이너 클릭 로직이 편집 모드에 따라 서로 다른 콜백을 호출하도록 변경되었습니다.

Changes

Cohort / File(s) Summary
Bookmark UI & callbacks
presentation/src/main/java/daily/dayo/presentation/screen/bookmark/BookmarkScreen.kt
BookmarkScreen 시그니처에 onPostClick: (Long) -> Unit 추가. BookmarkPostItemonBookmarkClick: () -> UnitonBookmarkPostClick: (BookmarkPost) -> UnitonBookmarkEditClick: () -> Unit으로 대체. 아이템/이미지 영역에 clickableSingle 적용: 편집 모드가 아닐 땐 onBookmarkPostClick(post) 호출, 편집 모드일 땐 onBookmarkEditClick() 호출. 체크박스의 onCheckedChangeonBookmarkEditClick()로 리다이렉트.
Navigation routing
presentation/src/main/java/daily/dayo/presentation/screen/mypage/MypageNavigation.kt
MyPageRoute.bookmark()에서 새 onPostClick: (Long) -> Unit 콜백을 BookmarkScreen으로 전달하도록 업데이트. 기존 onBackClick 전달은 유지.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경사항의 주요 내용을 정확히 반영합니다. 북마크 화면의 썸네일 카드 전체를 클릭 가능하게 만드는 것이 핵심 변경사항이며, 제목에서 명확히 드러납니다.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ 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 qa/bookmark

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.

@yuni-ju yuni-ju changed the title [QA] Fix entire thumbnail card clickable Fix entire thumbnail card clickable Apr 8, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@presentation/src/main/java/daily/dayo/presentation/screen/bookmark/BookmarkScreen.kt`:
- Around line 227-229: The Box currently always applies
Modifier.clickableSingle(onClick = { onBookmarkClick() }) causing toggles
outside edit mode; update the Box's modifier so clickableSingle is only applied
when the screen is in edit mode (e.g. use the edit-mode boolean used in this
class such as isEditMode/isEditing). Concretely, build the Modifier
conditionally (e.g. baseModifier.then(if (isEditMode) Modifier.clickableSingle {
onBookmarkClick() } else Modifier)) or use an if expression to return
Modifier.clickableSingle only when edit mode is true, keeping other modifiers
intact. Ensure you reference Modifier.clickableSingle, the Box composable and
the onBookmarkClick callback when making the change.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ec34b686-ae10-4f9a-89c6-4747b75806d7

📥 Commits

Reviewing files that changed from the base of the PR and between 4498271 and e1a318b.

📒 Files selected for processing (1)
  • presentation/src/main/java/daily/dayo/presentation/screen/bookmark/BookmarkScreen.kt

@github-project-automation github-project-automation bot moved this from Todo to In Progress in DAYO 2.0 Apr 11, 2026
@yuni-ju yuni-ju merged commit 70ed45c into develop Apr 11, 2026
2 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in DAYO 2.0 Apr 11, 2026
@yuni-ju yuni-ju deleted the qa/bookmark branch April 11, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[QA] Fix img_thumbnail in MY_bookmark_edit_select

2 participants