Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package com.ninecraft.booket.core.common.constants

data class ErrorDialogSpec(
val message: String,
val buttonLabel: String,
val buttonLabelResId: Int,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
val buttonLabelResId: Int,
@StringRes val buttonLabelResId: Int,

놓치신 거 같아서 슬쩍 제안드려용

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

억 붙였다고 생각하고 있었는데 빼먹었군여,, 다음 PR에 어노테이션 추가해야겠슴다...!

val action: () -> Unit,
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.ninecraft.booket.core.common.utils

import androidx.annotation.StringRes
import com.ninecraft.booket.core.common.R
import com.ninecraft.booket.core.common.constants.ErrorDialogSpec
import com.ninecraft.booket.core.common.constants.ErrorScope
import com.ninecraft.booket.core.common.event.ErrorEvent
Expand Down Expand Up @@ -46,11 +48,13 @@ fun handleException(
fun postErrorDialog(
errorScope: ErrorScope,
exception: Throwable,
@StringRes buttonLabelResId: Int = R.string.confirm,
action: () -> Unit = {},
) {
val spec = buildDialog(
scope = errorScope,
exception = exception,
buttonLabelResId = buttonLabelResId,
action = action,
)

Expand All @@ -60,6 +64,7 @@ fun postErrorDialog(
private fun buildDialog(
scope: ErrorScope,
exception: Throwable,
@StringRes buttonLabelResId: Int,
action: () -> Unit,
): ErrorDialogSpec {
val message = when {
Expand Down Expand Up @@ -92,7 +97,7 @@ private fun buildDialog(
}
}

return ErrorDialogSpec(message = message, buttonLabel = "확인", action = action)
return ErrorDialogSpec(message = message, buttonLabelResId = buttonLabelResId, action = action)
}

@Suppress("TooGenericExceptionCaught")
Expand Down
1 change: 1 addition & 0 deletions core/common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<string name="book_status_completed">독서 완료</string>
<string name="record_sort_page_ascending">페이지순</string>
<string name="record_sort_recent_register">최신 등록순</string>
<string name="confirm">확인</string>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Retry 라벨의 리소스 위치 일관성 확인 및 중앙화 제안

Splash에서 R.string.retry를 사용 중인데, 현재 confirm은 core-common에, retry는 다른 모듈(core-ui 등)에 있을 가능성이 있습니다. 버튼 라벨 리소스는 한 모듈로 중앙화하는 편이 의존성/가시성 측면에서 안정적입니다. 또한 PR 설명에 언급된 문구 통일(“다시 시도하기” vs “다시 시도”)도 함께 확정해 주세요.

다음 스크립트로 retry 리소스의 정의 위치를 확인해 주세요:

필요 시 core-common에 retry를 함께 두는 방향도 고려해 주세요. 예시:

   <string name="record_sort_recent_register">최신 등록순</string>
   <string name="confirm">확인</string>
+  <string name="retry">다시 시도</string>

🏁 Script executed:

#!/bin/bash
# retry 문자열 리소스 정의 위치 검색
rg -n -C1 -g '**/res/values/**/*.xml' '<string\s+name="retry">\s*([^<]+)\s*</string>'

Length of output: 393


Retry 라벨 리소스 중앙화 및 문구 통일 필요

현재 confirm 리소스는 core-common에, retry 리소스는 core-ui에 분리되어 있어 의존성 관리 및 가시성 측면에서 불일치합니다. 또한 사용 중인 버튼 문구가 “다시 시도”인지 “다시 시도하기”인지 프로젝트 전반에서 통일되어야 합니다.

수정 제안:

  • core-common/src/main/res/values/strings.xml에 retry 정의 추가 및 문구 확정
       <string name="confirm">확인</string>
    +  <string name="retry">다시 시도</string>  <!-- 또는 “다시 시도하기”로 통일 -->
  • core-ui/src/main/res/values/strings.xml에서 중복된 <string name="retry">…</string> 제거
  • 프로젝트 전역(코드, 레이아웃, 문서)에서 버튼 문구를 선택한 한 가지 표현으로 일관되게 교체
🤖 Prompt for AI Agents
In core/common/src/main/res/values/strings.xml around line 8, the retry label is
missing from core-common while a duplicate exists in core-ui; add a <string
name="retry"> entry to core-common with the decided wording (choose either "다시
시도" or "다시 시도하기"), remove the duplicated <string name="retry"> from
core-ui/src/main/res/values/strings.xml, and then search/replace across the
project (code, layouts, and docs) to ensure all usages use the chosen single
expression so resources are centralized and wording is consistent.

</resources>
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.ninecraft.booket.core.model

import androidx.compose.runtime.Stable

@Stable
data class BookUpsertModel(
val userBookId: String,
val userId: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.ninecraft.booket.core.model

import androidx.compose.runtime.Stable

data class ReadingRecordsModel(
val lastPage: Boolean = true,
val totalResults: Int = 0,
Expand All @@ -8,6 +10,7 @@ data class ReadingRecordsModel(
val readingRecords: List<ReadingRecordModel> = emptyList(),
)

@Stable
data class ReadingRecordModel(
val id: String = "",
val userBookId: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ fun ReedScaffold(
content: @Composable (PaddingValues) -> Unit,
) {
Scaffold(
modifier = modifier.keyboardHide(),
topBar = topBar,
bottomBar = bottomBar,
snackbarHost = snackbarHost,
floatingActionButton = floatingActionButton,
containerColor = containerColor,
contentWindowInsets = contentWindowInsets,
modifier = modifier.keyboardHide(),
) { innerPadding ->
content(innerPadding)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.ninecraft.booket.core.common.constants.ErrorDialogSpec
import com.ninecraft.booket.core.common.event.ErrorEvent
Expand Down Expand Up @@ -70,7 +71,8 @@ class MainActivity : ComponentActivity() {
dialogSpec.value?.let { spec ->
ReedDialog(
description = spec.message,
confirmButtonText = spec.buttonLabel,
confirmButtonText = stringResource(spec.buttonLabelResId),

onConfirmRequest = {
spec.action()
dialogSpec.value = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal fun RecordRegisterUi(
)
RecordProgressBar(
currentStep = state.currentStep,
modifier = modifier.padding(horizontal = ReedTheme.spacing.spacing5),
modifier = Modifier.padding(horizontal = ReedTheme.spacing.spacing5),
)
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing10))
when (state.currentStep) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class BookSearchPresenter @AssistedInject constructor(
}

is BookSearchUiEvent.OnSearchClick -> {
val query = event.text.trim()
val query = event.query.trim()
if (query.isNotEmpty()) {
searchBooks(query = query, startIndex = START_INDEX)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ internal fun SearchContent(
ReedTextField(
queryState = state.queryState,
queryHintRes = designR.string.search_book_hint,
onSearch = { text ->
state.eventSink(BookSearchUiEvent.OnSearchClick(text))
onSearch = { query ->
state.eventSink(BookSearchUiEvent.OnSearchClick(query))
},
onClear = {
state.eventSink(BookSearchUiEvent.OnClearClick)
},
modifier = modifier.padding(horizontal = ReedTheme.spacing.spacing5),
modifier = Modifier.padding(horizontal = ReedTheme.spacing.spacing5),
borderStroke = BorderStroke(width = 1.dp, color = ReedTheme.colors.borderBrand),
searchIconTint = ReedTheme.colors.contentBrand,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sealed interface BookSearchUiEvent : CircuitUiEvent {
data object OnBackClick : BookSearchUiEvent
data class OnRecentSearchClick(val query: String) : BookSearchUiEvent
data class OnRecentSearchRemoveClick(val query: String) : BookSearchUiEvent
data class OnSearchClick(val text: String) : BookSearchUiEvent
data class OnSearchClick(val query: String) : BookSearchUiEvent
data object OnClearClick : BookSearchUiEvent
data class OnBookClick(val isbn13: String) : BookSearchUiEvent
data object OnLoadMore : BookSearchUiEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ internal fun LibrarySearchContent(
ReedTextField(
queryState = state.queryState,
queryHintRes = R.string.library_search_hint,
onSearch = { text ->
state.eventSink(LibrarySearchUiEvent.OnSearchClick(text))
onSearch = { query ->
state.eventSink(LibrarySearchUiEvent.OnSearchClick(query))
},
onClear = {
state.eventSink(LibrarySearchUiEvent.OnClearClick)
},
modifier = modifier.padding(horizontal = ReedTheme.spacing.spacing5),
modifier = Modifier.padding(horizontal = ReedTheme.spacing.spacing5),
backgroundColor = ReedTheme.colors.baseSecondary,
borderStroke = null,
)
Expand Down
50 changes: 50 additions & 0 deletions feature/settings/src/main/assets/oss_licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,56 @@
"license": "Apache License 2.0",
"url": "https://github.com/coil-kt/coil"
},
{
"name": "Landscapist",
"license": "Apache License 2.0",
"url": "https://github.com/skydoves/landscapist"
},
{
"name": "Google Analytics",
"license": "Apache License 2.0",
"url": "https://firebase.google.com/docs/analytics"
},
{
"name": "Firebase Crashlytics",
"license": "Apache License 2.0",
"url": "https://firebase.google.com/docs/crashlytics"
},
{
"name": "ML Kit Text Recognition",
"license": "Apache License 2.0",
"url": "https://developers.google.com/ml-kit/vision/text-recognition"
},
{
"name": "Compose System UI Controller",
"license": "MIT License",
"url": "https://github.com/taehwandev/ComposeExtensions"
},
{
"name": "Compose Keyboard State",
"license": "MIT License",
"url": "https://github.com/taehwandev/ComposeExtensions"
},
{
"name": "Lottie Compose",
"license": "Apache License 2.0",
"url": "https://github.com/airbnb/lottie-android"
},
{
"name": "Kakao SDK",
"license": "Apache License 2.0",
"url": "https://developers.kakao.com/docs/latest/ko/android/getting-started"
},
{
"name": "Kotlinx Collections Immutable",
"license": "Apache License 2.0",
"url": "https://github.com/Kotlin/kotlinx.collections.immutable"
},
{
"name": "Compose Shadow",
"license": "MIT License",
"url": "https://github.com/adamglin0/compose-shadow"
},
{
"name": "Detekt",
"license": "Apache License 2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import com.ninecraft.booket.core.common.constants.ErrorScope
import com.ninecraft.booket.core.common.utils.postErrorDialog
import com.ninecraft.booket.core.data.api.repository.AuthRepository
Comment on lines +9 to 11
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

R 소스 모듈 확인: retry 리소스가 core-ui가 아닌 다른 모듈에 있을 수 있습니다.

현재 import com.ninecraft.booket.core.ui.R을 통해 R.string.retry를 참조합니다. 실제 retry 정의가 core-ui가 아닐 경우, 올바른 모듈의 R로 수정해야 합니다. 또한 confirm은 core-common에 있으므로 버튼 라벨 리소스의 모듈 위치를 통일하는 편이 좋습니다.

아래 스크립트로 retry 정의 위치와 현재 import가 맞는지 점검해 주세요:

Also applies to: 15-15


🏁 Script executed:

#!/bin/bash
# retry 문자열 정의 위치 나열
rg -n -C1 -g '**/res/values/**/*.xml' '<string\s+name="retry">\s*([^<]+)\s*</string>'

# SplashPresenter에서 실제로 어떤 R을 import하는지 출력
fd -t f 'SplashPresenter.kt' -E '.gradle' -E 'build' \
  | xargs -I{} rg -n 'import\s+.*\.R\b' {}

Length of output: 528


아래 스크립트로 confirm 문자열 정의 위치를 확인해 주세요:


🏁 Script executed:

#!/bin/bash
# confirm 문자열 정의 위치 나열
rg -n -C1 -g '**/res/values/**/*.xml' '<string\s+name="confirm">\s*([^<]+)\s*</string>'

Length of output: 342


UI 리소스 모듈 일관성 검토: retry(core-ui) vs confirm(core-common)

  • retry 정의:
    • 위치: core/ui/src/main/res/values/strings.xml:4
    • SplashPresenter의 import(com.ninecraft.booket.core.ui.R)과 일치함
  • confirm 정의:
    • 위치: core/common/src/main/res/values/strings.xml:8
    • 현 코드에서는 core-ui.R을 사용하므로 참조 모듈 불일치 가능성 존재
  • 제안: 버튼 라벨 리소스(retry, confirm)를 동일 모듈에서 관리하도록 조정
    • confirm을 core-ui 모듈로 이동 후 리소스 import 유지
    • 또는 retry를 core-common 모듈로 이동하고 SplashPresenter import를 com.ninecraft.booket.core.common.R로 변경
🤖 Prompt for AI Agents
In feature/splash/src/main/kotlin/com/ninecraft/booket/splash/SplashPresenter.kt
around lines 9 to 11, the presenter imports com.ninecraft.booket.core.ui.R while
string resources used (retry vs confirm) live in different modules (core-ui vs
core-common), causing inconsistent resource resolution; fix by making both
button labels reside in the same module and aligning imports: either move the
"confirm" string into core/ui (res/values/strings.xml) and keep the current
import, or move the "retry" string into core/common and change the import in
this file to com.ninecraft.booket.core.common.R, then update any references and
rebuild to ensure R resolves correctly.

import com.ninecraft.booket.core.data.api.repository.UserRepository
import com.ninecraft.booket.core.model.AutoLoginState
import com.ninecraft.booket.core.model.OnboardingState
import com.ninecraft.booket.core.ui.R
import com.ninecraft.booket.feature.screens.HomeScreen
import com.ninecraft.booket.feature.screens.LoginScreen
import com.ninecraft.booket.feature.screens.OnboardingScreen
Expand Down Expand Up @@ -50,8 +53,13 @@ class SplashPresenter @AssistedInject constructor(
navigator.resetRoot(LoginScreen)
}
}
.onFailure {
navigator.resetRoot(LoginScreen)
.onFailure { exception ->
postErrorDialog(
errorScope = ErrorScope.GLOBAL,
exception = exception,
buttonLabelResId = R.string.retry,
action = { checkTermsAgreement() },
)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ landscapist-placeholder = { group = "com.github.skydoves", name = "landscapist-p
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-datetime" }
kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "kotlinx-collections-immutable" }

circuit-foundation = { group = "com.slack.circuit", name = "circuit-foundation", version.ref = "circuit" }
Expand Down
Loading