Skip to content

migrate Tool Details tips tutorial flow to Circuit#4337

Merged
frett merged 7 commits into
developfrom
toolDetailsTipsTutorial
Apr 24, 2026
Merged

migrate Tool Details tips tutorial flow to Circuit#4337
frett merged 7 commits into
developfrom
toolDetailsTipsTutorial

Conversation

@frett

@frett frett commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Moves the tips tutorial launch logic from ToolDetailsActivity (intercept-based navigation) into ToolDetailsPresenter using rememberAnsweringNavigator
  • Replaces ToolDetailsActivity entirely with a Circuit-hosted ToolDetailsScreen launched via startCircuitActivity
  • Removes bridge classes (OpenToolTrainingScreen, SelectedToolSavedState) that were only needed while tutorials were outside the Circuit graph
  • Extracts createToolIntent as a Context extension (instead of Tool) so it can be called from the presenter without a Tool instance
  • Refactors rememberVariants to accept an onVariantSelect callback instead of the full eventSink, avoiding routing variant changes through the event sink

@codecov

codecov Bot commented Feb 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.23077% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.11%. Comparing base (b3fc61a) to head (b65cdda).
⚠️ Report is 8 commits behind head on develop.

Files with missing lines Patch % Lines
...ru/godtools/ui/tooldetails/ToolDetailsPresenter.kt 64.40% 8 Missing and 13 partials ⚠️
...main/kotlin/org/cru/godtools/util/ActivityUtils.kt 78.26% 5 Missing ⚠️
...org/cru/godtools/ui/dashboard/DashboardActivity.kt 0.00% 1 Missing ⚠️
.../godtools/ui/dashboard/lessons/LessonsPresenter.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4337      +/-   ##
===========================================
+ Coverage    50.82%   51.11%   +0.28%     
===========================================
  Files          450      447       -3     
  Lines        12050    12017      -33     
  Branches      2093     2093              
===========================================
+ Hits          6124     6142      +18     
+ Misses        5306     5251      -55     
- Partials       620      624       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@frett frett force-pushed the toolDetailsTipsTutorial branch from 58d705b to 7433e08 Compare March 11, 2026 19:55
@frett frett force-pushed the toolDetailsTipsTutorial branch from 7433e08 to b0de2c7 Compare April 23, 2026 22:29
@frett frett marked this pull request as ready for review April 24, 2026 16:12
@frett frett changed the title Update Tool Details to use Circuit to launch the tips tutorial migrate Tool Details tips tutorial flow to Circuit Apr 24, 2026
frett and others added 2 commits April 24, 2026 10:21
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the temporary non-Circuit workaround with proper Circuit navigation
using NavigableCircuitContent and rememberAnsweringNavigator, so the tips
tutorial result can be handled inline in the presenter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@frett frett force-pushed the toolDetailsTipsTutorial branch from 5b8018d to 37fcaa9 Compare April 24, 2026 16:27
@frett

frett commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

PR Review: migrate Tool Details tips tutorial flow to Circuit (#4337)

Summary

Moves the tips tutorial launch logic from ToolDetailsActivity into ToolDetailsPresenter using rememberAnsweringNavigator, deletes the now-unneeded ToolDetailsActivity, OpenToolTrainingScreen, and SelectedToolSavedState bridge classes, and refactors createToolIntent from a Tool extension to a Context extension. UiEvent.SwitchVariant is removed in favour of a direct callback.

Checklist Findings

✅ Looks Good

  • rememberAnsweringNavigator<TutorialScreen.Result> used correctly for Circuit result handling inside the presenter
  • tipsToolType, tipsFirstLanguage, tipsSecondLanguage stored via rememberSaveable — tutorial state survives process death
  • UiEvent.SwitchVariant removed; variant selection goes through an onVariantSelect callback — cleaner than routing internal state through the public event API
  • openTool() parameter toolCode: String (non-nullable) — type accurately reflects all call sites
  • createToolIntent overloads correct: Tool-based overload delegates to type/toolCode overload, preserving progressLastPageId
  • DashboardActivity uses startCircuitActivity(ToolDetailsScreen(...)) — no hard dependency on ToolDetailsActivity class literal
  • Tests cover both "tutorial already discovered → open with tips" and "tutorial not yet discovered → show tutorial" paths
  • SideEffect - DownloadLatestTranslation - Trigger on variant change updated to use the variant card's eventSink instead of the removed UiEvent.SwitchVariant
  • ktlint ✅ — unit tests ✅

Overall Verdict

APPROVE — clean migration with no remaining issues.

frett and others added 2 commits April 24, 2026 10:50
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@frett frett force-pushed the toolDetailsTipsTutorial branch from 37fcaa9 to b65cdda Compare April 24, 2026 16:52
@frett frett enabled auto-merge April 24, 2026 17:30
@frett frett disabled auto-merge April 24, 2026 17:31
@frett frett merged commit 85a8050 into develop Apr 24, 2026
13 checks passed
@frett frett deleted the toolDetailsTipsTutorial branch April 24, 2026 17:31
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.

2 participants