Skip to content

GT-3064 Switch tract page rendering to the shared RenderTractPage composable - #4562

Draft
frett wants to merge 3 commits into
developfrom
composeTractPage
Draft

GT-3064 Switch tract page rendering to the shared RenderTractPage composable#4562
frett wants to merge 3 commits into
developfrom
composeTractPage

Conversation

@frett

@frett frett commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Replaces the view-based tract page rendering stack (PageController/CardController/PageContentLayout) with the shared RenderTractPage composable from godtools-shared.

Changes

  • ManifestPagerAdapter now extends ViewHolderPagerAdapter directly, hosting one ComposeView per page that renders RenderTractPage wrapped in GodToolsTheme + ProvideRendererServices, with the page's ConstrainedStateLifecycleOwner provided as LocalLifecycleOwner so primary-page gating of analytics and content events falls out of the existing lifecycle promotion.
  • TractPageState is hoisted per page id in the adapter: updatePage() preserves the active card across language switches, inbound live-share NavigationEvents call navigateToCard(), and card position survives rotation/process death via the shared TractPageState.Saver in the view holder save/restore path.
  • TractPageEvents map to existing behaviors: GoToNextPage → page navigation, ActiveCardChanged (primary page only) → live-share publishing, OpenModal → the existing ModalOverlay compose overlay, CardTapped/CardSwiped → card feature-discovery settings. The first-card bounce hint is driven from lifecycle state + the feature-discovered flows.
  • Page/card screen analytics now come from the shared renderer's ScreenView state events; the host-side TractPageAnalyticsScreenEvent post remains only for the tip-dismiss re-track (dismissing a bottom sheet doesn't cycle the page lifecycle).
  • Deletes the legacy controllers, PageContentLayout, BounceInterpolator, the tract page/card/call-to-action layouts, now-dead databinding adapters, orphaned styles/dimens/drawable, unused module dependencies, and their tests (~1,900 lines removed).
  • The tract_card_previous/tract_card_next translations are intentionally kept for the Crowdin port to godtools-shared, matching the tips migration.

Dependencies

Depends on CruGlobal/kotlin-mpp-godtools-tool-parser#1230 — CI will fail until that PR is merged and a new 1.4.0-SNAPSHOT is published. Developed and verified locally against that branch via an includeBuild substitution.

Testing

  • :ui:tract-renderer, :ui:base-tool, :ui:cyoa-renderer, :ui:lesson-renderer, and :app unit tests pass
  • ktlint passes; :app:assembleProductionDebug builds
  • Both commits verified to compile individually

🤖 Generated with Claude Code

@frett frett changed the title Switch tract page rendering to the shared RenderTractPage composable GT-3064 Switch tract page rendering to the shared RenderTractPage composable Aug 18, 2026
@frett
frett force-pushed the composeTractPage branch 2 times, most recently from e87da43 to c00d5e7 Compare August 19, 2026 22:40
frett and others added 3 commits August 20, 2026 16:09
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tion

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
indexOfFirst returns -1 for a missing id, which PagerAdapter interprets
as POSITION_UNCHANGED, keeping a holder for a removed or renamed page
alive and rebinding it at its stale index.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@frett
frett force-pushed the composeTractPage branch from c00d5e7 to 7bd9733 Compare August 20, 2026 22:11
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.

1 participant