Skip to content

[WIP] Move the application shell to shared Compose navigation - #1

Draft
sargunv wants to merge 15 commits into
codex/maplibre-compose-completionfrom
sargunv/compose-multiplatform
Draft

sargunv wants to merge 15 commits into
codex/maplibre-compose-completionfrom
sargunv/compose-multiplatform

Conversation

@sargunv

@sargunv sargunv commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Pre-review mirror of streetcomplete#7125, based on codex/maplibre-compose-completion so the diff excludes the MapLibre Compose migration. Not intended to merge here.

@westnordost

westnordost commented Sep 18, 2026

Copy link
Copy Markdown

Hm weird, I merged master into maplibre-compose into maplibre-compose-completion into this branch (😅) but the PR diff is still showing me loads of changes on unrelated metadata (translations, icons, ...)

@sargunv
sargunv force-pushed the sargunv/compose-multiplatform branch from 3970c77 to bb184fc Compare September 18, 2026 20:37
@sargunv

sargunv commented Sep 18, 2026

Copy link
Copy Markdown
Owner Author

All the merge commits confused me so I just recreated this branch with a fresh commit on top of the latest streetcomplete#7088

@westnordost westnordost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

(not a complete review as this is still draft)

  1. Have a look at all places where AnimatedScreenVisibility is used. Most of these are in MainScreen. Now that it is completely in compose, it makes sense to have these screens (IntroTutorialScreen, OverlaysTutorialScreen, TeamModeWizard) as own screens in the nav graph.

  2. Not sure what to think of the appFormattingLocale stuff. It seems awfully error prone to sprinkle a check for that global variable everywhere we are doing anything Locale-aware (potentially) outside of the composition. I tend towards that it would be easier if the application class would listen for changes on the (app) locale settings and set the Locale.setDefault(…) on Android/JVM and something similar on iOS.

Comment thread androidApp/src/main/AndroidManifest.xml
Comment on lines -34 to 38
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
testProguardFile("test-proguard-rules.pro")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
}
getByName("debug") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
applicationIdSuffix = ".debug"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Removing the proguard-rules.pro config seems a bit dangerous to me. I don't know how one could test what of these rules is still needed and which not. As far as I know, if too much is stripped, it doesn't lead to the app not compiling, but to runtime "class/method not found" exceptions.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

fixed in 3597865, this snuck in with the rebase

Comment on lines +38 to +41
enterTransition = { slideInHorizontally(initialOffsetX = { +it * dir }) },
exitTransition = { slideOutHorizontally(targetOffsetX = { -it * dir }) },
popEnterTransition = { slideInHorizontally(initialOffsetX = { -it * dir }) },
popExitTransition = { slideOutHorizontally(targetOffsetX = { +it * dir }) },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You mentioned that this animation feels unnatural. I actually removed this recently to see what would be the default transition but for some reason, it resulted in no animation at all. (Even though there is a default, which doesn't look like "no animation".) Anyway, if you want to play around with this, this is the place.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I spent some time playing with the transitions, and couldn't get it to feel right on Navigation 2.

Will try a Navigation 3 upgrade on another branch.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Alright, we are one the same page/boat then

@sargunv

sargunv commented Sep 18, 2026

Copy link
Copy Markdown
Owner Author

Not sure what to think of the appFormattingLocale stuff. It seems awfully error prone to sprinkle a check for that global variable everywhere we are doing anything Locale-aware (potentially) outside of the composition. I tend towards that it would be easier if the application class would listen for changes on the (app) locale settings and set the Locale.setDefault(…) on Android/JVM and something similar on iOS.

consolidated in c7f9414

@sargunv

sargunv commented Sep 19, 2026

Copy link
Copy Markdown
Owner Author

Have a look at all places where AnimatedScreenVisibility is used. Most of these are in MainScreen. Now that it is completely in compose, it makes sense to have these screens (IntroTutorialScreen, OverlaysTutorialScreen, TeamModeWizard) as own screens in the nav graph.

Done in b10a374.

these full screen dialogs have a different transition than the other screens, so I preserved it for now with a conditional in the NavHost transition args.

looking at refining transitions separately

@westnordost

Copy link
Copy Markdown

these full screen dialogs have a different transition than the other screens, so I preserved it for now with a conditional in the NavHost transition args.

Right, this came to my mind this night, too. In the end, it remains to be seen whether it makes more sense as a full screen "dialog" or as part of the nav graph. On the other hand, it is part of the navigation (i.e. back stack etc) so it is probably more idiomatic to have it there.

@westnordost

This comment was marked as resolved.

Comment thread app/src/commonMain/kotlin/de/westnordost/streetcomplete/ui/LocalAppLocale.kt Outdated

This comment was marked as resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

However, the method seems to be widely used, so, I think it's fine to use it. If it causes app store rejection, it could still be changed. (I.e. the language selection feature disabled for iOS)

@westnordost westnordost Sep 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

More research on this:

On both Android 13 onwards and iOS 17 onwards, it is possible to set the app language from the system settings. To enable:

  • Android: in the manifest, add android:localeConfig="@xml/locale_config", where locale_config is a file that needs to include a list of supported languages as documented here.

  • iOS: setting UIPrefersShowingLanguageSettings in the Info.plist to yes. iOS doesn't provide an API to set/synchronize this with an in-app language selector.

For Android, I have actually looked into supporting it two years ago
streetcomplete#5623 (comment) and decided against it.

Anyway, the research doesn't change that I think the current path (in-app language selector) is the best path forward. Only, if the app is rejected because of this, we now know an alternative (for iOS).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I noticed AppleLanguages was being set recursively, causing a crash. a30a303 resolves

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

For Android, I have actually looked into supporting it two years ago

that's some interesting research; it's disappointing even the android api for this is not well suited

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants