From 54798a89cd97eef18111fa3ca29c505ecf1d0f17 Mon Sep 17 00:00:00 2001 From: hanminjae Date: Fri, 2 Jan 2026 18:18:56 +0900 Subject: [PATCH 1/4] docs: update README --- README.ko.md | 19 +++++++++++++++++++ README.md | 21 ++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/README.ko.md b/README.ko.md index 0725746..9c32133 100644 --- a/README.ko.md +++ b/README.ko.md @@ -149,6 +149,25 @@ val uri = "app://wisp/product/user?productId=123&userId=99".toUri() navController.navigateTo(uri) ``` +## ๐Ÿงช ํ…Œ์ŠคํŠธ ๋ฐฉ๋ฒ• (Testing) + +### ์ƒ˜ํ”Œ ์•ฑ ์‹คํ–‰ํ•˜๊ธฐ + +1. ์ด ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ํด๋ก ํ•˜์—ฌ Android Studio์—์„œ ์—ฝ๋‹ˆ๋‹ค. +2. `app` ์‹คํ–‰ ๊ตฌ์„ฑ์„ ์„ ํƒํ•˜๊ณ  ์—๋ฎฌ๋ ˆ์ดํ„ฐ๋‚˜ ์‹ค์ œ ๊ธฐ๊ธฐ์—์„œ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. +3. ์•ฑ ๋‚ด์˜ ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ ๋‚ด๋น„๊ฒŒ์ด์…˜์„ ํ…Œ์ŠคํŠธํ•ฉ๋‹ˆ๋‹ค. + +### ADB๋กœ ํ…Œ์ŠคํŠธํ•˜๊ธฐ + +`adb`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ปค๋งจ๋“œ ๋ผ์ธ์—์„œ ์ง์ ‘ ๋”ฅ๋งํฌ๋ฅผ ํ…Œ์ŠคํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์™ธ๋ถ€ ์†Œ์Šค๋กœ๋ถ€ํ„ฐ์˜ ๋งํฌ ํด๋ฆญ์„ ์‹œ๋ฎฌ๋ ˆ์ด์…˜ํ•˜๋Š” ์ข‹์€ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. + +**์ค‘์š”:** ์ปค๋งจ๋“œ ๋ผ์ธ์—์„œ ์—ฌ๋Ÿฌ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ํ…Œ์ŠคํŠธํ•  ๋•Œ๋Š” `&` ๋ฌธ์ž๊ฐ€ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์‹คํ–‰ ๋ช…๋ น์œผ๋กœ ์ธ์‹๋˜์ง€ ์•Š๋„๋ก `\&`๋กœ ์ด์Šค์ผ€์ดํ”„ํ•˜๊ฑฐ๋‚˜ ์ „์ฒด URI๋ฅผ ๋”ฐ์˜ดํ‘œ๋กœ ๊ฐ์‹ธ์•ผ ํ•ฉ๋‹ˆ๋‹ค. + +```bash +# '&' ๋ฌธ์ž๋ฅผ ๋ฐฑ์Šฌ๋ž˜์‹œ(\)๋กœ ์ด์Šค์ผ€์ดํ”„ํ•ฉ๋‹ˆ๋‹ค +adb shell am start -a android.intent.action.VIEW -d "app://wisp/product/user?productId=123\&userId=99" +``` + ## ๊ณ ๊ธ‰ ์‚ฌ์šฉ๋ฒ• (Advanced Usage) ### ์ปค์Šคํ…€ URI ํŒŒ์„œ diff --git a/README.md b/README.md index 6bee796..a595ff4 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,25 @@ val uri = "app://wisp/product/user?productId=123&userId=99".toUri() navController.navigateTo(uri) ``` +## ๐Ÿงช Testing + +### Running the Sample App + +1. Clone this repository and open it in Android Studio. +2. Select the `app` run configuration and run it on an emulator or a physical device. +3. Use the buttons in the app to test navigation. + +### Testing with ADB + +You can test your deep links directly from the command line using `adb`. This is a great way to simulate a link click from an external source. + +**Important:** When testing multiple parameters on the command line, you must escape the `&` character (`\&`) or wrap the entire URI in single quotes to prevent the shell from interpreting it as a background command. + +```bash +# Escape the '&' character with a backslash +adb shell am start -a android.intent.action.VIEW -d "app://wisp/product/user?productId=123\&userId=99" +``` + ## Advanced Usage ### Custom URI Parser @@ -183,4 +202,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -``` +``` \ No newline at end of file From 0ad51c856c0f9cf726a1c7d072b782350a3749b8 Mon Sep 17 00:00:00 2001 From: hanminjae Date: Fri, 2 Jan 2026 18:20:50 +0900 Subject: [PATCH 2/4] refactor: update splash screen navigation logic to handle deep links more effectively --- .../java/com/angrypodo/wisp/ui/main/MainActivity.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/angrypodo/wisp/ui/main/MainActivity.kt b/app/src/main/java/com/angrypodo/wisp/ui/main/MainActivity.kt index 0d72656..6819dc7 100644 --- a/app/src/main/java/com/angrypodo/wisp/ui/main/MainActivity.kt +++ b/app/src/main/java/com/angrypodo/wisp/ui/main/MainActivity.kt @@ -51,8 +51,15 @@ private fun WispNavHost(deepLinkUri: Uri?) { NavHost(navController = navController, startDestination = Splash) { composable { SplashScreen( - navController = navController, - uri = deepLinkUri + onSplashFinished = { + if (deepLinkUri != null) { + navController.navigateTo(deepLinkUri) + } else { + navController.navigate(Home) { + popUpTo(Splash) { inclusive = true } + } + } + } ) } From 8579852e183490eac435cc1d578a8931df885479 Mon Sep 17 00:00:00 2001 From: hanminjae Date: Fri, 2 Jan 2026 18:20:59 +0900 Subject: [PATCH 3/4] refactor: remove deep link handling from splash screen to simplify navigation logic --- .../wisp/ui/screens/SampleScreens.kt | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/angrypodo/wisp/ui/screens/SampleScreens.kt b/app/src/main/java/com/angrypodo/wisp/ui/screens/SampleScreens.kt index 09611a2..47ceec6 100644 --- a/app/src/main/java/com/angrypodo/wisp/ui/screens/SampleScreens.kt +++ b/app/src/main/java/com/angrypodo/wisp/ui/screens/SampleScreens.kt @@ -1,6 +1,5 @@ package com.angrypodo.wisp.ui.screens -import android.net.Uri import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -14,9 +13,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import androidx.navigation.NavController -import com.angrypodo.wisp.navigation.Home -import com.angrypodo.wisp.runtime.Wisp import kotlinx.coroutines.delay @Composable @@ -86,28 +82,13 @@ fun UserScreen(userId: Int) { @Composable fun SplashScreen( - navController: NavController, - uri: Uri? + onSplashFinished: () -> Unit ) { - val wisp = Wisp.getDefaultInstance() - // A real app would check login status, fetch initial data, etc. // Here we just simulate a delay. LaunchedEffect(Unit) { delay(1500) - - val routes = uri?.let { wisp.resolveRoutes(it) } - - if (routes.isNullOrEmpty()) { - // No deep link, navigate to home as usual. - navController.navigate(Home) { - popUpTo(navController.graph.id) { inclusive = true } - } - } else { - // Deep link found. - // Navigate to the parsed stack. - wisp.navigateTo(navController, routes) - } + onSplashFinished() } Column( From 3ef4b17fd47f3d2a5c210979282930f15a356d12 Mon Sep 17 00:00:00 2001 From: hanminjae Date: Fri, 2 Jan 2026 18:42:40 +0900 Subject: [PATCH 4/4] docs: update README --- README.ko.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.ko.md b/README.ko.md index 9c32133..4edefb6 100644 --- a/README.ko.md +++ b/README.ko.md @@ -25,7 +25,7 @@ Wisp๋Š” URI์˜ ๊ฒฝ๋กœ ์„ธ๊ทธ๋จผํŠธ(path segments)๋กœ๋ถ€ํ„ฐ ์ „์ฒด ๋ฐฑ์Šคํƒ์„ ## ๐Ÿ›๏ธ ์•„ํ‚คํ…์ฒ˜ ๋ฐ ์š”๊ตฌ์‚ฌํ•ญ -- **์‹ฑ๊ธ€ ์•กํ‹ฐ๋น„ํ‹ฐ ์•„ํ‚คํ…์ฒ˜:** Wisp๋Š” **์‹ฑ๊ธ€ ์•กํ‹ฐ๋น„ํ‹ฐ ๊ตฌ์กฐ(Single-Activity Architecture)**๋ฅผ ์œ„ํ•ด ์„ค๊ณ„๋˜์—ˆ์œผ๋ฉฐ, ์—ฌ๋Ÿฌ Activity ๊ฐ„์˜ ๋‚ด๋น„๊ฒŒ์ด์…˜์€ ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ด๋Š” Jetpack Compose์— ๊ถŒ์žฅ๋˜๋Š” ์ตœ์‹  ์•ˆ๋“œ๋กœ์ด๋“œ ๊ฐœ๋ฐœ ๋ฐฉ์‹๊ณผ ์ผ์น˜ํ•ฉ๋‹ˆ๋‹ค. +- **์‹ฑ๊ธ€ ์•กํ‹ฐ๋น„ํ‹ฐ ์•„ํ‚คํ…์ฒ˜:** Wisp๋Š” ์‹ฑ๊ธ€ ์•กํ‹ฐ๋น„ํ‹ฐ ๊ตฌ์กฐ(Single-Activity Architecture)๋ฅผ ์œ„ํ•ด ์„ค๊ณ„๋˜์—ˆ์œผ๋ฉฐ, ์—ฌ๋Ÿฌ Activity ๊ฐ„์˜ ๋‚ด๋น„๊ฒŒ์ด์…˜์€ ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ด๋Š” Jetpack Compose์— ๊ถŒ์žฅ๋˜๋Š” ์ตœ์‹  ์•ˆ๋“œ๋กœ์ด๋“œ ๊ฐœ๋ฐœ ๋ฐฉ์‹๊ณผ ์ผ์น˜ํ•ฉ๋‹ˆ๋‹ค. - **Jetpack Navigation ๋ฐ ํƒ€์ž… ์•ˆ์ •์„ฑ:** ์ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” Jetpack Navigation Compose์˜ **ํƒ€์ž… ์„ธ์ดํ”„(type-safe) ๋‚ด๋น„๊ฒŒ์ด์…˜** ํŒจ๋Ÿฌ๋‹ค์ž„ ์ „์šฉ์œผ๋กœ ์„ค๊ณ„๋˜์—ˆ์Šต๋‹ˆ๋‹ค. `NavController`๊ฐ€ ๋ฐ˜๋“œ์‹œ ํ•„์š”ํ•˜๋ฉฐ, ์ „ํ†ต์ ์ธ ๋ฌธ์ž์—ด ๊ธฐ๋ฐ˜์˜ ๋ผ์šฐํŠธ๋Š” ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. - **๋ฉ€ํ‹ฐ ๋ชจ๋“ˆ ์ง€์›:** Wisp๋Š” ๋ฉ€ํ‹ฐ ๋ชจ๋“ˆ ํ”„๋กœ์ ํŠธ๋ฅผ ์™„๋ฒฝํ•˜๊ฒŒ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. `ServiceLoader` ํŒจํ„ด์„ ์‚ฌ์šฉํ•˜์—ฌ, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ํฌํ•จ๋œ ๋ชจ๋“  ๋ชจ๋“ˆ๋กœ๋ถ€ํ„ฐ `@Wisp` ๋ผ์šฐํŠธ ์ •์˜๋ฅผ ์ž๋™์œผ๋กœ ํƒ์ง€ํ•ฉ๋‹ˆ๋‹ค. - **์ตœ์†Œ ์š”๊ตฌ์‚ฌํ•ญ:** @@ -84,7 +84,7 @@ dependencies { `@Serializable` ์–ด๋…ธํ…Œ์ด์…˜์ด ๋‹ฌ๋ฆฐ `data class`๋‚˜ `object`์— `@Wisp` ์–ด๋…ธํ…Œ์ด์…˜์„ ์ถ”๊ฐ€ํ•˜์—ฌ ๋”ฅ๋งํฌ ๋Œ€์ƒ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. -๋ผ์šฐํŠธ ํด๋ž˜์Šค์˜ ์†์„ฑ๋“ค์€ URI์˜ **์ฟผ๋ฆฌ ํŒŒ๋ผ๋ฏธํ„ฐ**๋กœ๋ถ€ํ„ฐ ์ž๋™์œผ๋กœ ๊ฐ’์ด ์ฑ„์›Œ์ง‘๋‹ˆ๋‹ค. ๋งŒ์•ฝ ์†์„ฑ์— **๊ธฐ๋ณธ๊ฐ’(default value)**์ด ์žˆ๋‹ค๋ฉด, ํ•ด๋‹น ์†์„ฑ์€ ์„ ํƒ์ (optional)์ธ ๊ฐ’์ด ๋ฉ๋‹ˆ๋‹ค. +๋ผ์šฐํŠธ ํด๋ž˜์Šค์˜ ์†์„ฑ๋“ค์€ URI์˜ **์ฟผ๋ฆฌ ํŒŒ๋ผ๋ฏธํ„ฐ**๋กœ๋ถ€ํ„ฐ ์ž๋™์œผ๋กœ ๊ฐ’์ด ์ฑ„์›Œ์ง‘๋‹ˆ๋‹ค. ๋งŒ์•ฝ ์†์„ฑ์— ๊ธฐ๋ณธ๊ฐ’(default value)์ด ์žˆ๋‹ค๋ฉด, ํ•ด๋‹น ์†์„ฑ์€ ์„ ํƒ์ (optional)์ธ ๊ฐ’์ด ๋ฉ๋‹ˆ๋‹ค. ```kotlin // ๋‚ด๋น„๊ฒŒ์ด์…˜ ๋˜๋Š” ๊ธฐ๋Šฅ ๋ชจ๋“ˆ ๋‚ด๋ถ€