Skip to content

Refactor ToolCard event types and introduce ToolCardPresenter interface#4410

Merged
frett merged 4 commits into
developfrom
toolCardEventsCleanup
May 5, 2026
Merged

Refactor ToolCard event types and introduce ToolCardPresenter interface#4410
frett merged 4 commits into
developfrom
toolCardEventsCleanup

Conversation

@frett

@frett frett commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rename ToolCard.State/Event to ToolCard.UiState/UiEvent for consistency with Circuit conventions
  • Extract ToolCardPresenter interface and replace Mockposable mocks with FakeToolCardPresenter in tests
  • Move ToolCardPresenter.UiState/UiEvent to be nested on the ToolCardPresenter interface
  • Introduce ToolCardEvent sealed sub-interface to separate card-level events (Click, OpenTool, OpenToolDetails) from presenter-level events (PinTool, UnpinTool)

Test plan

  • Existing unit tests pass (./gradlew :app:testProductionDebugUnitTest)
  • ktlint passes (./gradlew :build-logic:ktlintCheck ktlintCheck)
  • Tool cards open tools and tool details correctly
  • Pin/unpin actions still work on tool cards

🤖 Generated with Claude Code

frett and others added 4 commits May 5, 2026 09:46
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…th FakeToolCardPresenter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…esenter interface

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.84848% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.52%. Comparing base (1536e64) to head (f437d3a).

Files with missing lines Patch % Lines
.../cru/godtools/ui/tools/DefaultToolCardPresenter.kt 92.30% 0 Missing and 7 partials ⚠️
.../cru/godtools/ui/dashboard/tools/ToolsPresenter.kt 40.00% 4 Missing and 2 partials ⚠️
.../godtools/ui/dashboard/lessons/LessonsPresenter.kt 60.00% 1 Missing and 1 partial ⚠️
...in/org/cru/godtools/ui/tools/ToolCardComponents.kt 33.33% 0 Missing and 2 partials ⚠️
...odtools/ui/dashboard/home/AllFavoritesPresenter.kt 80.00% 0 Missing and 1 partial ⚠️
...rg/cru/godtools/ui/dashboard/home/HomePresenter.kt 87.50% 0 Missing and 1 partial ⚠️
...org/cru/godtools/ui/dashboard/tools/ToolsLayout.kt 0.00% 0 Missing and 1 partial ⚠️
...ru/godtools/ui/tooldetails/ToolDetailsPresenter.kt 50.00% 0 Missing and 1 partial ⚠️
...kotlin/org/cru/godtools/ui/tools/FavoriteAction.kt 75.00% 0 Missing and 1 partial ⚠️
...kotlin/org/cru/godtools/ui/tools/SquareToolCard.kt 66.66% 0 Missing and 1 partial ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4410      +/-   ##
===========================================
+ Coverage    51.47%   51.52%   +0.05%     
===========================================
  Files          449      451       +2     
  Lines        11992    11976      -16     
  Branches      2086     2066      -20     
===========================================
- Hits          6173     6171       -2     
+ Misses        5203     5194       -9     
+ Partials       616      611       -5     

☔ 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 merged commit 84789e0 into develop May 5, 2026
13 checks passed
@frett frett deleted the toolCardEventsCleanup branch May 5, 2026 20:46
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