Skip to content

Add new Insights components.#559

Open
greinard wants to merge 4 commits intomainfrom
Insights
Open

Add new Insights components.#559
greinard wants to merge 4 commits intomainfrom
Insights

Conversation

@greinard
Copy link
Collaborator

@greinard greinard commented Feb 6, 2026

Overview

This branch adds a number of new components that can be used to help participants visualize and gather insight from the survey and device data they have shared, with particular focus on daily log survey entries. This is in the same vein as the existing InsightMatrix component, which displays a comparative mashup, in tabular form, of similar types of data.

These new components operate on the concept of daily InsightsData, which includes a collection of survey answers and data points from that day. The included data is configurable. The InsightsData can be examined to determine progress toward badges, daily states, detailed overviews, etc. The components are highly configurable, allowing these components to be used in many different situations across a wide variety of projects and use cases.

Here is a brief description of each of the new components:

  • InsightsDataCoordinator - Responsible for the shared loading of relevant daily InsightsData. It is DateRangeContext aware. It provides a context that child components can use to access the loaded InsightsData.
  • InsightsRenderingCoordinator - This coordinator houses shared badge rendering and daily detail computation configuration. It provides a context that child components can use to access its configuration.
  • InsightsStateCoordinator - This coordinator houses shared state computation and display configuration. It provides a context that child components can use to access its configuration.
  • InsightsBadge - A component that renders as a progress ring surrounding an optional icon. It can be used to indicate progress toward achieving a goal. The configuration used with these generally comes from an InsightsRenderingCoordinator.
  • InsightsRenderer - A component that renders the insights for a particular day. It can render badges and computed details when configured to do so. The configuration for the badges and the detail computation generally come from an - InsightsRenderingCoordinator.
  • InsightsList - A component that renders a reverse chronological list of InsightsRenderer's.
  • InsightsPreview - A component that conditionally displays an InsightsRenderer or a CTA to enter a new log entry (if logging has been been enabled, but not yet completed) for the given day.
  • InsightsCalendar - A multi-state capable calendar component (weekly or monthly) of computed insight states. The weekly variant can also display daily badges when configured to do so. The configuration for the state computations comes from an InsightsStateCoordinator. The configuration for the badges and the detail computation comes from an InsightsRenderingCoordinator.
  • InsightsCalendarDayNavigator - A component that wraps an InsightsCalendar and a DateRangeCoordinator. The calendar is used to navigate and select individual days that are then rendered within the date range coordinator.

Screenshots

InsightsRenderer with InsightsBadge

image  image

InsightsPreview (logging configured, no log yet)

image  image

InsightsCalendar (month variant)

image  image

InsightsCalendarDayNavigator with InsightsCalendar (week variant) with InsightsBadge

image  image

Security

  • I have ensured no secure credentials or sensitive information remain in code, metadata, comments, etc.
    • Please verify that you double checked that .storybook/preview.js does not contain your participant access key details.
    • There are no temporary testing changes committed such as API base URLs, access tokens, print/log statements, etc.
  • These changes do not introduce any security risks, or any such risks have been properly mitigated.

No new security risk. This branch just adds new ways to render data that is already available.

Testing

  • This change can be adequately tested using the MDH Storybook.
  • This change requires additional testing in the MDH iOS/Android/Web apps. (Create a pre-release tag/build and test in a ViewBuilder PR.)

The vast majority of this can be tested via the Storybook, but the actual data loading will require a live running storybook or ViewBuilder PR.

Documentation

  • I have added relevant Storybook updates to this PR.
  • If this feature requires a developer doc update, I have tagged @CareEvolution/api-docs.
  • This change does not impact documentation or Storybook.

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-559.d1xp2kmk6zrv44.amplifyapp.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