Repository navigation
v0.7.6
What's Changed
Navigation
A single annotation now covers every navigation destination. The three older annotations (@NavScreen, @TabScreen, @NavSheet)
have been replaced by @NavDestination(kind = ...), and the processor auto-detects whether a presenter
accepts a runtime parameter from the route.
- Replace
@NavScreen,@TabScreen, and@NavSheetwith a single@NavDestination(kind = ...)annotation. The
processor reads one annotation on the presenter and picks the destination role from thekindparameter:SCREEN
for stack screens,OVERLAYfor modal sheets and dialogs,TAB_ROOTfor top level tab anchors. - Auto-detect parameterized presenters from a nested Metro's
@AssistedFactory. A presenter with a
nested factory generates a binding that reads the route property and threads it throughfactory.create(...).
A plain@Injectpresenter generates a binding that exposes the presenter directly. Annotating a tab presenter with@AssistedInjectproduces a compile error because a tab's route is a singletondata objectand carries no payload.
Lint rules
A new published lint-rules artifact ships six ktlint rules that enforce the project's navigation, preview, dependency injection, and test naming conventions. Two of the rules read .editorconfig so consumer projects can adapt the navigation layer location and the set of forbidden preview wrappers without forking.
- New
lint-rulesartifact (io.github.thomaskioko.gradle.plugins:lint-rules) shipping six custom ktlint rules:tvmaniac:no-mutating-router-importprevents Decompose router mutation imports outside the navigation layer. The two read only types (ChildStack,ChildSlot) remain allowed everywhere.tvmaniac:no-navigation-construct-outside-navpreventsStackNavigation()andSlotNavigation()construction outside the navigation layer. Type references in parameter and return positions are unaffected.tvmaniac:no-custom-navigator-interfaceprevents feature specific*Navigatorinterfaces. Presenters must inject the canonicalNavigatororSheetNavigatorfromnavigation/api.tvmaniac:no-style-wrapper-in-previewprevents redundant styling wrappers (TvManiacTheme,TvManiacBackground,Surface,MaterialThemeby default) inside@Previewcomposables. The wrapper provider applies the project styling once.tvmaniac:metro-redundant-injectremoves redundant@Injectfrom classes that already declare a Metro@Contributes...annotation. Autocorrect-able.tvmaniac:test-name-formatenforces theshould X given Ytest naming convention. Backticked and camelCase forms are both accepted.
- The navigation and preview rules read
.editorconfigproperties (ktlint_tvmaniac_navigation_module_paths,ktlint_tvmaniac_preview_wrappers,ktlint_tvmaniac_preview_wrapper_packages) so consumer projects can adjust the navigation layer location and the set of forbidden wrappers without forking. See lint-rules/README.md.
Misc
- Bumped ktlint dependency 1.4.0 → 1.8.0.
- Dependency updates.