Skip to content

[Feature/#209] Coil3 커스텀 ImageLoader 설정 추가#210

Merged
wjdrjs00 merged 3 commits intodevelopfrom
feat/#209-coil-image-loader-setup
Apr 2, 2026
Merged

[Feature/#209] Coil3 커스텀 ImageLoader 설정 추가#210
wjdrjs00 merged 3 commits intodevelopfrom
feat/#209-coil-image-loader-setup

Conversation

@wjdrjs00
Copy link
Copy Markdown
Member

@wjdrjs00 wjdrjs00 commented Apr 1, 2026

[ PR Content ]

어제 언급했던 Coil3 커스텀 ImageLoader를 Application 레벨에서 설정했습니다.

Related issue

Screenshot 📸

  • N/A

Work Description

  • CoilEntryPoint 추가: Hilt EntryPoint를 통해 @NoneAuth OkHttpClient 주입
  • BitnagilApplicationSingletonImageLoader.Factory 구현
    • components { add(OkHttpNetworkFetcherFactory(...)) }로 OkHttp 클라이언트 연결
    • 메모리 캐시 25%, 디스크 캐시 50MB, 전역 크로스페이드 활성화
    • DEBUG 빌드에서만 DebugLogger 활성화
  • CollapsibleHeader: imageUrl이 비어있을 때 Coil을 거치지 않고 Image(painterResource(...))로 직접 렌더링

To Reviewers 📢

  • 기존에는 Coil 기본 OkHttpClient를 사용했지만, 앱의 @NoneAuth OkHttpClient를 재사용하도록 변경하고 메모리/디스크 캐시 전략을 명시적으로 설정했습니다.
  • 이외 궁금점은 리뷰 남겨주십쇼!

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 이미지 로더 통합으로 메모리(약 25% 제한) 및 디스크(캐시 폴더, 약 50MB) 캐싱을 통해 이미지 로딩 성능과 효율성 개선
    • 이미지 표시 시 부드러운 Crossfade 애니메이션 적용
  • 버그 수정

    • 감정 이미지 URL이 없거나 로드 실패할 때 기본 감정 이미지로 안정적으로 표시되도록 개선

@wjdrjs00 wjdrjs00 requested a review from l5x5l April 1, 2026 09:01
@wjdrjs00 wjdrjs00 self-assigned this Apr 1, 2026
@wjdrjs00 wjdrjs00 added ✨ Feature 새로운 기능 구현 🧤 대현 labels Apr 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4f3e1647-75a7-4de6-99e2-8ba10461684a

📥 Commits

Reviewing files that changed from the base of the PR and between be0d01e and bdf825c.

📒 Files selected for processing (1)
  • app/src/main/java/com/threegap/bitnagil/BitnagilApplication.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/java/com/threegap/bitnagil/BitnagilApplication.kt

Walkthrough

앱에 Coil3 번들 의존성을 추가하고, Hilt EntryPoint로 제공되는 @NoneAuth OkHttpClient를 재사용하는 애플리케이션 수준의 커스텀 Coil ImageLoader를 구현했습니다. 또한 빈 imageUrl일 때 CollapsibleHeader에서 Async 호출을 건너뛰고 기본 이미지를 동기 렌더링하도록 변경했습니다.

Changes

Cohort / File(s) Summary
Coil 의존성 추가
app/build.gradle.kts
Coil 라이브러리 번들(libs.bundles.coil)을 앱 종속성에 추가 (implementation(libs.bundles.coil)).
커스텀 ImageLoader 구현
app/src/main/java/com/threegap/bitnagil/BitnagilApplication.kt
애플리케이션 클래스가 SingletonImageLoader.Factory를 구현하고 newImageLoader(context)를 추가: Hilt 제공 @NoneAuth OkHttpClient 사용, 메모리 캐시 25% 설정, 디스크 캐시 cacheDir/image_cache(50MB), 전역 크로스페이드, DEBUG 시 DebugLogger 활성화.
Hilt EntryPoint 추가
app/src/main/java/com/threegap/bitnagil/di/core/CoilEntryPoint.kt
@EntryPointCoilEntryPoint 추가: @NoneAuth로 제공되는 OkHttpClient를 노출하는 noneAuthOkHttpClient() 메서드 정의 (InstalledIn SingletonComponent).
조건부 이미지 렌더링 변경
presentation/src/main/java/com/threegap/bitnagil/presentation/screen/home/component/template/CollapsibleHeader.kt
dailyEmotion.imageUrl가 빈 문자열이면 Image로 동기적으로 R.drawable.default_emotion을 렌더링하고, 비어있지 않으면 AsyncImage로 로드하며 에러 시 기본 이미지로 폴백하도록 분기 처리 변경.

Sequence Diagram(s)

sequenceDiagram
    participant App as BitnagilApplication
    participant Hilt as Hilt EntryPoint
    participant OkHttp as OkHttpClient (`@NoneAuth`)
    participant Loader as Coil ImageLoader
    participant CacheM as MemoryCache
    participant CacheD as DiskCache
    participant Network as Remote Server

    App->>Hilt: EntryPointAccessors.fromApplication(...) 호출
    Hilt-->>OkHttp: noneAuthOkHttpClient() 반환
    App->>Loader: newImageLoader(context) 구성 (OkHttp, MemoryCache(25%), DiskCache(50MB), DebugLogger?, crossfade)
    Loader->>CacheM: 메모리 캐시 확인
    alt 캐시 미스
        Loader->>CacheD: 디스크 캐시 확인
        alt 디스크 미스
            Loader->>OkHttp: 이미지 요청 전송
            OkHttp->>Network: 네트워크 요청
            Network-->>OkHttp: 이미지 응답
            OkHttp-->>Loader: 이미지 전달
            Loader->>CacheD: 디스크에 저장
            Loader->>CacheM: 메모리에 저장
        else 디스크 히트
            CacheD-->>Loader: 이미지 전달
            Loader->>CacheM: 메모리에 저장
        end
    else 캐시 히트
        CacheM-->>Loader: 이미지 제공
    end
    Loader-->>App/UI: 이미지 렌더링 (crossfade)
Loading

예상 코드 리뷰 소요 시간

🎯 4 (Complex) | ⏱️ ~45 minutes

🐰 캐시 심었네, OkHttp도 빌려왔네
25%는 메모리밭, 50MB는 디스크 둑
빈 URL에는 요청을 멈추고
크로스페이드로 부드럽게 웃어보네 ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 Coil3 커스텀 ImageLoader 설정 추가라는 변경 사항의 핵심을 명확하게 나타내고 있습니다.
Description check ✅ Passed PR 설명은 관련 이슈, 작업 내용, 리뷰어 참고사항 등 필수 섹션을 모두 포함하고 있습니다.
Linked Issues check ✅ Passed 모든 계획된 작업이 완료되었습니다: Coil 의존성 추가, CoilEntryPoint 생성, BitnagilApplication에 SingletonImageLoader.Factory 구현, CollapsibleHeader 개선
Out of Scope Changes check ✅ Passed 모든 변경 사항이 이슈 #209의 목표와 일치하며 범위 내에 있습니다.

✏️ 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 feat/#209-coil-image-loader-setup

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.

Copy link
Copy Markdown
Contributor

@l5x5l l5x5l left a comment

Choose a reason for hiding this comment

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

🚀🚀

@wjdrjs00 wjdrjs00 merged commit 62d592e into develop Apr 2, 2026
2 checks passed
@wjdrjs00 wjdrjs00 deleted the feat/#209-coil-image-loader-setup branch April 2, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새로운 기능 구현 🧤 대현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Coil3 커스텀 ImageLoader 설정 추가

2 participants