Skip to content

chore(deps): drop the unused Navigation 2 dependencies - #1420

Merged
bmc08gt merged 2 commits into
code/cashfrom
chore/drop-navigation2-deps
Sep 4, 2026
Merged

chore(deps): drop the unused Navigation 2 dependencies#1420
bmc08gt merged 2 commits into
code/cashfrom
chore/drop-navigation2-deps

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Dependabot opened #1411 to bump Navigation from 2.9.8 to 2.10.0. No code uses Navigation 2, so this removes the dependency instead of upgrading it.

Navigation happens through Navigation 3 behind CodeNavigator. The Navigation 2 artifacts that were still declared:

  • navigation-fragment-ktx in :ui:theme
  • navigation-ui-ktx in the app module
  • the androidx.navigation.safeargs.kotlin plugin, in both the root and app build scripts
  • the androidx-navigation version and its three catalog aliases

No Kotlin source imports androidx.navigation, and there is no navigation graph XML, no NavHostFragment, and no generated Directions or Args classes.

Two things were reaching the build transitively through these artifacts, and only one of them survives the removal on its own.

FragmentActivity, used by Context.getActivity() in ui/theme/src/main/kotlin/com/getcode/ui/utils/View.kt, came in through navigation-fragment-ktx. It still resolves, because :ui:theme declares androidx-appcompat, which has an api dependency on androidx.fragment.

com.google.android.material:material came in through navigation-ui-ktx, which pins it at 1.4.0, and it was never declared anywhere in the build. Theme.Code in apps/flipcash/app/src/main/res/values/themes.xml extends Theme.MaterialComponents.DayNight.NoActionBar, so removing navigation-ui-ktx failed processDebugResources on the theme parent and on colorPrimaryVariant, colorOnPrimary, colorSecondary, colorSecondaryVariant and colorOnSecondary. The second commit declares it explicitly at 1.4.0, the version already resolving, which keeps this a build-graph change rather than a theming one. Material 1.5 reworked the color attributes, so a bump belongs in its own PR.

Closes #1411.

The app navigates with Navigation 3 behind `CodeNavigator`, but the build still
declared Navigation 2: `navigation-fragment-ktx` in `:ui:theme`,
`navigation-ui-ktx` in the app module, and the `safeargs` plugin in both the root
and app scripts.

Nothing consumed any of it. There are no `androidx.navigation` imports in Kotlin
sources, no navigation graph XML, no `NavHostFragment`, and no generated
`Directions` or `Args` classes.

`:ui:theme` uses `FragmentActivity` in `View.kt`, which arrived transitively
through `navigation-fragment-ktx`. It still resolves without it, because
`androidx-appcompat` is already declared there and depends on
`androidx.fragment` as an `api` dependency. `:ui:theme:compileDebugKotlin` and
`:apps:flipcash:app:compileDebugKotlin` both pass.

This closes #1411, which bumped these artifacts to 2.10.0.
@bmc08gt bmc08gt self-assigned this Sep 4, 2026
@github-actions github-actions Bot added area: ui Compose UI, theme, components, resources area: build-system Gradle, convention plugins, build-logic type: chore Maintenance, config, CI/CD labels Sep 4, 2026
…moval

Theme.Code extends Theme.MaterialComponents.DayNight.NoActionBar, but
com.google.android.material:material was never declared in the build — it
resolved transitively through navigation-ui, whose POM pins it at 1.4.0.
Dropping navigation-ui took it off the resource path and broke
processDebugResources on the theme parent and its colorPrimaryVariant,
colorOnPrimary, colorSecondary, colorSecondaryVariant and colorOnSecondary
attributes.

Declare it at 1.4.0, the version already resolving, so this stays a
build-graph change rather than a theming one. Material 1.5 reworked the
color attributes, so a bump is worth doing on its own.
@bmc08gt
bmc08gt merged commit c68711a into code/cash Sep 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build-system Gradle, convention plugins, build-logic area: ui Compose UI, theme, components, resources type: chore Maintenance, config, CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant