Skip to content

client homelessness start & summary updates (OUT-208, OUT-209, OUT-210, DEV-2408)#2003

Open
mikefeldberg wants to merge 8 commits intomainfrom
OUT-208/OUT-209/OUT-210/homelessness-start-fe
Open

client homelessness start & summary updates (OUT-208, OUT-209, OUT-210, DEV-2408)#2003
mikefeldberg wants to merge 8 commits intomainfrom
OUT-208/OUT-209/OUT-210/homelessness-start-fe

Conversation

@mikefeldberg
Copy link
Copy Markdown
Contributor

@mikefeldberg mikefeldberg commented Apr 1, 2026

OUT-208, OUT-209, OUT-210, DEV-2408

note: used a different house icon because asset wasn't provided. can update later

Summary by Sourcery

Capture and display a client’s living situation and approximate homelessness start date across profile forms, detail views, and client summary cards.

New Features:

  • Add an "Approximate Date Homelessness Started" field to the client personal info form and persist it in the client profile data model.
  • Show the client’s living situation and homelessness start date in the client summary via a new living situation panel and in the personal info card view.

Enhancements:

  • Extend client profile queries and list summaries to include living situation and unhoused start date fields.
  • Generalize date handling in client profile updates to consistently treat multiple date fields as date-only values.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 1, 2026

Reviewer's Guide

Adds support for capturing and displaying a client’s approximate homelessness start date and living situation in profile forms, client detail, and client summary views, including date parsing/serialization updates and a new living situation summary panel.

Sequence diagram for updating client homelessness start date

sequenceDiagram
  actor User
  participant PersonalInfoForm
  participant ReactHookForm
  participant toUpdateClientProfileInputs
  participant GraphQLClient as GraphQL_Client
  participant Server

  User->>PersonalInfoForm: Open personal info form
  PersonalInfoForm->>ReactHookForm: useWatch on unhousedStartDate and livingSituation

  User->>PersonalInfoForm: Select or clear unhoused start date in DatePicker
  PersonalInfoForm->>ReactHookForm: setValue unhousedStartDate(date_or_null)

  User->>PersonalInfoForm: Tap Save
  PersonalInfoForm->>toUpdateClientProfileInputs: Build UpdateClientProfileInput(values, dirtyFields)
  toUpdateClientProfileInputs->>toUpdateClientProfileInputs: Conditionally set updatedInputs.unhousedStartDate
  toUpdateClientProfileInputs->>toUpdateClientProfileInputs: Convert Date to YYYY-MM-DD string
  toUpdateClientProfileInputs-->>PersonalInfoForm: returns UpdateClientProfileInput

  PersonalInfoForm->>GraphQLClient: mutate UpdateClientProfile with input
  GraphQLClient->>Server: Send GraphQL mutation
  Server-->>GraphQLClient: Persisted client with unhousedStartDate
  GraphQLClient-->>PersonalInfoForm: Updated client profile
Loading

Class diagram for updated client profile personal info and summary components

classDiagram
  class PersonalInfoState {
    +string~id~
    +string~californiaId~
    +string~dateOfBirth~
    +string~gender~
    +string~givenName~
    +string~middleName~
    +string~surname~
    +string~preferredLanguage~
    +VeteranStatusEnum~veteranStatus~
    +LivingSituationEnum~livingSituation~
    +TProfilePhoto~profilePhoto~
    +Date~unhousedStartDate~
  }

  class PersonalInfoForm {
    +PersonalInfoForm()
    -any control
    -void setValue(fieldName, value)
  }

  class ClientProfile {
    +ID~id~
    +string~californiaId~
    +string~dateOfBirth~
    +string~gender~
    +string~givenName~
    +string~middleName~
    +string~surname~
    +LivingSituationEnum~livingSituation~
    +string~unhousedStartDate~
    +VeteranStatusEnum~veteranStatus~
    +TProfilePhoto~profilePhoto~
  }

  class ClientSummaryLivingSituationProps {
    +ClientProfilesQuery_client client
  }

  class ClientSummaryLivingSituation {
    +ClientSummaryLivingSituation(props)
    -ClientProfilesQuery_client client
  }

  class ClientProfileCardPersonalInfo {
    +ClientProfileCardPersonalInfo(props)
    -ClientProfile clientProfile
    -string formattedDob
    -string formattedUnhousedStartDate
  }

  class toUpdateClientProfileInputs {
    +UpdateClientProfileInput toUpdateClientProfileInputs(values, dirtyFields)
  }

  class extractClientFormDataFn {
    +PersonalInfoState extractClientFormData(clientProfile)
  }

  class UpdateClientProfileInput {
    +ID~id~
    +string~dateOfBirth~
    +string~unhousedStartDate~
    +string~gender~
    +string~givenName~
    +string~middleName~
    +string~surname~
    +LivingSituationEnum~livingSituation~
    +VeteranStatusEnum~veteranStatus~
  }

  PersonalInfoForm --> PersonalInfoState : uses
  PersonalInfoForm --> toUpdateClientProfileInputs : builds_update_input
  extractClientFormDataFn --> PersonalInfoState : returns
  extractClientFormDataFn --> ClientProfile : parses_unhousedStartDate
  ClientSummaryLivingSituation --> ClientSummaryLivingSituationProps : uses
  ClientSummaryLivingSituation --> ClientProfile : reads_livingSituation_and_unhousedStartDate
  ClientProfileCardPersonalInfo --> ClientProfile : formats_unhousedStartDate
  toUpdateClientProfileInputs --> UpdateClientProfileInput : returns
Loading

File-Level Changes

Change Details Files
Support editing and persisting client unhoused start date in the personal info form workflow.
  • Extend PersonalInfoForm state and useWatch to include an unhousedStartDate field.
  • Add a numeric DatePicker field with bounded valid range for approximate homelessness start date, wiring onChange/onDelete to setValue for unhousedStartDate.
  • Update client profile form types to include unhousedStartDate as an optional Date field.
  • Adjust client profile update input mapping to conditionally include unhousedStartDate only when the field is dirty and to serialize it as a date-only string when sending to the backend.
libs/expo/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/PersonalInfoForm/PersonalInfoForm.tsx
libs/expo/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/ClientProfileForm.tsx
libs/expo/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/types.ts
Load, parse, and display unhoused start date in client profile cards.
  • Extend extractClientFormData to pull unhousedStartDate from the profile, parse from yyyy-MM-dd into a Date, and include it in the returned form state.
  • Render formatted unhoused start date on the PersonalInfoCard alongside existing personal info.
  • Align comments and date handling logic to treat dateOfBirth and unhousedStartDate consistently when formatting and updating.
libs/expo/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/extractClientFormData.ts
libs/expo/betterangels/src/lib/screens/Client/ClientProfile/ClientProfileCards/PersonalInfoCard.tsx
libs/expo/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/ClientProfileForm.tsx
Expose living situation and unhoused start date via GraphQL and client summary UI.
  • Update client-related GraphQL queries for profile, profile form, and profile list to request livingSituation and unhousedStartDate where needed.
  • Regenerate associated TypeScript GraphQL types for the updated queries.
  • Add a new ClientSummaryLivingSituation component that shows a living situation panel with a house icon, formatted living situation label, and formatted homelessness start date with relative duration.
  • Include the new living situation summary section in the main ClientSummary layout.
libs/expo/betterangels/src/lib/ui-components/ClientProfileList/ClientProfiles.graphql
libs/expo/betterangels/src/lib/screens/Client/Client.graphql
libs/expo/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/clientProfile.graphql
libs/expo/betterangels/src/lib/ui-components/ClientSummary/ClientSummaryLivingSituation.tsx
libs/expo/betterangels/src/lib/ui-components/ClientSummary/index.tsx
libs/expo/betterangels/src/lib/screens/Client/__generated__/Client.generated.ts
libs/expo/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/__generated__/clientProfile.generated.ts
libs/expo/betterangels/src/lib/ui-components/ClientProfileList/__generated__/ClientProfiles.generated.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • There are console.log statements left in extractClientFormData for unhousedStartDate; these should be removed or guarded behind a debug flag before merging.
  • In ClientSummaryLivingSituation.tsx, the interface and component are still named ClientSummaryIdentity; consider renaming them (and the props interface) to match the file's living-situation purpose for clarity and consistency.
  • The conversion/normalization logic for dateOfBirth and unhousedStartDate in toUpdateClienProfileInputs is duplicated; consider extracting a small helper to keep the function more maintainable as additional date fields are added.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- There are `console.log` statements left in `extractClientFormData` for `unhousedStartDate`; these should be removed or guarded behind a debug flag before merging.
- In `ClientSummaryLivingSituation.tsx`, the interface and component are still named `ClientSummaryIdentity`; consider renaming them (and the props interface) to match the file's living-situation purpose for clarity and consistency.
- The conversion/normalization logic for `dateOfBirth` and `unhousedStartDate` in `toUpdateClienProfileInputs` is duplicated; consider extracting a small helper to keep the function more maintainable as additional date fields are added.

## Individual Comments

### Comment 1
<location path="libs/expo/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/extractClientFormData.ts" line_range="71-72" />
<code_context>
+        });
+      }
+
+      console.log('unhousedStartDateAsDate', unhousedStartDateAsDate);
+      console.log('unhousedStartDate', unhousedStartDate);
       return {
         id,
</code_context>
<issue_to_address>
**🚨 issue (security):** Remove debugging console.log statements from the data extraction path

These logs run on every profile load, add avoidable noise, and may expose sensitive timeline data. Please remove them or guard them behind a debug flag/logger with appropriate log levels.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

🚀 Expo continuous deployment is ready for betterangels!

  • Project → betterangels
  • Environment → Preview
  • Platforms → android, ios
  • Scheme → betterangels
  🤖 Android 🍎 iOS
Runtime Version 772073d14e0f1f3c5661f09703623a526d9b9269 772073d14e0f1f3c5661f09703623a526d9b9269
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview
Runtime version: 772073d14e0f1f3c5661f09703623a526d9b9269
App version: 1.0.61
Git commit: 23311addb6c80c1cd1f7674b0fc9a9e5c065b8cf
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview
Runtime version: 772073d14e0f1f3c5661f09703623a526d9b9269
App version: 1.0.61
Git commit: b98934f8996973a5cb7c28c67c2d197dea973a0d
Update Details Update Permalink
DetailsBranch: OUT-208-OUT-209-OUT-210-homelessness-start-fe
Runtime version: 772073d14e0f1f3c5661f09703623a526d9b9269
Git commit: d7845cada3a5d36065047b70bc968c0ee0e639ea
Update Permalink
DetailsBranch: OUT-208-OUT-209-OUT-210-homelessness-start-fe
Runtime version: 772073d14e0f1f3c5661f09703623a526d9b9269
Git commit: d7845cada3a5d36065047b70bc968c0ee0e639ea
Update QR

iOS Simulator Build: Simulator Build Link

Copy link
Copy Markdown
Contributor

@Davit-BetterAngels Davit-BetterAngels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. just remove 2 console logs sorcery mentioned

@mikefeldberg mikefeldberg changed the title client homelessness start & summary updates (OUT-208, OUT-209, OUT-210) client homelessness start & summary updates (OUT-208, OUT-209, OUT-210, DEV-2408) Apr 2, 2026
Base automatically changed from OUT-210/homelessness-start to main April 2, 2026 16:27
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