Skip to content

refactor(model): 홈·마음의 기록 전용 타입을 core:model 밖으로 (#1085) - #1102

Merged
Sadturtleman merged 2 commits into
developfrom
refactor/1085-core-model-relocation
Aug 25, 2026
Merged

Sadturtleman merged 2 commits into
developfrom
refactor/1085-core-model-relocation

Conversation

@Sadturtleman

Copy link
Copy Markdown
Collaborator

Closes #1085

무엇을

core:model 은 11개 모듈이 의존하는 자리인데, 두 타입을 아는 모듈은 셋뿐이었다.

타입 이동 아는 모듈
HomeSummary feature:home:presentation.usecase 홈 하나 (생산 GetHomeSummaryUseCase, 소비 HomeTabViewModel)
MindRecordCategory feature:mindrecord:presentation.model 홈 · 마음의 기록 · app

새 모듈 의존은 0건이다. app 과 feature:home:presentation 은 이미 implementation(projects.feature.mindrecord.presentation) 을 갖고 있다. mindrecord:domain 이 아니라 presentation 에 둔 것도 그 때문이다 — domain 은 implementation 이라 app 까지 전파되지 않아 새 의존을 추가해야 한다.

feature:home:presentation 의 implementation(projects.core.model) 은 남긴다 — Receiver·ReceiverDeliveryConditions 등을 계속 쓴다.

순수 이동이다 (파일 2개)

패키지 선언과 import 경로 외에 바뀐 것은 MindRecordCategory 의 KDoc 한 문단뿐이다.

- UI 리소스(아이콘·표시 문자열)는 피처 모듈에서 확장 프로퍼티로 제공한다.
+ 표시용 아이콘·문구는 같은 패키지의 [MindRecordCategoryUi] 가 들고 있다.

실제로는 확장 프로퍼티가 아니라 같은 패키지의 sealed class 라 사실에 맞췄다. 파일이 12줄이라 git 이 rename 대신 D+A 로 표시할 수 있는데, 그 외 내용은 손대지 않았다.

검증

게이트 결과
:app:assembleDebug BUILD SUCCESSFUL
전 모듈 compileDebugUnitTestKotlin BUILD SUCCESSFUL
:app:compileDebugAndroidTestKotlin BUILD SUCCESSFUL
screenshotTest 5모듈 compileDebugScreenshotTestKotlin BUILD SUCCESSFUL
:konsist:test --rerun-tasks --no-build-cache BUILD SUCCESSFUL
전 모듈 testDebugUnitTest --rerun-tasks BUILD SUCCESSFUL

konsist 는 이슈에 적힌 대로 --rerun-tasks --no-build-cache 로 돌렸다 — 캐시가 프로젝트 전체 스캔을 반영하지 못해 그냥 돌리면 FROM-CACHE 로 거짓 green 이 난다.

스크린샷 baseline 재생성 불필요 — import 경로만 바뀌어 렌더 결과가 불변이다. 실제로 HomeTabScreenScreenshotTest 도 import 한 줄만 바뀌었다.

실기동 QA: 해당 없음. 타입의 소유 모듈만 옮기는 변경이라 동작이 바뀌는 자리가 없다.

#700 과의 경계

#700 은 이 enum 의 값(WEEKLY_REPORT vs 시안의 「깊은 생각」)을 다루고, 이 PR 은 위치만 다룬다. 이쪽이 먼저 들어가면 #700 이 겪을 충돌은 import 경로 한 줄이다.

core:model 은 11개 모듈이 의존하는 자리인데, 두 타입을 아는 모듈은 홈·마음의
기록·app 셋뿐이었다.

- HomeSummary → feature:home:presentation.usecase — 유일한 생산자인
  GetHomeSummaryUseCase 옆. 소비처도 같은 모듈의 HomeTabViewModel 하나다.
- MindRecordCategory → feature:mindrecord:presentation.model — 표시용
  MindRecordCategoryUi 옆. 세 모듈이 이미 이 모듈에 의존하고 있어 새 모듈
  의존이 생기지 않는다.

MindRecordCategory 의 KDoc 이 "UI 리소스는 확장 프로퍼티로 제공한다" 고 적혀
있었으나 실제로는 같은 패키지의 sealed class 라 사실에 맞췄다. 파일이 짧아
git 이 rename 대신 D+A 로 잡을 수 있는데, 패키지·주석 외 내용은 그대로다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@1hyok 1hyok left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

이관 자체는 정확하다. core:model 에 잔존 참조가 남지 않았고(MindRecordCategory·HomeSummary 전수 grep, 0건), 이슈 #1085 가 제안한 위치(feature.home.presentation.usecase)와도 일치한다. 새 모듈 의존이 생기지 않는다는 주석의 주장도 확인했다 — HomeTabScreen 이 이미 feature.mindrecord.presentation.hometab 을 참조하고 있었다.

blocking 은 없다. 자기 패키지를 import 하는 줄이 두 곳 생겼는데, 옮기면서 IDE 가 자동으로 붙인 것으로 보인다. 컴파일·ktlint 모두 통과하므로 다음 커밋에 함께 정리해도 무방하다.

검증

  • CI: 필수 체크 11종 전부 green.
  • 이관 후 잔존 참조: MindRecordCategory 28곳 · HomeSummary 20곳 전수 확인 — 모두 새 경로를 가리킨다. core:model 참조 0건.
  • 실기동 QA·시안 대조 해당 없음 — 순수 타입 이동이라 런타임 거동·화면 변화가 없다.

지적

  1. [normal] 자기 패키지 import → GetHomeSummaryUseCase.kt:5 인라인 코멘트.
  2. [normal] 자기 패키지 import → MindRecordCategoryUi.kt:16 인라인 코멘트.

import com.afternote.core.common.result.runCatchingCancellable
import com.afternote.core.domain.repository.UserRepository
import com.afternote.core.model.HomeSummary
import com.afternote.feature.home.presentation.usecase.HomeSummary

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[normal] 이 파일의 package 가 com.afternote.feature.home.presentation.usecase 라 같은 패키지를 import 하고 있다. 지워도 컴파일된다.

HomeSummary.kt 를 같은 패키지로 옮겼으니 이 import 는 이관 과정에서 남은 흔적으로 보인다. ktlint 의 no-unused-imports 가 same-package import 는 잡지 않아 CI 로는 걸리지 않는다.

import androidx.compose.ui.unit.dp
import com.afternote.core.model.MindRecordCategory
import com.afternote.feature.mindrecord.presentation.R
import com.afternote.feature.mindrecord.presentation.model.MindRecordCategory

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[normal] 위와 같은 건이다 — 이 파일의 package 도 com.afternote.feature.mindrecord.presentation.model 이라 자기 패키지를 import 한다.

새로 만든 MindRecordCategory.kt 를 바로 옆에 뒀으니 이 줄은 필요 없다.

@github-actions github-actions Bot added the conflict base 와 충돌 — CI 가 트리거되지 않는다. base 를 병합하면 자동으로 떨어진다 label Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

이 PR 은 develop 와 충돌 상태이고, 그래서 CI 가 돌지 않는다.

pull_request 워크플로는 base 와 head 를 합친 가상 머지 커밋(refs/pull/<N>/merge)에서
실행되는데, 충돌이면 GitHub 이 그 ref 를 만들지 못해 워크플로가 트리거조차 되지 않는다.
체크가 실패하는 것이 아니라 아예 생성되지 않으므로, 새 커밋을 올려도 no checks reported
인 채 최신 커밋이 한 번도 검증되지 않은 상태로 남는다 (#1028).

develop 를 병합해 충돌을 풀면 검증이 다시 돈다. 해소되면 이 라벨은 자동으로 떨어진다.

수신자 예외 sealed 통합(#934)이 같은 import 블록을 고쳐 충돌했다 — 양쪽을 그대로 둔다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot removed the conflict base 와 충돌 — CI 가 트리거되지 않는다. base 를 병합하면 자동으로 떨어진다 label Aug 25, 2026
@Sadturtleman
Sadturtleman merged commit 428022f into develop Aug 25, 2026
14 checks passed
@Sadturtleman
Sadturtleman deleted the refactor/1085-core-model-relocation branch August 25, 2026 07:11
1hyok added a commit that referenced this pull request Aug 25, 2026
두 테스트 파일의 import 블록에서 충돌했다. #1102 가 MindRecordCategory 를
core:model 에서 feature:mindrecord:presentation 으로 옮겼고, 이 브랜치는 바로 옆
줄에서 repository import 를 픽스처로 바꿔 같은 hunk 에 걸렸다. 양쪽을 합친다.

검증: :koverXmlReportCi :konsist:test :build-logic:test
:app:compileDebugAndroidTestKotlin 전 모듈 ktlintCheck 통과.
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.

core:model 위치 정리 — 홈·마음의 기록 전용 타입 이관 (HomeSummary, MindRecordCategory)

2 participants