GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Goal: animated segments, custom medal images, and a completion celebration by chrisnowak · Pull Request #694 · CareEvolution/MyDataHelpsUI

Conversation

@chrisnowak

@chrisnowak chrisnowak commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Overview

For an upcoming study, participants earn a medal every 7 diary entries, and the home screen shows progress toward the next one as a ring around the medal. That's basically our existing Goal component, so rather than build something new this adds a few opt-in flags to it:

  • animateNewSegments - when the value goes up, only the new segment(s) sweep in, with a little spring/swell, instead of the whole ring redrawing from empty every time the app comes back to the foreground. Several new segments fill one after another.
  • iconUrl - an image in place of the Font Awesome icon (e.g. a medal). Until the goal is complete it's shown faded and greyscale, per the design.
  • celebration - when the goal is completed while it's on screen, the medal stamps in, a shine sweeps across it (images or FA icons), and then confetti, light rays or fireworks play. 'random' picks one, with a rare "everything at once" version about 1 time in 6.

Try it here: Container/Goal -> Animated Segments - click "Add entry" up to 7/7.

A few details:

  • The ring is now plain SVG instead of a recharts pie, which is what made the per-segment animations practical. With none of the new flags set, Goal should look and behave exactly as before. The ring is checked against recharts in unit tests (static paths and the load sweep, frame by frame), and I compared screenshots of all the existing Goal stories against main with no pixel differences.
  • With animateNewSegments on, Goal keeps showing its current value while it refreshes instead of dropping back to 0 with a spinner. That's what lets it animate just the change. Without the flag, the refresh works as it does today.
  • The celebration only plays on a not-complete -> complete change while the goal is on screen. Loading a goal that's already complete, or coming back to the app at 7/7, never celebrates. Going back to 0 isn't animated either, since in practice that happens on a schedule when the app likely isn't open.
  • Reduced motion is respected: no segment animation and no particles, just a fade from grey to color.
  • The effects draw on a canvas over the goal, so inside a default Card they're clipped to the card. Set allowOverflow on the card to let them spill out.

I went back and forth on how to rotate the celebration styles. Rotating by medal number would be nicer (never the same one twice in a row), but Goal only knows the current count toward the next medal, not how many medals have been earned. Storing total entries would make the backend more complex, so it's just random for now.

Not in this PR:

  • The ViewBuilder side (animateNewSegments, iconUrl and celebration on the Goal node). That'll come once this is released.

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.

iconUrl is rendered with an <img>, not pasted in as inline SVG markup, so an SVG can't run script and two medals with the same internal gradient ids can't clash. It's otherwise just presentation, with no new inputs or outputs.

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.)

In Storybook, Container/Goal -> Animated Segments:

  • Click "Add entry". Only the new segment should sweep in; the others shouldn't move.
  • Click it a few times quickly. The segments should fill one after another.
  • Get to 7/7. The ring should finish filling, then the medal stamps in, a shine crosses it, and a celebration plays.
  • Try each celebration style, the default icon vs. the image, and "card allows overflow" on and off.
  • Click "Remove entry". It should just repaint, with no animation.
  • Turn on reduce motion in your OS settings and get to 7/7 again. The medal should just fade to color.

Regression: the other Goal stories (Default, Advanced Colors, Tiered, Live) should look exactly as they do on main, including the sweep on load.

In the apps, I'd mostly like to see the celebrations on a real phone: fireworks inside a short card, performance on a lower-end Android (particles are capped at 150), and whether the faded medal is too faint in dark mode.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
claude added 5 commits October 30, 2026 13:05
@claude
Draw the Goal ring as plain SVG instead of a recharts pie
7f05e78
The ring reproduces the recharts layout, sector paths and 500ms ease sweep
exactly, which a test checks against recharts frame by frame. This leaves
the ring free to take segment-level animations later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WkXf5bWnK8HCAQU4vCivH5
@claude
Animate newly filled Goal segments
13ac3f1
With animateNewSegments, Goal keeps showing its current value while it
refreshes, so each newly filled segment sweeps in on its own with a short
spring and swell. Several new segments fill one after another. Lower values,
reduced motion and the default mode change the ring without animating.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WkXf5bWnK8HCAQU4vCivH5
@claude
Let Goal show an image in place of its icon
40cb687
iconUrl renders an image inside the ring instead of the Font Awesome icon,
sized to the icon's circle. An img keeps each SVG's internal ids separate,
so two badges that share gradient ids can sit on one page. The waterfall
badge is added for the stories.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WkXf5bWnK8HCAQU4vCivH5
@claude
Grey out a Goal's image until the goal is complete
5ac99fd
A not-yet-earned image shows faded and in greyscale, matching the medal
designs, and switches to full color with the completed colors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WkXf5bWnK8HCAQU4vCivH5
@claude
Celebrate when a Goal is completed
89eaaf3
With celebration set, completing the goal while it is on screen waits for
the ring to finish, stamps the icon in, sweeps a shine across an iconUrl
image once, and plays confetti, light rays or fireworks, picked at random
with a rare all-at-once version. Reduced motion only fades the image to
color. Loading a goal that is already complete never celebrates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WkXf5bWnK8HCAQU4vCivH5
@aws-amplify-us-east-1

aws-amplify-us-east-1 Bot commented Oct 30, 2026

Copy link
Copy Markdown

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

Access this pull request here: https://pr-694.d1xp2kmk6zrv44.amplifyapp.com

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

claude added 3 commits October 31, 2026 12:52
@claude
Sweep the completion shine across Font Awesome icons too
07a81a4
The shine is masked by the icon's own path, built as an SVG data URL, at the
icon's rendered size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WkXf5bWnK8HCAQU4vCivH5
@claude
Start the Goal celebration when the ring settles
84a2b1b
GoalRing now reports when its animation has finished, and Goal starts a
waiting celebration then, instead of estimating the ring's duration. The
estimate started too early when a fill grew while running, and too late
when completing changed the number of segments.

A Font Awesome icon keeps its in-progress color until the stamp and fades
under reduced motion, like an image. The celebration now begins during
render, so the completed look never shows before the wait.

GoalRing's animation planning is a pure, tested function, and its two frame
loops share one hook. Celebration timings live in one place, and
GoalCelebrationStyle is exported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WkXf5bWnK8HCAQU4vCivH5
@claude
Use the global theme toggle in the Animated Segments story
90be29a
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WkXf5bWnK8HCAQU4vCivH5
@chrisnowak chrisnowak changed the title DRAFT Goal improvements Goal: animated segments, custom medal images, and a completion celebration Oct 31, 2026
@chrisnowak
chrisnowak marked this pull request as ready for review October 31, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@chrisnowak @claude
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.