Skip to content

feat: Insurance Summary Card on Home Screen#1

Open
kopciuch97 wants to merge 9 commits intodevelopfrom
feat/insurance-summary-card
Open

feat: Insurance Summary Card on Home Screen#1
kopciuch97 wants to merge 9 commits intodevelopfrom
feat/insurance-summary-card

Conversation

@kopciuch97
Copy link
Copy Markdown
Collaborator

@kopciuch97 kopciuch97 commented Apr 9, 2026

Insurance Summary Card

Shows active insurance policies at a glance on the Home screen — policy names, monthly cost, next payment date, and a "View Details" CTA to the Insurances tab.

What changed

GraphQL & Domain — Extended QueryHome.graphql with exposureDisplayName, productVariant.displayName, and futureCharge fields. New InsuranceSummaryData domain model.

Use CaseGetHomeDataUseCaseImpl maps new GraphQL fields to InsuranceSummaryData. Returns null when no active contracts (card hidden). Demo mode includes mock data.

PresenterHomePresenter propagates summary data through SuccessDataHomeUiState.Success.

UI — New InsuranceSummaryCard composable using HedvigCard, HedvigTextButton, and design system typography. Rendered in HomeLayout center group after ClaimStatusCards. Navigation wired through HomeGraphHedvigNavHost.

Feature flagFeature.INSURANCE_SUMMARY_CARD for remote toggling.

Architecture Decisions

  • ADR-001: Extend HomeQuery (single network call, atomic loading)
  • ADR-002: Code in feature-home (not new module — card is a Home concern)
  • ADR-003: Static card (display-only + navigation button)
  • ADR-004: TDD red-green-refactor at each layer

Test Coverage

  • 13 new tests (60 total feature-home, 0 regressions)
  • 5 use case tests: multi-contract, zero contracts, missing futureCharge, single contract, 5+ contracts
  • 5 presenter tests: data propagation, null handling, error recovery, state preservation, reload
  • 3 domain model tests

Known Limitations

  • Hardcoded English strings — needs Lokalise integration before production
  • Date formatting locale-unaware — uses English month names
  • No cap on displayed policies for very tall card scenario

AI SDLC Process

This feature was developed using an AI-augmented SDLC with full traceability:

  1. Research — 3 solution variants analyzed, 4 ADRs documented
  2. Specification — 9 core requirements, 16 reusable components identified
  3. UI Mockups — 4 variants (isolation, standard, empty state, busy screen)
  4. TDD Implementation — 27 steps across 5 groups (GraphQL, UseCase, Presenter, UI, Test Review)
  5. Automated Verification — 6 independent audits (completeness, test suite, code review, pragmatic review, production readiness, reality assessment)

Standards automatically discovered and applied: coding-style, conventions, error-handling, test-writing, minimal-implementation, components, accessibility, commenting.

Full documentation: .ai/tasks/development/2026-04-07-insurance-summary-card/

Merge note

Squash before merge. Commits are kept granular intentionally to show the real timeline of work on the ticket.

szymonkopa and others added 9 commits April 7, 2026 11:04
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add INSURANCE_SUMMARY_CARD feature flag with remote kill switch
- Add @immutable annotations to InsuranceSummaryData and PolicyInfo
- Add accessibility contentDescription to InsuranceSummaryCard
- Change toInsuranceSummary() visibility from private to internal
- Remove InsuranceSummaryDataTest (tested constructors, not behavior)
- Add 8-argument combine() overload for feature flag flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Navigate to Insurances tab using popUpTo + saveState/restoreState
so the Home tab remains accessible via bottom navigation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Research, specification, implementation plan, UI mockups, work-log,
and verification report — full traceability from ticket to delivery.

Made-with: Cursor
Rename AI SDLC documentation directory from .maister to .ai
and update all internal references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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