Skip to content

Commit d66565a

Browse files
authored
Merge pull request #416 from OpenHub-Store/deffered-installation
2 parents 27f8197 + a5cb0da commit d66565a

50 files changed

Lines changed: 3699 additions & 261 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.local.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
"Bash(grep -r \"\\\\.FLATPAK\\\\|Flatpak\\\\|flatpak\" . --include=*.kt)",
55
"Bash(./gradlew :composeApp:assembleDebug)",
66
"Bash(./gradlew :composeApp:jvmJar)",
7-
"Bash(./gradlew :composeApp:assembleDebug :composeApp:jvmJar)"
7+
"Bash(./gradlew :composeApp:assembleDebug :composeApp:jvmJar)",
8+
"Bash(./gradlew :core:data:compileDebugKotlinAndroid :core:domain:compileDebugKotlinAndroid)",
9+
"Bash(./gradlew :feature:details:presentation:compileDebugKotlinAndroid)",
10+
"Bash(./gradlew :feature:apps:presentation:compileDebugKotlinAndroid)",
11+
"Bash(./gradlew :core:data:compileDebugKotlinAndroid)",
12+
"Bash(./gradlew :core:data:compileDebugKotlinAndroid :feature:details:presentation:compileDebugKotlinAndroid :feature:apps:presentation:compileDebugKotlinAndroid)",
13+
"Bash(./gradlew :composeApp:compileDebugKotlinAndroid :core:data:compileDebugKotlinAndroid :core:domain:compileDebugKotlinAndroid :feature:details:presentation:compileDebugKotlinAndroid :feature:apps:presentation:compileDebugKotlinAndroid)"
814
]
915
}
1016
}

composeApp/src/androidMain/AndroidManifest.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@
6363
android:scheme="githubstore" />
6464
</intent-filter>
6565

66+
<!-- Pending-install notification deep link -->
67+
<intent-filter>
68+
<action android:name="android.intent.action.VIEW" />
69+
70+
<category android:name="android.intent.category.DEFAULT" />
71+
<category android:name="android.intent.category.BROWSABLE" />
72+
73+
<data
74+
android:host="apps"
75+
android:scheme="githubstore" />
76+
</intent-filter>
77+
6678
<intent-filter>
6779
<action android:name="android.intent.action.SEND" />
6880
<category android:name="android.intent.category.DEFAULT" />

composeApp/src/androidMain/res/xml/filepaths.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<paths xmlns:android="http://schemas.android.com/apk/res/android">
33

4-
<!-- Public Downloads/GitHub Store folder (visible in file managers) -->
5-
<external-path
4+
<!-- App-private downloads (no permissions required) -->
5+
<external-files-path
66
name="ghs_downloads"
7-
path="Download/GitHub Store/" />
7+
path="Download/" />
88

9-
<!-- Legacy app-private downloads (for migration) -->
10-
<external-files-path
11-
name="ghs_legacy_downloads"
12-
path="/" />
9+
<!-- Internal fallback when external files dir is unavailable -->
10+
<files-path
11+
name="ghs_internal_downloads"
12+
path="downloads/" />
1313

1414
<cache-path
1515
name="exports"

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/Main.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ fun App(deepLinkUri: String? = null) {
4141
)
4242
}
4343

44+
DeepLinkDestination.Apps -> {
45+
// Pending-install notification dropped us here.
46+
// Navigate to the apps tab so the user can finish
47+
// the deferred install from the row.
48+
navController.navigate(GithubStoreGraph.AppsScreen) {
49+
popUpTo(GithubStoreGraph.HomeScreen) {
50+
saveState = true
51+
}
52+
launchSingleTop = true
53+
restoreState = true
54+
}
55+
}
56+
4457
DeepLinkDestination.None -> {
4558
// ignore unrecognized deep links
4659
}

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/deeplink/DeepLinkParser.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ sealed interface DeepLinkDestination {
66
val repo: String,
77
) : DeepLinkDestination
88

9+
/**
10+
* Deep link to the apps tab. Used by the pending-install
11+
* notification to bring the user back to the row where they can
12+
* complete a deferred install.
13+
*/
14+
data object Apps : DeepLinkDestination
15+
916
data object None : DeepLinkDestination
1017
}
1118

@@ -52,6 +59,14 @@ object DeepLinkParser {
5259

5360
fun parse(uri: String): DeepLinkDestination {
5461
return when {
62+
// Pending-install notification opens the apps tab. No path
63+
// segments — the deferred install is keyed by package name
64+
// on the row itself, so the link only needs to bring the
65+
// user to the right tab.
66+
uri == "githubstore://apps" || uri == "githubstore://apps/" || uri.startsWith("githubstore://apps?") -> {
67+
DeepLinkDestination.Apps
68+
}
69+
5570
uri.startsWith("githubstore://repo/") -> {
5671
val path = uri.removePrefix("githubstore://repo/")
5772
val decoded = urlDecode(path)

0 commit comments

Comments
 (0)