Repository navigation
fix(mindrecord): 일기 기록 날짜를 표시 전용으로 바꾼다 (#1008) #1121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
06cc3f5
fix(mindrecord): 일기 기록 날짜를 표시 전용으로 바꾼다 (#1008)
Sadturtleman 384d1dc
Merge remote-tracking branch 'origin/develop' into fix/1008-diary-dat…
Sadturtleman d3b4844
fix(mindrecord): 표시 전용 전환의 남은 자국을 정리한다 (#1008 리뷰)
Sadturtleman 8ebf1bf
Merge develop into fix/1008-diary-date-display-only
Sadturtleman 80b384d
Merge develop into fix/1008-diary-date-display-only
Sadturtleman 2127c9b
Merge develop into fix/1008-diary-date-display-only
Sadturtleman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
.../kotlin/com/afternote/feature/mindrecord/presentation/screen/DiaryWriteDateDisplayTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package com.afternote.feature.mindrecord.presentation.screen | ||
|
|
||
| import com.afternote.feature.mindrecord.presentation.viewmodel.DiaryWriteViewModel | ||
| import org.junit.Assert.assertTrue | ||
| import org.junit.Test | ||
| import java.time.LocalDate | ||
|
|
||
| /** | ||
| * 일기 기록 날짜가 «고를 수 있지만 반영되지 않는» 상태가 아닌지 (#1008). | ||
| * | ||
| * 서버는 생성·수정 어느 쪽에서도 `date` 를 받지 않고 기록 날짜를 요청 시각으로 정한다 | ||
| * (실측 2026-08-25: `POST`·`PATCH` 에 `date: "2026-08-01"` 을 실어 보내도 저장분은 | ||
| * `2026-08-25`, Swagger 스키마에도 필드가 없다). 그 상태에서 날짜 피커를 열어 두면 | ||
| * 사용자는 고른 날짜로 남았다고 믿는다. | ||
| * | ||
| * 화면에서 피커를 걷어냈으므로 **ViewModel 에 날짜를 바꾸는 창구가 남아 있으면 안 된다** — | ||
| * 남겨 두면 다음 사람이 그 함수를 보고 UI 를 되살린다. BE 가 `date` 를 수용하면 그때 함께 | ||
| * 되돌린다. | ||
| */ | ||
| class DiaryWriteDateDisplayTest { | ||
| @Test | ||
| fun `날짜를 바꾸는 공개 창구가 없다`() { | ||
| // "update" 가 "date" 를 부분 문자열로 품는다 — 날짜와 무관한 updateXxx 가 하나만 | ||
| // 생겨도 빨개지므로, 이름 규칙이 아니라 **LocalDate 를 받는 공개 함수**로 좁힌다. | ||
| val dateSetters = | ||
| DiaryWriteViewModel::class.java.methods | ||
| .filter { | ||
| java.lang.reflect.Modifier | ||
| .isPublic(it.modifiers) | ||
| }.filter { it.parameterTypes.any { type -> type == LocalDate::class.java } } | ||
| .map { it.name } | ||
|
|
||
| assertTrue("날짜 변경 창구가 남아 있다: $dateSetters", dateSetters.isEmpty()) | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[normal] 둘 다 막는 것은 아니다. 다음에 이 파일을 열 때 같이 정리하면 된다.
1. 이 필터는 항상 참이다.
Class.getMethods()는 정의상 public 멤버만 돌려준다(상속분 포함). 그래서isPublic은 걸러 내는 것이 없고, ktlint 가 이 호출 때문에 줄을 셋으로 쪼갰다. 지우면 한 줄로 돌아온다.2. 내가 제안한 타입 기반에는 구멍이 있다 — 짚어 두는 게 맞겠다.
LocalDate를 받는 함수만 보므로, 날짜 창구가onDateSelected(millis: Long)이나onDateSelected(iso: String)으로 되살아나면 이 가드는 침묵한다. 가상의 이야기만은 아니다 — 피커를 되살리는 사람은BottomSheetCalendar의 콜백 시그니처를 그대로 받아 적을 가능성이 높고, Compose 의 날짜 피커 계열은 epoch millis 를 넘기는 쪽이 흔하다.이름과 타입을 둘 다 보면 오탐 없이 촘촘해진다. 이름 쪽은 앞서 문제가 된
update…접두만 빼면 되고, 그 예외를 주석이 아니라 코드로 적어 두면 다음 사람이 왜 빠졌는지 알 수 있다.updateDate같은 이름이 생기면 이 예외에 가려지지만, 그때는LocalDate인자를 받든 다른 타입을 받든 첫 조건이나 리뷰가 잡는다. 지금처럼 한 조건만 두는 것보다는 넓다.