-
Notifications
You must be signed in to change notification settings - Fork 1
Navigation3로 전환한다 #712
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
Open
l2hyunwoo
wants to merge
2
commits into
develop
Choose a base branch
from
feature/nav-3-base
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Navigation3로 전환한다 #712
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # CLAUDE.md | ||
|
|
||
| ## Code Style Rules | ||
|
|
||
| ### No Inline Imports (FQCN 직접 사용 금지) | ||
| - 클래스를 사용할 때 반드시 상단에 `import` 문을 선언하고, 코드 본문에서는 단순 클래스명만 사용할 것 | ||
| - `android.app.Activity`처럼 FQCN(Fully Qualified Class Name)을 코드 본문에 직접 작성하지 않을 것 | ||
| - Bad: `(context as? android.app.Activity)?.finish()` | ||
| - Good: `import android.app.Activity` 후 `(context as? Activity)?.finish()` |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package com.ku_stacks.ku_ring | ||
|
|
||
| import androidx.activity.ComponentActivity | ||
| import androidx.activity.compose.setContent | ||
| import androidx.activity.enableEdgeToEdge | ||
| import androidx.navigation3.runtime.entryProvider | ||
| import androidx.navigation3.runtime.rememberNavBackStack | ||
| import androidx.navigation3.ui.NavDisplay | ||
| import com.ku_stacks.ku_ring.compose.locals.KuringCompositionLocalProvider | ||
| import com.ku_stacks.ku_ring.designsystem.kuringtheme.KuringTheme | ||
| import com.ku_stacks.ku_ring.navigation.EntryBuilderProvider | ||
| import com.ku_stacks.ku_ring.navigation.keys.SplashKey | ||
| import dagger.hilt.android.AndroidEntryPoint | ||
| import javax.inject.Inject | ||
|
|
||
| @AndroidEntryPoint | ||
| class HostActivity : ComponentActivity() { | ||
|
|
||
| @Inject | ||
| lateinit var entryBuilders: @JvmSuppressWildcards Set<EntryBuilderProvider> | ||
|
|
||
| override fun onCreate(savedInstanceState: android.os.Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| enableEdgeToEdge() | ||
| setContent { | ||
| KuringCompositionLocalProvider { | ||
| KuringTheme { | ||
| val backStack = rememberNavBackStack(SplashKey) | ||
| NavDisplay( | ||
| backStack = backStack, | ||
| onBack = { if (backStack.removeLastOrNull() == null) finish() }, | ||
| entryProvider = entryProvider { | ||
| entryBuilders.forEach { builder -> | ||
| with(builder) { provide() } | ||
| } | ||
| } | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/ku_stacks/ku_ring/di/NavigationModule.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,14 @@ | ||
| package com.ku_stacks.ku_ring.di | ||
|
|
||
| import com.ku_stacks.ku_ring.navigation.EntryBuilderProvider | ||
| import dagger.Module | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
| import dagger.multibindings.Multibinds | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| abstract class NavigationModule { | ||
| @Multibinds | ||
| abstract fun bindEntryBuilderProviders(): Set<EntryBuilderProvider> | ||
| } |
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
19 changes: 19 additions & 0 deletions
19
build-logic/src/main/kotlin/com/ku_stacks/ku_ring/buildlogic/primitive/Navigation3Plugin.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,19 @@ | ||
| package com.ku_stacks.ku_ring.buildlogic.primitive | ||
|
|
||
| import com.ku_stacks.ku_ring.buildlogic.dsl.implementation | ||
| import com.ku_stacks.ku_ring.buildlogic.dsl.library | ||
| import com.ku_stacks.ku_ring.buildlogic.dsl.libs | ||
| import org.gradle.api.Plugin | ||
| import org.gradle.api.Project | ||
| import org.gradle.kotlin.dsl.dependencies | ||
|
|
||
| class Navigation3Plugin : Plugin<Project> { | ||
| override fun apply(target: Project) = | ||
| with(target) { | ||
| dependencies { | ||
| implementation(libs.library("navigation3-runtime")) | ||
| implementation(libs.library("navigation3-ui")) | ||
| implementation(libs.library("lifecycle-viewmodel-navigation3")) | ||
| } | ||
| } | ||
| } |
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 @@ | ||
| /build |
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,13 @@ | ||
| import com.ku_stacks.ku_ring.buildlogic.dsl.setNameSpace | ||
|
|
||
| plugins { | ||
| kuring("feature") | ||
| } | ||
|
|
||
| android { | ||
| setNameSpace("core.navigation") | ||
| } | ||
|
|
||
| dependencies { | ||
| api(libs.navigation3.runtime) | ||
| } |
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,3 @@ | ||
| # Keep all @Serializable NavKey implementations for Navigation 3 back stack serialization | ||
| -keep @kotlinx.serialization.Serializable class * implements androidx.navigation3.runtime.NavKey { *; } | ||
| -keepnames @kotlinx.serialization.Serializable class * implements androidx.navigation3.runtime.NavKey |
8 changes: 8 additions & 0 deletions
8
core/navigation/src/main/java/com/ku_stacks/ku_ring/navigation/EntryBuilderProvider.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,8 @@ | ||
| package com.ku_stacks.ku_ring.navigation | ||
|
|
||
| import androidx.navigation3.runtime.EntryProviderScope | ||
| import androidx.navigation3.runtime.NavKey | ||
|
|
||
| interface EntryBuilderProvider { | ||
| fun EntryProviderScope<NavKey>.provide() | ||
| } |
8 changes: 8 additions & 0 deletions
8
core/navigation/src/main/java/com/ku_stacks/ku_ring/navigation/keys/AppLifecycleKeys.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,8 @@ | ||
| package com.ku_stacks.ku_ring.navigation.keys | ||
|
|
||
| import androidx.navigation3.runtime.NavKey | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable data object SplashKey : NavKey | ||
| @Serializable data object OnboardingKey : NavKey | ||
| @Serializable data class AuthFlowKey(val entryPoint: String) : NavKey |
18 changes: 18 additions & 0 deletions
18
core/navigation/src/main/java/com/ku_stacks/ku_ring/navigation/keys/ContentDetailKeys.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,18 @@ | ||
| package com.ku_stacks.ku_ring.navigation.keys | ||
|
|
||
| import androidx.navigation3.runtime.NavKey | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable data class NoticeWebKey( | ||
| val url: String, | ||
| val articleId: String, | ||
| val id: String, | ||
| val category: String, | ||
| val subject: String, | ||
| ) : NavKey | ||
|
|
||
| @Serializable data class NotionViewKey(val url: String) : NavKey | ||
|
|
||
| @Serializable data object ClubOnboardingKey : NavKey | ||
| @Serializable data class ClubDetailKey(val clubId: Int) : NavKey | ||
| @Serializable data object ClubSubscriptionKey : NavKey | ||
9 changes: 9 additions & 0 deletions
9
core/navigation/src/main/java/com/ku_stacks/ku_ring/navigation/keys/MainNavigationKeys.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,9 @@ | ||
| package com.ku_stacks.ku_ring.navigation.keys | ||
|
|
||
| import androidx.navigation3.runtime.NavKey | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable data class MainHubKey(val startTab: String = "Notice") : NavKey | ||
| @Serializable data object ArchiveKey : NavKey | ||
| @Serializable data object SearchKey : NavKey | ||
| @Serializable data object OpenSourceKey : NavKey |
11 changes: 11 additions & 0 deletions
11
core/navigation/src/main/java/com/ku_stacks/ku_ring/navigation/keys/UtilityScreenKeys.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,11 @@ | ||
| package com.ku_stacks.ku_ring.navigation.keys | ||
|
|
||
| import androidx.navigation3.runtime.NavKey | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable data object FeedbackKey : NavKey | ||
| @Serializable data object EditSubscriptionKey : NavKey | ||
| @Serializable data object EditDepartmentsKey : NavKey | ||
| @Serializable data object NotificationKey : NavKey | ||
| @Serializable data object LibrarySeatKey : NavKey | ||
| @Serializable data object KuringBotKey : NavKey |
Empty file.
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
43 changes: 43 additions & 0 deletions
43
feature/club/src/main/java/com/ku_stacks/ku_ring/club/detail/ClubDetailEntryBuilder.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,43 @@ | ||
| package com.ku_stacks.ku_ring.club.detail | ||
|
|
||
| import android.app.Activity | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.safeDrawingPadding | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.platform.LocalContext | ||
| import androidx.navigation3.runtime.EntryProviderScope | ||
| import androidx.navigation3.runtime.NavKey | ||
| import com.ku_stacks.ku_ring.designsystem.kuringtheme.KuringTheme | ||
| import com.ku_stacks.ku_ring.navigation.EntryBuilderProvider | ||
| import com.ku_stacks.ku_ring.navigation.keys.ClubDetailKey | ||
| import com.ku_stacks.ku_ring.util.navigateToExternalBrowser | ||
| import dagger.Module | ||
| import dagger.Provides | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
| import dagger.multibindings.IntoSet | ||
|
|
||
| class ClubDetailEntryBuilder : EntryBuilderProvider { | ||
| override fun EntryProviderScope<NavKey>.provide() { | ||
| entry<ClubDetailKey> { key -> | ||
| val context = LocalContext.current | ||
| ClubDetailScreen( | ||
| onBack = { (context as? Activity)?.finish() }, | ||
| onMoveToRecruitmentLink = context::navigateToExternalBrowser, | ||
| modifier = Modifier | ||
| .background(KuringTheme.colors.background) | ||
| .safeDrawingPadding() | ||
| .fillMaxSize(), | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| object ClubDetailEntryBuilderModule { | ||
| @Provides | ||
| @IntoSet | ||
| fun provideClubDetailEntryBuilder(): EntryBuilderProvider = ClubDetailEntryBuilder() | ||
| } |
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
...re/club/src/main/java/com/ku_stacks/ku_ring/club/onboarding/ClubOnboardingEntryBuilder.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.ku_stacks.ku_ring.club.onboarding | ||
|
|
||
| import android.app.Activity | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.platform.LocalContext | ||
| import androidx.navigation3.runtime.EntryProviderScope | ||
| import androidx.navigation3.runtime.NavKey | ||
| import com.ku_stacks.ku_ring.navigation.EntryBuilderProvider | ||
| import com.ku_stacks.ku_ring.navigation.keys.ClubOnboardingKey | ||
| import dagger.Module | ||
| import dagger.Provides | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
| import dagger.multibindings.IntoSet | ||
|
|
||
| class ClubOnboardingEntryBuilder : EntryBuilderProvider { | ||
| override fun EntryProviderScope<NavKey>.provide() { | ||
| entry<ClubOnboardingKey> { | ||
| val context = LocalContext.current | ||
| ClubOnboardingScreen( | ||
| onClose = { (context as? Activity)?.finish() }, | ||
| modifier = Modifier.fillMaxSize(), | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| object ClubOnboardingEntryBuilderModule { | ||
| @Provides | ||
| @IntoSet | ||
| fun provideClubOnboardingEntryBuilder(): EntryBuilderProvider = ClubOnboardingEntryBuilder() | ||
| } |
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
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.
id필드 타입 불일치:StringvsIntNoticeWebKey.id가String타입으로 선언되었지만, 기존WebViewNotice.id와NoticeDetailRoute.NoticeWeb.id는 모두Int타입입니다(data/domain/src/main/java/com/ku_stacks/ku_ring/domain/WebViewNotice.kt및domain/navigation/src/main/java/com/ku_stacks/ku_ring/navigation/NoticeDetailRoute.kt참조).이 불일치로 인해 변환 시 파싱 오류가 발생하거나 데이터 손실이 있을 수 있습니다. URL 직렬화를 위해 의도적으로 String을 사용한 경우라도, 매핑 로직에서 일관성 있게 처리해야 합니다.
🔧 Int 타입으로 일관성 유지 제안
`@Serializable` data class NoticeWebKey( val url: String, val articleId: String, - val id: String, + val id: Int, val category: String, val subject: String, ) : NavKey📝 Committable suggestion
🤖 Prompt for AI Agents