Repository navigation
Conversation
Accompanist pager is deprecated and this was its last usage in the app. TutorialPagerIndicator now draws its own row of dots from the PagerState, keeping the Accompanist defaults (8dp circles with 8dp spacing, primary active color, 38% alpha inactive color) and the existing test tag, height and modifier chain. Like Accompanist's indicator, the active dot is drawn on top of the inactive row and offset by currentPage plus currentPageOffsetFraction, so it slides between pages while swiping instead of jumping when currentPage changes. The offset step is rounded to whole pixels the same way the Row rounds the dot size and spacing, so the active dot lines up with the other dots at any display density. The page dots carry selected semantics so tests can check which page is active, and are hidden from accessibility services. Without a Tab role Compose reports a selected node as checkable, which would give TalkBack a focus stop per dot. Accompanist's indicator exposed nothing to TalkBack either. The selected dot and the active dot's offset are clamped to the current page count, since pagerState.currentPage is not clamped synchronously when an app language change shrinks the page list (same cause as #4544). TutorialLayoutTest also moves to the v2 runComposeUiTest entry point, since the v1 one is deprecated and the file gains new page indicator tests here.
TutorialPagerIndicator no longer uses Accompanist, and nothing else in the app does, so drop the dependency and its version catalog entries.
Covers the page indicator drawn by TutorialPagerIndicator now that it no longer comes from Accompanist. The tutorial renderer had no snapshot tests yet, so this also applies the Paparazzi plugin to the module and pulls in BasePaparazziTest from the :ui:base test fixtures. The test snapshots the LIVE_SHARE tutorial, which opens on a static image and still shows the page indicator. The FEATURES and TIPS tutorials open on Lottie animations that rememberLottieComposition loads in the background, so whether they show up in the single Paparazzi frame depends on timing.
The signature fits within 120 characters, so ktlint wants it on a single line with the expression body on the next one.
Tapping Continue animates the pager to the next page, and the v2 runComposeUiTest does not run that animation to the end before the next assertion. Wait until the second dot is selected, and click the first Continue button in case the pager also composed the next page.
Tapping Continue in the FEATURES tutorial never moved the pager under the v2 runComposeUiTest, so the test timed out waiting for the second dot. Test TutorialPagerIndicator() directly against a HorizontalPager and move it with requestScrollToPage(), like the page count test.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4652 +/- ##
===========================================
+ Coverage 53.86% 53.96% +0.09%
===========================================
Files 439 439
Lines 11645 11668 +23
Branches 1967 1970 +3
===========================================
+ Hits 6273 6297 +24
+ Misses 4785 4781 -4
- Partials 587 590 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # gradle/libs.versions.toml
|
Build App is failing on this PR after merging develop, but the failure does not come from this PR. It also fails on develop at 491d722 (Update android.gradle.plugin to v9.5.1, #4693). The last develop build on 9.5.0 (760d90f) passed. The errors are in code this PR does not touch, and they change from run to run:
This PR only changes Generated by Claude Code |
# Conflicts: # gradle/libs.versions.toml
Resolves #4608
TutorialPagerIndicatorwas the last place the app used Accompanist (accompanist-pager-indicators, which is deprecated). The pager itself was already the FoundationHorizontalPager, so only the indicator had to move. It now draws its own row of dots straight from thePagerState, which is the approach the Compose docs suggest for Foundation pagers.Changes
TutorialPagerIndicator: works the same way Accompanist's did. ARowshows one 8dpCircleShapedot per page, 8dp apart, inMaterialTheme.colorScheme.primaryat 38% alpha. The active dot, in fullprimary, is drawn on top and offset bycurrentPage + currentPageOffsetFraction(limited to the valid range), so it slides with the pager while you swipe.TEST_TAG_PAGE_INDICATOR, thetutorial_indicator_heightheight,wrapContentSize()and the caller'smodifierare applied in the same order as before. Each page dot has a newTEST_TAG_PAGE_INDICATOR_PAGEtag andselectedsemantics for tests, and is hidden from accessibility services (like Accompanist's indicator, it gives TalkBack nothing to focus). The active dot's step is rounded to whole pixels the same way the dot row is, so it lines up at any display size.pagerState.currentPage.coerceAtMost(pageCount - 1).currentPageis not clamped right away when an app language change shrinks the page list (the same cause as TutorialLayout can throw IndexOutOfBoundsException when the app language changes the number of tutorial pages #4544), so this stops the indicator from pointing at a page that no longer exists.accompanist-pager-indicatorsfrom:ui:tutorial-rendererand dropped theaccompanistversion and library entries fromgradle/libs.versions.toml. No Accompanist imports or dependencies are left.testFixtures(projects.ui.base)to:ui:tutorial-rendererso it can useBasePaparazziTest, and addedTutorialLayoutPaparazziTest.TutorialLayoutTest: moved the whole file to the v2runComposeUiTestimport, since the v1 one is deprecated and the file gains new page indicator tests.OnboardingLayoutin:appuses the sameTutorialPagerIndicatorand looks and behaves the same as before.Snapshots
TutorialLayoutorOnboardingLayout, and theDashboardLayoutPaparazziTest"Banner - Tutorial" goldens only show the dashboard banner. No existing goldens needed to be re-recorded.TutorialLayoutPaparazziTest>TutorialLayout() - LIVE_SHARE(Nexus 5 / Pixel 6 Pro x NIGHT / NOTNIGHT, plus Nexus 5 accessibility). Recorded by the Record Snapshots workflow.Tests
TutorialLayoutTest(Page Indicator region):FEATURES - one indicator per page: the dot count matchespagesFor(Locale.ENGLISH), and the first dot is selected.FEATURES - indicators hidden from accessibility: every dot hasHideFromAccessibilityset. Fails without it.FEATURES - updates when app language changes page count: switching from English (5 pages) to French (4 pages) gives 4 dots with the first one selected. This is a no-crash check; the clamp itself is covered below.runComposeUiTestimport.TutorialLayoutTest>TutorialPagerIndicator() - active indicator follows current page: drives aHorizontalPagerand the indicator from the samePagerState, scrolls to page 2 withrequestScrollToPage(1), and checks that the selection moves from dot 1 to dot 2. This uses thePagerStatedirectly instead of tapping Continue, so it doesn't depend on page animations settling.TutorialLayoutTest>TutorialPagerIndicator() - clamps active indicator when page count shrinks: shrinking aPagerStatefrom 5 pages to 3 while it sits on page 4 leaves the last dot selected. This test fails without the clamp.TutorialLayoutPaparazziTest>TutorialLayout() - LIVE_SHARE.Review
selectedsemantics with no role, which Compose reports as checkable, so TalkBack got one focus stop per dot. They are now hidden from accessibility, with a test.TutorialLayoutTestnow uses the v2runComposeUiTestimport (the v1 import is deprecated for new layout tests).TutorialLayoutandTutorialPagerIndicator(small, and each guards its own reader).